
This PR exposes the backend pass config to plugins via a callback. Plugin authors can register a callback that is being triggered before the target backend adds their passes to the pipeline. In the callback they then get access to the `TargetMachine`, the `PassManager`, and the `TargetPassConfig`. This allows plugins to call `TargetPassConfig::insertPass`, which is honored in the subsequent `addPass` of the main backend. We implemented this using the legacy pass manager since backends still use it as the default.
8 lines
235 B
LLVM
8 lines
235 B
LLVM
; RUN: llc -load %llvmshlibdir/../unittests/CodeGen/CGPluginTest/CGTestPlugin%pluginext %s -o - | FileCheck %s
|
|
; REQUIRES: native, system-linux, llvm-dylib
|
|
|
|
; CHECK: CodeGen Test Pass running on main
|
|
define void @main() {
|
|
ret void
|
|
}
|