Skip to content

Commit 5ae3eff

Browse files
committed
add demangled parameter to getIRName
1 parent 153bb2f commit 5ae3eff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Passes/StandardInstrumentations.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,12 @@ void printIR(raw_ostream &OS, const MachineFunction *MF) {
235235
MF->print(OS);
236236
}
237237

238-
std::string getIRName(Any IR) {
238+
std::string getIRName(Any IR, bool demangled = false) {
239239
if (unwrapIR<Module>(IR))
240240
return "[module]";
241241

242242
if (const auto *F = unwrapIR<Function>(IR))
243-
return F->getName().str();
243+
return demangled ? demangle(F->getName()) : F->getName().str();
244244

245245
if (const auto *C = unwrapIR<LazyCallGraph::SCC>(IR))
246246
return C->getName();
@@ -249,7 +249,7 @@ std::string getIRName(Any IR) {
249249
return L->getName().str();
250250

251251
if (const auto *MF = unwrapIR<MachineFunction>(IR))
252-
return MF->getName().str();
252+
return demangled ? demangle(MF->getName()) : MF->getName().str();
253253

254254
llvm_unreachable("Unknown wrapped IR type");
255255
}
@@ -1577,7 +1577,7 @@ void TimeProfilingPassesHandler::registerCallbacks(
15771577
}
15781578

15791579
void TimeProfilingPassesHandler::runBeforePass(StringRef PassID, Any IR) {
1580-
timeTraceProfilerBegin(PassID, demangle(getIRName(IR)));
1580+
timeTraceProfilerBegin(PassID, getIRName(IR, true));
15811581
}
15821582

15831583
void TimeProfilingPassesHandler::runAfterPass() { timeTraceProfilerEnd(); }

0 commit comments

Comments
 (0)