Skip to content

Commit 655a810

Browse files
committed
Print NewPM passes
-C passes=list was printing passes for the legacy pass manager. Use PassBuilder::printPassNames() to print NewPM passes instead.
1 parent 45f694d commit 655a810

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+2-16
Original file line numberDiff line numberDiff line change
@@ -987,22 +987,8 @@ LLVMRustPrintModule(LLVMModuleRef M, const char *Path, DemangleFn Demangle) {
987987
}
988988

989989
extern "C" void LLVMRustPrintPasses() {
990-
struct MyListener : PassRegistrationListener {
991-
void passEnumerate(const PassInfo *Info) {
992-
StringRef PassArg = Info->getPassArgument();
993-
StringRef PassName = Info->getPassName();
994-
if (!PassArg.empty()) {
995-
// These unsigned->signed casts could theoretically overflow, but
996-
// realistically never will (and even if, the result is implementation
997-
// defined rather plain UB).
998-
printf("%15.*s - %.*s\n", (int)PassArg.size(), PassArg.data(),
999-
(int)PassName.size(), PassName.data());
1000-
}
1001-
}
1002-
} Listener;
1003-
1004-
PassRegistry *PR = PassRegistry::getPassRegistry();
1005-
PR->enumerateWith(&Listener);
990+
PassBuilder PB;
991+
PB.printPassNames(outs());
1006992
}
1007993

1008994
extern "C" void LLVMRustRunRestrictionPass(LLVMModuleRef M, char **Symbols,

0 commit comments

Comments
 (0)