summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use attributes for all the override control specifiers.Anders Carlsson2011-01-241-3/+2
| | | | llvm-svn: 124122
* Add final/explicit getters and setters to CXXRecordDecl.Anders Carlsson2011-01-221-0/+1
| | | | llvm-svn: 124037
* Implement the preference for move-construction over copy-constructionDouglas Gregor2011-01-211-10/+25
| | | | | | | | | | | | when returning an NRVO candidate expression. For example, this properly picks the move constructor when dealing with code such as MoveOnlyType f() { MoveOnlyType mot; return mot; } The previously-XFAIL'd rvalue-references test case now works, and has been moved into the appropriate paragraph-specific test case. llvm-svn: 123992
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-7/+0
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* PR3558: mark "logically const" accessor methods in ASTContext as const,Jay Foad2011-01-121-6/+6
| | | | | | | and mark the fields they use as mutable. This allows us to remove a few const_casts. llvm-svn: 123314
* Rename CXXCtorInitializer::BaseOrMember to Initializee, since it will also beAlexis Hunt2011-01-081-9/+9
| | | | | | used to store the CXXConstructorDecl in a delegating constructor. llvm-svn: 123095
* Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,Alexis Hunt2011-01-081-36/+37
| | | | | | | more accurate, and makes it make sense for it to hold a delegating constructor call. llvm-svn: 123084
* Implement pack expansion of base initializers, so that we canDouglas Gregor2011-01-041-5/+6
| | | | | | | initialize those lovely mixins that come from pack expansions of base specifiers. llvm-svn: 122793
* Implement pack expansions whose pattern is a base-specifier.Douglas Gregor2011-01-031-1/+2
| | | | llvm-svn: 122782
* Revert r120808, my previous implementation of caching for the linkageDouglas Gregor2010-12-061-2/+0
| | | | | | | | | and visibility of declarations, because it was extremely messy and it increased the size of NamedDecl. An improved implementation is forthcoming. llvm-svn: 121012
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-041-4/+14
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Implement caching for the linkage and visibility calculations ofDouglas Gregor2010-12-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | declarations. The motivation for this patch is that linkage/visibility computations are linear in the number of redeclarations of an entity, and we've run into a case where a single translation unit has > 6500 redeclarations of the same (unused!) external variable. Since each redeclaration involves a linkage check, the resulting quadratic behavior makes Clang slow to a crawl. With this change, a simple test with 512 redeclarations of a variable syntax-checks ~20x faster than before. That said, I hate this change, and will probably end up reverting it in a few hours. Reasons to hate it: - It makes NamedDecl larger, since we don't have enough free bits in Decl to squeeze in the extra information about caching. - There are way too many places where we need to invalidate this cache, because the visibility of a declaration can change due to redeclarations (!). Despite self-hosting and passing the testsuite, I have no confidence that I've found all of places where this cache needs to be invalidated. llvm-svn: 120808
* Eliminate two uses of NDEBUG in headers that cause different symbolsDouglas Gregor2010-12-021-14/+0
| | | | | | to be available in debug vs. release builds. llvm-svn: 120629
* Replace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to ↵Argyrios Kyrtzidis2010-11-101-0/+38
| | | | | | | | avoid leaking memory. Fixes rdar://8649963. llvm-svn: 118674
* Improve our handling of C++ [class.copy]p3, which specifies that aDouglas Gregor2010-11-081-7/+1
| | | | | | | | | constructor template will not be used to copy a class object to a value of its own type. We were eliminating all constructor templates whose specializations look like a copy constructor, which eliminated important candidates. Fixes PR8182. llvm-svn: 118418
* Rename alignof -> alignOf to avoid irritating C++'0x compilers,Chris Lattner2010-10-301-1/+1
| | | | | | PR8423 llvm-svn: 117775
* Make the deserialization of C++ base class specifiers lazy, improvingDouglas Gregor2010-10-291-5/+5
| | | | | | the performance of C++ PCH and reducing stack depth in the reader. llvm-svn: 117732
* Keep track in chained PCH of implicit members that were added after the ↵Argyrios Kyrtzidis2010-10-241-6/+5
| | | | | | definition was completed. llvm-svn: 117240
* Put the mechanism in place to track modifications in an AST entity that were ↵Argyrios Kyrtzidis2010-10-241-0/+1
| | | | | | | | | | | | committed after its initial creation/deserialization and store the changes in a chained PCH. The idea is that the AST entities call methods on the ASTMutationListener to give notifications of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes of the updated entity. WIP llvm-svn: 117235
* Pass TInfo to CXXDestructorDecl::Create(), just like we do for otherCraig Silverstein2010-10-211-3/+4
| | | | | | | | function decls. Reviewed by rjmccall and nlewycky. llvm-svn: 116979
* When implicit members are added to a C++ record, notify the serializer so ↵Argyrios Kyrtzidis2010-10-201-0/+7
| | | | | | | | that a chained PCH writes the definition again. Thanks to Doug for the hint! llvm-svn: 116975
* Move the management of the set of conversion functions in a C++ classDouglas Gregor2010-09-291-0/+36
| | | | | | | | | | into CXXRecordDecl. The only part that we do not handle this way are using declarations, since that would require extra name lookup that we don't currently want to pay for. This fixes <rdar://problem/8459981>, so that LLDB can build a CXXRecordDecl and magically get all of the right bits set. llvm-svn: 115026
* Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bitDouglas Gregor2010-09-291-0/+58
| | | | | | | | | | | completely into CXXRecordDecl, by adding a new completeDefinition() function. This required a little reshuffling of the final-overrider checking code, since the "abstract" calculation in the presence of abstract base classes needs to occur in CXXRecordDecl::completeDefinition() but we don't want to compute final overriders more than one in the common case. llvm-svn: 115007
* Teach FunctionDecl::setPure() to (indirectly) mark the Abstract bit inDouglas Gregor2010-09-281-2/+7
| | | | | | CXXRecordDecl::DefinitionData, rather than having Sema mark the bit. llvm-svn: 114993
* Reinstate r114925 and r114929, both steps towardDouglas Gregor2010-09-281-8/+78
| | | | | | <rdar://problem/8459981>. llvm-svn: 114984
* Centralize the management of CXXRecordDecl::DefinitionData's Empty bitDouglas Gregor2010-09-281-7/+38
| | | | | | | | | | | | in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. This reinstates r114924, with one crucial bug fix: we were ignoring the implicit fields created by anonymous structs/unions when updating the bits in CXXRecordDecl, which means that a class/struct containing only an anonymous class/struct would be considered "empty". Hilarity follows. llvm-svn: 114980
* Reinstate r114921, which I've exonerated via a self-host build.Douglas Gregor2010-09-281-2/+48
| | | | | | | | Centralize the management of CXXRecordDecl::DefinitionData's Aggregate and PlainOldData bits in CXXRecordDecl itself. Another milepost on the road toward <rdar://problem/8459981>. llvm-svn: 114977
* Temporarily revert 114929 114925 114924 114921. It looked like they (or at leastBill Wendling2010-09-281-153/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one of them) was causing a series of failures: http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518 svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114929 into '.': U include/clang/Sema/Sema.h U include/clang/AST/DeclCXX.h U lib/Sema/SemaDeclCXX.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaDecl.cpp U lib/Sema/SemaTemplateInstantiate.cpp U lib/AST/DeclCXX.cpp svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114925 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/AST/DeclCXX.cpp svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114924 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp U lib/AST/ASTContext.cpp svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114921 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp llvm-svn: 114933
* Centralize the management of CXXRecordDecl::DefinitionData'sDouglas Gregor2010-09-281-7/+67
| | | | | | | | | | | HasTrivialConstructor, HasTrivialCopyConstructor, HasTrivialCopyAssignment, and HasTrivialDestructor bits in CXXRecordDecl's methods. This completes all but the Abstract bit and the set of conversion functions, both of which will require a bit of extra work. The majority of <rdar://problem/8459981> is now implemented (but not all of it). llvm-svn: 114929
* Centralize the management of CXXRecordDecl::DefinitionData'sDouglas Gregor2010-09-271-1/+11
| | | | | | | Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. llvm-svn: 114925
* Centralize the management of CXXRecordDecl::DefinitionData's Empty bitDouglas Gregor2010-09-271-2/+27
| | | | | | in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. llvm-svn: 114924
* Centralize the management of CXXRecordDecl::DefinitionData's AggregateDouglas Gregor2010-09-271-2/+48
| | | | | | | and PlainOldData bits in CXXRecordDecl itself. Another milepost on the road toward <rdar://problem/8459981>. llvm-svn: 114921
* Centralize the handling of CXXRecordDecl::DefinitionData'sDouglas Gregor2010-09-271-4/+10
| | | | | | | DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl itself. Another step on the road to <rdar://problem/8459981>. llvm-svn: 114918
* Kill FunctionDecl's IsCopyAssignment bit; it duplicated what couldDouglas Gregor2010-09-271-5/+2
| | | | | | | | already be determined by isCopyAssignmentOperator(), and was set too late in the process for all clients to see the appropriate value. Cleanup only; no functionality change. llvm-svn: 114916
* Centralize the handling ofDouglas Gregor2010-09-271-81/+108
| | | | | | | CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for copy-assignment operators. Another step toward <rdar://problem/8459981>. llvm-svn: 114899
* Clean up the handling of the DeclaredDefaultConstructor andDouglas Gregor2010-09-271-5/+21
| | | | | | | | | | | | | DeclaredCopyConstructor bits in CXXRecordDecl's DefinitionData structure. Rather than having Sema call addedConstructor or set the bits directly at semi-random places, move all of the logic for managing these bits into CXXRecordDecl itself and tie the addedConstructor call into DeclContext::addDecl(). This makes it easier for AST-building clients to get the right bits set in DefinitionData, and is one small part of <rdar://problem/8459981>. llvm-svn: 114889
* Remove CXXRecordDecl::getDefaultConstructor(), an inherently unsafe function ↵Sebastian Redl2010-09-131-22/+0
| | | | | | due to lazy declaration of default constructors. Now that __has_nothrow_constructor doesn't use it anymore, part of PR8101 is fixed. llvm-svn: 113794
* Implement __has_virtual_destructor. Patch by Steven Watanabe.Sebastian Redl2010-09-021-1/+2
| | | | llvm-svn: 112905
* Implement libclang support for using directives (cursor + visitation +Douglas Gregor2010-09-011-8/+2
| | | | | | | | suppressing USRs). Also, fix up the source location information for using directives so that the declaration location refers to the namespace name. llvm-svn: 112693
* Added locations and type source info for DeclarationName inside UsingDecl.Abramo Bagnara2010-08-121-8/+7
| | | | llvm-svn: 110912
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-14/+19
| | | | llvm-svn: 110860
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-261-8/+6
| | | | llvm-svn: 109396
* Remove destructors from declaration nodesDouglas Gregor2010-07-251-6/+0
| | | | llvm-svn: 109380
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-28/+0
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead ↵Argyrios Kyrtzidis2010-07-071-1/+1
| | | | | | | | of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. Makes de-serialization of the function body even more "lazier". llvm-svn: 107768
* Read/write more information of ASTContext for PCH. Overriden methods and ↵Argyrios Kyrtzidis2010-07-041-0/+4
| | | | | | instantiated-from information. llvm-svn: 107597
* Lazily declare default constructors. We now delay the construction ofDouglas Gregor2010-07-031-1/+4
| | | | | | | | | | | | | | | | | | 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>. llvm-svn: 107551
* Lazily declare implicit copy constructors.Douglas Gregor2010-07-021-1/+4
| | | | llvm-svn: 107543
* Lazily declare copy-assignment operators.Douglas Gregor2010-07-021-49/+3
| | | | llvm-svn: 107521
* Lazily declare the implicitly-declared destructor in a C++ class.Douglas Gregor2010-07-021-0/+1
| | | | llvm-svn: 107510
OpenPOWER on IntegriCloud