[LLVMdev] Segmentation fault when traverse call graph

lucefe noviceup at gmail.com
Mon Dec 2 01:36:43 PST 2013


Dear everyone,

I want to traverse call graph, but I have some trouble .

In my pass MyPass which need to traverse call graph, I firstly added the
CallGraph analysis to the pass requirements by

*AU.addRequired<CallGraph>();*

My pass MyPass then will be added to a pass manager by

*manager.add(new MyPass());*

and then I want to traverse the call graph such as:

CallGraph CG = this->getAnalysis<CallGraph>;
for (CallGraph::const_iterator i = CG.begin(); i != CG.end(); ++i) {
....
}

However, I encountered a segmentation fault with the next core dump
information. What should I do?

llvm::PassInfo::createPass() const + 4
llvm::PMTopLevelManager::schedulePass(llvm::Pass*)
llvm::PassManager::add(llvm::Pass*)
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131202/c8daa472/attachment.html>


More information about the llvm-dev mailing list