aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
AgeCommit message (Collapse)Author
2010-10-24Put the mechanism in place to track modifications in an AST entity that were ↵Argyrios Kyrtzidis
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-23Update to use 'LLVM_*' macro names for attributes.Chandler Carruth
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117201 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22Substantially revise how clang computes the visibility of a declaration toJohn McCall
more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22Move classes into anonymous namespaces.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21Always treat 'main' as an extern "C" function, so that we detectDouglas Gregor
redeclarations of main appropriately rather than allowing it to be overloaded. Also, disallowing declaring main as a template. Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21Pass TInfo to CXXDestructorDecl::Create(), just like we do for otherCraig Silverstein
function decls. Reviewed by rjmccall and nlewycky. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116979 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20When implicit members are added to a C++ record, notify the serializer so ↵Argyrios Kyrtzidis
that a chained PCH writes the definition again. Thanks to Doug for the hint! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20Had the wrong type for ArgType. :-( Fixed.Craig Silverstein
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20The type-to-delete may not be a pointer if it's a dependent type.Craig Silverstein
Here's example code: --- template<class T> class MyClass { struct S { }; S* NewS() { return new S; } void DeleteS() { delete NewS(); } }; --- CXXDeleteExpr::getDestroyedType() on the 'delete NewS()' expression would crash before this change. Now it returns a dependent type object. Solution suggested by dgregor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Putting back safe fixes 116836,116837,116838Andrew Trick
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116866 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Reverting 116836,116837,116838 until we resolve the getLangStandardForKind ↵Andrew Trick
failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116859 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Minor optimization; if we have a CXXRecordDecl we can get the definition ↵Argyrios Kyrtzidis
decl directly without iterating over the redeclarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15Treat __extension__ like ParenExpr.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116569 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14At Fariborz's request, a somewhat cleaner bit-combining hack.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116524 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14Store in PCH the key function of C++ class to avoid deserializing the ↵Argyrios Kyrtzidis
complete declaration context in order to compute it. Progress for rdar://7260160. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14Allow deserialization of just the fields of a record, when we want to ↵Argyrios Kyrtzidis
iterate over them, instead of deserializing the complete declaration context of the record. Iterating over the fields of a record is very common (e.g to determine the layout), unfortunately we needlessly deserialize every declaration that the declaration context of the record contains; this can be bad for large C++ classes that contain a lot of methods. Fix this by allow deserialization of just the fields when we want to iterate over them. Progress for rdar://7260160. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14Eliminate usage of ObjCSuperExpr used forFariborz Jahanian
'super' as receiver of property or a setter/getter methods. //rdar: //8525788 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14Compress bit fields / enums from ReferenceType, BuiltinType, FunctionType, andJohn McCall
ObjCObjectType into Type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13Introduce a bit into Type that keeps track of whether there are anyDouglas Gregor
unnamed or local types within that type. This bit is cached along with the linkage of a type, so that it can be recomputed (e.g., when we see that a typedef has given a name to an anonymous declaration). Use this bit when checking C++03 [temp.arg.type]p2, so that we don't walk template argument types repeatedly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13Compute whether a type is variably modified as we build the type,Douglas Gregor
rather than walking the type's structure every time we request this information. Performance optimization; no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13Embrace C++ ABI 5.2.6 and consider that template instantiations don't have ↵Argyrios Kyrtzidis
key functions (same as GCC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12Progress.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12Add some infrastructure for dealing with expressions of 'placeholder' type,John McCall
i.e. expressions with an internally-convenient type which should not be appearing in generally valid, complete ASTs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11IRgen/Obj-C: Fix encoding of "long double".Daniel Dunbar
- The mind boggles. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09Permit constant evaluation of const floating-point variables withJohn McCall
constant initializers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor
bit by me). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08__attribute__((aligned(n))) directly specifies the alignment of a declarationJohn McCall
unless it's a non-packed field, in which case it can only increase the alignment. [[align]] effectively works the same way for well-formed code (because it's ill-formed for [[align]] to decrease alignment ever). Fixes rdar://problem/8335865 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116070 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07Fix a crash encoding ivars of vector types and Fariborz Jahanian
to match gcc's encoding. Fixes //rdar: // 8519948. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06Use a more conventional/efficient implementation for isEnumeralType()John McCall
and isBuiltinType(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Don't add an imported function into its lexical context until *after*Douglas Gregor
we've set all of its parameters. Fixes <rdar://problem/8499598>; thanks to Sean for the diagnosis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01enhance ASTContext::GetBuiltinType to return a bitmask indicating which ↵Chris Lattner
arguments are required to be ICE's. No clients of this new functionality yet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01random cleanups, no functionality change.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor
auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115322 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Various builtins a require an integer constant. Not providingChris Lattner
one results in an obscure error from the backend that doesn't make sense. Capture this information in the .def files for builtins with a new "I" modifier letter indicating the an argument needs to be an ICE. Nothing uses this yet, but sema will eventually enforce this (eliminating some special cases from semachecking.cpp) and codegen will use this to force an ICE value, preventing backend error messages. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115302 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Make the FileID import map key on FileID.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29Move the management of the set of conversion functions in a C++ classDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bitDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28Teach FunctionDecl::setPure() to (indirectly) mark the Abstract bit inDouglas Gregor
CXXRecordDecl::DefinitionData, rather than having Sema mark the bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28Reinstate r114925 and r114929, both steps towardDouglas Gregor
<rdar://problem/8459981>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114984 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28Centralize the management of CXXRecordDecl::DefinitionData's Empty bitDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28Reinstate r114921, which I've exonerated via a self-host build.Douglas Gregor
Centralize the management of CXXRecordDecl::DefinitionData's Aggregate and PlainOldData bits in CXXRecordDecl itself. Another milepost on the road toward <rdar://problem/8459981>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28Temporarily revert 114929 114925 114924 114921. It looked like they (or at leastBill Wendling
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28Centralize the management of CXXRecordDecl::DefinitionData'sDouglas Gregor
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114929 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Centralize the management of CXXRecordDecl::DefinitionData'sDouglas Gregor
Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Centralize the management of CXXRecordDecl::DefinitionData's Empty bitDouglas Gregor
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Centralize the management of CXXRecordDecl::DefinitionData's AggregateDouglas Gregor
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the road toward <rdar://problem/8459981>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Centralize the handling of CXXRecordDecl::DefinitionData'sDouglas Gregor
DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl itself. Another step on the road to <rdar://problem/8459981>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Patch to support transparent_union argumentsFariborz Jahanian
passed to nonnull attributed functions. Implements radar 6857843. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Kill FunctionDecl's IsCopyAssignment bit; it duplicated what couldDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Centralize the handling ofDouglas Gregor
CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for copy-assignment operators. Another step toward <rdar://problem/8459981>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114899 91177308-0d34-0410-b5e6-96231b3b80d8