From ab41a1c50558f23e5b6aa7a3b68825f9b4a71fe7 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Sun, 17 Oct 2021 22:48:35 -0700 Subject: [clang] Disable -clear-ast-before-backend with -print-stats We still need access to various things in the ASTContext when printing stats. Differential Revision: https://reviews.llvm.org/D111973 --- clang/lib/Frontend/CompilerInvocation.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 7360e6b..410702d 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -454,6 +454,8 @@ static bool FixupInvocation(CompilerInvocation &Invocation, CodeGenOpts.XRayAlwaysEmitTypedEvents = LangOpts.XRayAlwaysEmitTypedEvents; CodeGenOpts.DisableFree = FrontendOpts.DisableFree; FrontendOpts.GenerateGlobalModuleIndex = FrontendOpts.UseGlobalModuleIndex; + if (FrontendOpts.ShowStats) + CodeGenOpts.ClearASTBeforeBackend = false; LangOpts.SanitizeCoverage = CodeGenOpts.hasSanitizeCoverage(); LangOpts.ForceEmitVTables = CodeGenOpts.ForceEmitVTables; LangOpts.SpeculativeLoadHardening = CodeGenOpts.SpeculativeLoadHardening; -- cgit v1.1