[LLVMdev] Segmentation fault when traverse call graph

lucefe noviceup at gmail.com
Wed Dec 4 05:20:15 PST 2013


Yes, you are right. I have solved this problem according to your
instruction.

Thank you very much.



2013/12/3 Pablo Barrio <pbarrio at die.upm.es>

>  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 listLLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.eduhttp://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/20131204/f3aa67fb/attachment.html>


More information about the llvm-dev mailing list