[PATCH] D135658: demangle OptFunction trace names

Trass3r via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 03:48:19 PDT 2022


Trass3r created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Trass3r requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This improves consistency in the trace files as other entries are demangled too.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135658

Files:
  llvm/lib/IR/CMakeLists.txt
  llvm/lib/IR/LegacyPassManager.cpp


Index: llvm/lib/IR/LegacyPassManager.cpp
===================================================================
--- llvm/lib/IR/LegacyPassManager.cpp
+++ 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);
Index: llvm/lib/IR/CMakeLists.txt
===================================================================
--- llvm/lib/IR/CMakeLists.txt
+++ llvm/lib/IR/CMakeLists.txt
@@ -77,6 +77,7 @@
 
   LINK_COMPONENTS
   BinaryFormat
+  Demangle
   Remarks
   Support
   )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135658.466760.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221011/664855da/attachment.bin>


More information about the llvm-commits mailing list