Revert "[clang] Pass -clear-ast-before-backend in Clang::ConstructJob()"
authorArthur Eubanks <aeubanks@google.com>
Sat, 16 Oct 2021 19:05:41 +0000 (12:05 -0700)
committerArthur Eubanks <aeubanks@google.com>
Sat, 16 Oct 2021 19:05:41 +0000 (12:05 -0700)
This reverts commit 47eb99aa44ab1d20327d67a49d6c47163de76387.

This causes crashes with -print-stats: PR52193.

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

index 83afbc3..d2c0841 100644 (file)
@@ -4660,7 +4660,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;
index d14940d..02b3025 100644 (file)
@@ -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);
 }