[LLVMdev] Why llvm-pass don't work when applied on itself(passfile)

Prashanth Sharma cs13m1017 at iith.ac.in
Mon Jun 16 12:41:35 PDT 2014


Sir,
I have attached the full procedure I have followed.may be this would help
you to understand my problem


On Mon, Jun 16, 2014 at 12:17 AM, John Criswell <criswell at illinois.edu>
wrote:

>  On 6/15/14, 12:04 PM, Prashanth Sharma wrote:
>
> Let's take Hello.cpp  pass file from llvm/lib/Transform/Hello. Now I want
> to run clang -emit-llvm -c Hello.cpp(Hello.c).Means I want to apply this
> pass on itself.Then there are too many errors.
>
>
> You need to be more specific about how you are running your pass on the
> bitcode file and what errors you are seeing.  No one can figure out what
> the problem is with the small amount of information that you have provided.
>
> Regards,
>
> John Criswell
>
>
>
>
> On Sun, Jun 15, 2014 at 10:27 PM, John Criswell <criswell at illinois.edu>
> wrote:
>
>>  On 6/14/14, 6:02 AM, Prashanth Sharma wrote:
>>
>> Hi,
>> I applied some pass i.e.  Hello pass on Hello.cpp(the pass file).It
>> doesnot work as using command clang -emit-llvm -c Hello.c(Hell.cpp) does
>> not create any .bc file .Can any body have some suggestion ?
>>
>>
>>  Is the problem that you can't create a bitcode file or that you can't
>> get clang to run your pass?
>>
>> Assuming you can't generate a bitcode file, clang -emit-llvm -c <file.c>
>> should create a file ending with .o that is an LLVM bitcode file.  It will
>> not have a .bc suffix.
>>
>> Regards,
>>
>> John Criswell
>>
>>
>>
>>  --
>>  Thanks
>>  Prashant Sharma
>>
>>
>> _______________________________________________
>> LLVM Developers mailing listLLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>>
>
>
>  --
>  Thanks
>  Prashant Sharma
>
>
>


-- 
Thanks
Prashant Sharma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140617/d98fd229/attachment.html>
-------------- next part --------------
sir,
that I followed this procedure.As I followed these steps:-please tell me whered did i go wrong?

    Checkout LLVM:
        cd LLVM
        svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
    Checkout Clang:
        cd LLVM
        cd llvm/tools
        svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
    Checkout Compiler-RT:
        cd LLVM
        cd llvm/projects
        svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
    Get the Test Suite Source Code
        cd LLVM
        cd llvm/projects
        svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite

      5.Configure and build LLVM and Clang
        mkdir build  (inside LLVM)
        cd build
        ../llvm/configure --prefix =/home/username/LLVM/build  (path of build directory)
           make -j4
           make check-all
      6.now went to Hello folder in lib/Transform/Hello
            make (this create Hello.so in Debug+Asserts

Now I want to apply this hello pass on same Hello.cpp file(that is my file in which pass is written)
so if I compile this Hello.cpp file using command : clang -emit-llvm -c Hello.cpp(Hello.c) than it gives me following errors:-

Hello.c:15:10: fatal error: 'llvm/ADT/Statistic.h' file not found
#include "llvm/ADT/Statistic.h"

###########################now when I gave path using -I like  clang -emit-llvm -c Hello.cpp -o Hello.bc(Hello.c) -I path even then it gives errors.







More information about the llvm-dev mailing list