Hello, I want to access the instructions via: CallGraph->CallGraphNode->Function->BB->Instruction Is this possible? Right now, I'm iterating over the CallGraph Nodes via CallGraphSCC:iterator, but then I have to cast that iterator to a CallGraphNode const and then when I call CallGraphNode->getFunction, it returns a valid function but seg faults on function->getName()? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111019/408766ae/attachment.html>
Hi Ryan,> I want to access the instructions via: > CallGraph->CallGraphNode->Function->BB->Instruction > > Is this possible? > > Right now, I'm iterating over the CallGraph Nodes via CallGraphSCC:iterator, but > then I have to cast that iterator to a CallGraphNode constyou should be able to use (*I)->getFunction() and then when I call> CallGraphNode->getFunction, it returns a valid function but seg faults on > function->getName()?All functions defined outside the module are represented by the null pointer. So if for example you declare a function foo, but it has no body, and call it from somewhere in your module, then foo is considered part of the "external SCC"; when you do getFunction() for this SCC node you will get a null pointer. Ciao, Duncan.
Apparently Analagous Threads
- [LLVMdev] Function::getName in CallGraphSCCPass causes bus error
- [LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass
- [LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass
- [LLVMdev] Problem getting LoopInfo inside non-LoopPass
- [LLVMdev] CallGraphSCCPass