Skip to content

Commit 59ec3ed

Browse files
committed
Fix LLVM compile warning message for deprecated-declarations
1 parent 39c6804 commit 59ec3ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,13 @@ extern "C" typedef void (*LLVMRustSelfProfileBeforePassCallback)(void*, // LlvmS
523523
extern "C" typedef void (*LLVMRustSelfProfileAfterPassCallback)(void*); // LlvmSelfProfiler
524524

525525
std::string LLVMRustwrappedIrGetName(const llvm::Any &WrappedIr) {
526-
if (any_isa<const Module *>(WrappedIr))
526+
if (any_cast<const Module *>(WrappedIr) != nullptr)
527527
return any_cast<const Module *>(WrappedIr)->getName().str();
528-
if (any_isa<const Function *>(WrappedIr))
528+
if (any_cast<const Function *>(WrappedIr) != nullptr)
529529
return any_cast<const Function *>(WrappedIr)->getName().str();
530-
if (any_isa<const Loop *>(WrappedIr))
530+
if (any_cast<const Loop *>(WrappedIr) != nullptr)
531531
return any_cast<const Loop *>(WrappedIr)->getName().str();
532-
if (any_isa<const LazyCallGraph::SCC *>(WrappedIr))
532+
if (any_cast<const LazyCallGraph::SCC *>(WrappedIr) != nullptr)
533533
return any_cast<const LazyCallGraph::SCC *>(WrappedIr)->getName();
534534
return "<UNKNOWN>";
535535
}

0 commit comments

Comments
 (0)