[PATCH] D111270: [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 14 15:30:07 PDT 2021


aeubanks updated this revision to Diff 379866.
aeubanks added a comment.

force off for the clang interpreter
I thought I ran check-clang, apparently I didn't


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111270/new/

https://reviews.llvm.org/D111270

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


Index: clang/lib/Interpreter/Interpreter.cpp
===================================================================
--- clang/lib/Interpreter/Interpreter.cpp
+++ clang/lib/Interpreter/Interpreter.cpp
@@ -113,6 +113,10 @@
 
   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);
 }
 
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4660,6 +4660,7 @@
   // cleanup.
   if (!C.isForDiagnostics())
     CmdArgs.push_back("-disable-free");
+  CmdArgs.push_back("-clear-ast-before-backend");
 
 #ifdef NDEBUG
   const bool IsAssertBuild = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111270.379866.patch
Type: text/x-patch
Size: 915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211014/0c7bc4d7/attachment.bin>


More information about the cfe-commits mailing list