]> granicus.if.org Git - clang/commitdiff
Revert "Frontend: Stop leaking when not -disable-free"
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 4 May 2015 13:01:42 +0000 (13:01 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 4 May 2015 13:01:42 +0000 (13:01 +0000)
This reverts commit r236419, since it caused some bots to fail.  On:

http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/26124
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/35086

these tests:

FAIL: Clang::import-decl.cpp
FAIL: Clang::floating-literal.c
FAIL: Clang::x86_64-linux-android.c

fail with this output:

Command Output (stderr):
--
Stack dump:
0.  Program arguments: /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/clang -cc1 -internal-isystem /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/../lib/clang/3.7.0/include -nostdsysteminc -ast-print -x ast -
/var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/tools/clang/test/Modules/Output/import-decl.cpp.script: line 3:  9665 Segmentation fault      (core dumped) /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/clang -cc1 -internal-isystem /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/../lib/clang/3.7.0/include -nostdsysteminc -ast-print -x ast - < /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/tools/clang/test/Modules/Output/import-decl.cpp.tmp.ast
      9666 Done                    | /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/FileCheck /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.src/tools/clang/test/Modules/import-decl.cpp

--

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236422 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/FrontendAction.cpp

index 3c136262ef7a5199d7e8b400aa37e395b3b3fde5..d42ca718c397da1d0a1d1e839abbb565512e9ed4 100644 (file)
@@ -494,20 +494,13 @@ void FrontendAction::EndSourceFile() {
   // FrontendAction.
   CI.clearOutputFiles(/*EraseFiles=*/shouldEraseOutputFiles());
 
+  // FIXME: Only do this if DisableFree is set.
   if (isCurrentFileAST()) {
-    if (DisableFree) {
-      CI.resetAndLeakSema();
-      CI.resetAndLeakASTContext();
-      CI.resetAndLeakPreprocessor();
-      CI.resetAndLeakSourceManager();
-      CI.resetAndLeakFileManager();
-    } else {
-      CI.setSema(nullptr);
-      CI.setASTContext(nullptr);
-      CI.setPreprocessor(nullptr);
-      CI.setSourceManager(nullptr);
-      CI.setFileManager(nullptr);
-    }
+    CI.resetAndLeakSema();
+    CI.resetAndLeakASTContext();
+    CI.resetAndLeakPreprocessor();
+    CI.resetAndLeakSourceManager();
+    CI.resetAndLeakFileManager();
   }
 
   setCompilerInstance(nullptr);