diff --git a/llvm/lib/IR/CMakeLists.txt b/llvm/lib/IR/CMakeLists.txt --- a/llvm/lib/IR/CMakeLists.txt +++ b/llvm/lib/IR/CMakeLists.txt @@ -77,6 +77,7 @@ LINK_COMPONENTS BinaryFormat + Demangle Remarks Support ) diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -12,6 +12,7 @@ #include "llvm/IR/LegacyPassManager.h" #include "llvm/ADT/MapVector.h" +#include "llvm/Demangle/Demangle.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/LLVMContext.h" @@ -1408,7 +1409,9 @@ FunctionSize = F.getInstructionCount(); } - llvm::TimeTraceScope FunctionScope("OptFunction", F.getName()); + llvm::TimeTraceScope FunctionScope("OptFunction", [&]() { + return demangle(F.getName().str()); + }); for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { FunctionPass *FP = getContainedPass(Index);