Sir, your answer put me in starting situation.As I told I am not able to generate .bc file of hello.cpp(the pass file) as it is giving errors when I use clang -emit-llvm -c hello.cpp -o hello.bc.So please if you can help me. Thanks On Fri, Jun 6, 2014 at 3:48 PM, Dan Liew <dan at su-root.co.uk> wrote:> On 5 June 2014 10:12, Prashanth Sharma <cs13m1017 at iith.ac.in> wrote: > > sir, > > I am able to generate .bc file for other normal code but my problem how > to > > run the pass source code. If I write some pass then how should I run that > > pass? > > The answer is right there is the documentation > > ``` > $ opt -load ../../../Debug+Asserts/lib/Hello.so -hello < hello.bc > > /dev/null > ``` > > the ``-load`` flag loads your pass (which you built earlier) as a > plugin. Once loaded the ``-hello`` command line option becomes > available which will tell the opt tool to run that pass. > > Also in future I would advise you to **not** send images of your > errors to the mailing list. It's a waste of space and you can easily > send the error messages to a file (e.g. ``clang -emit-llvm hello.cpp > 2> errors.log`` ) and attach it instead which is much smaller and > easier to parse. > > Thanks, > Dan. >-- Thanks Prashant Sharma -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140607/1f4c724f/attachment.html>
> your answer put me in starting situation.As I told I am not able to generate > .bc file of hello.cpp(the pass file) as it is giving errors when I use clang > -emit-llvm -c hello.cpp -o hello.bc.So please if you can help me.I recently wrote a small (and rather incomplete) tutorial on LLVM passes and provided the source code [1]. If you look in the ``helloPass`` folder you will see I've taken the helloPass from LLVM and have built it as an out of tree plug-in. The ``run.sh`` script (this is generated by the build system) shows how to use it. This might help you gain understanding of how you can use the hello pass. However I provide no guarantees that this code will work for you and I provide absolutely no support so do not ask me questions on how to build this code (it is already documented in README.md). [1] https://github.com/delcypher/srg-llvm-pass-tutorial -- Dan Liew PhD Student - Imperial College London
Hi, Thank you very much to all. On Wed, Jun 11, 2014 at 7:40 PM, Dan Liew <dan at su-root.co.uk> wrote:> > your answer put me in starting situation.As I told I am not able to > generate > > .bc file of hello.cpp(the pass file) as it is giving errors when I use > clang > > -emit-llvm -c hello.cpp -o hello.bc.So please if you can help me. > > I recently wrote a small (and rather incomplete) tutorial on LLVM > passes and provided the source code [1]. If you look in the > ``helloPass`` folder you will see I've taken the helloPass from LLVM > and have built it as an out of tree plug-in. The ``run.sh`` script > (this is generated by the build system) shows how to use it. This > might help you gain understanding of how you can use the hello pass. > However I provide no guarantees that this code will work for you and I > provide absolutely no support so do not ask me questions on how to > build this code (it is already documented in README.md). > > > [1] https://github.com/delcypher/srg-llvm-pass-tutorial > > -- > Dan Liew > PhD Student - Imperial College London >-- Thanks Prashant Sharma -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140613/4a4d82b2/attachment.html>