diff options
author | Shilei Tian <i@tianshilei.me> | 2024-07-28 15:28:09 -0400 |
---|---|---|
committer | Shilei Tian <i@tianshilei.me> | 2024-08-06 23:22:11 -0400 |
commit | 0110da5be4f0430826bac7ede96bc71b238ef0fc (patch) | |
tree | 83217b585a0b5cb9ac980696b889674e3fd78f37 /llvm/tools/opt/NewPMDriver.cpp | |
parent | b64ec3c9faf0adce6e92c69fb48a7c7473c57200 (diff) | |
download | llvm-users/shiltian/extend-callback-signature.zip llvm-users/shiltian/extend-callback-signature.tar.gz llvm-users/shiltian/extend-callback-signature.tar.bz2 |
[LLVM][PassBuilder] Extend the function signature of callback for optimizer pipeline extension pointusers/shiltian/extend-callback-signature
These callbacks can be invoked in multiple places when building an optimization
pipeline, both in compile time and link time. However, there is no indicator on
what pipeline it is currently building.
In this patch, an extra argument is added to indicate its (Thin)LTO stage such
that the callback can check it if needed. There is no test expected from this,
and the benefit of this change will be demonstrated in https://github.com/llvm/llvm-project/pull/66488.
Diffstat (limited to 'llvm/tools/opt/NewPMDriver.cpp')
-rw-r--r-- | llvm/tools/opt/NewPMDriver.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp index 91ec905..acbdbbf 100644 --- a/llvm/tools/opt/NewPMDriver.cpp +++ b/llvm/tools/opt/NewPMDriver.cpp @@ -306,7 +306,7 @@ static void registerEPCallbacks(PassBuilder &PB) { }); if (tryParsePipelineText<ModulePassManager>(PB, OptimizerLastEPPipeline)) PB.registerOptimizerLastEPCallback( - [&PB](ModulePassManager &PM, OptimizationLevel) { + [&PB](ModulePassManager &PM, OptimizationLevel, ThinOrFullLTOPhase) { ExitOnError Err("Unable to parse OptimizerLastEP pipeline: "); Err(PB.parsePassPipeline(PM, OptimizerLastEPPipeline)); }); |