提交 a34e961b 编写于 作者: B Benjamin Kramer 提交者: TensorFlower Gardener

Remove references to llvm::any_isa

It's going away in https://github.com/llvm/llvm-project/commit/5378117327317ac08eb25e52519f482af7571445

PiperOrigin-RevId: 564711879
上级 280122a4
...@@ -312,23 +312,18 @@ void DumpModule(const std::string output_filename, const llvm::Module* module) { ...@@ -312,23 +312,18 @@ void DumpModule(const std::string output_filename, const llvm::Module* module) {
} }
const llvm::Module* GetModule(llvm::Any IR) { const llvm::Module* GetModule(llvm::Any IR) {
if (llvm::any_isa<const llvm::Module*>(IR)) if (const auto** M = llvm::any_cast<const llvm::Module*>(&IR)) return *M;
return llvm::any_cast<const llvm::Module*>(IR);
if (llvm::any_isa<const llvm::Function*>(IR)) { if (const auto** F = llvm::any_cast<const llvm::Function*>(&IR)) {
const llvm::Function* F = llvm::any_cast<const llvm::Function*>(IR); return (*F)->getParent();
return F->getParent();
} }
if (llvm::any_isa<const llvm::LazyCallGraph::SCC*>(IR)) { if (const auto** C = llvm::any_cast<const llvm::LazyCallGraph::SCC*>(&IR)) {
const llvm::LazyCallGraph::SCC* C = return (*C)->begin()->getFunction().getParent();
llvm::any_cast<const llvm::LazyCallGraph::SCC*>(IR);
return C->begin()->getFunction().getParent();
} }
if (llvm::any_isa<const llvm::Loop*>(IR)) { if (const auto** L = llvm::any_cast<const llvm::Loop*>(&IR)) {
const llvm::Loop* L = llvm::any_cast<const llvm::Loop*>(IR); const llvm::Function* F = (*L)->getHeader()->getParent();
const llvm::Function* F = L->getHeader()->getParent();
return F->getParent(); return F->getParent();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册