[LLVMdev] A question about running Clang after LLVM passes

Padefic padefic at 126.com
Thu Jun 12 19:29:02 PDT 2014


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. 


I need to access the objects created in LLVM pass  to get information. 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.


In addition, it seems that by directly running command "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? 


Thanks!





At 2014-06-13 04:43:15, "Bruce Hoult" <bruce at hoult.org> wrote:

However, LLVM can output using the C back end ... which you can then feed into Clang.



On Fri, Jun 13, 2014 at 3:58 AM, Eli Bendersky <eliben at google.com> wrote:






On Wed, Jun 11, 2014 at 12:41 AM, Padefic <padefic at 126.com> wrote:

Hello,


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?


Thank you in advance!




Clang does not consume LLVM IR, so the answer is no. What are you trying to do?


Eli
 

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140613/5ee9b35a/attachment.html>


More information about the llvm-dev mailing list