]> granicus.if.org Git - clang/log
clang
15 years agoImplement support for parsing pseudo-destructor expression with a nested-name-specifi...
Douglas Gregor [Sun, 21 Feb 2010 18:36:56 +0000 (18:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96743 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoA constructor template cannot be used to copy to an object of the same class type...
Douglas Gregor [Sun, 21 Feb 2010 18:30:38 +0000 (18:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96742 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement AST import for C++ member functions, including constructors, destructors...
Douglas Gregor [Sun, 21 Feb 2010 18:29:16 +0000 (18:29 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96741 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement AST importing for C++ namespaces.
Douglas Gregor [Sun, 21 Feb 2010 18:26:36 +0000 (18:26 +0000)]
Implement AST importing for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96740 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCollect the code that imports all of the members of a declaration context into a...
Douglas Gregor [Sun, 21 Feb 2010 18:24:45 +0000 (18:24 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96739 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement PCH support for C++ namespaces.
Douglas Gregor [Sun, 21 Feb 2010 18:22:14 +0000 (18:22 +0000)]
Implement PCH support for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96738 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCommiting a revert from dgregor of a bit of destructor logic until we can
Chandler Carruth [Sun, 21 Feb 2010 10:19:54 +0000 (10:19 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96733 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake Decl::isOutOfLine() virtual, and use that to determine when definitions
Chandler Carruth [Sun, 21 Feb 2010 07:08:09 +0000 (07:08 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96729 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoClang really intends to reject attribute 'warn_unused_result' on Objective-C methods...
Ted Kremenek [Sun, 21 Feb 2010 05:15:32 +0000 (05:15 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96723 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't emit a warning about a dllimport attribute being used in a typedef
Ted Kremenek [Sun, 21 Feb 2010 05:12:56 +0000 (05:12 +0000)]
Don't emit a warning about a dllimport attribute being used in a typedef
when -fms-extensions is specified.  Fixes <rdar://problem/7653870>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96722 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't warn about functions redeclared without the dllimport attribute when
Ted Kremenek [Sun, 21 Feb 2010 05:12:53 +0000 (05:12 +0000)]
Don't warn about functions redeclared without the dllimport attribute when
-fms-extensions is enabled.  Fixes <rdar://problem/7669559>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96721 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStart supporting declaration of ivars in @implementation
Fariborz Jahanian [Fri, 19 Feb 2010 20:58:54 +0000 (20:58 +0000)]
Start supporting declaration of ivars in @implementation
blocks. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96696 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd the CK_UnusedFunctionPointer component kind for unused function pointers.
Anders Carlsson [Fri, 19 Feb 2010 20:08:13 +0000 (20:08 +0000)]
Add the CK_UnusedFunctionPointer component kind for unused function pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96695 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIssue extended diagnostic when property dot-syntax is used and
Fariborz Jahanian [Fri, 19 Feb 2010 18:30:30 +0000 (18:30 +0000)]
Issue extended diagnostic when property dot-syntax is used and
there is a setter but no getter (part of radar 7664555).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96687 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify the CIndex fix-it API, now that we have half-open CXSourceRanges.
Douglas Gregor [Fri, 19 Feb 2010 18:16:06 +0000 (18:16 +0000)]
Simplify the CIndex fix-it API, now that we have half-open CXSourceRanges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96685 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix link.
Ted Kremenek [Fri, 19 Feb 2010 18:12:09 +0000 (18:12 +0000)]
Fix link.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96684 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate front page to mention Xcode integration.
Ted Kremenek [Fri, 19 Feb 2010 17:33:38 +0000 (17:33 +0000)]
Update front page to mention Xcode integration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96682 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoExpose "Key features" paragraph.
Ted Kremenek [Fri, 19 Feb 2010 17:33:30 +0000 (17:33 +0000)]
Expose "Key features" paragraph.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96681 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOnly parse C++0x attribute specifiers in declarators when in C++0x
Douglas Gregor [Fri, 19 Feb 2010 16:47:56 +0000 (16:47 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96679 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement C++ name lookup for instance variables of Objective-C classes
Douglas Gregor [Fri, 19 Feb 2010 16:08:35 +0000 (16:08 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96677 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake Sema::ActOnClassMessage robust when name lookup for the receiver
Douglas Gregor [Fri, 19 Feb 2010 15:18:45 +0000 (15:18 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96676 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore refactoring around constructor/destructor code generation.
John McCall [Fri, 19 Feb 2010 09:25:03 +0000 (09:25 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96670 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLabel examples.
Ted Kremenek [Fri, 19 Feb 2010 08:24:37 +0000 (08:24 +0000)]
Label examples.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96668 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix link.
Ted Kremenek [Fri, 19 Feb 2010 08:19:14 +0000 (08:19 +0000)]
Fix link.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96667 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify menu.
Ted Kremenek [Fri, 19 Feb 2010 08:18:02 +0000 (08:18 +0000)]
Simplify menu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96666 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTweak menu.
Ted Kremenek [Fri, 19 Feb 2010 08:16:18 +0000 (08:16 +0000)]
Tweak menu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96665 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd section on using the analyzer within Xcode.
Ted Kremenek [Fri, 19 Feb 2010 08:14:02 +0000 (08:14 +0000)]
Add section on using the analyzer within Xcode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96664 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDump this-adjustments for destructors as well.
Anders Carlsson [Fri, 19 Feb 2010 06:03:53 +0000 (06:03 +0000)]
Dump this-adjustments for destructors as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96660 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd another test from the ABI spec.
Anders Carlsson [Fri, 19 Feb 2010 05:59:40 +0000 (05:59 +0000)]
Add another test from the ABI spec.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96659 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd new intro about running scan-build.
Ted Kremenek [Fri, 19 Feb 2010 05:36:44 +0000 (05:36 +0000)]
Add new intro about running scan-build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96658 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnable -mconstructor-aliases by default on non-darwin platforms.
John McCall [Fri, 19 Feb 2010 02:45:38 +0000 (02:45 +0000)]
Enable -mconstructor-aliases by default on non-darwin platforms.
The linker bug holding this back is Darwin-specific.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96655 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert: "Change InitListExpr to allocate the array for holding references"
Ted Kremenek [Fri, 19 Feb 2010 01:50:18 +0000 (01:50 +0000)]
Revert: "Change InitListExpr to allocate the array for holding references"

This was causing buildbot breakage.

This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96652 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove this test for now.
Fariborz Jahanian [Fri, 19 Feb 2010 01:40:48 +0000 (01:40 +0000)]
Remove this test for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96651 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a missing break. Cocoa.h can now be merged twice into the same AST context
Douglas Gregor [Fri, 19 Feb 2010 01:36:36 +0000 (01:36 +0000)]
Add a missing break. Cocoa.h can now be merged twice into the same AST context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96650 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRe-introduce the ctor/dtor alias optimization, this time hidden behind a
John McCall [Fri, 19 Feb 2010 01:32:20 +0000 (01:32 +0000)]
Re-introduce the ctor/dtor alias optimization, this time hidden behind a
command-line option which defaults off.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96649 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context
Douglas Gregor [Fri, 19 Feb 2010 01:32:14 +0000 (01:32 +0000)]
AST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96648 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAST import for sizeof and alignof expressions
Douglas Gregor [Fri, 19 Feb 2010 01:24:23 +0000 (01:24 +0000)]
AST import for sizeof and alignof expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96647 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAST import for DeclRefExprs
Douglas Gregor [Fri, 19 Feb 2010 01:17:02 +0000 (01:17 +0000)]
AST import for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96646 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoXFAIL until I can fugure out how test check for a pattern when
Fariborz Jahanian [Fri, 19 Feb 2010 01:11:52 +0000 (01:11 +0000)]
XFAIL until I can fugure out how test check for a pattern when
clang is built optimized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96645 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoXFAIL some of the c-index-test tests on Windows, where they are failing inexplicably
Douglas Gregor [Fri, 19 Feb 2010 01:10:48 +0000 (01:10 +0000)]
XFAIL some of the c-index-test tests on Windows, where they are failing inexplicably

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96644 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAST import of parenthesized expressions, unary operators, binary
Douglas Gregor [Fri, 19 Feb 2010 01:07:06 +0000 (01:07 +0000)]
AST import of parenthesized expressions, unary operators, binary
operators, and compound assignment operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96643 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange InitListExpr to allocate the array for holding references
Ted Kremenek [Fri, 19 Feb 2010 00:42:33 +0000 (00:42 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse a little binary header in serialized diagnostics to help the deserializer skip...
Douglas Gregor [Fri, 19 Feb 2010 00:40:40 +0000 (00:40 +0000)]
Use a little binary header in serialized diagnostics to help the deserializer skip over noise in the stream

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96641 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch removes IVars list from ObjCInterfaceDecl and
Fariborz Jahanian [Fri, 19 Feb 2010 00:31:17 +0000 (00:31 +0000)]
Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96638 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove unused function & enumerations
Blaine Garst [Fri, 19 Feb 2010 00:24:37 +0000 (00:24 +0000)]
remove unused function & enumerations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96635 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach ASTUnit to keep track of temporary files, then delete them when
Douglas Gregor [Thu, 18 Feb 2010 23:35:40 +0000 (23:35 +0000)]
Teach ASTUnit to keep track of temporary files, then delete them when
the ASTUnit itself is destroyed. Fixes <rdar://problem/7649385>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96628 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRe-apply my diagnostics-capture patch for CIndex, with some tweaks to
Douglas Gregor [Thu, 18 Feb 2010 23:07:20 +0000 (23:07 +0000)]
Re-apply my diagnostics-capture patch for CIndex, with some tweaks to
try to address the msvc failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96624 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAllow GNU attributes to appear in an Objective-C method declaration
Ted Kremenek [Thu, 18 Feb 2010 23:05:16 +0000 (23:05 +0000)]
Allow GNU attributes to appear in an Objective-C method declaration
before the selector name (but after the return type).  Among other things,
this allows IBAction to be implemented with an attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96623 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert "Sort visitor methods so we can easily tell what's implemented."
Ted Kremenek [Thu, 18 Feb 2010 22:36:18 +0000 (22:36 +0000)]
Revert "Sort visitor methods so we can easily tell what's implemented."

This reverts commit 4383e04c75731f8695b8355783f9966ac56b0926.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96622 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert "Tidy up order of switch statement. No functionality change."
Ted Kremenek [Thu, 18 Feb 2010 22:32:43 +0000 (22:32 +0000)]
Revert "Tidy up order of switch statement.  No functionality change."

This reverts commit 95575005fc6409df98e6e079caf324308f62171b.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96620 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert my CIndex diagnostic changes (r96603, 96606, 96607), which were
Douglas Gregor [Thu, 18 Feb 2010 22:27:07 +0000 (22:27 +0000)]
Revert my CIndex diagnostic changes (r96603, 96606, 96607), which were
breaking the msvc9 builder for unknown reasons.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96618 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert the ctor/dtor alias optimization for now; the buildbots can detect
John McCall [Thu, 18 Feb 2010 21:31:48 +0000 (21:31 +0000)]
Revert the ctor/dtor alias optimization for now;  the buildbots can detect
some failure here that I can't.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96612 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed a crash specific to blocks in c++ uncovered by an internal
Fariborz Jahanian [Thu, 18 Feb 2010 20:31:02 +0000 (20:31 +0000)]
Fixed a crash specific to blocks in c++ uncovered by an internal
test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96608 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduce debugging/testing hook clang_enableStackTraces() into
Douglas Gregor [Thu, 18 Feb 2010 20:22:25 +0000 (20:22 +0000)]
Introduce debugging/testing hook clang_enableStackTraces() into
CIndex, so that c-index-test to use it to call
lvm::sys::PrintStackTraceOnErrorSignal().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96607 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoResurrect the displayDiagnostics parameter to clang_createIndex(), and
Douglas Gregor [Thu, 18 Feb 2010 20:11:31 +0000 (20:11 +0000)]
Resurrect the displayDiagnostics parameter to clang_createIndex(), and
display captured diagnostics when we can't return an invalid
CXTranslationUnit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96606 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake deleting and complete dtor variants defer to other dtor variants by
John McCall [Thu, 18 Feb 2010 19:59:28 +0000 (19:59 +0000)]
Make deleting and complete dtor variants defer to other dtor variants by
calling them as subroutines.  This triggers whenever the alias optimization
doesn't, i.e. when the dtor has linkonce linkage or there are virtual bases
or it's the deleting dtor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96605 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduce CIndex API functions for displaying a diagnostic, with some
Douglas Gregor [Thu, 18 Feb 2010 19:08:21 +0000 (19:08 +0000)]
Introduce CIndex API functions for displaying a diagnostic, with some
knobs to control formatting. Eventually, I'd like to merge the
implementation of this code with the TextDiagnosticPrinter, so that
it's easy for CIndex clients to produce beautiful diagnostics like the
clang compiler does.

Use this new function to display diagnostics within c-index-test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96603 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTidy up order of switch statement. No functionality change.
Ted Kremenek [Thu, 18 Feb 2010 18:52:18 +0000 (18:52 +0000)]
Tidy up order of switch statement.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96602 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSort visitor methods so we can easily tell what's implemented.
Ted Kremenek [Thu, 18 Feb 2010 18:47:08 +0000 (18:47 +0000)]
Sort visitor methods so we can easily tell what's implemented.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96600 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange cursor behavior for attributes to have them visited as part of recursing
Ted Kremenek [Thu, 18 Feb 2010 18:47:01 +0000 (18:47 +0000)]
Change cursor behavior for attributes to have them visited as part of recursing
to the children of a Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96599 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAttempt to fix the 32-bit test failures.
Anders Carlsson [Thu, 18 Feb 2010 18:20:49 +0000 (18:20 +0000)]
Attempt to fix the 32-bit test failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96595 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotests: Tweak %clangxx definition to something which should be more portable.
Daniel Dunbar [Thu, 18 Feb 2010 18:10:26 +0000 (18:10 +0000)]
tests: Tweak %clangxx definition to something which should be more portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96593 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRework how CIndex handles diagnostics. Rather than using a callback,
Douglas Gregor [Thu, 18 Feb 2010 18:08:43 +0000 (18:08 +0000)]
Rework how CIndex handles diagnostics. Rather than using a callback,
we attach diagnostics to translation units and code-completion
results, so they can be queried at any time.

To facilitate this, the new StoredDiagnostic class stores a diagnostic
in a serializable/deserializable form, and ASTUnit knows how to
capture diagnostics in this stored form. CIndex's CXDiagnostic is a
thin wrapper around StoredDiagnostic, providing a C interface to
stored or de-serialized diagnostics.

I've XFAIL'd one test case temporarily, because currently we end up
storing diagnostics in an ASTUnit that's never returned to the user
(because it contains errors). I'll introduce a temporary fix for this
soon; the real fix will be to allow us to return and query invalid ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96592 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix another bug and add another class.
Anders Carlsson [Thu, 18 Feb 2010 17:32:33 +0000 (17:32 +0000)]
Fix another bug and add another class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96590 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd another class from cxx-vtable-ex.html
Anders Carlsson [Thu, 18 Feb 2010 17:28:16 +0000 (17:28 +0000)]
Add another class from cxx-vtable-ex.html

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96588 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore work on vcall offsets.
Anders Carlsson [Thu, 18 Feb 2010 17:26:40 +0000 (17:26 +0000)]
More work on vcall offsets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96587 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd tests from the Itanium C++ ABI spec.
Anders Carlsson [Thu, 18 Feb 2010 17:07:24 +0000 (17:07 +0000)]
Add tests from the Itanium C++ ABI spec.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96586 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStart stubbing out vcall offset handling.
Anders Carlsson [Thu, 18 Feb 2010 17:00:09 +0000 (17:00 +0000)]
Start stubbing out vcall offset handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96585 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStore the base offset of the final overrider in the OverriderInfo struct, to be used...
Anders Carlsson [Thu, 18 Feb 2010 16:29:24 +0000 (16:29 +0000)]
Store the base offset of the final overrider in the OverriderInfo struct, to be used for vcall offsets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96582 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove some dead code.
Anders Carlsson [Thu, 18 Feb 2010 16:24:20 +0000 (16:24 +0000)]
Remove some dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96581 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTry to fix the auroraux buildbot. I suspect it has a "#define SEC" somewhere.
Benjamin Kramer [Thu, 18 Feb 2010 13:02:13 +0000 (13:02 +0000)]
Try to fix the auroraux buildbot. I suspect it has a "#define SEC" somewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96577 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd basic cursor traversal for attributes. We currently don't have source
Ted Kremenek [Thu, 18 Feb 2010 05:46:33 +0000 (05:46 +0000)]
Add basic cursor traversal for attributes.  We currently don't have source
ranges for Attr objects, so lookup by cursor location currently doesn't work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96571 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAlso don't warn about force_align_arg_pointer on function typedefs. (This will
Charles Davis [Thu, 18 Feb 2010 04:56:59 +0000 (04:56 +0000)]
Also don't warn about force_align_arg_pointer on function typedefs. (This will
break if you declare an actual function using that typedef. Come to think of it,
maybe I should make this part of the type.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96570 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTwo fixes related to force_align_arg_pointer:
Charles Davis [Thu, 18 Feb 2010 04:39:19 +0000 (04:39 +0000)]
Two fixes related to force_align_arg_pointer:
- Also recognize __force_align_arg_pointer__.
- Don't warn if it's used on a function pointer typedef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96568 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some spacing in the code-completion results for a return statement
Douglas Gregor [Thu, 18 Feb 2010 04:06:48 +0000 (04:06 +0000)]
Add some spacing in the code-completion results for a return statement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96567 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach CMake to put the CIndex header into the Xcode/MSVC project
Douglas Gregor [Thu, 18 Feb 2010 04:01:41 +0000 (04:01 +0000)]
Teach CMake to put the CIndex header into the Xcode/MSVC project

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96566 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoExtract out function-body code generation into its own method. No functionality
John McCall [Thu, 18 Feb 2010 03:17:58 +0000 (03:17 +0000)]
Extract out function-body code generation into its own method.  No functionality
change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96564 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStart adding cursor kinds for attributes, with first exposing
Ted Kremenek [Thu, 18 Feb 2010 03:09:07 +0000 (03:09 +0000)]
Start adding cursor kinds for attributes, with first exposing
IBActionAttr and IBOutletAttr respectively.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96563 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange the behavior of ibaction attributes to be attached to methods, not ivars.
Ted Kremenek [Thu, 18 Feb 2010 03:08:58 +0000 (03:08 +0000)]
Change the behavior of ibaction attributes to be attached to methods, not ivars.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96562 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAST import for character literals
Douglas Gregor [Thu, 18 Feb 2010 02:21:22 +0000 (02:21 +0000)]
AST import for character literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96557 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAST import for forward declarations of Objective-C protocols
Douglas Gregor [Thu, 18 Feb 2010 02:12:22 +0000 (02:12 +0000)]
AST import for forward declarations of Objective-C protocols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96555 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement import of forward declarations of Objective-C classes
Douglas Gregor [Thu, 18 Feb 2010 02:04:09 +0000 (02:04 +0000)]
Implement import of forward declarations of Objective-C classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96554 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAllow redefinitions of extern inline functions in GNU89 mode, just as GCC
Charles Davis [Thu, 18 Feb 2010 02:00:42 +0000 (02:00 +0000)]
Allow redefinitions of extern inline functions in GNU89 mode, just as GCC
does. Fixes PR5253.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96553 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAST import of Objective-C categories.
Douglas Gregor [Thu, 18 Feb 2010 01:47:50 +0000 (01:47 +0000)]
AST import of Objective-C categories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96551 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago__typeof should be able to handle block pointer types when
Fariborz Jahanian [Thu, 18 Feb 2010 01:20:22 +0000 (01:20 +0000)]
__typeof should be able to handle block pointer types when
rewriting. Fixes radar 7659483.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96549 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't diagnose overflow in case statements when the conversion is a
Douglas Gregor [Thu, 18 Feb 2010 00:56:01 +0000 (00:56 +0000)]
Don't diagnose overflow in case statements when the conversion is a
signed<->unsigned conversion with the same bit width. Fixes
<rdar://problem/7658121>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96545 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRecognize attributes ns_returns_not_retained and cf_returns_not_retained
Ted Kremenek [Thu, 18 Feb 2010 00:06:12 +0000 (00:06 +0000)]
Recognize attributes ns_returns_not_retained and cf_returns_not_retained
in the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96539 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd __has_feature support for attributes ns_returns_not_retained
Ted Kremenek [Thu, 18 Feb 2010 00:06:04 +0000 (00:06 +0000)]
Add __has_feature support for attributes ns_returns_not_retained
and cf_returns_not_retained.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96538 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSort @includes.
Ted Kremenek [Thu, 18 Feb 2010 00:05:58 +0000 (00:05 +0000)]
Sort @includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96537 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSort cases.
Ted Kremenek [Thu, 18 Feb 2010 00:05:52 +0000 (00:05 +0000)]
Sort cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96536 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes to
Ted Kremenek [Thu, 18 Feb 2010 00:05:45 +0000 (00:05 +0000)]
Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes to
match 'ns_returns_retained' and 'cf_returns_retained' respectively.  These
are not yet hooked up to the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96535 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFor -Wswitch-enum warnings, be sure to look through typedefs of enum
Douglas Gregor [Wed, 17 Feb 2010 23:29:11 +0000 (23:29 +0000)]
For -Wswitch-enum warnings, be sure to look through typedefs of enum
types. Fixes <rdar://problem/7643909>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96531 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHook the "overflow converting case value to switch condition type"
Douglas Gregor [Wed, 17 Feb 2010 23:02:29 +0000 (23:02 +0000)]
Hook the "overflow converting case value to switch condition type"
warning into -Wswitch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96529 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen diagnosing enumerator values outside of the range of 'int', be
Douglas Gregor [Wed, 17 Feb 2010 22:40:11 +0000 (22:40 +0000)]
When diagnosing enumerator values outside of the range of 'int', be
sure that we get the "too large" vs. "too small" part of the
diagnostic correct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96524 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosilence warning in a cleaner way
Chris Lattner [Wed, 17 Feb 2010 21:42:34 +0000 (21:42 +0000)]
silence warning in a cleaner way

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96520 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAlphabetize #includes. No functionality change.
Ted Kremenek [Wed, 17 Feb 2010 21:27:48 +0000 (21:27 +0000)]
Alphabetize #includes.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96518 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange GNUInlineAttr definition to just use DEF_SIMPLE_ATTR.
Ted Kremenek [Wed, 17 Feb 2010 21:27:41 +0000 (21:27 +0000)]
Change GNUInlineAttr definition to just use DEF_SIMPLE_ATTR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96517 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement AST importing of ImplicitParamDecls, despite the sad fact
Douglas Gregor [Wed, 17 Feb 2010 21:22:52 +0000 (21:22 +0000)]
Implement AST importing of ImplicitParamDecls, despite the sad fact
that we can't test it yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96516 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't make the inclusion of crashtracer information depend on NDEBUG.
Ted Kremenek [Wed, 17 Feb 2010 21:12:23 +0000 (21:12 +0000)]
Don't make the inclusion of crashtracer information depend on NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96515 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHopefully make buildbot happy.
Fariborz Jahanian [Wed, 17 Feb 2010 21:01:05 +0000 (21:01 +0000)]
Hopefully make buildbot happy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96513 91177308-0d34-0410-b5e6-96231b3b80d8