Basically I have two separate passes (first is a loop pass) which are two different files and two different opts but I need to keep the data consistent (ie, I want the changes to show up the resulting .bc output file from the first (loop) pass so the second pass can use these new names. Currently, when I print out "BB->getName().str()" after the code below, I get the correct renaming but this doesn't show up in the output 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><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Ryan Taylor</b> <span dir="ltr"><<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>></span><br>
Date: Wed, Nov 16, 2011 at 5:23 PM<br>Subject: Re: [LLVMdev] Problem getting LoopInfo inside non-LoopPass<br>To: <a href="mailto:llvmdev@cs.uiuc.edu">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 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 sure what I'm doing wrong.<br><br>Thanks.<br><br><br>
</div><br>