I would have thought this would have been possible.<br><br><div class="gmail_quote">On Thu, Nov 17, 2011 at 3:49 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">So is this simply not possible?<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">On Thu, Nov 17, 2011 at 10:31 AM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Nick,<br><br>   Thanks for this info, though this didn't help my problem at all.<div><div><br><br><div class="gmail_quote">On Wed, Nov 16, 2011 at 7:21 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Never create a Twine as a local variable.<br>
<br>
  V->setName(Twine("new_name"));<br>
<br>
should work fine, however. Note that Twine itself has an implicit constructor from const char *, so this code:<br>
<br>
  V->setName("new_name");<br>
<br>
should also work fine.<br>
<br>
Nick<br>
<br>
Ryan Taylor wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Basically I have two separate passes (first is a loop pass) which are<br>
two different files and two different opts but I need to keep the data<br>
consistent (ie, I want the changes to show up the resulting .bc output<br>
file from the first (loop) pass so the second pass can use these new<br>
names. Currently, when I print out "BB->getName().str()" after the code<br>
below, I get the correct renaming but this doesn't show up in the output<br>
file.<br>
<br>
I'm calling the opt like this:<br>
<br>
opt -load Release/lib/OptFile.so -optTag -S <file.bc> -o file.ll<br>
<br>
I have also tried:<br>
<br>
opt -load Release/lib/OptFile.so -optTag <file.bc> -o file.bc<br>
<br>
Thanks.<br>
<br>
---------- Forwarded message ----------<br></div><div>
From: *Ryan Taylor* <<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a> <mailto:<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>>><br>
Date: Wed, Nov 16, 2011 at 5:23 PM<br>
Subject: Re: [LLVMdev] Problem getting LoopInfo inside non-LoopPass<br></div><div>
To: <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a> <mailto:<a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a>><br>
<br>
<br>
LLVMers,<br>
<br>
   So, I'm trying to write a pass that changes the names of the basic<br>
blocks through the use of Value, so:<br>
<br>
   Value *V = *BasicBlockPtr;<br>
   const Twine Tname("new_name");<br>
   V->setName(Tname);<br>
<br>
But when I run the opt and look at the IR output nothing is changed? Not<br>
sure what I'm doing wrong.<br>
<br>
Thanks.<br>
<br>
<br>
<br>
<br>
<br></div><div>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</div></blockquote>
<br>
</blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>