summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/TranslationUnit.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When destroying a translation unit, deallocate its owned declarations in ↵Douglas Gregor2008-10-271-1/+3
| | | | | | reverse order, because there may be dependencies among the declarations. llvm-svn: 58244
* Patch by Csaba Hruska and Peter Neumark:Ted Kremenek2008-07-101-21/+60
| | | | | | "adds support (de)serialization (from)to (in memory) buffer." llvm-svn: 53425
* Reclaim memory owned by ObjCForwardProtocolDecls.Ted Kremenek2008-06-061-2/+20
| | | | llvm-svn: 52063
* Implement "Destroy" and destructor for ObjCClassDecl, allowing us to reclaim ↵Ted Kremenek2008-06-061-6/+21
| | | | | | its memory and the memory of the Decls it owns. llvm-svn: 52059
* Implement "Destroy" and destructor for ObjCProtocolDecl, allowing us to ↵Ted Kremenek2008-06-061-1/+14
| | | | | | reclaim its memory and the memory of the Decls it owns. llvm-svn: 52055
* Because of a lack of a clear ownership role between ObjCInterfaceDecls andTed Kremenek2008-06-061-0/+14
| | | | | | | ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a horrible hack, and must be removed eventually. llvm-svn: 52051
* Moved LangOptions from TranslationUnit to ASTContext. This induced a ↵Ted Kremenek2008-06-041-9/+3
| | | | | | variety of cleanups in some ASTConsumers. llvm-svn: 51943
* Fix the destruction "properly" in the sense that we actually destroy the Eli Friedman2008-05-211-1/+4
| | | | | | | ASTs. This is a hack, but I haven't considered how we really want to do this. llvm-svn: 51364
* Don't kill the declarations if the translation unit doesn't own them Eli Friedman2008-05-211-11/+8
| | | | | | | (specifically, for TranslationUnits created from SerializationTest.cpp). Fixes a double-free bug in the serialization tests. llvm-svn: 51362
* Try to plug some memory leaks...Ted Kremenek2008-05-201-3/+10
| | | | | | | | | | | | | | | | 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
* TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objectsTed Kremenek2008-04-231-2/+19
| | | | | | | | | | | | | | | | when it is constructed via deserialization. This is done by recording a flag indicating that this is the case, and it deletes these objects by getting the references stored in the ASTContext object. This fixes some memory leaks that occurs when we deserialize translation units from bitcode files. The rationale between having TranslationUnit sometimes own these objects and sometimes not is that a TranslationUnit object can be constructed from state generated by the parser (Preprocessor; semantic analyzer, etc.), and thus in these cases won't own the IdentifierTable or Selectors, etc. During deserialization, there is no Preprocessor, so somebody needs to own these objects in order for them to be properly reclaimed. llvm-svn: 50149
* Stub out and start using a Decl::Destroy() method.Sam Bishop2008-04-111-1/+1
| | | | llvm-svn: 49532
* Pass the ASTContext object around when deserializing Decl and Stmt objects, soSam Bishop2008-04-071-1/+1
| | | | | | they can be created using the same allocator as in the "from source code" case. llvm-svn: 49353
* trivial whitespace fixSam Bishop2008-04-031-2/+1
| | | | llvm-svn: 49160
* Created a destructor so that the top-level decls can be deleted.Sam Bishop2008-04-031-0/+5
| | | | llvm-svn: 49142
* Update to match simplified llvm MemoryBuffer interfaces for files.Chris Lattner2008-04-011-2/+1
| | | | llvm-svn: 49042
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+225
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