[llvm] r267829 - Use llvm:Twine instead of std::to_string.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 10:12:36 PDT 2016


Cool. Thanks Chaoren!

- Lang.

On Wed, Apr 27, 2016 at 5:49 PM, Chaoren Lin via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: chaoren
> Date: Wed Apr 27 19:49:37 2016
> New Revision: 267829
>
> URL: http://llvm.org/viewvc/llvm-project?rev=267829&view=rev
> Log:
> Use llvm:Twine instead of std::to_string.
>
> std::to_string is not available from the Android NDK.
>
> Reviewers: lhames, ovyalov, chandlerc
>
> Subscribers: llvm-commits
>
> Differential Revision: http://reviews.llvm.org/D19638
>
> Modified:
>
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
>
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
>
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h
>
> Modified:
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h?rev=267829&r1=267828&r2=267829&view=diff
>
> ==============================================================================
> ---
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
> (original)
> +++
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
> Wed Apr 27 19:49:37 2016
> @@ -82,9 +82,9 @@ public:
>      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;
>      }
>
>
> Modified:
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h?rev=267829&r1=267828&r2=267829&view=diff
>
> ==============================================================================
> ---
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
> (original)
> +++
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
> Wed Apr 27 19:49:37 2016
> @@ -49,8 +49,8 @@ public:
>                                           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) {
> @@ -59,9 +59,9 @@ public:
>      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;
>      }
>
>
> Modified:
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h?rev=267829&r1=267828&r2=267829&view=diff
>
> ==============================================================================
> ---
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h
> (original)
> +++
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h
> Wed Apr 27 19:49:37 2016
> @@ -64,9 +64,9 @@ public:
>      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;
>      }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160428/fc8121df/attachment.html>


More information about the llvm-commits mailing list