Auto merge of #110523 - ecnelises:llvm_isa_fix, r=cuviper
Replace LLVM any_isa with any_cast
Per 585a6eb3eb/llvm/include/llvm/ADT/Any.h (L130)
, `any_isa` has been deprecated in LLVM. Use `any_cast` instead to avoid warnings.
This commit is contained in:
commit
b628260df0
@ -523,14 +523,14 @@ extern "C" typedef void (*LLVMRustSelfProfileBeforePassCallback)(void*, // LlvmS
|
||||
extern "C" typedef void (*LLVMRustSelfProfileAfterPassCallback)(void*); // LlvmSelfProfiler
|
||||
|
||||
std::string LLVMRustwrappedIrGetName(const llvm::Any &WrappedIr) {
|
||||
if (any_isa<const Module *>(WrappedIr))
|
||||
return any_cast<const Module *>(WrappedIr)->getName().str();
|
||||
if (any_isa<const Function *>(WrappedIr))
|
||||
return any_cast<const Function *>(WrappedIr)->getName().str();
|
||||
if (any_isa<const Loop *>(WrappedIr))
|
||||
return any_cast<const Loop *>(WrappedIr)->getName().str();
|
||||
if (any_isa<const LazyCallGraph::SCC *>(WrappedIr))
|
||||
return any_cast<const LazyCallGraph::SCC *>(WrappedIr)->getName();
|
||||
if (const auto *Cast = any_cast<const Module *>(&WrappedIr))
|
||||
return (*Cast)->getName().str();
|
||||
if (const auto *Cast = any_cast<const Function *>(&WrappedIr))
|
||||
return (*Cast)->getName().str();
|
||||
if (const auto *Cast = any_cast<const Loop *>(&WrappedIr))
|
||||
return (*Cast)->getName().str();
|
||||
if (const auto *Cast = any_cast<const LazyCallGraph::SCC *>(&WrappedIr))
|
||||
return (*Cast)->getName();
|
||||
return "<UNKNOWN>";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user