diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index c9acbab253e10..c22249028ac78 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -523,13 +523,13 @@ extern "C" typedef void (*LLVMRustSelfProfileBeforePassCallback)(void*, // LlvmS extern "C" typedef void (*LLVMRustSelfProfileAfterPassCallback)(void*); // LlvmSelfProfiler std::string LLVMRustwrappedIrGetName(const llvm::Any &WrappedIr) { - if (any_isa(WrappedIr)) + if (any_cast(WrappedIr) != nullptr) return any_cast(WrappedIr)->getName().str(); - if (any_isa(WrappedIr)) + if (any_cast(WrappedIr) != nullptr) return any_cast(WrappedIr)->getName().str(); - if (any_isa(WrappedIr)) + if (any_cast(WrappedIr) != nullptr) return any_cast(WrappedIr)->getName().str(); - if (any_isa(WrappedIr)) + if (any_cast(WrappedIr) != nullptr) return any_cast(WrappedIr)->getName(); return ""; }