<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>I am doing a research project. I want to run the DSA pass of LLVM, and use its result in Clang for automatic fixing. I have to use Clang because the line numbers in Clang are accurate so that I can change code accordingly, while LLVM IR seems to lose the information. </div><div><br></div><div>I need to access the objects created <span style="line-height: 1.7;">in LLVM pass </span><span style="line-height: 1.7;"> to get information. </span><span style="line-height: 1.7;">Thank Bruce for your advice, could you explain more about how to output using the C backend? Does it mean to output to files, which then input into Clang? I would appreciate any reference on this problem.</span></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;">In addition, it seems that by directly running command "</span><span style="color: inherit; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; line-height: 1.42857143; background-color: transparent;">clang -Xclang -load -Xclang mypass.so", we can run llvm pass with clang automatically. So is it a possible way to hack into clang and do something after the LLVM-pass-related code? </span></div><div><span style="color: inherit; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; line-height: 1.42857143; background-color: transparent;"><br></span></div><div><span style="color: inherit; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: inherit; white-space: pre-wrap; line-height: 1.42857143; background-color: transparent;">Thanks!</span></div><br><br><br><div></div><div id="divNeteaseMailCard"></div><br>At 2014-06-13 04:43:15, "Bruce Hoult" <bruce@hoult.org> wrote:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><div dir="ltr">However, LLVM can output using the C back end ... which you can then feed into Clang.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 13, 2014 at 3:58 AM, Eli Bendersky <span dir="ltr"><<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Wed, Jun 11, 2014 at 12:41 AM, Padefic <span dir="ltr"><<a href="mailto:padefic@126.com" target="_blank">padefic@126.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><span style="color:rgb(34,34,34);font-family:arial;font-size:small;line-height:normal">Hello,</span><div style="color:rgb(34,34,34);font-family:arial;font-size:small;line-height:normal">


<br></div><div style="color:rgb(34,34,34);font-family:arial;font-size:small;line-height:normal">Clang is used before LLVM to generate IR, and is it possible to use it in a reverse way, i.e., after running LLVM passes, we can run clang again to use LLVM pass results? If so, should I write clang functions in LLVM passes, or write LLVM pass requirements in clang?</div>


<div style="color:rgb(34,34,34);font-family:arial;font-size:small;line-height:normal"><br></div><div style="color:rgb(34,34,34);font-family:arial;font-size:small;line-height:normal">Thank you in advance!</div></div></blockquote>


<div><br></div><div><br></div></div></div><div>Clang does not consume LLVM IR, so the answer is no. What are you trying to do?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Eli</div><div> </div></font></span></div>
</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">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/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>