Skip to content

Instantly share code, notes, and snippets.

@MatzeB
Created November 4, 2023 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MatzeB/9a578040fa0fe599ade7d9a6d9cb1766 to your computer and use it in GitHub Desktop.
Save MatzeB/9a578040fa0fe599ade7d9a6d9cb1766 to your computer and use it in GitHub Desktop.
Install cparser/libfirm and view a graph
# CParser
$ git clone --recursive https://github.com/libfirm/cparser.git
$ cd cparser
$ make
$ cat ~/test.c
int foobar(int a, int b) {
return a + b;
}
$ build/debug/cparser -S -o - ~/test.c -fdump-all-phases
# This will create lots of *.vcg files in the current directory
# YComp graph viewer (Note: noncommercial/research use only!)
$ curl -L -O http://pp.ipd.kit.edu/firm/download/yComp-1.3.19.zip
$ unzip yComp-1.3.19.zip
$ cd yComp-1.3.19
$ java -jar yComp.jar <my-graph.vcg> --dolayout --export <my-graph.svg>
$ open <my-graph.svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment