[cfe-dev] LLVM- AST contents display and dependency analysis

yaduveer singh yaduveer99 at gmail.com
Wed May 13 03:30:10 PDT 2015


Hi All,

I tried seeing the AST contents in 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/ 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:

********************

Could someone please advise me on following queries:

a) Is there some way so that I can get dependency analysis of AST and
 Basic Blocks.
b) How can I modify an existing pass by writing a new Pass just like
 "Hello" pass but the dependencies involved in that pass must not show
error like "redeclaration".

Regards,
Yaduveer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150513/42bb1eaf/attachment.html>


More information about the cfe-dev mailing list