summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-171-0/+6
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* Silence uninitialized value warning during Release build.Ted Kremenek2008-06-161-4/+5
| | | | llvm-svn: 52375
* -Add DeclChain member to DeclContext.Argyrios Kyrtzidis2008-06-101-1/+1
| | | | | | | -ScopedDecls get chained to their DeclContext. -DeclContext's DeclChain replaces FunctionDecl's DeclChain and EnumDecl's ElementList. llvm-svn: 52164
* -Changes to TagDecl:Argyrios Kyrtzidis2008-06-091-1/+8
| | | | | | | | | Added TagKind enum. Added getTagKind() method. Added convenience methods: isEnum(), isStruct(), isUnion(), isClass(). -RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one. llvm-svn: 52160
* Added new C++ AST Decl subclasses.Argyrios Kyrtzidis2008-06-091-1/+1
| | | | llvm-svn: 52155
* Move Decl and DeclContext implementations into a new DeclBase.cpp file.Argyrios Kyrtzidis2008-06-041-312/+1
| | | | llvm-svn: 51936
* fix decl attributes cleaningNuno Lopes2008-06-011-8/+16
| | | | | | this plugs the leak of attributes and also fixes a crash in the test llvm-svn: 51862
* Don't swap function decls, and add them to the scope as they are Eli Friedman2008-05-271-57/+0
| | | | | | | | | | | | | encountered. Mixing up the decls is unintuitive, and confuses the AST destruction code. Fixes PR2360. Note that there is a need to look up the characteristics and declarations of a function associated with a particular name or decl, but the original swapping code doesn't solve it properly. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one suggestion for how to fix that. llvm-svn: 51584
* Call the correct destructor.Ted Kremenek2008-05-241-1/+1
| | | | llvm-svn: 51544
* Tweak AST dumper for ObjC ivars.Steve Naroff2008-05-231-0/+1
| | | | llvm-svn: 51463
* Reclaim memory from chains of ScopedDecls, and reclaim memory for the ↵Ted Kremenek2008-05-201-0/+37
| | | | | | initializers of EnumConstantDecls. llvm-svn: 51299
* Reclaim memory allocated for ParmVarDecl's in FunctionDecl::Destroy.Ted Kremenek2008-05-201-1/+6
| | | | | | | | Fixed a bug in ParmVarDecl::param_end(): Handle the case where there are no ParmVarDecls for a FunctionDecl, but its function prototype has formal arguments (can happen with typedefs). llvm-svn: 51297
* Remove unnecessary #include (introduced by a recent patch of mine).Ted Kremenek2008-05-201-1/+0
| | | | llvm-svn: 51288
* Try to plug some memory leaks...Ted Kremenek2008-05-201-41/+13
| | | | | | | | | | | | | | | | 1) Sema::ParseAST now constructs a TranslationUnit object to own the top-level Decls, which releases the top-level Decls upon exiting ParseAST. 2) Bug fix: TranslationUnit::~TranslationUnit handles the case where a Decl is added more than once as a top-level Decl. 3) Decl::Destroy is now a virtual method, obviating the need for a special dispatch based on DeclKind. 3) FunctionDecl::Destroy now releases its Body using its Destroy method. 4) Added Stmt::Destroy and Stmt::DestroyChildren, which recursively delete the child ASTs of a Stmt and call their dstors. We may need to special case dstor/Destroy methods for particular Stmt subclasses that own other dynamically allocated objects besides AST nodes. 5) REGRESSION: We temporarily are not deallocating attributes; a FIXME is provided. llvm-svn: 51286
* Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.Chris Lattner2008-05-041-11/+28
| | | | | | | Fix 'swapping' of attributes to not insert null values into the DeclAttrs map. llvm-svn: 50612
* Parsing of namespaces:Argyrios Kyrtzidis2008-04-271-3/+18
| | | | | | | | | -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-12/+12
| | | | | | | | | | | DeclContext *CtxDecl -> DeclContext *DeclCtx DeclContext *CD -> DeclContext *DC It makes the code more consistent." Patch by Zhongxing Xu! llvm-svn: 50105
* Clean up handling of function redeclarationsDouglas Gregor2008-04-211-0/+77
| | | | llvm-svn: 50021
* Addition of TranslationUnitDecl to the AST:Argyrios Kyrtzidis2008-04-171-1/+7
| | | | | | | | -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
* New AST class for property implementation declarations.Fariborz Jahanian2008-04-161-0/+7
| | | | llvm-svn: 49821
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-31/+16
| | | | | | | | 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 static_cast<> instead of cast<> in Decl::Destroy(). Suggestion by ArgirisSam Bishop2008-04-131-2/+5
| | | | | | Kirtzidis! llvm-svn: 49603
* Default argument cleanups and minor improvements, patch byChris Lattner2008-04-121-1/+1
| | | | | | Doug Gregor! llvm-svn: 49598
* Invoke destructors in Decl::Destroy().Sam Bishop2008-04-111-0/+33
| | | | llvm-svn: 49547
* Stub out and start using a Decl::Destroy() method.Sam Bishop2008-04-111-0/+4
| | | | llvm-svn: 49532
* Several improvements from Doug Gregor related to defaultChris Lattner2008-04-101-0/+13
| | | | | | argument handling. I'll fix up the c89 (void) thing next. llvm-svn: 49459
* Changed the Decl::Kind enum of the ObjCPropertyDecl class, so that it followsSam Bishop2008-04-081-1/+1
| | | | | | the pattern of the other Decl classes. llvm-svn: 49399
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-2/+2
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
* remove a use of getCanonicalType.Chris Lattner2008-04-061-2/+3
| | | | llvm-svn: 49294
* This patch contains these changes:Chris Lattner2008-04-061-15/+15
| | | | | | | | | | -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-45/+52
| | | | | | | | | | | -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
* Call "delete" on the body of FunctionDecls.Sam Bishop2008-04-031-0/+1
| | | | llvm-svn: 49135
* Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass ↵Steve Naroff2008-04-011-4/+0
| | | | | | | | | | | | | (to inherit from NamedDecl, instead of ScopedDecl). - Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl. - Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's. - Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl(). - Some minor indentation changes. Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit... llvm-svn: 49058
* rename Decl::CompatibleAlias -> ObjCCompatibleAlias.Chris Lattner2008-03-311-6/+42
| | | | | | | | | | | | | | Fix objc ivar lookup. Ivar lookup should occur between lookup of method-local values and lookup of globals. Emulate this with some logic in the handling of Sema::ActOnIdentifierExpr. Two todo's left: 1) sema shouldn't turn a bare reference to an ivar into "self->ivar" in the AST. This is a hack. 2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does not correctly handle typedefs and enum constants yet. llvm-svn: 48972
* Split objc decl implementation out into DeclObjC.cppChris Lattner2008-03-161-297/+1
| | | | llvm-svn: 48404
* switch the rest of the C decl classes to do their Chris Lattner2008-03-161-0/+17
| | | | | | allocation through ASTContext. llvm-svn: 48403
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+652
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