summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix C++ PCH issue.Argyrios Kyrtzidis2010-09-091-8/+4
| | | | | | | | | Another beating by boost in this test case: http://llvm.org/PR8117 A function specialization wasn't properly initialized if it wasn't canonical. I wish there was a nice little test case but this was boost. llvm-svn: 113481
* Fix C++ PCH issues.Argyrios Kyrtzidis2010-09-081-28/+9
| | | | | | | | | | | PCH got a severe beating by the boost-using test case reported here: http://llvm.org/PR8099 Fix issues like: -When PCH reading, make sure Decl's getASTContext() doesn't get called since a Decl in the parent hierarchy may be initializing. -In ASTDeclReader::VisitFunctionDecl VisitRedeclarable should be called before using FunctionDecl's isCanonicalDecl() -In ASTDeclReader::VisitRedeclarableTemplateDecl CommonOrPrev must be initialized before anything else. llvm-svn: 113391
* Fix the source-range information for an EnumConstantDecl; previously,Douglas Gregor2010-09-011-0/+7
| | | | | | it did not include the initializer expression. llvm-svn: 112739
* Rename DeclContext::getLookupContext to getRedeclContext and change its ↵Sebastian Redl2010-08-311-3/+3
| | | | | | semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them. llvm-svn: 112563
* De-memberify the VarDecl and FunctionDecl StorageClass enums.John McCall2010-08-261-27/+27
| | | | | | This lets us remove Sema.h's dependency on Expr.h and Decl.h. llvm-svn: 112156
* A member function never has "C" linkage. Fixes <rdar://problem/8318976>.Douglas Gregor2010-08-171-0/+3
| | | | llvm-svn: 111238
* Properly give unique-external linkage to members of member templatesJohn McCall2010-08-131-15/+51
| | | | | | instantiated with unique-external parameters. llvm-svn: 111012
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-4/+3
| | | | llvm-svn: 110860
* Remove mutable data on TagType and InjectedClassNameType, by instead walking ↵Sebastian Redl2010-08-021-19/+2
| | | | | | the declaration chain in search of a definition. This is necessary for a sane chained PCH implementation. No observable performance change on Carbon.h syntax-only, and bootstraps cleanly. llvm-svn: 110051
* Remove destructors from declaration nodesDouglas Gregor2010-07-251-14/+0
| | | | llvm-svn: 109380
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-85/+0
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Hide FunctionTemplateDecl's specializations folding set as implementation ↵Argyrios Kyrtzidis2010-07-201-6/+7
| | | | | | | | | | | detail and introduce FunctionTemplateDecl::findSpecialization. Redeclarations of specializations will not cause the previous decl to be removed from the set, the set will keep the canonical decl. findSpecialization will return the most recent redeclaration. llvm-svn: 108834
* Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead ↵Argyrios Kyrtzidis2010-07-071-8/+19
| | | | | | | | 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
* Improve the accuracy of getSourceRange() for DeclaratorDecl andDouglas Gregor2010-07-061-5/+24
| | | | | | | TagDecl subclasses when out-of-line template declaration information is available, from Peter Collingbourne! llvm-svn: 107686
* Read/write some source location for PCH.Argyrios Kyrtzidis2010-07-051-3/+6
| | | | llvm-svn: 107616
* Add some side-effect free Create methods for TypeDecl subclasses and use ↵Argyrios Kyrtzidis2010-07-021-0/+9
| | | | | | them for PCH reading. llvm-svn: 107468
* Modify ClassTemplateSpecializationDecl and ↵Argyrios Kyrtzidis2010-06-231-1/+1
| | | | | | ClassTemplatePartialSpecializationDecl to allow PCH read/write. llvm-svn: 106624
* Make it easier to read/write the template part of FunctionDecl.Argyrios Kyrtzidis2010-06-221-0/+38
| | | | | | | | | | | Introduce: -FunctionDecl::getTemplatedKind() which returns an enum signifying what kind of templated FunctionDecl it is. -An overload of FunctionDecl::setFunctionTemplateSpecialization() which accepts arrays of TemplateArguments and TemplateArgumentLocs -A constructor to TemplateArgumentList which accepts an array of TemplateArguments. llvm-svn: 106532
* Fixes a corner case bug whereby declaring and defining an extern variable in a Fariborz Jahanian2010-06-211-1/+9
| | | | | | | particular sequence causes its definition to not be generated in the object file. (fixes radar 8071804). llvm-svn: 106424
* Allocate template parameter lists for out-of-line definitions via theDouglas Gregor2010-06-151-3/+10
| | | | | | ASTContext rather than via the normal heap. llvm-svn: 106008
* Fix:Chris Lattner2010-06-141-1/+1
| | | | | | | | | | | | Decl.cpp:716:28: warning: initialization of pointer of type 'clang::VarDecl *' from literal 'false' [-Wbool-conversions] VarDecl *LastTentative = false; ^ RewriteRope.cpp:535:12: warning: initialization of pointer of type '<anonymous>::RopePieceBTreeNode *' from literal 'false' [-Wbool-conversions] return false; ^ llvm-svn: 105946
* Added template parameters info for out-of-line definitions of class template ↵Abramo Bagnara2010-06-121-0/+23
| | | | | | methods. llvm-svn: 105882
* Copy source information for the inner type of an elaborated type; fixes someJohn McCall2010-05-281-9/+2
| | | | | | valgrind problems. llvm-svn: 105062
* Roll back r104941.John McCall2010-05-281-1/+0
| | | | llvm-svn: 104990
* Add a new attribute on records, __attribute__((adl_invisible)), and defineJohn McCall2010-05-281-0/+1
| | | | | | | | | | | | the x86-64 __va_list_tag with this attribute. The attribute causes the affected type to behave like a fundamental type when considered by ADL. (x86-64 is the only target we currently provide with a struct-based __builtin_va_list) Fixes PR6762. llvm-svn: 104941
* Introduce a method to get from an anonymous struct or union record declarationJohn McCall2010-05-211-0/+11
| | | | | | to the associated object declaration. llvm-svn: 104309
* Added TemplateArgumentListInfo to FunctionTemplateSpecializationInfo.Abramo Bagnara2010-05-201-1/+13
| | | | llvm-svn: 104226
* Renamed misleading getSourceRange -> getLocalSourceRange and ↵Abramo Bagnara2010-05-201-1/+1
| | | | | | getFullSourceRange -> getSourceRange for TypeLoc. llvm-svn: 104220
* Cache the linkage of a type within its canonical type, eliminatingDouglas Gregor2010-05-191-0/+6
| | | | | | | some seriously non-linear performance with deeply nested template instantiations, as shown in PR6998. llvm-svn: 104139
* Determine when the instantiation of a friend function defined inside aDouglas Gregor2010-05-171-3/+2
| | | | | | | class template conflicts with an existing (non-template) definition. This is another part of PR6952. llvm-svn: 103948
* Merged Elaborated and QualifiedName types.Abramo Bagnara2010-05-111-11/+1
| | | | llvm-svn: 103517
* Push TypeSourceInfo::getTypeLoc() into a header file so that it'sJohn McCall2010-05-061-5/+0
| | | | | | | | inlineable. That header file has to be TypeLoc.h, which means that TypeLoc.h needs to depend on Decl.h because TypeSourceInfo doesn't have its own header. That could be remedied, though. llvm-svn: 103176
* Remember the number of positive and negative bits used by the enumerators ofJohn McCall2010-05-061-1/+5
| | | | | | | an enum in the enum decl itself. Use some spare bits from TagDecl for this purpose. llvm-svn: 103173
* Mark a variable as used in the absence of asserts to silence a GCC warning.Chandler Carruth2010-05-061-0/+1
| | | | llvm-svn: 103165
* When we start the definition of a class template, set theDouglas Gregor2010-04-301-0/+9
| | | | | | | | | 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. llvm-svn: 102691
* Add FunctionDecl::isVariadic() to match BlockDecl::isVariadic() and ↵Ted Kremenek2010-04-291-0/+6
| | | | | | | | ObjCMethodDecl::isVariadic(). Do some minor refactoring along the way. llvm-svn: 102635
* Reduce string trashing in getQualifiedNameAsString.Benjamin Kramer2010-04-281-48/+38
| | | | llvm-svn: 102498
* Make TemplateDecl and ObjCContainerDecl abstractDouglas Gregor2010-04-221-1/+0
| | | | llvm-svn: 102145
* Specify linkage for Objective-C declarations.Ted Kremenek2010-04-201-0/+23
| | | | llvm-svn: 101953
* Keep track of the actual storage specifier written on a variable orDouglas Gregor2010-04-191-8/+10
| | | | | | | | function declaration, since it may end up being changed (e.g., "extern" can become "static" if a prior declaration was static). Patch by Enea Zaffanella and Paolo Bolzoni. llvm-svn: 101826
* Add printName to DeclarationName which prints the human-readable name on aBenjamin Kramer2010-04-171-6/+0
| | | | | | raw_ostream. Use it in getAsString and NamedDecl's raw_ostream operator. llvm-svn: 101633
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-171-0/+6
| | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. llvm-svn: 101632
* Fix an embarrasing memory error. I was apparently very tired when I wrote thisJohn McCall2010-04-131-1/+1
| | | | | | | | code the first time. Fixes PR6827. llvm-svn: 101184
* Implement dependent friend function template specializations.John McCall2010-04-081-0/+34
| | | | llvm-svn: 100753
* Implement the protected access restriction ([class.protected]), which requiresJohn McCall2010-04-061-0/+18
| | | | | | | | that protected members be used on objects of types which derive from the naming class of the lookup. My first N attempts at this were poorly-founded, largely because the standard is very badly worded here. llvm-svn: 100562
* Properly account for redeclarations when explicitly instantiating class ↵John McCall2010-03-261-4/+2
| | | | | | | | | | | | | templates. What happens here is that we actually turn the first declaration into a definition, regardless of whether it was actually originally a definition, and furthermore we do this all after we've instantiated all the declarations. This exposes a bug in my DefinitionData patch where it was only setting the DefinitionData for previous declarations, not future declarations. Fortunately, there's an iterator for that. llvm-svn: 99657
* Implement -Wshadow. Based on a patch by Mike M.!John McCall2010-03-161-1/+4
| | | | llvm-svn: 98684
* Remember declaration scope qualifiers in the AST. Imposes no memory overheadJohn McCall2010-03-151-6/+69
| | | | | | | | | | | on unqualified declarations. Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes with the ASTContext and delete them during Destroy(). I audited a bunch of Destroy methods at the same time, to ensure that the correct teardown was being done. llvm-svn: 98540
* Make Decl::isOutOfLine() virtual, and use that to determine when definitionsChandler Carruth2010-02-211-4/+4
| | | | | | | are for out of line declarations more easily. This simplifies the logic and handles the case of out-of-line class definitions correctly. Fixes PR6107. llvm-svn: 96729
* Remove use of 'std::string' from Attr objects, using instead a byteTed Kremenek2010-02-111-9/+0
| | | | | | | | | array allocated using the allocator in ASTContext. This addresses these strings getting leaked when using a BumpPtrAllocator (in ASTContext). Fixes: <rdar://problem/7636765> llvm-svn: 95853
OpenPOWER on IntegriCloud