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

add header


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120666

Files:
  clang/docs/ClangPlugins.rst


Index: clang/docs/ClangPlugins.rst
===================================================================
--- clang/docs/ClangPlugins.rst
+++ clang/docs/ClangPlugins.rst
@@ -200,3 +200,14 @@
   PluginASTAction::ActionType getActionType() override {
     return AddAfterMainAction;
   }
+
+Interaction with ``-clear-ast-before-backend``
+----------------------------------------------
+
+If the main AST action is codegen, having any plugins that run after the
+codegen action automatically turns off ``-clear-ast-before-backend``, which
+saves peak memory by clearing the Clang AST after generating IR and before
+running IR optimizations. Use ``CmdlineBeforeMainAction`` or
+``AddBeforeMainAction`` as ``getActionType`` to run plugins before the codegen
+action and still have access to peak memory savings from
+``-clear-ast-before-backend``.


Index: clang/docs/ClangPlugins.rst
===================================================================
--- clang/docs/ClangPlugins.rst
+++ clang/docs/ClangPlugins.rst
@@ -200,3 +200,14 @@
   PluginASTAction::ActionType getActionType() override {
     return AddAfterMainAction;
   }
+
+Interaction with ``-clear-ast-before-backend``
+----------------------------------------------
+
+If the main AST action is codegen, having any plugins that run after the
+codegen action automatically turns off ``-clear-ast-before-backend``, which
+saves peak memory by clearing the Clang AST after generating IR and before
+running IR optimizations. Use ``CmdlineBeforeMainAction`` or
+``AddBeforeMainAction`` as ``getActionType`` to run plugins before the codegen
+action and still have access to peak memory savings from
+``-clear-ast-before-backend``.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to