How to print "Instruction" nodes instead of "BasicBlock" in a .dot file ?

Dear LLVM developers,

I am Shen, a PhD student in computer science in lehigh university. Now I am using LLVM to generate a Program Dependence Graph(PDG), and each node in my graph represent a statement(should be an Instruction in LLVM, i think).

Now I have generated a coarse PDG on BasicBlock level as shown in the following figure, using APIs such as

std::string getNodeLabel(const [BasicBlock]( *[Node](, const [Function]( *Graph) 

However, all APIs I found in class DOTGraphTraits ask “BasicBlock”, not Instruction for arguments. So if i want to generate a more fine-grained PDG on “Instruction” level, should i revise the llvm source code to add my new APIs, or use some built-in APIs i did’t know? Or, can i generate a basicblock for each instruction? Thank you!

Best regards,


Hi Shen,