[PATCH] D111973: [clang] Disable -clear-ast-before-backend with -print-stats
Arthur Eubanks via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 18 08:44:04 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGab41a1c50558: [clang] Disable -clear-ast-before-backend with -print-stats (authored by aeubanks).
Changed prior to commit:
https://reviews.llvm.org/D111973?vs=380281&id=380421#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111973/new/
https://reviews.llvm.org/D111973
Files:
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/Misc/clear-ast-before-backend.c
Index: clang/test/Misc/clear-ast-before-backend.c
===================================================================
--- clang/test/Misc/clear-ast-before-backend.c
+++ clang/test/Misc/clear-ast-before-backend.c
@@ -1,3 +1,9 @@
// RUN: %clang_cc1 -clear-ast-before-backend %s -emit-obj -o /dev/null -O1
+// RUN: %clang_cc1 -clear-ast-before-backend %s -emit-obj -o /dev/null -print-stats 2>&1 | FileCheck %s
+
+// CHECK: *** Decl Stats:
+// CHECK: {{.*}} decls total
+// CHECK: 1 Function decls
+// CHECK: Total bytes =
void f() {}
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -454,6 +454,8 @@
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111973.380421.patch
Type: text/x-patch
Size: 1261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211018/be1cbfe3/attachment.bin>
More information about the cfe-commits
mailing list