hanchenye-llvm-project/clang/Driver
Ted Kremenek 467297ab48 TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
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
2008-04-23 16:25:39 +00:00
..
ASTConsumers.cpp TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects 2008-04-23 16:25:39 +00:00
ASTConsumers.h class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its dstor. 2008-04-17 22:31:54 +00:00
DiagChecker.cpp rename ASTSTreamer.{h|cpp} -> ParseAST.{h|cpp} 2008-02-06 00:23:21 +00:00
HTMLDiagnostics.cpp PathDiagnosticClients now retain ownership of passed PathDiagnostics, requiring 2008-04-22 16:15:03 +00:00
HTMLDiagnostics.h class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its dstor. 2008-04-17 22:31:54 +00:00
HTMLPrint.cpp simplify ownership of the predefines buffer. 2008-04-19 23:09:31 +00:00
Makefile Take 2. 2007-10-31 20:01:01 +00:00
PrintParserCallbacks.cpp Change uses of std::cerr/std::cout to llvm::Lcerr/llvm::cout, and remove 2008-01-14 16:44:48 +00:00
PrintPreprocessedOutput.cpp Fix rdar://5843510 don't assert and die when an invalid output 2008-04-11 06:14:11 +00:00
RewriteObjC.cpp Remove bogus cast (<rdar://problem/5874848> clang objc-rewriter: structure with list of protocols has wrong cast). 2008-04-18 22:15:15 +00:00
SerializationTest.cpp TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects 2008-04-23 16:25:39 +00:00
TextDiagnosticBuffer.cpp Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:25 +00:00
TextDiagnosticBuffer.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:25 +00:00
TextDiagnosticPrinter.cpp Allow redirecting text diagnostic printer output to any llvm::OStream, rather 2008-04-17 18:06:57 +00:00
TextDiagnosticPrinter.h Allow redirecting text diagnostic printer output to any llvm::OStream, rather 2008-04-17 18:06:57 +00:00
TextDiagnostics.cpp Fix PR1966 by ignoring non-error diagnostics from system headers even if they are 2008-02-03 09:00:04 +00:00
TextDiagnostics.h Fix PR1966 by ignoring non-error diagnostics from system headers even if they are 2008-02-03 09:00:04 +00:00
clang.cpp TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects 2008-04-23 16:25:39 +00:00
clang.h Make -o work with -E, patch contributed by Shantonu Sen! 2008-01-27 23:55:11 +00:00