-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Description
Description
When using clang or clang-cl to invoke an LLVM pass plugin built for the new Pass Manager,
the -passes option (passed via -mllvm) is not recognized.
However, the same plugin works correctly with opt -load-pass-plugin -passes="...".
Steps to reproduce
- Build any new-PM compatible pass plugin, e.g.:
PB.registerPipelineParsingCallback(
[](StringRef Name, FunctionPassManager &FPM,
ArrayRef<PassBuilder::PipelineElement> Inner) -> bool {
if (Name == "fla") {
FPM.addPass(FlatteningPass());
return true;
}
return false;
});- Compile and run:
clang -O1 -fpass-plugin=build/MyPass.dll -mllvm -passes="fla" main.cpp
- Output:
clang (LLVM option parsing): Unknown command line argument '-passes=fla'. Try: 'clang (LLVM option parsing) --help'
clang (LLVM option parsing): Did you mean '--pgso=fla'?
Running the same plugin with opt works fine:
opt -load-pass-plugin=build/MyPass.dll -passes="fla" test.bc -o out.bc
Does clang support the new PassManager '-passes=' pipeline like opt?
Metadata
Metadata
Assignees
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'