forked from OSchip/llvm-project
Bury leaked sema pointer when reading from AST files.
Should suppress several LSan reports. llvm-svn: 207056
This commit is contained in:
parent
1a80595a2b
commit
1ada62654f
|
@ -455,6 +455,7 @@ public:
|
|||
}
|
||||
|
||||
Sema *takeSema() { return TheSema.release(); }
|
||||
void resetAndLeakSema() { BuryPointer(TheSema.release()); }
|
||||
|
||||
/// }
|
||||
/// @name Module Management
|
||||
|
|
|
@ -415,7 +415,7 @@ void FrontendAction::EndSourceFile() {
|
|||
if (CI.getFrontendOpts().DisableFree) {
|
||||
BuryPointer(CI.takeASTConsumer());
|
||||
if (!isCurrentFileAST()) {
|
||||
BuryPointer(CI.takeSema());
|
||||
CI.resetAndLeakSema();
|
||||
CI.resetAndLeakASTContext();
|
||||
}
|
||||
} else {
|
||||
|
@ -444,7 +444,7 @@ void FrontendAction::EndSourceFile() {
|
|||
CI.clearOutputFiles(/*EraseFiles=*/shouldEraseOutputFiles());
|
||||
|
||||
if (isCurrentFileAST()) {
|
||||
CI.takeSema();
|
||||
CI.resetAndLeakSema();
|
||||
CI.resetAndLeakASTContext();
|
||||
CI.resetAndLeakPreprocessor();
|
||||
CI.resetAndLeakSourceManager();
|
||||
|
|
Loading…
Reference in New Issue