[clang] 57553ce - Revert "Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()"

Zequan Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 19 12:39:43 PDT 2021


Author: Zequan Wu
Date: 2021-10-19T12:39:34-07:00
New Revision: 57553ce43281a7c379e375161320cc09d8236839

URL: https://github.com/llvm/llvm-project/commit/57553ce43281a7c379e375161320cc09d8236839
DIFF: https://github.com/llvm/llvm-project/commit/57553ce43281a7c379e375161320cc09d8236839.diff

LOG: Revert "Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()"

This reverts commit 1fb24fe85a19ae71b00875ff6c96ef1831dcf7e3.

This causes clang crash on chromium. See repro at https://bugs.chromium.org/p/chromium/issues/detail?id=1261551#c1.

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Clang.cpp
    clang/lib/Interpreter/Interpreter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index e56cd4829759f..b689301e9bb14 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -4675,7 +4675,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   // cleanup.
   if (!C.isForDiagnostics())
     CmdArgs.push_back("-disable-free");
-  CmdArgs.push_back("-clear-ast-before-backend");
 
 #ifdef NDEBUG
   const bool IsAssertBuild = false;

diff  --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index d14940d2e1321..02b3025297b67 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -113,10 +113,6 @@ CreateCI(const llvm::opt::ArgStringList &Argv) {
 
   Clang->getTarget().adjust(Clang->getDiagnostics(), Clang->getLangOpts());
 
-  // Don't clear the AST before backend codegen since we do codegen multiple
-  // times, reusing the same AST.
-  Clang->getCodeGenOpts().ClearASTBeforeBackend = false;
-
   return std::move(Clang);
 }
 


        


More information about the cfe-commits mailing list