[clang] [llvm] demangle function names in trace files (PR #87626)

Jamie Schmeiser via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 5 08:30:11 PDT 2024


================
@@ -1495,7 +1496,7 @@ void TimeProfilingPassesHandler::registerCallbacks(
 }
 
 void TimeProfilingPassesHandler::runBeforePass(StringRef PassID, Any IR) {
-  timeTraceProfilerBegin(PassID, getIRName(IR));
+  timeTraceProfilerBegin(PassID, demangle(getIRName(IR)));
----------------
jamieschmeiser wrote:

getIRName is a locally defined function (see above in this file).  In most of the cases, it is desirable to have the mangled name because that can be used for filtering.  In this case, I don't think that there is filtering available, so demangling the name seems reasonable.  However, as you noted, there are many situations where demangling is not appropriate.  I would suggest that you add a parameter to the getIRName function (defaulting to false) to allow demangling of appropriate names and do the demangling there.

https://github.com/llvm/llvm-project/pull/87626


More information about the cfe-commits mailing list