[llvm] [NewPM][CodeGen] add TargetPassConfig like API (PR #70906)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 23:40:23 PST 2023


================
@@ -17,6 +17,51 @@
 
 using namespace llvm;
 
+namespace {
+
+/// RAII class to replace addMachinePrePasses/addMachinePostPasses
+/// If we need more complex logics, consider add class like
+/// CodeGenInstrumentation
+// TODO: skip FreeMachineFunctionPass and AsmPrinter
+class PrePostPasses {
----------------
aeubanks wrote:

shouldn't this something that goes into `PIC`, rather than a separate RAII class? a random
```
PrePostPasses Hook(...);
```
in the code below goes against the entire purpose of pass instrumentation

https://github.com/llvm/llvm-project/pull/70906


More information about the llvm-commits mailing list