<div dir="ltr">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.<div>I suggest to start with something simpler for first .bc example, like:<div><br>
</div><div><div>> cat > t.c</div><div>int main() { return 1+2; }</div></div><div><br></div><div>> clang -emit-llvm -c t.c -o hello.bc<br></div><div><br></div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
Regards,</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">Alexander</div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-04 23:22 GMT+04:00 Prashanth Sharma <span dir="ltr"><<a href="mailto:cs13m1017@iith.ac.in" target="_blank">cs13m1017@iith.ac.in</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">attaching  screenshot of errors I got <br></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">
On Wed, Jun 4, 2014 at 11:07 PM, Prashanth Sharma <span dir="ltr"><<a href="mailto:cs13m1017@iith.ac.in" target="_blank">cs13m1017@iith.ac.in</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"><div>sir,<br></div>that I already applied this.As I followed these steps:-please tell me whered did i go wrong?<br>

<ol><li>Checkout LLVM:<ul><li><tt><span>cd</span> LLVM</tt></li><li>
<tt><span>svn</span> <span>co</span> <span><a href="http://llvm.org/svn/llvm-project/llvm/trunk" target="_blank">http://llvm.org/svn/llvm-project/llvm/trunk</a></span> <span>llvm</span></tt></li>
</ul>
</li><li>Checkout Clang:<ul><li><tt><span>cd</span> <span>LLVM</span></tt></li><li><tt><span>cd</span> <span>llvm/tools</span></tt></li><li><tt><span>svn</span> <span>co</span> <span><a href="http://llvm.org/svn/llvm-project/cfe/trunk" target="_blank">http://llvm.org/svn/llvm-project/cfe/trunk</a></span> <span>clang</span></tt></li>


</ul>
</li><li>Checkout Compiler-RT:<ul><li><tt><span>cd</span> <span>LLVM</span></tt></li><li><tt><span>cd</span> <span>llvm/projects</span></tt></li><li><tt><span>svn</span> <span>co</span> <span><a href="http://llvm.org/svn/llvm-project/compiler-rt/trunk" target="_blank">http://llvm.org/svn/llvm-project/compiler-rt/trunk</a></span> <span>compiler-rt</span></tt></li>


</ul>
</li><li>Get the Test Suite Source Code<b></b><ul><li><tt><span>cd</span> <span>LLVM</span></tt></li><li><tt><span>cd</span> <span>llvm/projects</span></tt></li><li><tt><span>svn</span> <span>co</span> <span><a href="http://llvm.org/svn/llvm-project/test-suite/trunk" target="_blank">http://llvm.org/svn/llvm-project/test-suite/trunk</a></span> <span>test-suite</span></tt></li>


</ul>
</li></ol>      5.Configure and build LLVM and Clang<tt><span><br>        mkdir</span> <span>build</span></tt>  <tt><span>(inside LLVM)<br>        cd</span> <span>build</span></tt><tt><span><br>
        ../llvm/configure</span> </tt>--prefix =/home/username/LLVM/build  (path of build directory)<tt><span></span></tt><br>           make -j4<br>           make check-all<div class="gmail_extra">      6.now went to Hello folder in lib/Transform/Hello<br>


</div><div class="gmail_extra">            make (this create Hello.so in Debug+Asserts<br>            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)<br>


<br></div><div class="gmail_extra">            <br></div><div class="gmail_extra">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?<br>


</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Wed, Jun 4, 2014 at 9:08 PM, Alexander Musman <span dir="ltr"><<a href="mailto:alexander.musman@gmail.com" target="_blank">alexander.musman@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>You can, for example, generate it with clang from some source file:</div><div><br>


</div>clang -emit-llvm -c hello.c -o hello.bc<br><div><br></div><div>Regards,</div><div>Alexander</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-06-02 11:26 GMT+04:00 Prashanth Sharma <span dir="ltr"><<a href="mailto:cs13m1017@iith.ac.in" target="_blank">cs13m1017@iith.ac.in</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<div><div>
<div dir="ltr"><div><div>sir,<br></div>As defined in    <a href="http://llvm.org/docs/WritingAnLLVMPass.html#setting-up-the-build-environment" target="_blank">http://llvm.org/docs/WritingAnLLVMPass.html#setting-up-the-build-environment</a><br>




<br></div>running pass with opt but here how I get hello.bc file .<span><font color="#888888"><br clear="all"><div><div><div><div><br>-- <br><div dir="ltr"><div><font face="arial,helvetica,sans-serif">Thanks <br>
</font></div><font face="arial,helvetica,sans-serif">Prashant Sharma<br>
</font></div>
</div></div></div></div></font></span></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">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 clear="all"><br></div></div><span><font color="#888888">-- <br><div dir="ltr"><div><font face="arial,helvetica,sans-serif">Thanks <br></font></div><font face="arial,helvetica,sans-serif">Prashant Sharma<br>

</font></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr"><div><font face="arial,helvetica,sans-serif">Thanks <br></font></div><font face="arial,helvetica,sans-serif">Prashant Sharma<br>
</font></div>
</font></span></div>
</blockquote></div><br></div>