summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce support for "transparent" DeclContexts, which areDouglas Gregor2009-01-051-7/+52
| | | | | | | | | | | | | | | | | | | | | | 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
* Don't push OverloadedFunctionDecls onto the chain of declarationsDouglas Gregor2008-12-231-23/+10
| | | | | | | | attached to an identifier. Instead, all overloaded functions will be pushed into scope, and we'll synthesize an OverloadedFunctionDecl on the fly when we need it. llvm-svn: 61386
* Don't explicitly represent OverloadedFunctionDecls withinDouglas Gregor2008-12-231-68/+95
| | | | | | | | | | | | | | | | | | | | | | | | DeclContext. Instead, just keep the list of currently-active declarations and only build the OverloadedFunctionDecl when we absolutely need it. This is a half-step toward eliminating the need to explicitly build OverloadedFunctionDecls that store sets of overloaded functions. This was suggested by Argiris a while back, and it's a good thing for several reasons: first, it eliminates the messy logic that currently tries to keep the OverloadedFunctionDecl in sync with the declarations that are being added. Second, it will (eventually) eliminate the need to allocate memory for overload sets, which could help performance. Finally, it helps set us up for when name lookup can return multiple (possibly ambiguous) results, as can happen with lookup of class members in C++. Next steps: make the IdentifierResolver store overloads as separate entries in its list rather than replacing them with an OverloadedFunctionDecl now, then see how far we can go toward eliminating OverloadedFunctionDecl entirely. llvm-svn: 61357
* Add case for the new AST node.Fariborz Jahanian2008-12-201-1/+8
| | | | llvm-svn: 61287
* Don't double-destroy constructors defined out-of-line. This is aDouglas Gregor2008-12-151-1/+0
| | | | | | | half-solution; the real solution is coming when constructors and destructors are treated like all other functions by ActOnDeclarator. llvm-svn: 61037
* Address some comments on the name lookup/DeclContext patch from ChrisDouglas Gregor2008-12-111-10/+8
| | | | llvm-svn: 60897
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-7/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+2
| | | | | | | | | | | | | | | 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
* -Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.Steve Naroff2008-12-011-0/+3
| | | | | | -Start adding support for rewriting @synthesize. llvm-svn: 60368
* Make DeclContext::getLexicalParent reuse DeclContext::getParent.Argyrios Kyrtzidis2008-11-191-4/+1
| | | | llvm-svn: 59651
* Take care another assert:Argyrios Kyrtzidis2008-11-191-0/+9
| | | | | | | | | | | | | | | | | | | | struct A { struct B; }; struct A::B { void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one." }; Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g: namespace A { struct S; } struct A::S {}; // getParent() == namespace 'A' // getLexicalParent() == translation unit llvm-svn: 59650
* Make the non-const DeclContext::getParent call the const version, instead of ↵Argyrios Kyrtzidis2008-11-191-3/+3
| | | | | | the other way around. llvm-svn: 59646
* Parsing, ASTs, and semantic analysis for the declaration of conversionDouglas Gregor2008-11-071-0/+1
| | | | | | | | | | | | | functions in C++, e.g., struct X { operator bool() const; }; Note that these conversions don't actually do anything, since we don't yet have the ability to use them for implicit or explicit conversions. llvm-svn: 58860
* Parsing, representation, and preliminary semantic analysis of destructors.Douglas Gregor2008-11-051-0/+1
| | | | | | | | | | | Implicit declaration of destructors (when necessary). Extended Declarator to store information about parsed constructors and destructors; this will be extended to deal with declarators that name overloaded operators (e.g., "operator +") and user-defined conversion operators (e.g., "operator int"). llvm-svn: 58767
* Add support for parsing and representing C++ constructor declarations.Douglas Gregor2008-10-311-0/+1
| | | | | | | | | | | | | | | Notes: - Constructors are never found by name lookup, so they'll never get pushed into any scope. Instead, they are stored as an OverloadedFunctionDecl in CXXRecordDecl for easy overloading. - There's a new action isCurrentClassName that determines whether an identifier is the name of the innermost class currently being defined; we use this to identify the declarator-id grammar rule that refers to a type-name. - MinimalAction does *not* support parsing constructors. - We now handle virtual and explicit function specifiers. llvm-svn: 58499
* Preliminary support for function overloadingDouglas Gregor2008-10-211-2/+9
| | | | llvm-svn: 57909
* Simplify handling of struct/union/class tags.Argyrios Kyrtzidis2008-10-151-5/+4
| | | | | | | 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
* Improve the const-ness of a few methods.Argyrios Kyrtzidis2008-10-121-3/+3
| | | | | | No functionality change. llvm-svn: 57417
* Implement more efficient Decl <-> DeclContext conversions.Argyrios Kyrtzidis2008-10-121-10/+10
| | | | | | | | When the static type on the Decl side is a subclass of DeclContext the compiler will use a "inlinable" static_cast, instead of always using an out-of-line function call. Note, though, that the isa<> check still uses an out-of-line function call. llvm-svn: 57415
* Final phase of converting BlockDecls over to DeclContext. This is ↵Steve Naroff2008-10-101-0/+2
| | | | | | unfortunately a largish/complex diff, however it was necessry to pass all the current block tests. llvm-svn: 57337
* - Add BlockDecl AST node.Steve Naroff2008-10-081-0/+3
| | | | | | | | | | - 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
* Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.Ted Kremenek2008-08-201-1/+6
| | | | | | This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl. llvm-svn: 55037
* More #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | | - Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and SourceLocation.h) - Move ASTContext constructor into implementation llvm-svn: 54627
* Add some C++ Decl statistics.Argyrios Kyrtzidis2008-08-101-3/+12
| | | | llvm-svn: 54604
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-171-0/+1
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* Added new C++ AST Decl subclasses.Argyrios Kyrtzidis2008-06-091-0/+8
| | | | llvm-svn: 52155
* Fix the line endings in the newly added DeclBase.cpp.Eli Friedman2008-06-071-325/+325
| | | | llvm-svn: 52075
* Move Decl and DeclContext implementations into a new DeclBase.cpp file.Argyrios Kyrtzidis2008-06-041-0/+325
llvm-svn: 51936
OpenPOWER on IntegriCloud