]> granicus.if.org Git - clang/log
clang
14 years agoCorrectly set the location of the "template" keyword for a class
Douglas Gregor [Tue, 6 Jul 2010 18:33:12 +0000 (18:33 +0000)]
Correctly set the location of the "template" keyword for a class
template specialization, from Peter Collingbourne.

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

14 years agoRemove my egregious hack that forced deserialization of visible
Douglas Gregor [Tue, 6 Jul 2010 18:29:01 +0000 (18:29 +0000)]
Remove my egregious hack that forced deserialization of visible
declarations when implicitly declaring the default constructor, copy
constructor, destructor, and copy-assignment operators of a
class. Argiris fixed the underlying problem in r107596.

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

14 years agoPacify versions of gcc that think these variables may be used
Duncan Sands [Tue, 6 Jul 2010 18:19:40 +0000 (18:19 +0000)]
Pacify versions of gcc that think these variables may be used
uninitialized (which doesn't seem to be the case), by giving
them arbitrary initial values.

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

14 years agoWhen destroying a cleanup, kill any references to instructions in the entry
John McCall [Tue, 6 Jul 2010 17:35:03 +0000 (17:35 +0000)]
When destroying a cleanup, kill any references to instructions in the entry
block before deleting it.  Fixes PR7575.

This really just a short-term fix before implementing lazy cleanups.

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

14 years agoAdded several helper functions to Stmt to recursively check for different elements...
Tom Care [Tue, 6 Jul 2010 17:28:49 +0000 (17:28 +0000)]
Added several helper functions to Stmt to recursively check for different elements (macros, enum constants, etc).

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

14 years agoRead/write function template specializations for PCH, properly this time.
Argyrios Kyrtzidis [Tue, 6 Jul 2010 15:37:09 +0000 (15:37 +0000)]
Read/write function template specializations for PCH, properly this time.

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

14 years agoAdd to PCH missing Sema information about VTable uses and dynamic classes.
Argyrios Kyrtzidis [Tue, 6 Jul 2010 15:37:04 +0000 (15:37 +0000)]
Add to PCH missing Sema information about VTable uses and dynamic classes.

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

14 years agoAllow a CXXRecordDecl to get a DefinitionData pointer even when its owner is still...
Argyrios Kyrtzidis [Tue, 6 Jul 2010 15:36:58 +0000 (15:36 +0000)]
Allow a CXXRecordDecl to get a DefinitionData pointer even when its owner is still initializing.

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

14 years agoRead/write instantiated-from-member of EnumDecl for PCH.
Argyrios Kyrtzidis [Tue, 6 Jul 2010 15:36:48 +0000 (15:36 +0000)]
Read/write instantiated-from-member of EnumDecl for PCH.

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

14 years agoAdd skeleton code to make wpa call the analysis engine.
Zhongxing Xu [Tue, 6 Jul 2010 09:18:02 +0000 (09:18 +0000)]
Add skeleton code to make wpa call the analysis engine.

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

14 years agoAdd an assertion.
Zhongxing Xu [Tue, 6 Jul 2010 07:08:47 +0000 (07:08 +0000)]
Add an assertion.

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

14 years agoCollect function definitions in the Indexer when indexing through the ASTs.
Zhongxing Xu [Tue, 6 Jul 2010 05:55:13 +0000 (05:55 +0000)]
Collect function definitions in the Indexer when indexing through the ASTs.
Add an API to get an Entity associated with a name in the global namespace.

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

14 years agoWhen creating functions to run global initializers and destructors, mark them
John McCall [Tue, 6 Jul 2010 04:38:10 +0000 (04:38 +0000)]
When creating functions to run global initializers and destructors, mark them
as nounwind in -fno-exceptions.  Fixes rdar://problem/8090834.

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

14 years agoRemove the now-unused GRState::isEqual method. Instead of asking if an expression...
Jordy Rose [Tue, 6 Jul 2010 04:12:24 +0000 (04:12 +0000)]
Remove the now-unused GRState::isEqual method. Instead of asking if an expression equals a certain value, use SValuator::EvalEQ and GRState::Assume to see if it can, must, or must not equal that value.

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

14 years agoOops, tabs --> spaces in test.
Jordy Rose [Tue, 6 Jul 2010 02:42:09 +0000 (02:42 +0000)]
Oops, tabs --> spaces in test.

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

14 years agoImprove NULL-checking for CFRetain/CFRelease. We now remember that the argument was...
Jordy Rose [Tue, 6 Jul 2010 02:34:42 +0000 (02:34 +0000)]
Improve NULL-checking for CFRetain/CFRelease. We now remember that the argument was non-NULL, and we report where the null assumption came from (like AttrNonNullChecker already did).

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

14 years agoStop testing for specific basic block numbers in this test.
John McCall [Tue, 6 Jul 2010 02:14:28 +0000 (02:14 +0000)]
Stop testing for specific basic block numbers in this test.

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

14 years agoValidated by nightly-test runs on x86 and x86-64 darwin, including after
John McCall [Tue, 6 Jul 2010 01:34:17 +0000 (01:34 +0000)]
Validated by nightly-test runs on x86 and x86-64 darwin, including after
self-host.  Hopefully these results hold up on different platforms.

I tried to keep the GNU ObjC runtime happy, but it's hard for me to test.
Reimplement how clang generates IR for exceptions.  Instead of creating new
invoke destinations which sequentially chain to the previous destination,
push a more semantic representation of *why* we need the cleanup/catch/filter
behavior, then collect that information into a single landing pad upon request.

Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional
control flow) are generated, since it's actually fairly closely tied in with
the former.  Remove the need to track which cleanup scope a block is associated
with.

Document a lot of previously poorly-understood (by me, at least) behavior.

The new framework implements the Horrible Hack (tm), which requires every
landing pad to have a catch-all so that inlining will work.  Clang no longer
requires the Horrible Hack just to make exceptions flow correctly within
a function, however.  The HH is an unfortunate requirement of LLVM's EH IR.

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

14 years agoLocal variables have no linkage, make invalid Entities.
Zhongxing Xu [Tue, 6 Jul 2010 01:20:49 +0000 (01:20 +0000)]
Local variables have no linkage, make invalid Entities.

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

14 years agoGenerate fewer first class aggregate values for other
Chris Lattner [Mon, 5 Jul 2010 20:41:41 +0000 (20:41 +0000)]
Generate fewer first class aggregate values for other
coerce cases (e.g. {double,int}) which avoids fastisel
bailing out at -O0.

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

14 years agoin the "coerce" case, the ABI handling code ends up making the
Chris Lattner [Mon, 5 Jul 2010 20:21:00 +0000 (20:21 +0000)]
in the "coerce" case, the ABI handling code ends up making the
alloca for an argument.  Make sure the argument gets the proper
decl alignment, which may be different than the type alignment.

This fixes PR7567

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

14 years agofix a bug I introduced in r107624
Chris Lattner [Mon, 5 Jul 2010 19:36:34 +0000 (19:36 +0000)]
fix a bug I introduced in r107624

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

14 years agorearrange some logic, no functionality change.
Chris Lattner [Mon, 5 Jul 2010 19:17:26 +0000 (19:17 +0000)]
rearrange some logic, no functionality change.

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

14 years agofix PR7564 a cast where the bitfield struct init code
Chris Lattner [Mon, 5 Jul 2010 18:03:30 +0000 (18:03 +0000)]
fix PR7564 a cast where the bitfield struct init code
wasn't handling array padding elements right.

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

14 years agoAppendBitField really can never fail, so return its return value.
Chris Lattner [Mon, 5 Jul 2010 17:04:23 +0000 (17:04 +0000)]
AppendBitField really can never fail, so return its return value.
Everyone knows that no bugs are ever possible with bitfields.

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

14 years agoRead/write the identifier namespace in PCH for decls that may modify it.
Argyrios Kyrtzidis [Mon, 5 Jul 2010 10:38:01 +0000 (10:38 +0000)]
Read/write the identifier namespace in PCH for decls that may modify it.

We can now use a PCH'ed <map>.

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

14 years agoRead/write some source location for PCH.
Argyrios Kyrtzidis [Mon, 5 Jul 2010 10:37:55 +0000 (10:37 +0000)]
Read/write some source location for PCH.

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

14 years agoSupport sizeof for VLA expressions (sizeof(someVLA)). sizeof(int[n]) still unimplemen...
Jordy Rose [Mon, 5 Jul 2010 04:42:43 +0000 (04:42 +0000)]
Support sizeof for VLA expressions (sizeof(someVLA)). sizeof(int[n]) still unimplemented. A VLA region's sizeof value matches its extent.

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

14 years agoRefrase comments.
Zhongxing Xu [Mon, 5 Jul 2010 02:36:16 +0000 (02:36 +0000)]
Refrase comments.

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

14 years agoAlthough in C++ class name has external linkage, usually the definition of the
Zhongxing Xu [Mon, 5 Jul 2010 02:35:40 +0000 (02:35 +0000)]
Although in C++ class name has external linkage, usually the definition of the
class is available in the same translation unit when it's needed. So we make
all of them invalid Entity.

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

14 years agoMake FieldDecl an invalid Entity since it has no linkage.
Zhongxing Xu [Mon, 5 Jul 2010 02:31:16 +0000 (02:31 +0000)]
Make FieldDecl an invalid Entity since it has no linkage.

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

14 years agoIndexer: make FieldDecl an internal Entity.
Zhongxing Xu [Mon, 5 Jul 2010 01:44:14 +0000 (01:44 +0000)]
Indexer: make FieldDecl an internal Entity.

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

14 years agoTrack extents for VLAs.
Jordy Rose [Mon, 5 Jul 2010 00:50:15 +0000 (00:50 +0000)]
Track extents for VLAs.

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

14 years agoFix a regression of a previous commit of mine (rdar://8158953).
Argyrios Kyrtzidis [Sun, 4 Jul 2010 21:44:47 +0000 (21:44 +0000)]
Fix a regression of a previous commit of mine (rdar://8158953).

Some of the invariant checks for creating Record/Enum types don't hold true during PCH reading.
Introduce more suitable ASTContext::getRecordType() and getEnumType().

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

14 years agoRead/write more information of ASTContext for PCH. Overriden methods and instantiated...
Argyrios Kyrtzidis [Sun, 4 Jul 2010 21:44:35 +0000 (21:44 +0000)]
Read/write more information of ASTContext for PCH. Overriden methods and instantiated-from information.

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

14 years agoWhen adding a visible decl, deserialize the visible decls and add it.
Argyrios Kyrtzidis [Sun, 4 Jul 2010 21:44:25 +0000 (21:44 +0000)]
When adding a visible decl, deserialize the visible decls and add it.

Before this commit, visible decls added before deserialization were ignored.
This was not an issue since name lookup (that usually comes before the addition) forces deserialization
but it is an issue for lazily declared class implicit members.

We can use a PCH'ed <string> now.

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

14 years agoDon't try to install the __[u]int128_t identifier if it is already installed by PCHRe...
Argyrios Kyrtzidis [Sun, 4 Jul 2010 21:44:19 +0000 (21:44 +0000)]
Don't try to install the __[u]int128_t identifier if it is already installed by PCHReader.

Currently, adding it to visible decls of a PCH'ed translation unit has no effect because
adding visible decls before deserialization has no effect (the decls won't be visible).
This will be fixed in a future commit; then it will force deserialization of visible decls, so avoid pointlessly installing it.

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

14 years agoWrite/read ParmVarDecl's UninstantiatedDefaultArg for PCH.
Argyrios Kyrtzidis [Sun, 4 Jul 2010 21:44:07 +0000 (21:44 +0000)]
Write/read ParmVarDecl's UninstantiatedDefaultArg for PCH.

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

14 years agoRead/write specialization info of static data members for PCH.
Argyrios Kyrtzidis [Sun, 4 Jul 2010 21:44:00 +0000 (21:44 +0000)]
Read/write specialization info of static data members for PCH.

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

14 years agoAdd TypeLoc traversal to the RecursiveASTVisitor! Because the TypeLocs don't
Nick Lewycky [Sun, 4 Jul 2010 21:29:45 +0000 (21:29 +0000)]
Add TypeLoc traversal to the RecursiveASTVisitor! Because the TypeLocs don't
contain all the same information that their Types do, we will fall back to
traversing the Types instead. The default TypeLoc visitor calls the matching
Type visitor so that existing clients should continue to work with no change.

Also adds element traversal to the ExtVectorType.

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

14 years agoFix ObjCInterfaceTypeLoc to inherit from ObjCObjectTypeLoc so as to match the
Nick Lewycky [Sun, 4 Jul 2010 01:41:30 +0000 (01:41 +0000)]
Fix ObjCInterfaceTypeLoc to inherit from ObjCObjectTypeLoc so as to match the
Type hierarchy. Without this, TypeLocNodes.def will give you wrong type
hierarchy information (claiming that ObjCObjectTypeLoc is the base of
ObjCInterfaceTypeLoc, which it wasn't).

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

14 years agoAdd a new symbol type, SymbolExtent, to represent the extents of memory regions that...
Jordy Rose [Sun, 4 Jul 2010 00:00:41 +0000 (00:00 +0000)]
Add a new symbol type, SymbolExtent, to represent the extents of memory regions that may not be known at compile-time (such as those created by malloc). This replaces the old setExtent/getExtent API on Store, which used the GRState's GDM to store SVals.

Also adds a getKnownValue() method to SValuator, which gets the integer value of an SVal if it is known to only have one possible value. There are more places in the code that could be using this, but in general we want to be dealing entirely in SVals, so its usefulness is limited.

The only visible functionality change is that extents are now honored for any DeclRegion, such as fields and Objective-C ivars, rather than just variables. This shows up in bounds-checking and cast-size-checking.

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

14 years agoUnbreak test on platforms where size_t != unsigned long.
Benjamin Kramer [Sat, 3 Jul 2010 20:33:13 +0000 (20:33 +0000)]
Unbreak test on platforms where size_t != unsigned long.

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

14 years agoMark the operator delete associated with a virtual destructor as referenced.
John McCall [Sat, 3 Jul 2010 18:33:00 +0000 (18:33 +0000)]
Mark the operator delete associated with a virtual destructor as referenced.

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

14 years agoMangle Objective-C pointers and block pointers in the Microsoft C++ Mangler.
Charles Davis [Sat, 3 Jul 2010 16:56:59 +0000 (16:56 +0000)]
Mangle Objective-C pointers and block pointers in the Microsoft C++ Mangler.

ObjC pointers were easy enough (as far as the ABI is concerned, they're
just pointers to structs), but I had to invent a new mangling for block
pointers. This is particularly worrying with the Microsoft ABI, because
it is a vendor-specific ABI; extending it could come back to bite us
later when MS extends it on their own (and you know they will).

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

14 years agoProvide convenience routines to save and restore the current insertion
John McCall [Sat, 3 Jul 2010 09:25:20 +0000 (09:25 +0000)]
Provide convenience routines to save and restore the current insertion
point.

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

14 years agoFix mangling of array dimensions in the Microsoft C++ Mangler.
Charles Davis [Sat, 3 Jul 2010 08:15:16 +0000 (08:15 +0000)]
Fix mangling of array dimensions in the Microsoft C++ Mangler.

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

14 years agoMangle member pointer types in the Microsoft C++ Mangler.
Charles Davis [Sat, 3 Jul 2010 08:01:32 +0000 (08:01 +0000)]
Mangle member pointer types in the Microsoft C++ Mangler.

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

14 years agoWhen setting the anonymous namespace at PCH reading, it may still be initializing...
Argyrios Kyrtzidis [Sat, 3 Jul 2010 07:57:53 +0000 (07:57 +0000)]
When setting the anonymous namespace at PCH reading, it may still be initializing so avoid
the invariant checks at NamespaceDecl::setAnonymousNamespace().

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

14 years agoFix mangling of function pointers in the Microsoft C++ Mangler.
Charles Davis [Sat, 3 Jul 2010 05:53:41 +0000 (05:53 +0000)]
Fix mangling of function pointers in the Microsoft C++ Mangler.

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

14 years agoForward -fno-builtin to clang, add .cp as a supported
Shantonu Sen [Sat, 3 Jul 2010 03:08:23 +0000 (03:08 +0000)]
Forward -fno-builtin to clang, add .cp as a supported
extension if you otherwise configure scan-build
to do c++ static analysis.

OKed by Ted

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

14 years agoFix mangling of array parameters for functions in the Microsoft C++ Mangler.
Charles Davis [Sat, 3 Jul 2010 02:41:45 +0000 (02:41 +0000)]
Fix mangling of array parameters for functions in the Microsoft C++ Mangler.
Only actual functions get mangled correctly; I don't know how to fix it for
function pointers yet. Thanks to John McCall for the hint.

Also, mangle anonymous tag types. I don't have a suitable testcase yet; I have
a feeling that that's going to need support for static locals, and I haven't
figured out exactly how MSVC's scheme for mangling those works.

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

14 years agoLazily declare default constructors. We now delay the construction of
Douglas Gregor [Sat, 3 Jul 2010 00:47:00 +0000 (00:47 +0000)]
Lazily declare default constructors. We now delay the construction of
declarations for implicit default constructors, copy constructors,
copy assignment operators, and destructors. On a "simple" translation
unit that includes a bunch of C++ standard library headers, we
generate relatively few of these implicit declarations now:

  4/159 implicit default constructors created
  18/236 implicit copy constructors created
  70/241 implicit copy assignment operators created
  0/173 implicit destructors created

And, on this translation unit, this optimization doesn't really
provide any benefit. I'll do some more performance measurements soon,
but this completes the implementation work for <rdar://problem/8151045>.

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

14 years agoLazily declare implicit copy constructors.
Douglas Gregor [Fri, 2 Jul 2010 23:41:54 +0000 (23:41 +0000)]
Lazily declare implicit copy constructors.

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

14 years agoRead/write CastExpr's CXXBaseSpecifierArray for PCH.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 23:30:27 +0000 (23:30 +0000)]
Read/write CastExpr's CXXBaseSpecifierArray for PCH.

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

14 years agoFix broken PCH support for CXXDefaultArgExpr.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 23:30:15 +0000 (23:30 +0000)]
Fix broken PCH support for CXXDefaultArgExpr.

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

14 years agoIntroduce a new routine, LookupConstructors(), and use it for all
Douglas Gregor [Fri, 2 Jul 2010 23:12:18 +0000 (23:12 +0000)]
Introduce a new routine, LookupConstructors(), and use it for all
constructor-name lookup.

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

14 years agoLazily declare copy-assignment operators.
Douglas Gregor [Fri, 2 Jul 2010 21:50:04 +0000 (21:50 +0000)]
Lazily declare copy-assignment operators.

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

14 years agoMake RecursiveASTVisitor traverse function parameter types in a function
Zhanyong Wan [Fri, 2 Jul 2010 21:02:30 +0000 (21:02 +0000)]
Make RecursiveASTVisitor traverse function parameter types in a function
prototype declaration.  Reviewed by chandlerc and csilvers.

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

14 years agoLazily declare the implicitly-declared destructor in a C++ class.
Douglas Gregor [Fri, 2 Jul 2010 20:37:36 +0000 (20:37 +0000)]
Lazily declare the implicitly-declared destructor in a C++ class.

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

14 years agoDon't visit implicitly defined functions (default constructors and the
Craig Silverstein [Fri, 2 Jul 2010 19:07:50 +0000 (19:07 +0000)]
Don't visit implicitly defined functions (default constructors and the
like).  Our goal with this visitor is to visit exactly what people type.

Reviewed by chandlerc.

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

14 years agoMove the "current scope" state from the Parser into Action. This
Douglas Gregor [Fri, 2 Jul 2010 17:43:08 +0000 (17:43 +0000)]
Move the "current scope" state from the Parser into Action. This
allows Sema some limited access to the current scope, which we only
use in one way: when Sema is performing some kind of declaration that
is not directly driven by the parser (e.g., due to template
instantiatio or lazy declaration of a member), we can find the Scope
associated with a DeclContext, if that DeclContext is still in the
process of being parsed.

Use this to make the implicit declaration of special member functions
in a C++ class more "scope-less", rather than using the NULL Scope hack.

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

14 years agoBy default, warn about commas at the end of an enumerator list in C++/C89.
Douglas Gregor [Fri, 2 Jul 2010 16:17:01 +0000 (16:17 +0000)]
By default, warn about commas at the end of an enumerator list in C++/C89.

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

14 years agoHandle CXXConstructorDecl, CXXDestructorDecl, and CXXConversionDecl for PCH.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 15:58:43 +0000 (15:58 +0000)]
Handle CXXConstructorDecl, CXXDestructorDecl, and CXXConversionDecl for PCH.

<vector> header can be used correctly through PCH now.

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

14 years agoProvide some test cases for C++ PCH.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:48 +0000 (11:55 +0000)]
Provide some test cases for C++ PCH.

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

14 years agoDisable Decl::CheckAccessDeclContext() temporarily.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:44 +0000 (11:55 +0000)]
Disable Decl::CheckAccessDeclContext() temporarily.

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

14 years agoFix reading FunctionDecls from PCH.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:40 +0000 (11:55 +0000)]
Fix reading FunctionDecls from PCH.

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

14 years agoFix reading ClassTemplateDecl's ClassTemplateSpecializationDecls and ClassTemplatePar...
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:37 +0000 (11:55 +0000)]
Fix reading ClassTemplateDecl's ClassTemplateSpecializationDecls and ClassTemplatePartialSpecializationDecls.

Store/read also their template arguments because they may be initializing and not be able to provide them.

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

14 years agoFully read/write CXXRecordDecl for PCH.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:32 +0000 (11:55 +0000)]
Fully read/write CXXRecordDecl for PCH.

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

14 years agoFix reading of DependentNameType.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:24 +0000 (11:55 +0000)]
Fix reading of DependentNameType.

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

14 years agoAllow reading of InjectedClassNameType from PCH even when its decl is currently initi...
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:20 +0000 (11:55 +0000)]
Allow reading of InjectedClassNameType from PCH even when its decl is currently initializing.

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

14 years agoFix broken reading of member pointer from PCH.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:15 +0000 (11:55 +0000)]
Fix broken reading of member pointer from PCH.

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

14 years ago- Allow a typedef type to be read from PCH even if its decl is currently initializing.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:11 +0000 (11:55 +0000)]
- Allow a typedef type to be read from PCH even if its decl is currently initializing.
- Fix creation of TemplateSpecializationType.

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

14 years agoFix broken reading of "#lines" from PCH.
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:05 +0000 (11:55 +0000)]
Fix broken reading of "#lines" from PCH.

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

14 years agoGenerally types expect an initialized TypeDecl; its safer and less complicated to...
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:55:01 +0000 (11:55 +0000)]
Generally types expect an initialized TypeDecl; its safer and less complicated to delay PCH reading the type of a TypeDecl.

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

14 years agoAdd some side-effect free Create methods for TypeDecl subclasses and use them for...
Argyrios Kyrtzidis [Fri, 2 Jul 2010 11:54:55 +0000 (11:54 +0000)]
Add some side-effect free Create methods for TypeDecl subclasses and use them for PCH reading.

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

14 years agoCreate a ASTUnitTU class to interface ASTUnit to the Indexer.
Zhongxing Xu [Fri, 2 Jul 2010 11:52:15 +0000 (11:52 +0000)]
Create a ASTUnitTU class to interface ASTUnit to the Indexer.

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

14 years agoadd -analyze-function option.
Zhongxing Xu [Fri, 2 Jul 2010 07:03:03 +0000 (07:03 +0000)]
add -analyze-function option.

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

14 years agoadd -view-call-graph option to wpa.
Zhongxing Xu [Fri, 2 Jul 2010 06:58:30 +0000 (06:58 +0000)]
add -view-call-graph option to wpa.

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

14 years agoChange CallGraph::Prog to be a reference. idx::Program means to be a global object...
Zhongxing Xu [Fri, 2 Jul 2010 06:39:46 +0000 (06:39 +0000)]
Change CallGraph::Prog to be a reference. idx::Program means to be a global object to the Index library.

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

14 years agoHandle typedef function declarations correctly, such as
Craig Silverstein [Thu, 1 Jul 2010 23:46:26 +0000 (23:46 +0000)]
Handle typedef function declarations correctly, such as
       typedef int (*Myfunc)(int);
       Myfunc func;

Reviewed by chandlerc

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

14 years agoAdd a new routine Sema::LookupDestructor and make all destructor-lookup calls use...
Douglas Gregor [Thu, 1 Jul 2010 22:47:18 +0000 (22:47 +0000)]
Add a new routine Sema::LookupDestructor and make all destructor-lookup calls use that routine

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

14 years agoProvide exception specifications for implicitly-declared default constructors.
Douglas Gregor [Thu, 1 Jul 2010 22:31:05 +0000 (22:31 +0000)]
Provide exception specifications for implicitly-declared default constructors.

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

14 years agoMove the implicit declaration of a default constructor into a separate
Douglas Gregor [Thu, 1 Jul 2010 22:02:46 +0000 (22:02 +0000)]
Move the implicit declaration of a default constructor into a separate
routine; no functionality change.

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

14 years agoProvide exception specifications for implicitly-declared copy constructors.
Douglas Gregor [Thu, 1 Jul 2010 20:59:04 +0000 (20:59 +0000)]
Provide exception specifications for implicitly-declared copy constructors.

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

14 years agoMC: Pass the target instance to the AsmParser constructor.
Daniel Dunbar [Thu, 1 Jul 2010 20:41:59 +0000 (20:41 +0000)]
MC: Pass the target instance to the AsmParser constructor.

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

14 years agoFix PR 7475 by enhancing the static analyzer to also invalidate bindings for non...
Ted Kremenek [Thu, 1 Jul 2010 20:16:50 +0000 (20:16 +0000)]
Fix PR 7475 by enhancing the static analyzer to also invalidate bindings for non-static global variables
when calling a function/method whose impact on global variables we cannot accurately estimate.
This change introduces two new MemSpaceRegions that divide up the memory space of globals, and causes
RegionStore and BasicStore to consult a binding to the NonStaticGlobalsMemSpaceRegion when lazily
determining the value of a global.

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

14 years agoAdd an ivar to SymbolReaper for the current statement, and then stop passing the...
Jordy Rose [Thu, 1 Jul 2010 20:09:55 +0000 (20:09 +0000)]
Add an ivar to SymbolReaper for the current statement, and then stop passing the current statement around everywhere. Preparation for symbolic extents.

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

14 years agoTest implicit declaration of copy assignment operator with non-const argument
Douglas Gregor [Thu, 1 Jul 2010 20:08:52 +0000 (20:08 +0000)]
Test implicit declaration of copy assignment operator with non-const argument

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

14 years agoMove the implicit declaration of a constructor out to a separate
Douglas Gregor [Thu, 1 Jul 2010 19:09:28 +0000 (19:09 +0000)]
Move the implicit declaration of a constructor out to a separate
method. No functionality change.

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

14 years agoTeach DeclareImplicitCopyConstructor how to cope with virtual bases
Douglas Gregor [Thu, 1 Jul 2010 18:27:03 +0000 (18:27 +0000)]
Teach DeclareImplicitCopyConstructor how to cope with virtual bases
and multi-dimensional array fields. Fixes several bugs found by
inspection.

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

14 years agoMove declaration of a class's implicit copy constructor into a
Douglas Gregor [Thu, 1 Jul 2010 17:57:27 +0000 (17:57 +0000)]
Move declaration of a class's implicit copy constructor into a
separate function. Aside from making the loops infinitely faster, no
functionality change.

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

14 years agoProvide an exception-specification for an implicitly-declared
Douglas Gregor [Thu, 1 Jul 2010 17:48:08 +0000 (17:48 +0000)]
Provide an exception-specification for an implicitly-declared
copy-assignment operator.

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

14 years agoMove the implicit declaration of a class's copy-assignment operator
Douglas Gregor [Thu, 1 Jul 2010 16:36:15 +0000 (16:36 +0000)]
Move the implicit declaration of a class's copy-assignment operator
into a separate routine. No functionality change.

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

14 years agoMake loops infinitely faster. No functionality change.
Douglas Gregor [Thu, 1 Jul 2010 15:29:53 +0000 (15:29 +0000)]
Make loops infinitely faster. No functionality change.

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

14 years agoAdd Sema test case for exception-specifiers implicitly added to destructors.
Douglas Gregor [Thu, 1 Jul 2010 14:21:35 +0000 (14:21 +0000)]
Add Sema test case for exception-specifiers implicitly added to destructors.

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

14 years agoRemove unnecessary ASTContext parameter from
Douglas Gregor [Thu, 1 Jul 2010 14:13:13 +0000 (14:13 +0000)]
Remove unnecessary ASTContext parameter from
CXXRecordDecl::getDestructor(); no functionality change.

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

14 years agoExplodedGraph never uses ASTContext, remove it.
Zhongxing Xu [Thu, 1 Jul 2010 07:10:59 +0000 (07:10 +0000)]
ExplodedGraph never uses ASTContext, remove it.

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

14 years agofix rdar://8147692 - yet another crash due to my abi work.
Chris Lattner [Thu, 1 Jul 2010 06:20:47 +0000 (06:20 +0000)]
fix rdar://8147692 - yet another crash due to my abi work.

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

14 years agoReinstate fix for PR7526, which was failing because, now that we
Douglas Gregor [Thu, 1 Jul 2010 05:10:53 +0000 (05:10 +0000)]
Reinstate fix for PR7526, which was failing because, now that we
aren't dropping all exception specifications on destructors, the
exception specifications on implicitly-declared destructors were
detected as being wrong (which they were).

Introduce logic to provide a proper exception-specification for
implicitly-declared destructors. This also fixes PR6972.

Note that the other implicitly-declared special member functions also
need to get exception-specifications. I'll deal with that in a
subsequent commit.

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