[PATCH] D112190: [clang] Don't clear AST if we have consumers running after the main action

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 21 09:02:21 PDT 2021


aeubanks added inline comments.


================
Comment at: clang/test/Misc/clear-ast-before-backend-plugins.c:3-8
+// RUN: %clang_cc1 -mllvm -debug-only=codegenaction -clear-ast-before-backend -emit-obj -o /dev/null -load %llvmshlibdir/PrintFunctionNames%pluginext %s 2>&1 | FileCheck %s --check-prefix=YES
+// YES: Clearing AST
+
+// RUN: %clang_cc1 -mllvm -debug-only=codegenaction -clear-ast-before-backend -emit-obj -o /dev/null -load %llvmshlibdir/PrintFunctionNames%pluginext -add-plugin print-fns -plugin-arg-print-fns help %s 2>&1 | FileCheck %s --check-prefix=NO
+// NO-NOT: Clearing AST
+
----------------
dblaikie wrote:
> Can you test that the "consumers running after the main action" are actually running here in a relatively lightweight manner? (ie: in a way that depends on as little details of their behavior as possible, just that they ran)
I don't think so, the only observable behavior is anything the plugin does, and this plugin only prints things. Clang on its own doesn't do much debug logging.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112190



More information about the cfe-commits mailing list