[llvm] bef4007 - [Attributor][NFC] Avoid string concat for non-tracing runs

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 17:21:46 PDT 2023


Author: Johannes Doerfert
Date: 2023-06-23T17:21:21-07:00
New Revision: bef4007a421a35399dbdb5719299a6a9e6099bde

URL: https://github.com/llvm/llvm-project/commit/bef4007a421a35399dbdb5719299a6a9e6099bde
DIFF: https://github.com/llvm/llvm-project/commit/bef4007a421a35399dbdb5719299a6a9e6099bde.diff

LOG: [Attributor][NFC] Avoid string concat for non-tracing runs

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/IPO/Attributor.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 72862b38f9fc1..babafdf8fa465 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -1622,7 +1622,10 @@ struct Attributor {
     }
 
     {
-      TimeTraceScope TimeScope(AA.getName() + "::initialize");
+      TimeTraceScope TimeScope("initialize", [&]() {
+        return AA.getName() +
+               std::to_string(AA.getIRPosition().getPositionKind());
+      });
       ++InitializationChainLength;
       AA.initialize(*this);
       --InitializationChainLength;


        


More information about the llvm-commits mailing list