Question

I am able to convert a C code into bitcode and then to CallGraph using LLVM. Now I need to perform parsing for various metrics purposes. How to proceed?

Call Graph looks like this:

Call graph node <<null function>><<0x949dc90>>  #uses=0
  CS<0x0> calls function 'main'
  CS<0x0> calls function 'printf'

Call graph node for function: 'printf'<<0x949d220>>  #uses=2
  CS<0x0> calls external node

Call graph node for function: 'main'<<0x94ac7f8>>  #uses=1
  CS<0x949e3a0> calls function 'printf'
Was it helpful?

Solution

If you don't have any previous experience in Java this may be a tall order.

You will first need to establish the format of the call graph. Then tokenize either using word boundaries, regular expression or a parser generator such as antlr.

Beyond that, the problem is too large for a complete answer on StackOverflow. Try to study these options and ask specific questions the option you choose when you encounter problems.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top