[LLVMdev] Segmentation fault when traverse call graph

Pablo Barrio pbarrio at die.upm.es
Tue Dec 3 04:46:42 PST 2013


I recall having a similar problem while coding my own special-purpose 
"opt". My guess: try adding the following lines before your pass is 
inserted into the PassManager:

     PassRegistry &Registry = *PassRegistry::getPassRegistry();
     initializeIPA(Registry);

You might require other library initializations. Have a look at the 
"opt" source code.

On 02/12/13 10:36, lucefe wrote:
> 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*)
> ...
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


-- 
Pablo Barrio
Dpt. Electrical Engineering - Technical University of Madrid
Office C-203
Avda. Complutense s/n, 28040 Madrid
Tel. (+34) 915495700 ext. 4234
@: pbarrio at die.upm.es

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131203/1fe3b0a2/attachment.html>


More information about the llvm-dev mailing list