Skip to content

Commit 9e881d3

Browse files
committed
use printAsOperand
1 parent 6afd1fa commit 9e881d3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/CodeGen/MachineCFGPrinter.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ MachineCFGPrinterPass::run(MachineFunction &MF,
5959
MachineFunctionAnalysisManager &MFAM) {
6060
if (!MCFGFuncName.empty() && !MF.getName().contains(MCFGFuncName))
6161
return PreservedAnalyses::all();
62-
OS << "Writing Machine CFG for function ";
63-
StringRef Name = MF.getName();
64-
if (Name.empty())
65-
Name = "(unamed machine function)";
66-
OS.write_escaped(Name) << '\n';
62+
std::string Name;
63+
raw_string_ostream SS(Name);
64+
MF.getFunction().printAsOperand(SS, /*PrintType=*/false);
65+
OS << "Writing Machine CFG for function " << SS.str();
6766
writeMCFGToDotFile(MF);
6867
return PreservedAnalyses::all();
6968
}

0 commit comments

Comments
 (0)