<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Thanks David, Will give it a try.<br>
      <br>
      On 11/5/2014 8:32 PM, David Blaikie wrote:<br>
    </div>
    <blockquote
cite="mid:CAENS6EsFfEkfqdo7NE_1Bv7gnS_NyOmo56N8SaoNizXwji5GBg@mail.gmail.com"
      type="cite">
      <pre wrap="">(oops, forgot to reply-all)

On Wed, Nov 5, 2014 at 6:32 PM, David Blaikie <a class="moz-txt-link-rfc2396E" href="mailto:dblaikie@gmail.com"><dblaikie@gmail.com></a> wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">

On Wed, Nov 5, 2014 at 6:03 PM, Shankar Easwaran <a class="moz-txt-link-rfc2396E" href="mailto:shankarke@gmail.com"><shankarke@gmail.com></a>
wrote:

</pre>
        <blockquote type="cite">
          <pre wrap="">Author: shankare
Date: Wed Nov  5 20:03:40 2014
New Revision: 221428

URL: <a class="moz-txt-link-freetext" href="http://llvm.org/viewvc/llvm-project?rev=221428&view=rev">http://llvm.org/viewvc/llvm-project?rev=221428&view=rev</a>
Log:
[ELF] Use llvm::Twine

Modified:
    lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h

Modified: lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h
URL:
<a class="moz-txt-link-freetext" href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h?rev=221428&r1=221427&r2=221428&view=diff">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h?rev=221428&r1=221427&r2=221428&view=diff</a>

==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h Wed Nov  5 20:03:40
2014
@@ -130,12 +130,8 @@ template <class ELFT> void ExecutableWri
   auto endAtomIter = this->_layout.findAbsoluteAtom("end");

   auto startEnd = [&](StringRef sym, StringRef sec) -> void {
-    // TODO: This looks like a good place to use Twine...
-    std::string start("__"), end("__");
-    start += sym;
-    start += "_start";
-    end += sym;
-    end += "_end";
+    std::string start = (llvm::Twine("__", sym) + "_start").str();
+    std::string end = (llvm::Twine("__", sym) + "_end").str();

</pre>
        </blockquote>
        <pre wrap="">
Do you need the "Twine(" at all? I think const char * + StringRef -> Twine
implicitly:

"__" + sym + "_end"

If that doesn't work, usually we just explicitly convert the first operand
to Twine:

Twine("__") + sym + "_end"

rather than using Twine's concatenation operations directly.


</pre>
        <blockquote type="cite">
          <pre wrap="">     auto s = this->_layout.findAbsoluteAtom(start);
     auto e = this->_layout.findAbsoluteAtom(end);
     auto section = this->_layout.findOutputSection(sec);


_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>

</pre>
        </blockquote>
        <pre wrap="">

</pre>
      </blockquote>
      <pre wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
  </body>
</html>