[PATCH] D79464: [NFC] Outliner label name clean up.

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 18:54:06 PDT 2020


plotfi created this revision.
plotfi added a reviewer: paquette.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
paquette accepted this revision.
paquette added a comment.
This revision is now accepted and ready to land.

LGTM


Just simplifying how the label name is generated and using std::to_string instead of Twine.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79464

Files:
  llvm/lib/CodeGen/MachineOutliner.cpp


Index: llvm/lib/CodeGen/MachineOutliner.cpp
===================================================================
--- llvm/lib/CodeGen/MachineOutliner.cpp
+++ llvm/lib/CodeGen/MachineOutliner.cpp
@@ -1110,13 +1110,10 @@
   // Create the function name. This should be unique.
   // FIXME: We should have a better naming scheme. This should be stable,
   // regardless of changes to the outliner's cost model/traversal order.
-  std::string FunctionName;
+  std::string FunctionName = "OUTLINED_FUNCTION_";
   if (OutlineRepeatedNum > 0)
-    FunctionName = ("OUTLINED_FUNCTION_" + Twine(OutlineRepeatedNum + 1) + "_" +
-                    Twine(Name))
-                       .str();
-  else
-    FunctionName = ("OUTLINED_FUNCTION_" + Twine(Name)).str();
+    FunctionName += std::to_string(OutlineRepeatedNum + 1) + "_";
+  FunctionName += std::to_string(Name);
 
   // Create the function using an IR-level function.
   LLVMContext &C = M.getContext();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79464.262279.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200506/48c613fd/attachment.bin>


More information about the llvm-commits mailing list