<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 13, 2015 at 12:25 PM, yaduveer singh <span dir="ltr"><<a href="mailto:yaduveer99@gmail.com" target="_blank">yaduveer99@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Renato,<div><br></div><div>Thanks for the help.</div><div><br></div><div>I am trying to follow the AST way. I tried seeing the AST contents by using following command:</div><div><br></div><div><div><b><i>clang -Xclang -ast-dump -fsyntax-only loop.c</i></b></div></div><div><b><i><br></i></b></div><div>This is giving me some AST output( I believe so) but I am having two issue:</div><div><br></div><div>1. I am not able to put this output in a file as Its showing following error:</div><div><br></div><div><div><i>yaduveer@yaduveer-Inspiron-3542:~/RP$ clang -Xclang -ast-dump -fsyntax-only loop1d.c | llvm-dis -o ast.txt</i></div><div><i>llvm-dis: Invalid bitcode signature</i></div><div><i>clang: error: unable to execute command: Broken pipe</i></div><div><i>clang: error: clang frontend command failed due to signal (use -v to see invocation)</i></div><div><i>clang version 3.6.0 (trunk 225627) (llvm/trunk 225626)</i></div><div><i>Target: x86_64-unknown-linux-gnu</i></div><div><i>Thread model: posix</i></div><div><i>clang: note: diagnostic msg: PLEASE submit a bug report to <a href="http://llvm.org/bugs/" target="_blank">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and associated run script.</i></div><div><i>clang: note: diagnostic msg: </i></div><div><i>********************</i></div><div><i><br></i></div><div><i>PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:</i></div><div><i>Preprocessed source(s) and associated run script(s) are located at:</i></div><div><i>clang: note: diagnostic msg: /tmp/loop1d-71cd19.c</i></div><div><i>clang: note: diagnostic msg: /tmp/loop1d-71cd19.sh</i></div><div><i>clang: note: diagnostic msg: </i></div><div><i><br></i></div><div><i>********************</i></div></div><div><i><br></i></div><div>2. I don't know whether this AST output is correct or not as I am seeing very large output  compared to my small input program( file loop1d.c).</div></div></blockquote><div><br></div><div>llvm-dis works on LLVM bitcode and not on clang ASTs. </div><div>You are mixing frontend and LLVM IR. <br>Please see <a href="http://llvm.org/docs/CommandGuide/llvm-dis.html">http://llvm.org/docs/CommandGuide/llvm-dis.html</a> for more info.   </div><div><br></div><div>Regards,</div><div>Suyog</div></div><br></div></div>