]> granicus.if.org Git - clang/log
clang
14 years agoWhen a class contains a non-empty anonymous union or struct, mark is
Douglas Gregor [Mon, 3 May 2010 15:18:25 +0000 (15:18 +0000)]
When a class contains a non-empty anonymous union or struct, mark is
as non-empty. Fixes PR7021.

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

14 years agoDon't build an aggregate constructor loop when the constructor is trivial.
Anders Carlsson [Mon, 3 May 2010 15:09:17 +0000 (15:09 +0000)]
Don't build an aggregate constructor loop when the constructor is trivial.

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

14 years agoAdd test case that I forgot to check in.
Anders Carlsson [Mon, 3 May 2010 14:22:40 +0000 (14:22 +0000)]
Add test case that I forgot to check in.

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

14 years agoReplace a char*/size pair with stringref.
Benjamin Kramer [Mon, 3 May 2010 13:08:54 +0000 (13:08 +0000)]
Replace a char*/size pair with stringref.

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

14 years agoSimplify.
Anders Carlsson [Mon, 3 May 2010 02:07:56 +0000 (02:07 +0000)]
Simplify.

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

14 years agoDon't copy or initialize empty classes. Fixes PR7012.
Anders Carlsson [Mon, 3 May 2010 01:20:20 +0000 (01:20 +0000)]
Don't copy or initialize empty classes. Fixes PR7012.

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

14 years agoStore the entire base subobject in SubVTTIndices.
Anders Carlsson [Mon, 3 May 2010 00:55:11 +0000 (00:55 +0000)]
Store the entire base subobject in SubVTTIndices.

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

14 years agoRemove OldGetAddressOfBaseClass - bye bye ambiguities.
Anders Carlsson [Mon, 3 May 2010 00:32:27 +0000 (00:32 +0000)]
Remove OldGetAddressOfBaseClass - bye bye ambiguities.

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

14 years agoGet rid of the last caller of OldGetAddressOfBaseClass.
Anders Carlsson [Mon, 3 May 2010 00:29:58 +0000 (00:29 +0000)]
Get rid of the last caller of OldGetAddressOfBaseClass.

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

14 years agoMore work towards getting rid of OldGetAddressOfBaseClass.
Anders Carlsson [Mon, 3 May 2010 00:07:07 +0000 (00:07 +0000)]
More work towards getting rid of OldGetAddressOfBaseClass.

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

14 years agoGet rid of a call to GetAddressOfDirectBaseInCompleteClass.
Anders Carlsson [Sun, 2 May 2010 23:57:15 +0000 (23:57 +0000)]
Get rid of a call to GetAddressOfDirectBaseInCompleteClass.

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

14 years agoHave getSubVTTIndex take a BaseSubobject instead of just a base.
Anders Carlsson [Sun, 2 May 2010 23:53:25 +0000 (23:53 +0000)]
Have getSubVTTIndex take a BaseSubobject instead of just a base.

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

14 years agoChange CXXConstructExpr::Create to take a ConstructionKind.
Anders Carlsson [Sun, 2 May 2010 23:53:04 +0000 (23:53 +0000)]
Change CXXConstructExpr::Create to take a ConstructionKind.

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

14 years agoPass ForVirtualBase all the way to GetVTTParameter.
Anders Carlsson [Sun, 2 May 2010 23:33:10 +0000 (23:33 +0000)]
Pass ForVirtualBase all the way to GetVTTParameter.

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

14 years agoAdd the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.
Anders Carlsson [Sun, 2 May 2010 23:29:11 +0000 (23:29 +0000)]
Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.

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

14 years agoRevert my last change and add a 'ForVirtualBase' parameter to EmitCXXConstructorCall...
Anders Carlsson [Sun, 2 May 2010 23:20:53 +0000 (23:20 +0000)]
Revert my last change and add a 'ForVirtualBase' parameter to EmitCXXConstructorCall instead.

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

14 years agoPass the construction kind down to EmitCXXConstructorCall.
Anders Carlsson [Sun, 2 May 2010 23:01:10 +0000 (23:01 +0000)]
Pass the construction kind down to EmitCXXConstructorCall.

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

14 years agoAdd an enum to CXXConstructExpr so we can determine if the construction expression...
Anders Carlsson [Sun, 2 May 2010 22:54:08 +0000 (22:54 +0000)]
Add an enum to CXXConstructExpr so we can determine if the construction expression constructs a non-virtual or virtual base.

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

14 years agoRemove another unused function.
Anders Carlsson [Sun, 2 May 2010 18:13:35 +0000 (18:13 +0000)]
Remove another unused function.

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

14 years agoRemove an unused function.
Anders Carlsson [Sun, 2 May 2010 18:12:22 +0000 (18:12 +0000)]
Remove an unused function.

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

14 years agoCodeGen: Shrink RValue. 4 words -> 2 words.
Benjamin Kramer [Sun, 2 May 2010 14:59:10 +0000 (14:59 +0000)]
CodeGen: Shrink RValue. 4 words -> 2 words.

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

14 years agoAs per Chris' request, return the Instruction from EmitCall and add the metadata...
David Chisnall [Sun, 2 May 2010 13:41:58 +0000 (13:41 +0000)]
As per Chris' request, return the Instruction from EmitCall and add the metadata in the caller.

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

14 years agoComplete reimplementation of the synthesis for implicitly-defined copy
Douglas Gregor [Sat, 1 May 2010 20:49:11 +0000 (20:49 +0000)]
Complete reimplementation of the synthesis for implicitly-defined copy
assignment operators.

Previously, Sema provided type-checking and template instantiation for
copy assignment operators, then CodeGen would synthesize the actual
body of the copy constructor. Unfortunately, the two were not in sync,
and CodeGen might pick a copy-assignment operator that is different
from what Sema chose, leading to strange failures, e.g., link-time
failures when CodeGen called a copy-assignment operator that was not
instantiation, run-time failures when copy-assignment operators were
overloaded for const/non-const references and the wrong one was
picked, and run-time failures when by-value copy-assignment operators
did not have their arguments properly copy-initialized.

This implementation synthesizes the implicitly-defined copy assignment
operator bodies in Sema, so that the resulting ASTs encode exactly
what CodeGen needs to do; there is no longer any special code in
CodeGen to synthesize copy-assignment operators. The synthesis of the
body is relatively simple, and we generate one of three different
kinds of copy statements for each base or member:

  - For a class subobject, call the appropriate copy-assignment
    operator, after overload resolution has determined what that is.
  - For an array of scalar types or an array of class types that have
    trivial copy assignment operators, construct a call to
    __builtin_memcpy.
  - For an array of class types with non-trivial copy assignment
    operators, synthesize a (possibly nested!) for loop whose inner
    statement calls the copy constructor.
  - For a scalar type, use built-in assignment.

This patch fixes at least a few tests cases in Boost.Spirit that were
failing because CodeGen picked the wrong copy-assignment operator
(leading to link-time failures), and I suspect a number of undiagnosed
problems will also go away with this change.

Some of the diagnostics we had previously have gotten worse with this
change, since we're going through generic code for our
type-checking. I will improve this in a subsequent patch.

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

14 years agofix a broken link, diagnostickinds.td was fissioned.
Chris Lattner [Sat, 1 May 2010 17:35:19 +0000 (17:35 +0000)]
fix a broken link, diagnostickinds.td was fissioned.

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

14 years agoSimplify EmitCopyCtorCall.
Anders Carlsson [Sat, 1 May 2010 17:07:40 +0000 (17:07 +0000)]
Simplify EmitCopyCtorCall.

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

14 years agoSimplify EmitClassAggrMemberwiseCopy.
Anders Carlsson [Sat, 1 May 2010 17:02:18 +0000 (17:02 +0000)]
Simplify EmitClassAggrMemberwiseCopy.

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

14 years agoBump default template instantiation depth to 1024, as required by C++0x
Douglas Gregor [Sat, 1 May 2010 16:59:21 +0000 (16:59 +0000)]
Bump default template instantiation depth to 1024, as required by C++0x

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

14 years agoClean up EmitClassMemberwiseCopy further.
Anders Carlsson [Sat, 1 May 2010 16:54:05 +0000 (16:54 +0000)]
Clean up EmitClassMemberwiseCopy further.

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

14 years agoGet rid of a parameter from EmitClassMemberwiseCopy.
Anders Carlsson [Sat, 1 May 2010 16:49:43 +0000 (16:49 +0000)]
Get rid of a parameter from EmitClassMemberwiseCopy.

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

14 years agoWhen defining implicit copy constructors, use SetBaseOrMemberInitializers to initiali...
Anders Carlsson [Sat, 1 May 2010 16:39:01 +0000 (16:39 +0000)]
When defining implicit copy constructors, use SetBaseOrMemberInitializers to initialize the bases.

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

14 years agoAdded an RAII object that helps set up/tear down the Sema context
Douglas Gregor [Sat, 1 May 2010 15:04:51 +0000 (15:04 +0000)]
Added an RAII object that helps set up/tear down the Sema context
information required to implicitly define a C++ special member
function. Use it rather than explicitly setting CurContext on entry
and exit, which is fragile.

Use this RAII object for the implicitly-defined default constructor,
copy constructor, copy assignment operator, and destructor.

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

14 years agoAttach message send metadata to the lookup as well as to the call (GNU runtime).
David Chisnall [Sat, 1 May 2010 12:56:56 +0000 (12:56 +0000)]
Attach message send metadata to the lookup as well as to the call (GNU runtime).

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

14 years agoMake super message lookups cacheable (GNUstep Runtime)
David Chisnall [Sat, 1 May 2010 12:37:16 +0000 (12:37 +0000)]
Make super message lookups cacheable (GNUstep Runtime)

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

14 years agoTweaked EmitCall() to permit the caller to provide some metadata to attach to the...
David Chisnall [Sat, 1 May 2010 11:15:56 +0000 (11:15 +0000)]
Tweaked EmitCall() to permit the caller to provide some metadata to attach to the call site.

Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining.

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

14 years agoRemove empty directory.
Benjamin Kramer [Sat, 1 May 2010 10:30:16 +0000 (10:30 +0000)]
Remove empty directory.

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

14 years agowith recent optimizer changes, these all get devirtualized.
Chris Lattner [Sat, 1 May 2010 01:42:06 +0000 (01:42 +0000)]
with recent optimizer changes, these all get devirtualized.

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

14 years agoIt turns out that basically every caller to RequireCompleteDeclContext
John McCall [Sat, 1 May 2010 00:40:08 +0000 (00:40 +0000)]
It turns out that basically every caller to RequireCompleteDeclContext
already knows what context it's looking in.  Just pass that context in
instead of (questionably) recalculating it.

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

14 years agoFix NON_ANSI_COMPILE_FLAGS setting, for MSVC.
Daniel Dunbar [Sat, 1 May 2010 00:06:42 +0000 (00:06 +0000)]
Fix NON_ANSI_COMPILE_FLAGS setting, for MSVC.

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

14 years agoAdd null check in CFGBuilder::VisitStmt() to make CFG construction
Ted Kremenek [Fri, 30 Apr 2010 22:25:53 +0000 (22:25 +0000)]
Add null check in CFGBuilder::VisitStmt() to make CFG construction
more resilient to bad code.

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

14 years agoRename 'CIndex' to 'libclang', since it has basically become our stable public
Daniel Dunbar [Fri, 30 Apr 2010 21:51:10 +0000 (21:51 +0000)]
Rename 'CIndex' to 'libclang', since it has basically become our stable public
(C) API, and will likely grow further in this direction in the future.

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

14 years agoDon't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
Ted Kremenek [Fri, 30 Apr 2010 21:49:25 +0000 (21:49 +0000)]
Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
fatal error has occurred.

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

14 years agoAfter substituting a template argument for a non-type template
Douglas Gregor [Fri, 30 Apr 2010 21:46:38 +0000 (21:46 +0000)]
After substituting a template argument for a non-type template
parameter with pointer-to-member type, we may have to perform a
qualification conversion, since the pointee type of the parameter
might be more qualified than the pointee type of the argument we form
from the declaration. Fixes PR6986.

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

14 years agoWhen synthesizing Objective C records, give the synthetic fields public
John McCall [Fri, 30 Apr 2010 21:35:41 +0000 (21:35 +0000)]
When synthesizing Objective C records, give the synthetic fields public
access.  Fixes an assertion.

Fixes rdar://problem/7927811.  Too lazy to reduce a test case.

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

14 years agoFix a thinko that caused us not to compute __builtin_offset as a
Douglas Gregor [Fri, 30 Apr 2010 20:35:01 +0000 (20:35 +0000)]
Fix a thinko that caused us not to compute __builtin_offset as a
constant expression in C.

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

14 years agoTeach clang_getLocation() to cope with a NULL file argument.
Douglas Gregor [Fri, 30 Apr 2010 19:45:53 +0000 (19:45 +0000)]
Teach clang_getLocation() to cope with a NULL file argument.

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

14 years agoRemove an unnecessary parameter from EmitClassCopyAssignment.
Anders Carlsson [Fri, 30 Apr 2010 19:45:28 +0000 (19:45 +0000)]
Remove an unnecessary parameter from EmitClassCopyAssignment.

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

14 years agoClean up our handling of local instantiation scopes, which keep track
Douglas Gregor [Fri, 30 Apr 2010 18:55:50 +0000 (18:55 +0000)]
Clean up our handling of local instantiation scopes, which keep track
of the mapping from local declarations to their instantiated
counterparts during template instantiation. Previously, we tried to do
some unholy merging of local instantiation scopes that involved
storing a single hash table along with an "undo" list on the
side... which was ugly, and never handled function parameters
properly.

Now, we just keep separate hash tables for each local instantiation
scope, and "combining" two scopes means that we'll look in each of the
combined hash tables. The combined scope stack is rarely deep, and
this makes it easy to avoid the "undo" issues we were hitting. Also,
I've simplified the logic for function parameters: if we're declaring
a function and we need the function parameters to live longer, we just
push them back into the local instantiation scope where we need them.

Fixes PR6990.

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

14 years agoMove include installation steps to better location, inside each include dir instead...
Daniel Dunbar [Fri, 30 Apr 2010 17:59:38 +0000 (17:59 +0000)]
Move include installation steps to better location, inside each include dir instead of at the top-level.

Also, don't set NO_INSTALL=1 for c-index-test.

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

14 years agoFixed incorrect type of alloca (GNU runtime).
David Chisnall [Fri, 30 Apr 2010 13:36:12 +0000 (13:36 +0000)]
Fixed incorrect type of alloca (GNU runtime).

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

14 years agoAdd calling convention related attributes to related declaration. Mark attributes...
Abramo Bagnara [Fri, 30 Apr 2010 13:10:51 +0000 (13:10 +0000)]
Add calling convention related attributes to related declaration. Mark attributes invalid on type related checking so to add them to declarations only when everything is ok.

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

14 years agoAttribute noreturn is now put in declaration attributes. Fixed a double warning gener...
Abramo Bagnara [Fri, 30 Apr 2010 09:13:03 +0000 (09:13 +0000)]
Attribute noreturn is now put in declaration attributes. Fixed a double warning generation.

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

14 years agoAn edge from a call expression to the exit block is only an abnormal edge
John McCall [Fri, 30 Apr 2010 07:10:06 +0000 (07:10 +0000)]
An edge from a call expression to the exit block is only an abnormal edge
if *none* of the successors of the call expression is the exit block.
This matters when a call of bool type is the condition of (say) a while
loop in a function with no statements after the loop.  This *can* happen
in C, but it's much more common in C++ because of overloaded operators.

Suppresses some substantial number of spurious -Wmissing-noreturn warnings.

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

14 years agoFix ADL for types declared in transparent decls, from Alp Toker!
Douglas Gregor [Fri, 30 Apr 2010 07:08:38 +0000 (07:08 +0000)]
Fix ADL for types declared in transparent decls, from Alp Toker!

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

14 years agoIntroduce a sequence number into class template partial
Douglas Gregor [Fri, 30 Apr 2010 05:56:50 +0000 (05:56 +0000)]
Introduce a sequence number into class template partial
specializations, which keeps track of the order in which they were
originally declared. We use this number so that we can always walk the
list of partial specializations in a predictable order during matching
or template instantiation. This also fixes a failure in Boost.Proto,
where SourceManager::isBeforeInTranslationUnit was behaving
poorly in inconsistent ways.

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

14 years agoAccount for the VTT argument when making an implicit copy constructor for
John McCall [Fri, 30 Apr 2010 05:56:45 +0000 (05:56 +0000)]
Account for the VTT argument when making an implicit copy constructor for
a class with virtual bases.  Just a patch until Sema starts (correctly) doing
most of this analysis.

Fixes PR 6622.

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

14 years agoWhen we start the definition of a class template, set the
Douglas Gregor [Fri, 30 Apr 2010 04:39:27 +0000 (04:39 +0000)]
When we start the definition of a class template, set the
InjectedClassNameType's Decl to point at the definition. It's a little
messy, but we do the same thing with classes and their record types,
since much of Clang expects that the TagDecl* one gets out of a type
is the definition. Fixes several Boost.Proto failures.

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

14 years agoRemove unused trait.
Zhongxing Xu [Fri, 30 Apr 2010 04:17:33 +0000 (04:17 +0000)]
Remove unused trait.

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

14 years agoRefactor the AnalysisConsumer to analyze functions after the whole
Zhongxing Xu [Fri, 30 Apr 2010 04:14:20 +0000 (04:14 +0000)]
Refactor the AnalysisConsumer to analyze functions after the whole
translation unit is parsed. This enables us to inline some calls when still
analyzing one function at a time.

Actions are classified into Function, CXXMethod, ObjCMethod,
ObjCImplementation.

This does not hurt performance much. The analysis time for sqlite3.c:

before:
real    17m52.440s
user    17m49.460s
sys    0m2.010s

after:
real    18m0.500s
user    17m56.900s
sys    0m2.330s

DisplayProgress option is broken now. -inine-call action is removed. It
will be reenabled in another form, perhaps as an indenpendant option.

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

14 years agoFix a tentative-parse error with unqualified template ids in cast expressions.
John McCall [Fri, 30 Apr 2010 03:11:01 +0000 (03:11 +0000)]
Fix a tentative-parse error with unqualified template ids in cast expressions.
Also resolve a long-working FIXME in the test case I modified.

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

14 years agoFix pasto in this test
Douglas Gregor [Fri, 30 Apr 2010 03:07:23 +0000 (03:07 +0000)]
Fix pasto in this test

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

14 years agoAdd Clang version inspection macros. Fixes PR6681.
Douglas Gregor [Fri, 30 Apr 2010 02:51:06 +0000 (02:51 +0000)]
Add Clang version inspection macros. Fixes PR6681.

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

14 years agoFix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTI
John McCall [Fri, 30 Apr 2010 01:15:21 +0000 (01:15 +0000)]
Fix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTI
when used by the exceptions routines.  Fixes PR 6974.

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

14 years agological ops, unary ops, pairwise ops
Nate Begeman [Fri, 30 Apr 2010 00:46:57 +0000 (00:46 +0000)]
logical ops, unary ops, pairwise ops

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

14 years agoTeach EHCleanupBlock to deal appropriately with the possibility that there
John McCall [Fri, 30 Apr 2010 00:06:43 +0000 (00:06 +0000)]
Teach EHCleanupBlock to deal appropriately with the possibility that there
might not have been an insertion block set at start.  Fixes PR6975.

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

14 years agoGet the base class addresses before calling EmitClassCopyAssignment.
Anders Carlsson [Fri, 30 Apr 2010 00:04:01 +0000 (00:04 +0000)]
Get the base class addresses before calling EmitClassCopyAssignment.

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

14 years agoRemove an unnecessary argument to EmitClassCopyAssignment.
Anders Carlsson [Thu, 29 Apr 2010 23:51:42 +0000 (23:51 +0000)]
Remove an unnecessary argument to EmitClassCopyAssignment.

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

14 years agoRebuild the nested name specifiers in member-pointer declarator chunks when
John McCall [Thu, 29 Apr 2010 23:50:39 +0000 (23:50 +0000)]
Rebuild the nested name specifiers in member-pointer declarator chunks when
entering the current instantiation.  Set up a little to preserve type location
information for typename types while we're in there.

Fixes a Boost failure.

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

14 years agoComparisons.
Nate Begeman [Thu, 29 Apr 2010 23:36:09 +0000 (23:36 +0000)]
Comparisons.

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

14 years agoDo not enable '-analyze-check-security-syntactic' by default when using '--analyze...
Ted Kremenek [Thu, 29 Apr 2010 22:50:22 +0000 (22:50 +0000)]
Do not enable '-analyze-check-security-syntactic' by default when using '--analyze'.  There
are several known issues to address for it should be turned on by default.

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

14 years agoWhen determining a standard conversion sequence involves resolving the
Douglas Gregor [Thu, 29 Apr 2010 18:24:40 +0000 (18:24 +0000)]
When determining a standard conversion sequence involves resolving the
address of an overloaded function (or function template), perform that
resolution prior to determining the implicit conversion
sequence. This resolution is not part of the implicit conversion
sequence itself.

Previously, we would always consider this resolution to be a
function pointer decay, which was a lie: there might be an explicit &
in the expression, in which case decay should not occur. This caused
the CodeGen assertion in PR6973 (where we created a
pointer to a pointer to a function when we should have had a pointer
to a function), but it's likely that there are corner cases of
overload resolution where this would have failed.

Cleaned up the code involved in determining the type that will
produced afer resolving the overloaded function reference, and added
an assertion to make sure the result is correct. Fixes PR6973.

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

14 years agoProperties cannot be synthesized by-dafult in
Fariborz Jahanian [Thu, 29 Apr 2010 17:52:18 +0000 (17:52 +0000)]
Properties cannot be synthesized by-dafult in
categories. Issue usual warnings instead of
confusing error message. Radar 7920807

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

14 years agoUse clang::VarDecl name instead of llvm::GlobalVariable name.
Devang Patel [Thu, 29 Apr 2010 17:48:37 +0000 (17:48 +0000)]
Use clang::VarDecl name instead of llvm::GlobalVariable name.
llvm::GLobalVariable name may not match user visibile name for function static variables.

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

14 years agoAdd USR support for 'static inline' functions (which can be declared in header files).
Ted Kremenek [Thu, 29 Apr 2010 17:43:29 +0000 (17:43 +0000)]
Add USR support for 'static inline' functions (which can be declared in header files).
Add USR support for 'static' functions and local variables, which can be handy for resolving named variables within a translation unit.

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

14 years agoRemove USRGenerator::VisitBlockDecl(). We don't need to generate USRs for blocks...
Ted Kremenek [Thu, 29 Apr 2010 17:43:26 +0000 (17:43 +0000)]
Remove USRGenerator::VisitBlockDecl().  We don't need to generate USRs for blocks, since
they have no linkage and by definition are anonymous.

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

14 years agoAdd test case for __has_feature(objc_weak_class).
Ted Kremenek [Thu, 29 Apr 2010 17:43:21 +0000 (17:43 +0000)]
Add test case for __has_feature(objc_weak_class).

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

14 years agoStart stamping out the __builtin_neon stuff.
Nate Begeman [Thu, 29 Apr 2010 17:37:19 +0000 (17:37 +0000)]
Start stamping out the __builtin_neon stuff.

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

14 years agoAdd FunctionDecl::isVariadic() to match BlockDecl::isVariadic() and ObjCMethodDecl...
Ted Kremenek [Thu, 29 Apr 2010 16:49:01 +0000 (16:49 +0000)]
Add FunctionDecl::isVariadic() to match BlockDecl::isVariadic() and ObjCMethodDecl::isVariadic().
Do some minor refactoring along the way.

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

14 years agoRename BlockDecl::IsVariadic() to BlockDecl::isVariadic() to match the casing
Ted Kremenek [Thu, 29 Apr 2010 16:48:58 +0000 (16:48 +0000)]
Rename BlockDecl::IsVariadic() to BlockDecl::isVariadic() to match the casing
for similar methods.  No functionality change.

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

14 years agoIRgen/NeXT: Put the synthesized _objc_super, _message_ref_t decls in a valid DeclCont...
Daniel Dunbar [Thu, 29 Apr 2010 16:29:11 +0000 (16:29 +0000)]
IRgen/NeXT: Put the synthesized _objc_super, _message_ref_t decls in a valid DeclContext, to satisfy the invariants that should hold on a RecordDecl.

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

14 years agoRemove a FIXME that is unlikely to be fixed (streaming code generation).
Daniel Dunbar [Thu, 29 Apr 2010 16:29:09 +0000 (16:29 +0000)]
Remove a FIXME that is unlikely to be fixed (streaming code generation).

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

14 years agoFrontend: Tie backend verification passes to CodeGenOptions::VerifyModule,
Daniel Dunbar [Thu, 29 Apr 2010 16:29:06 +0000 (16:29 +0000)]
Frontend: Tie backend verification passes to CodeGenOptions::VerifyModule,
instead of NDEBUG.

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

14 years agoBump Clang version number.
Ted Kremenek [Thu, 29 Apr 2010 15:30:51 +0000 (15:30 +0000)]
Bump Clang version number.

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

14 years agoWhen performing partial ordering of class template partial
Douglas Gregor [Thu, 29 Apr 2010 06:31:36 +0000 (06:31 +0000)]
When performing partial ordering of class template partial
specializations, substitute the deduced template arguments and check
the resulting substitution before concluding that template argument
deduction succeeds. This marvelous little fix makes a bunch of
Boost.Spirit tests start working.

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

14 years agoFor template argument deduction from class template partial
Douglas Gregor [Thu, 29 Apr 2010 06:21:43 +0000 (06:21 +0000)]
For template argument deduction from class template partial
specializations, separate out the deduction part from the checking and
substitution of the deduced arguments.

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

14 years agoA not equal for an unordered relation should return true as specified in IEEE-754...
Mon P Wang [Thu, 29 Apr 2010 05:53:29 +0000 (05:53 +0000)]
A not equal for an unordered relation should return true as specified in IEEE-754, e.g.,
NAN != NAN ? 1 : 0 should return 1.  Also fix the case for complex.

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

14 years agoIt turns out that we *can* end up having to display template argument
Douglas Gregor [Thu, 29 Apr 2010 04:55:13 +0000 (04:55 +0000)]
It turns out that we *can* end up having to display template argument
bindings when the template argument is still an expression; it happens
while checking the template arguments of a class template partial
specializations. Fixes PR6964.

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

14 years agoAdd '__has_feature' support for weak ObjC classes.
Ted Kremenek [Thu, 29 Apr 2010 02:06:46 +0000 (02:06 +0000)]
Add '__has_feature' support for weak ObjC classes.

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

14 years agoSort '__has_feature' cases. No functionality change.
Ted Kremenek [Thu, 29 Apr 2010 02:06:42 +0000 (02:06 +0000)]
Sort '__has_feature' cases.  No functionality change.

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

14 years agoTest case for r102578.
John McCall [Thu, 29 Apr 2010 01:20:45 +0000 (01:20 +0000)]
Test case for r102578.

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

14 years agoAccess-check during template argument deduction from the context of the
John McCall [Thu, 29 Apr 2010 01:18:58 +0000 (01:18 +0000)]
Access-check during template argument deduction from the context of the
template decl itself, not its context.  Testcase to follow;  fixes selfhost.

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

14 years agoFix CFG crasher involving statement expressions reported in PR 6938.
Ted Kremenek [Thu, 29 Apr 2010 01:10:26 +0000 (01:10 +0000)]
Fix CFG crasher involving statement expressions reported in PR 6938.

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

14 years agoProperly switch into the declaring scope of a template when performing
John McCall [Thu, 29 Apr 2010 00:35:03 +0000 (00:35 +0000)]
Properly switch into the declaring scope of a template when performing
template argument deduction or (more importantly) the final substitution
required by such deduction.  Makes access control magically work in these
cases.

Fixes PR6967.

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

14 years agoTeach __builtin_offsetof to compute the offsets of members of base
Douglas Gregor [Thu, 29 Apr 2010 00:18:15 +0000 (00:18 +0000)]
Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.

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

14 years agobuild: Add CLANG_NO_RUNTIME build variable, which disables building clang
Daniel Dunbar [Wed, 28 Apr 2010 23:36:26 +0000 (23:36 +0000)]
build: Add CLANG_NO_RUNTIME build variable, which disables building clang
runtime library stuff, even if compiler-rt is available.

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

14 years agoDriver: Add support for -fobjc-abi-version=.
Daniel Dunbar [Wed, 28 Apr 2010 23:25:24 +0000 (23:25 +0000)]
Driver: Add support for -fobjc-abi-version=.
 - <rdar://problem/7919678>

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

14 years agoEnsure that cv-qualifiers are correctly removed for post-inc/decrements
Sean Hunt [Wed, 28 Apr 2010 23:02:27 +0000 (23:02 +0000)]
Ensure that cv-qualifiers are correctly removed for post-inc/decrements
as well as pre- and post-inc/decrements in C (not that I think it
matters for any C code).

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

14 years agoFix template instantiation for __builtin_offfsetof expressions that refer to members...
Douglas Gregor [Wed, 28 Apr 2010 22:43:14 +0000 (22:43 +0000)]
Fix template instantiation for __builtin_offfsetof expressions that refer to members of anonymous structs/unions

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

14 years agoA bit more neon work, adds work (but the ABI is wrong), types mostly stamped out.
Nate Begeman [Wed, 28 Apr 2010 22:37:01 +0000 (22:37 +0000)]
A bit more neon work, adds work (but the ABI is wrong), types mostly stamped out.

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

14 years agoDiagnose __builtin_offsetof expressions that refer to bit-fields
Douglas Gregor [Wed, 28 Apr 2010 22:36:06 +0000 (22:36 +0000)]
Diagnose __builtin_offsetof expressions that refer to bit-fields

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

14 years agoSupport for construct/destruct of ivar array
Fariborz Jahanian [Wed, 28 Apr 2010 22:30:33 +0000 (22:30 +0000)]
Support for construct/destruct of ivar array
of c++ objects (NeXt runtime).
radar 7900343.

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