[LLVMdev] CFG as DOT: where do node addresses come from?
Trevor Harmon
Trevor.W.Harmon at nasa.gov
Mon Mar 15 16:22:05 PDT 2010
Hi,
The -dot-cfg option of opt will write a diagram of an analyzed
function's CFG to DOT format. If you then open the DOT file, you will
see that the BasicBlocks are uniquely identified with hexadecimal
addresses. For example, an edge from one block to another may look like:
Node0x10026b0:s0 -> Node0x1004c20;
I've been trying to figure out where these hexadecimal addresses come
from. I've been up and down the code but remain at a loss. I can see
where GraphWriter.h is actually writing the strings to the DOT file,
and I can see that some of the DOT data is coming from DOTGraphTraits
in CFGPrinter.h. But the hexadecimal addresses are a mystery. I
thought perhaps a BasicBlock method, such as getName, might be
producing the addresses, but no.
Can anyone shed some light on this for me? Thanks,
Trevor
More information about the llvm-dev
mailing list