This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd0a5f61c4f6f: [clang] Support -clear-ast-before-backend
without -disable-free (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES
aeubanks updated this revision to Diff 379827.
aeubanks added a comment.
add more comments about the cleanup
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111767/new/
https://reviews.llvm.org/D111767
Files:
clang/include/clang/AST/ASTContext.h
dblaikie accepted this revision.
dblaikie added subscribers: aaron.ballman, rsmith.
dblaikie added a comment.
This revision is now accepted and ready to land.
Sounds OK, thanks!
Comment at: clang/lib/CodeGen/CodeGenAction.cpp:355-356
+ if (CodeGenOpts.ClearASTBeforeBackend
aeubanks added inline comments.
Comment at: clang/lib/CodeGen/CodeGenAction.cpp:355-356
+ if (CodeGenOpts.ClearASTBeforeBackend) {
+// The ASTContext may be unusable after this.
+C.cleanup();
C.getAllocator().Reset();
dblaikie wrote:
dblaikie added inline comments.
Comment at: clang/lib/CodeGen/CodeGenAction.cpp:355-356
+ if (CodeGenOpts.ClearASTBeforeBackend) {
+// The ASTContext may be unusable after this.
+C.cleanup();
C.getAllocator().Reset();
Any chance of r
aeubanks created this revision.
aeubanks added a reviewer: dblaikie.
aeubanks requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Previously without -disable-free, -clear-ast-before-backend would crash in
~ASTContext() due to various reasons.