sir, that I already applied this.As I followed these steps:-please tell me whered did i go wrong? 1. Checkout LLVM: - cd LLVM - svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm 2. Checkout Clang: - cd LLVM - cd llvm/tools - svn co http://llvm.org/svn/llvm-project/cfe/trunk clang 3. Checkout Compiler-RT: - cd LLVM - cd llvm/projects - svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt 4. 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 clang -emit-llvm -c hello.c -o hello.bc ( Then this gives me some file missing like Pass.h or some other that are already in Include folder) or (if i give path using -I /path/to/these files/ it gives me error in inside these file) Please sir, help me out.wasted so much time on this.and please tell me all path variable or environment path that I have to set before doing all this .And also tell me where did i went wrong? On Wed, Jun 4, 2014 at 9:08 PM, Alexander Musman <alexander.musman at gmail.com> wrote:> You can, for example, generate it with clang from some source file: > > clang -emit-llvm -c hello.c -o hello.bc > > Regards, > Alexander > > > 2014-06-02 11:26 GMT+04:00 Prashanth Sharma <cs13m1017 at iith.ac.in>: > >> sir, >> As defined in >> http://llvm.org/docs/WritingAnLLVMPass.html#setting-up-the-build-environment >> >> running pass with opt but here how I get hello.bc file . >> >> -- >> Thanks >> Prashant Sharma >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-- Thanks Prashant Sharma -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140604/550d06e4/attachment.html>
attaching screenshot of errors I got On Wed, Jun 4, 2014 at 11:07 PM, Prashanth Sharma <cs13m1017 at iith.ac.in> wrote:> sir, > that I already applied this.As I followed these steps:-please tell me > whered did i go wrong? > > 1. Checkout LLVM: > - cd LLVM > - svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm > 2. Checkout Clang: > - cd LLVM > - cd llvm/tools > - svn co http://llvm.org/svn/llvm-project/cfe/trunk clang > 3. Checkout Compiler-RT: > - cd LLVM > - cd llvm/projects > - svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk > compiler-rt > 4. 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 > clang -emit-llvm -c hello.c -o hello.bc ( Then this gives me > some file missing like Pass.h or some other that are already in Include > folder) or (if i give path using -I /path/to/these files/ it gives me error > in inside these file) > > > Please sir, help me out.wasted so much time on this.and please tell me all > path variable or environment path that I have to set before doing all this > .And also tell me where did i went wrong? > > > > On Wed, Jun 4, 2014 at 9:08 PM, Alexander Musman < > alexander.musman at gmail.com> wrote: > >> You can, for example, generate it with clang from some source file: >> >> clang -emit-llvm -c hello.c -o hello.bc >> >> Regards, >> Alexander >> >> >> 2014-06-02 11:26 GMT+04:00 Prashanth Sharma <cs13m1017 at iith.ac.in>: >> >>> sir, >>> As defined in >>> http://llvm.org/docs/WritingAnLLVMPass.html#setting-up-the-build-environment >>> >>> running pass with opt but here how I get hello.bc file . >>> >>> -- >>> Thanks >>> Prashant Sharma >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://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/20140605/ca9a8bd6/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2014-06-05 00:51:33.png Type: image/png Size: 244009 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140605/ca9a8bd6/attachment.png>
You are trying to use the pass source code to generate .bc file, it would need all the flags/includes that used to build it. I suggest to start with something simpler for first .bc example, like:> cat > t.cint main() { return 1+2; }> clang -emit-llvm -c t.c -o hello.bcRegards, Alexander 2014-06-04 23:22 GMT+04:00 Prashanth Sharma <cs13m1017 at iith.ac.in>:> attaching screenshot of errors I got > > > On Wed, Jun 4, 2014 at 11:07 PM, Prashanth Sharma <cs13m1017 at iith.ac.in> > wrote: > >> sir, >> that I already applied this.As I followed these steps:-please tell me >> whered did i go wrong? >> >> 1. Checkout LLVM: >> - cd LLVM >> - svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm >> 2. Checkout Clang: >> - cd LLVM >> - cd llvm/tools >> - svn co http://llvm.org/svn/llvm-project/cfe/trunk clang >> 3. Checkout Compiler-RT: >> - cd LLVM >> - cd llvm/projects >> - svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk >> compiler-rt >> 4. 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 >> clang -emit-llvm -c hello.c -o hello.bc ( Then this gives me >> some file missing like Pass.h or some other that are already in Include >> folder) or (if i give path using -I /path/to/these files/ it gives me error >> in inside these file) >> >> >> Please sir, help me out.wasted so much time on this.and please tell me >> all path variable or environment path that I have to set before doing all >> this .And also tell me where did i went wrong? >> >> >> >> On Wed, Jun 4, 2014 at 9:08 PM, Alexander Musman < >> alexander.musman at gmail.com> wrote: >> >>> You can, for example, generate it with clang from some source file: >>> >>> clang -emit-llvm -c hello.c -o hello.bc >>> >>> Regards, >>> Alexander >>> >>> >>> 2014-06-02 11:26 GMT+04:00 Prashanth Sharma <cs13m1017 at iith.ac.in>: >>> >>>> sir, >>>> As defined in >>>> http://llvm.org/docs/WritingAnLLVMPass.html#setting-up-the-build-environment >>>> >>>> running pass with opt but here how I get hello.bc file . >>>> >>>> -- >>>> Thanks >>>> Prashant Sharma >>>> >>>> _______________________________________________ >>>> LLVM Developers mailing list >>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>> http://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/20140605/6406d985/attachment.html>