aeubanks created this revision. aeubanks updated this revision to Diff 378327. aeubanks added a comment. aeubanks edited the summary of this revision. aeubanks retitled this revision from "[clang] Always pass -clear-ast-before-backend" to "[clang] Pass -clear-ast-before-backend". aeubanks edited the summary of this revision. aeubanks added reviewers: rnk, dblaikie. aeubanks retitled this revision from "[clang] Pass -clear-ast-before-backend" to "[clang] Pass -clear-ast-before-backend in Clang::ConstructJob()". aeubanks published this revision for review. Herald added a project: clang. Herald added a subscriber: cfe-commits.
update This clears the memory used for the Clang AST before we run LLVM passes. https://llvm-compile-time-tracker.com/compare.php?from=b6a8c695542b2987eb9a203d5663a0740cb4725f&to=05aa5c451dd87b6a8d6c2410eaccb25edf15a16f&stat=max-rss shows significant memory savings with no slowdown (in fact -O0 slightly speeds up). For more background, see https://lists.llvm.org/pipermail/cfe-dev/2021-September/068930.html. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D111270 Files: clang/lib/Driver/ToolChains/Clang.cpp Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -4661,6 +4661,7 @@ // cleanup. if (!C.isForDiagnostics()) CmdArgs.push_back("-disable-free"); + CmdArgs.push_back("-clear-ast-before-backend"); #ifdef NDEBUG const bool IsAssertBuild = false;
Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -4661,6 +4661,7 @@ // cleanup. if (!C.isForDiagnostics()) CmdArgs.push_back("-disable-free"); + CmdArgs.push_back("-clear-ast-before-backend"); #ifdef NDEBUG const bool IsAssertBuild = false;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits