Skip to content

Commit 8d2d679

Browse files
author
liujunchang
committed
[Pass] Support MachineFunction in getIRName
It is necessary in MachinePassManager
1 parent 4f56d47 commit 8d2d679

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Passes/StandardInstrumentations.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "llvm/Analysis/CallGraphSCCPass.h"
2020
#include "llvm/Analysis/LazyCallGraph.h"
2121
#include "llvm/Analysis/LoopInfo.h"
22+
#include "llvm/CodeGen/MachineFunction.h"
2223
#include "llvm/IR/Constants.h"
2324
#include "llvm/IR/Function.h"
2425
#include "llvm/IR/Module.h"
@@ -222,6 +223,9 @@ std::string getIRName(Any IR) {
222223
if (const auto **L = llvm::any_cast<const Loop *>(&IR))
223224
return (*L)->getName().str();
224225

226+
if (const auto **MF = llvm::any_cast<const MachineFunction *>(&IR))
227+
return (*MF)->getName().str();
228+
225229
llvm_unreachable("Unknown wrapped IR type");
226230
}
227231

0 commit comments

Comments
 (0)