| Issue |
167445
|
| Summary |
clang does not recognize '-passes' argument when used with '-fpass-plugin' (works in opt)
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
white9ash
|
### 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
1. Build any new-PM compatible pass plugin, e.g.:
~~~CPP
PB.registerPipelineParsingCallback(
[](StringRef Name, FunctionPassManager &FPM,
ArrayRef<PassBuilder::PipelineElement> Inner) -> bool {
if (Name == "fla") {
FPM.addPass(FlatteningPass());
return true;
}
return false;
});
~~~
2. Compile and run:
`clang -O1 -fpass-plugin=build/MyPass.dll -mllvm -passes="fla" main.cpp`
3. 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:
4. `opt -load-pass-plugin=build/MyPass.dll -passes="fla" test.bc -o out.bc`
Does clang support the new PassManager '-passes=' pipeline like opt?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs