Adapt LLVMRustPrintPasses to LLVM 4.0 preferring StringRef
over char *
This commit is contained in:
parent
29abe6f9e8
commit
cb0e24eafa
@ -529,10 +529,17 @@ LLVMRustPrintPasses() {
|
||||
LLVMInitializePasses();
|
||||
struct MyListener : PassRegistrationListener {
|
||||
void passEnumerate(const PassInfo *info) {
|
||||
#if LLVM_VERSION_GE(4, 0)
|
||||
if (!info->getPassArgument().empty()) {
|
||||
printf("%15s - %s\n", info->getPassArgument().data(),
|
||||
info->getPassName().data());
|
||||
}
|
||||
#else
|
||||
if (info->getPassArgument() && *info->getPassArgument()) {
|
||||
printf("%15s - %s\n", info->getPassArgument(),
|
||||
info->getPassName());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} listener;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user