[LLVMdev] Modifying LoopUnrollingPass

suyog sarda sardask01 at gmail.com
Wed May 13 02:39:33 PDT 2015


On Wed, May 13, 2015 at 12:25 PM, yaduveer singh <yaduveer99 at gmail.com>
wrote:

> Hi Renato,
>
> Thanks for the help.
>
> I am trying to follow the AST way. I tried seeing the AST contents by
> using following command:
>
> *clang -Xclang -ast-dump -fsyntax-only loop.c*
>
> This is giving me some AST output( I believe so) but I am having two issue:
>
> 1. I am not able to put this output in a file as Its showing following
> error:
>
> *yaduveer at yaduveer-Inspiron-3542:~/RP$ clang -Xclang -ast-dump
> -fsyntax-only loop1d.c | llvm-dis -o ast.txt*
> *llvm-dis: Invalid bitcode signature*
> *clang: error: unable to execute command: Broken pipe*
> *clang: error: clang frontend command failed due to signal (use -v to see
> invocation)*
> *clang version 3.6.0 (trunk 225627) (llvm/trunk 225626)*
> *Target: x86_64-unknown-linux-gnu*
> *Thread model: posix*
> *clang: note: diagnostic msg: PLEASE submit a bug report to
> http://llvm.org/bugs/ <http://llvm.org/bugs/> and include the crash
> backtrace, preprocessed source, and associated run script.*
> *clang: note: diagnostic msg: *
> **********************
>
> *PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:*
> *Preprocessed source(s) and associated run script(s) are located at:*
> *clang: note: diagnostic msg: /tmp/loop1d-71cd19.c*
> *clang: note: diagnostic msg: /tmp/loop1d-71cd19.sh*
> *clang: note: diagnostic msg: *
>
> **********************
>
> 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).
>

llvm-dis works on LLVM bitcode and not on clang ASTs.
You are mixing frontend and LLVM IR.
Please see http://llvm.org/docs/CommandGuide/llvm-dis.html for more info.

Regards,
Suyog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150513/71a1acda/attachment.html>


More information about the llvm-dev mailing list