Commit Graph

20805 Commits

Author SHA1 Message Date
Douglas Gregor 36c569fb33 Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.

llvm-svn: 96766
2010-02-21 22:15:06 +00:00
Daniel Dunbar 7126183006 Spell string.h correctly.
llvm-svn: 96765
2010-02-21 22:14:52 +00:00
Daniel Dunbar 65927014a9 Add missing include, noticed by ace2001ac on IRC.
llvm-svn: 96764
2010-02-21 22:07:42 +00:00
Daniel Dunbar 43b464cfe5 Remove unused includes.
llvm-svn: 96760
2010-02-21 21:47:19 +00:00
Douglas Gregor 6122e55813 De-XFAIL some win32 tests that are now passing
llvm-svn: 96759
2010-02-21 20:58:24 +00:00
Douglas Gregor e61e24a5e3 Attempt to fix the MSVC9 failure with c-indext-test, where the CIndex DLL
and the c-index-test executable end up getting different copies	of
stderr, causing	non-deterministic ordering of output. Fixed by
flushing the file after printing a diagnostic (only on Windows).

llvm-svn: 96754
2010-02-21 20:15:42 +00:00
Douglas Gregor 90d554ecb3 Implement support for parsing pseudo-destructor expression with a nested-name-specifier, e.g.,
typedef int Int;
  int *p;
  p->Int::~Int();

This weakens the invariant that the only types in nested-name-specifiers are tag types (restricted to class types in C++98/03). However, we weaken this invariant as little as possible, accepting arbitrary types in nested-name-specifiers only when we're in a member access expression that looks like a pseudo-destructor expression.

llvm-svn: 96743
2010-02-21 18:36:56 +00:00
Douglas Gregor 901e717f92 A constructor template cannot be used to copy to an object of the same class type (per C++ [class.copy]p3). Make sure that includes copies that involve a derived-to-base conversion. Fixes PR6141.
llvm-svn: 96742
2010-02-21 18:30:38 +00:00
Douglas Gregor 00eace1958 Implement AST import for C++ member functions, including constructors, destructors, and conversions. Unfortunately, this cannot be tested yet, since we don't have C++ PCH support.
llvm-svn: 96741
2010-02-21 18:29:16 +00:00
Douglas Gregor f18a2c7dd1 Implement AST importing for C++ namespaces.
llvm-svn: 96740
2010-02-21 18:26:36 +00:00
Douglas Gregor 968d633176 Collect the code that imports all of the members of a declaration context into a single function, ImportDeclContext. Use it rather than explicit loops. No functionality change.
llvm-svn: 96739
2010-02-21 18:24:45 +00:00
Douglas Gregor e31bbd904d Implement PCH support for C++ namespaces.
llvm-svn: 96738
2010-02-21 18:22:14 +00:00
Chandler Carruth 8f2548112e Commiting a revert from dgregor of a bit of destructor logic until we can
figure out how not to break lots of code using this. See PR6358 and PR6359 for
motivating examples. FIXME's left in the code and the test.

llvm-svn: 96733
2010-02-21 10:19:54 +00:00
Chandler Carruth f50ef6ed9a Make Decl::isOutOfLine() virtual, and use that to determine when definitions
are for out of line declarations more easily. This simplifies the logic and
handles the case of out-of-line class definitions correctly. Fixes PR6107.

llvm-svn: 96729
2010-02-21 07:08:09 +00:00
Ted Kremenek 2fb89539f7 Clang really intends to reject attribute 'warn_unused_result' on Objective-C methods, but
instead it crashes on them.  We might extend this attribute to work on methods, but for
now fix the crasher.  Addresses <rdar://problem/7670939>.

llvm-svn: 96723
2010-02-21 05:15:32 +00:00
Ted Kremenek 1979007ca8 Don't emit a warning about a dllimport attribute being used in a typedef
when -fms-extensions is specified.  Fixes <rdar://problem/7653870>.

llvm-svn: 96722
2010-02-21 05:12:56 +00:00
Ted Kremenek a3cfc4d1e1 Don't warn about functions redeclared without the dllimport attribute when
-fms-extensions is enabled.  Fixes <rdar://problem/7669559>.

llvm-svn: 96721
2010-02-21 05:12:53 +00:00
Fariborz Jahanian 34e3cef483 Start supporting declaration of ivars in @implementation
blocks. WIP.

llvm-svn: 96696
2010-02-19 20:58:54 +00:00
Anders Carlsson 350b56eed5 Add the CK_UnusedFunctionPointer component kind for unused function pointers.
llvm-svn: 96695
2010-02-19 20:08:13 +00:00
Fariborz Jahanian c5d61df0a9 Issue extended diagnostic when property dot-syntax is used and
there is a setter but no getter (part of radar 7664555).

llvm-svn: 96687
2010-02-19 18:30:30 +00:00
Douglas Gregor 836ec94c8e Simplify the CIndex fix-it API, now that we have half-open CXSourceRanges.
llvm-svn: 96685
2010-02-19 18:16:06 +00:00
Ted Kremenek 2b5faeb84f Fix link.
llvm-svn: 96684
2010-02-19 18:12:09 +00:00
Ted Kremenek a3e1e99b05 Update front page to mention Xcode integration.
llvm-svn: 96682
2010-02-19 17:33:38 +00:00
Ted Kremenek 3efee522ee Expose "Key features" paragraph.
llvm-svn: 96681
2010-02-19 17:33:30 +00:00
Douglas Gregor 0286b46702 Only parse C++0x attribute specifiers in declarators when in C++0x
mode. This allows us to detect invalid VLAs in Objective-C++
mode. This should be the last of <rdar://problem/7660386>.

llvm-svn: 96679
2010-02-19 16:47:56 +00:00
Douglas Gregor 337caf9e3e Implement C++ name lookup for instance variables of Objective-C classes
from an instance method. Previously, we were following the Objective-C
name lookup rules for ivars, which are of course completely different
from and incompatible with the Objective-C++ rules.

For the record, the Objective-C++ rules are the sane ones.

This is another part of <rdar://problem/7660386>.

llvm-svn: 96677
2010-02-19 16:08:35 +00:00
Douglas Gregor cfd70242ca Make Sema::ActOnClassMessage robust when name lookup for the receiver
name finds something other than a TypedefDecl or an
ObjCInterfaceDecl. This is a small part of <rdar://problem/7660386>.

llvm-svn: 96676
2010-02-19 15:18:45 +00:00
John McCall b81884d347 More refactoring around constructor/destructor code generation.
Fix some bugs with function-try-blocks and simplify normal try-block
code generation.

This implementation excludes a deleting destructor's call to
operator delete() from the function-try-block, which I believe
is correct but which I can't find straightforward support for at
a moment's glance.

llvm-svn: 96670
2010-02-19 09:25:03 +00:00
Ted Kremenek 353394f7b1 Label examples.
llvm-svn: 96668
2010-02-19 08:24:37 +00:00
Ted Kremenek d14f766789 Fix link.
llvm-svn: 96667
2010-02-19 08:19:14 +00:00
Ted Kremenek 33b73215c8 Simplify menu.
llvm-svn: 96666
2010-02-19 08:18:02 +00:00
Ted Kremenek 92b4bd9556 Tweak menu.
llvm-svn: 96665
2010-02-19 08:16:18 +00:00
Ted Kremenek 926520489a Add section on using the analyzer within Xcode.
llvm-svn: 96664
2010-02-19 08:14:02 +00:00
Anders Carlsson 2d3d903872 Dump this-adjustments for destructors as well.
llvm-svn: 96660
2010-02-19 06:03:53 +00:00
Anders Carlsson 821095085b Add another test from the ABI spec.
llvm-svn: 96659
2010-02-19 05:59:40 +00:00
Ted Kremenek 809c89461d Add new intro about running scan-build.
llvm-svn: 96658
2010-02-19 05:36:44 +00:00
John McCall 8517abc30d Enable -mconstructor-aliases by default on non-darwin platforms.
The linker bug holding this back is Darwin-specific.

llvm-svn: 96655
2010-02-19 02:45:38 +00:00
Ted Kremenek 013041eef0 Revert: "Change InitListExpr to allocate the array for holding references"
This was causing buildbot breakage.

This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.

llvm-svn: 96652
2010-02-19 01:50:18 +00:00
Fariborz Jahanian 40efb08d87 Remove this test for now.
llvm-svn: 96651
2010-02-19 01:40:48 +00:00
Douglas Gregor 01cc437159 Add a missing break. Cocoa.h can now be merged twice into the same AST context
llvm-svn: 96650
2010-02-19 01:36:36 +00:00
John McCall d4324148d7 Re-introduce the ctor/dtor alias optimization, this time hidden behind a
command-line option which defaults off.

llvm-svn: 96649
2010-02-19 01:32:20 +00:00
Douglas Gregor 5481d329a3 AST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context
llvm-svn: 96648
2010-02-19 01:32:14 +00:00
Douglas Gregor d8552cdc96 AST import for sizeof and alignof expressions
llvm-svn: 96647
2010-02-19 01:24:23 +00:00
Douglas Gregor 52f820ead4 AST import for DeclRefExprs
llvm-svn: 96646
2010-02-19 01:17:02 +00:00
Fariborz Jahanian ad238e2bde XFAIL until I can fugure out how test check for a pattern when
clang is built optimized.

llvm-svn: 96645
2010-02-19 01:11:52 +00:00
Douglas Gregor f0bc0d22d3 XFAIL some of the c-index-test tests on Windows, where they are failing inexplicably
llvm-svn: 96644
2010-02-19 01:10:48 +00:00
Douglas Gregor c74247eddd AST import of parenthesized expressions, unary operators, binary
operators, and compound assignment operators.

llvm-svn: 96643
2010-02-19 01:07:06 +00:00
Ted Kremenek 445a603c78 Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself.  I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

llvm-svn: 96642
2010-02-19 00:42:33 +00:00
Douglas Gregor 70127c1dcf Use a little binary header in serialized diagnostics to help the deserializer skip over noise in the stream
llvm-svn: 96641
2010-02-19 00:40:40 +00:00
Fariborz Jahanian aef662206b Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.

llvm-svn: 96638
2010-02-19 00:31:17 +00:00