neda
neda

Reputation: 219

Program Dependence Graphs (PDG)

I am new to LLVM and I need to analyse the program (Control flow and Data flow analysis). I couldn't find PDG or Task Graph in LLVM. How can I do this?

Upvotes: 5

Views: 2785

Answers (3)

Peter Teoh
Peter Teoh

Reputation: 6713

The detail procedure is available here (take note you have to download LLVM 9.0.0 for this to work, from https://releases.llvm.org/download.html, choose according to your preferred platform):

https://github.com/tthtlc/my_llvm_program_dependency_generator

The example hello.c inside is here:

#include <stdio.h>

int main() {
  printf("hello world\n");
  return 0;
}

The output of the program dependency graph is here:

enter image description here

Upvotes: 1

Garfield
Garfield

Reputation: 21

You can use this tool to build an inter-procedural program dependence graph in LLVM: https://bitbucket.org/psu_soslab/program-dependence-graph-in-llvm/src/master/

Upvotes: 1

wjl
wjl

Reputation: 7735

If you look at this link: http://llvm.org/docs/ProgrammersManual.html#ViewGraph (the "Viewing graphs while debugging code" section) it talks about how to generate and view graphs using graphviz. This is useful for both interactive use as well as for creating graphs for publication.

Upvotes: -1

Related Questions