summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclSerialization.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor FieldDecls to be ValueDecls instead of NamedDecls.Mike Stump2009-02-101-3/+2
| | | | llvm-svn: 64231
* Improve the representation of template type parameters. We nowDouglas Gregor2009-02-051-8/+4
| | | | | | | | | | | canonicalize by template parameter depth, index, and name, and the unnamed version of a template parameter serves as the canonical. TemplateTypeParmDecl no longer needs to inherit from TemplateParmPosition, since depth and index information is present within the type. llvm-svn: 63899
* Basic representation of C++ class templates, from Andrew Sutton.Douglas Gregor2009-02-041-1/+47
| | | | llvm-svn: 63750
* Semantic analysis, ASTs, and unqualified name lookup support for C++Douglas Gregor2009-02-031-0/+8
| | | | | | using directives, from Piotr Rak! llvm-svn: 63646
* Add a macro-based enumeration of all of the Decl nodes (like we doDouglas Gregor2009-02-021-6/+6
| | | | | | | with Stmt/Expr nodes), and convert some of the more mundane switch-on-all-decl-kinds uses over to use this new file. llvm-svn: 63570
* Remove many references to ASTContext::getAllocator(), replacing them with ↵Steve Naroff2009-01-271-30/+14
| | | | | | | | calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate(). This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness. llvm-svn: 63135
* Static Analyzer: When generating plists for errors reports, generate one ↵Ted Kremenek2009-01-211-3/+3
| | | | | | plist file per translation unit that contains all of the diagnostics. llvm-svn: 62647
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-165/+91
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* Replace DeclContext's vector of ScopedDecl pointers with a linked listDouglas Gregor2009-01-091-0/+7
| | | | | | | | | | | | | | | | | | of ScopedDecls (using the new ScopedDecl::NextDeclInScope pointer). Performance-wise: - It's a net win in memory utilization, since DeclContext is now one pointer smaller than it used to be (std::vectors are typically 3 pointers; we now use 2 pointers) and - Parsing Cocoa.h with -fsyntax-only (with a Release-Asserts Clang) is about 1.9% faster than before, most likely because we no longer have the memory allocations and copying associated with the std::vector. I'll re-enable serialization of DeclContexts once I've sorted out the NextDeclarator/NextDeclInScope question. llvm-svn: 62001
* Initial implementation of anonymous unions (and, as a GNU extension,Douglas Gregor2009-01-071-0/+2
| | | | | | | | | | | | structures and classes) in C++. Covers name lookup and the synthesis and member access for the unnamed objects/fields associated with anonymous unions. Some C++ semantic checks are still missing (anonymous unions can't have function members, static data members, etc.), and there is no support for anonymous structs or unions in C. llvm-svn: 61840
* Introduce support for "transparent" DeclContexts, which areDouglas Gregor2009-01-051-17/+0
| | | | | | | | | | | | | | | | | | | | | | DeclContexts whose members are visible from enclosing DeclContexts up to (and including) the innermost enclosing non-transparent DeclContexts. Transparent DeclContexts unify the mechanism to be used for various language features, including C enumerations, anonymous unions, C++0x inline namespaces, and C++ linkage specifications. Please refer to the documentation in the Clang internals manual for more information. Only enumerations and linkage specifications currently use transparent DeclContexts. Still to do: use transparent DeclContexts to implement anonymous unions and GCC's anonymous structs extension, and, later, the C++0x features. We also need to tighten up the DeclContext/ScopedDecl link to ensure that every ScopedDecl is in a single DeclContext, which will ensure that we can then enforce ownership and reduce the memory footprint of DeclContext. llvm-svn: 61735
* Fix an uninitialized-variable warningDouglas Gregor2009-01-051-1/+1
| | | | llvm-svn: 61700
* Finish up saving original parameter type andFariborz Jahanian2008-12-201-1/+2
| | | | | | using it in ObjC's method parameter encoding. llvm-svn: 61293
* introducing ParmVarWithOriginalTypeDecl class toFariborz Jahanian2008-12-201-0/+24
| | | | | | | keep track of the original parameter decl. types. This is work in progress. llvm-svn: 61286
* Make linkage-specifications hold on to all of their declarationsDouglas Gregor2008-12-161-2/+19
| | | | llvm-svn: 61110
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-32/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
* Representation of template type parameters and non-type templateDouglas Gregor2008-12-051-0/+25
| | | | | | | | | | | | | | | parameters, with some semantic analysis: - Template parameters are introduced into template parameter scope - Complain about template parameter shadowing (except in Microsoft mode) Note that we leak template parameter declarations like crazy, a problem we'll remedy once we actually create proper declarations for templates. Next up: dependent types and value-dependent/type-dependent expressions. llvm-svn: 60597
* Extend DeclarationName to support C++ overloaded operators, e.g.,Douglas Gregor2008-11-181-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | operator+, directly, using the same mechanism as all other special names. Removed the "special" identifiers for the overloaded operators from the identifier table and IdentifierInfo data structure. IdentifierInfo is back to representing only real identifiers. Added a new Action, ActOnOperatorFunctionIdExpr, that builds an expression from an parsed operator-function-id (e.g., "operator +"). ActOnIdentifierExpr used to do this job, but operator-function-ids are no longer represented by IdentifierInfo's. Extended Declarator to store overloaded operator names. Sema::GetNameForDeclarator now knows how to turn the operator name into a DeclarationName for the overloaded operator. Except for (perhaps) consolidating the functionality of ActOnIdentifier, ActOnOperatorFunctionIdExpr, and ActOnConversionFunctionExpr into a common routine that builds an appropriate DeclRefExpr by looking up a DeclarationName, all of the work on normalizing declaration names should be complete with this commit. llvm-svn: 59526
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-4/+50
| | | | | | | | representing the names of declarations in the C family of languages. DeclarationName is used in NamedDecl to store the name of the declaration (naturally), and ObjCMethodDecl is now a NamedDecl. llvm-svn: 59441
* Use ReadPtr, not ReadUIntPtr through a reinterpret_cast.Argyrios Kyrtzidis2008-11-141-2/+2
| | | | | | Thanks to Sebastian for the suggestion. llvm-svn: 59330
* Introduce ScopedDecl::getLexicalDeclContext() which is different from ↵Argyrios Kyrtzidis2008-11-091-4/+20
| | | | | | | | | | | | | ScopedDecl::getDeclContext() when there are nested-names. e.g.: namespace A { void f(); // SemanticDC (getDeclContext) == LexicalDC (getLexicalDeclContext) == 'namespace A' } void A::f(); // SemanticDC == namespace 'A' // LexicalDC == global namespace llvm-svn: 58948
* Properly deserialize ParamInfo of FunctionDecl.Argyrios Kyrtzidis2008-11-071-2/+6
| | | | | | | When allocating an array for ParamInfo, the "decl->getNumParams()" call was used, but this will return 0 since it checks ParamInfo (which isn't yet defined and is null). The result was that ParamInfo got an array of zero length to hold the ParmVarDecls. llvm-svn: 58850
* Preliminary support for function overloadingDouglas Gregor2008-10-211-1/+34
| | | | llvm-svn: 57909
* Simplify handling of struct/union/class tags.Argyrios Kyrtzidis2008-10-151-7/+7
| | | | | | | Instead of using two sets of Decl kinds (Struct/Union/Class and CXXStruct/CXXUnion/CXXClass), use one 'Record' and one 'CXXRecord' Decl kind and make tag kind a property of TagDecl. Cleans up the code a bit and better reflects that Decl class structure. llvm-svn: 57541
* silence some release-assert warnings.Chris Lattner2008-10-121-1/+0
| | | | llvm-svn: 57391
* - Add BlockDecl AST node.Steve Naroff2008-10-081-0/+16
| | | | | | | | | | - Modify BlockExpr to reference the BlockDecl. This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?). Still some follow-up work to finish this (forthcoming). llvm-svn: 57298
* Remove "NextDecl" from RecordDecl. This change touches many files that ↵Ted Kremenek2008-09-051-3/+1
| | | | | | | | where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration. The motivation behind this change is that chaining the RecordDecls is simply unnecessary. Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType. llvm-svn: 55821
* RecordDecl serialization:Ted Kremenek2008-09-021-7/+4
| | | | | | | - Don't serialize out the NextDeclarator field. It is unused and deprecated. - Serialize out the NextDecl pointer. llvm-svn: 55644
* -Add DeclChain member to DeclContext.Argyrios Kyrtzidis2008-06-101-16/+46
| | | | | | | -ScopedDecls get chained to their DeclContext. -DeclContext's DeclChain replaces FunctionDecl's DeclChain and EnumDecl's ElementList. llvm-svn: 52164
* Added new C++ AST Decl subclasses.Argyrios Kyrtzidis2008-06-091-1/+2
| | | | llvm-svn: 52155
* When serializing FunctionDecl, serialize out a reference to the previous ↵Ted Kremenek2008-05-201-0/+2
| | | | | | declaration. llvm-svn: 51294
* Unbreak build.Ted Kremenek2008-05-121-1/+1
| | | | llvm-svn: 50980
* Grammar cleanup in comment.Ted Kremenek2008-05-121-3/+2
| | | | | | Remove redundant assignment. llvm-svn: 50978
* When reading in the DeclCtx during deserialization, register the DeclCtx of theTed Kremenek2008-05-121-3/+4
| | | | | | | | | ScopedDecl with the backpatcher, and *not* a local variable on the stack. The value of DeclCtx gets filled in *later* by the backpatcher. This fixes: http://llvm.org/bugs/show_bug.cgi?id=2308 llvm-svn: 50976
* Parsing of namespaces:Argyrios Kyrtzidis2008-04-271-2/+28
| | | | | | | | | -NamespaceDecl for the AST -Checks for name clashes between namespaces and tag/normal declarations. This commit doesn't implement proper name lookup for namespaces. llvm-svn: 50321
* "This patch renames Chris Lattner2008-04-221-1/+1
| | | | | | | | | | | DeclContext *CtxDecl -> DeclContext *DeclCtx DeclContext *CD -> DeclContext *DC It makes the code more consistent." Patch by Zhongxing Xu! llvm-svn: 50105
* Addition of TranslationUnitDecl to the AST:Argyrios Kyrtzidis2008-04-171-0/+23
| | | | | | | | -Added TranslationUnitDecl class to serve as top declaration context -ASTContext gets a TUDecl member and a getTranslationUnitDecl() function -All ScopedDecls get the TUDecl as DeclContext when declared at global scope llvm-svn: 49855
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-25/+8
| | | | | | | | VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl(). This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it). llvm-svn: 49748
* Use the ASTContext allocator when creating deserialized Decl objects.Sam Bishop2008-04-111-15/+25
| | | | llvm-svn: 49530
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-2/+3
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
* Pass the ASTContext object around when deserializing Decl and Stmt objects, soSam Bishop2008-04-071-60/+63
| | | | | | they can be created using the same allocator as in the "from source code" case. llvm-svn: 49353
* This patch contains these changes:Chris Lattner2008-04-061-3/+3
| | | | | | | | | | -Renamed ContextDecl -> DeclContext -Removed DeclContext pointer from FieldDecl -EnumDecl inherits from DeclContext, instead of TagDecl Patch by Argiris Kirtzidis! llvm-svn: 49261
* Rename ScopedDecl::getContext() -> getContextDecl(). Two motivations:Steve Naroff2008-04-041-1/+1
| | | | | | | #1: To be consistent with FieldDecl::getContextDecl(), which serves the same purpose. #2: From my perspective, getContext() is too general (and used by several other classes for different purposes). llvm-svn: 49224
* Introduce ContextDecl, patch by Argiris Kirtzidis!Chris Lattner2008-04-041-10/+14
| | | | | | | | | | | -Added ContextDecl (no TranslationUnitDecl) -ScopedDecl class has a ContextDecl member -FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily -FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context. -Moved Decl class to a "DeclBase.h" along with ContextDecl class -CurContext is handled by Sema llvm-svn: 49208
* switch the rest of the C decl classes to do their Chris Lattner2008-03-161-1/+1
| | | | | | allocation through ASTContext. llvm-svn: 48403
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+463
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud