[PATCH] D19638: Use llvm:Twine instead of std::to_string.

Chaoren Lin via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 16:08:00 PDT 2016


chaoren updated this revision to Diff 55348.
chaoren added a comment.

Add reason.


http://reviews.llvm.org/D19638

Files:
  lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
  lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
  lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h

Index: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h
===================================================================
--- lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h
+++ lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h
@@ -64,9 +64,9 @@
     UNIMPLEMENTED_RELOC(MachO::X86_64_RELOC_TLV);
     default:
       if (RelType > MachO::X86_64_RELOC_TLV)
-        return make_error<RuntimeDyldError>("MachO X86_64 relocation type " +
-                                            std::to_string(RelType) +
-                                            " is out of range");
+        return make_error<RuntimeDyldError>(("MachO X86_64 relocation type " +
+                                             Twine(RelType) +
+                                             " is out of range").str());
       break;
     }
 
Index: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
===================================================================
--- lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
+++ lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
@@ -49,19 +49,19 @@
                                          ObjSectionToID);
       else if (RelType == MachO::GENERIC_RELOC_VANILLA)
         return processScatteredVANILLA(SectionID, RelI, Obj, ObjSectionToID);
-      return make_error<RuntimeDyldError>("Unhandled I386 scattered relocation "
-                                          "type: " + std::to_string(RelType));
+      return make_error<RuntimeDyldError>(("Unhandled I386 scattered relocation "
+                                           "type: " + Twine(RelType)).str());
     }
 
     switch (RelType) {
     UNIMPLEMENTED_RELOC(MachO::GENERIC_RELOC_PAIR);
     UNIMPLEMENTED_RELOC(MachO::GENERIC_RELOC_PB_LA_PTR);
     UNIMPLEMENTED_RELOC(MachO::GENERIC_RELOC_TLV);
     default:
       if (RelType > MachO::GENERIC_RELOC_TLV)
-        return make_error<RuntimeDyldError>("MachO I386 relocation type " +
-                                            std::to_string(RelType) +
-                                            " is out of range");
+        return make_error<RuntimeDyldError>(("MachO I386 relocation type " +
+                                             Twine(RelType) +
+                                             " is out of range").str());
       break;
     }
 
Index: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
===================================================================
--- lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
+++ lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
@@ -82,9 +82,9 @@
     UNIMPLEMENTED_RELOC(MachO::ARM_RELOC_HALF);
     default:
       if (RelType > MachO::ARM_RELOC_HALF_SECTDIFF)
-        return make_error<RuntimeDyldError>("MachO ARM relocation type " +
-                                            std::to_string(RelType) +
-                                            " is out of range");
+        return make_error<RuntimeDyldError>(("MachO ARM relocation type " +
+                                             Twine(RelType) +
+                                             " is out of range").str());
       break;
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19638.55348.patch
Type: text/x-patch
Size: 3236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160427/bc66ec6f/attachment.bin>


More information about the llvm-commits mailing list