<div dir="ltr">String allocation is pretty cheap so I don't think it's worth to do, but if it does, we should probably copy the entire .drectve section to the linker context's allocator before passing it to parse().</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 10:01 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Do you want to detect and do this only for when you process directive sections ?<div class="im"><br>
<br>
On 8/27/2013 12:00 AM, Rui Ueyama wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Yes if they are pointing to .drectve section they could become invalid<br>
references.<br>
<br>
<br>
On Mon, Aug 26, 2013 at 9:57 PM, Shankar Easwaran<br>
<<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>><u></u>wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
How are these temporary strings ? They all are pointing to the arguments<br>
argv[].<br>
<br>
Is this to handle the .directive file ?<br>
<br>
Thanks<br>
<br>
Shankar Easwaran<br>
<br>
<br>
On 8/26/2013 11:27 PM, Rui Ueyama wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Author: ruiu<br>
Date: Mon Aug 26 23:27:18 2013<br>
New Revision: 189310<br>
<br></div>
URL: <a href="http://llvm.org/viewvc/llvm-**project?rev=189310&view=rev" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project?rev=189310&view=rev</a><<a href="http://llvm.org/viewvc/llvm-project?rev=189310&view=rev" target="_blank">ht<u></u>tp://llvm.org/viewvc/llvm-<u></u>project?rev=189310&view=rev</a>><div class="im">

<br>
Log:<br>
Fix use of temporary strings.<br>
<br>
Modified:<br></div>
      lld/trunk/lib/Driver/**<u></u>WinLinkDriver.cpp<br>
<br>
Modified: lld/trunk/lib/Driver/**<u></u>WinLinkDriver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-**project/lld/trunk/lib/Driver/**" target="_blank">http://llvm.org/viewvc/llvm-**<u></u>project/lld/trunk/lib/Driver/*<u></u>*</a><br>
WinLinkDriver.cpp?rev=189310&*<u></u>*r1=189309&r2=189310&view=<u></u>diff<<a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=189310&r1=189309&r2=189310&view=diff" target="_blank">http://llvm.org/viewvc/<u></u>llvm-project/lld/trunk/lib/<u></u>Driver/WinLinkDriver.cpp?rev=<u></u>189310&r1=189309&r2=189310&<u></u>view=diff</a>><br>


==============================<u></u>**============================<u></u>==**<br>
==================<br>
--- lld/trunk/lib/Driver/**<u></u>WinLinkDriver.cpp (original)<br>
+++ lld/trunk/lib/Driver/**<u></u>WinLinkDriver.cpp Mon Aug 26 23:27:18 2013<div class="im"><br>
@@ -350,12 +350,12 @@ bool WinLinkDriver::parse(int argc, cons<br>
         case OPT_entry:<br>
         // handle /entry<br></div>
-      ctx.setEntrySymbolName(**<u></u>inputArg->getValue());<br>
+      ctx.setEntrySymbolName(ctx.**<u></u>allocateString(inputArg->**<div class="im"><br>
getValue()));<br>
         break;<br>
         case OPT_libpath:<br>
         // handle /libpath<br></div>
-      ctx.appendInputSearchPath(**<u></u>inputArg->getValue());<br>
+      ctx.appendInputSearchPath(ctx.<u></u>**allocateString(inputArg->**<div class="im"><br>
getValue()));<br>
         break;<br>
         case OPT_force:<br>
@@ -408,12 +408,12 @@ bool WinLinkDriver::parse(int argc, cons<br>
         case OPT_incl:<br>
         // handle /incl<br></div>
-      ctx.addInitialUndefinedSymbol(<u></u>**inputArg->getValue());<br>
+      ctx.addInitialUndefinedSymbol(<u></u>**ctx.allocateString(inputArg-<u></u>>**<div class="im"><br>
getValue()));<br>
         break;<br>
         case OPT_out:<br>
         // handle /out<br></div>
-      ctx.setOutputPath(inputArg->**<u></u>getValue());<br>
+      ctx.setOutputPath(ctx.**<u></u>allocateString(inputArg->**<u></u>getValue()));<br>
         break;<br>
         case OPT_INPUT: {<br>
<br>
<br>
______________________________<u></u>**_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/**mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/**<u></u>mailman/listinfo/llvm-commits</a><<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank"><u></u>http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a>><br>


<br>
<br>
<br>
</blockquote><div class="im">
--<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted<br>
by the Linux Foundation<br>
<br>
<br>
</div></blockquote></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</div></div></blockquote></div><br></div>