diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp index 06cc58c021963..8cae1235487f1 100644 --- a/llvm/lib/Passes/StandardInstrumentations.cpp +++ b/llvm/lib/Passes/StandardInstrumentations.cpp @@ -19,6 +19,7 @@ #include "llvm/Analysis/CallGraphSCCPass.h" #include "llvm/Analysis/LazyCallGraph.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/CodeGen/MachineFunction.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Function.h" #include "llvm/IR/Module.h" @@ -222,6 +223,9 @@ std::string getIRName(Any IR) { if (const auto **L = llvm::any_cast(&IR)) return (*L)->getName().str(); + if (const auto **MF = llvm::any_cast(&IR)) + return (*MF)->getName().str(); + llvm_unreachable("Unknown wrapped IR type"); }