<div>Yes, you are right. I have solved this problem according to your instruction.</div>
<div> </div>
<div>Thank you very much.</div>
<div><br><br> </div>
<div class="gmail_quote">2013/12/3 Pablo Barrio <span dir="ltr"><<a href="mailto:pbarrio@die.upm.es" target="_blank">pbarrio@die.upm.es</a>></span><br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div text="#000000" bgcolor="#FFFFFF">
<div>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:<br><br> PassRegistry &Registry = *PassRegistry::getPassRegistry();<br>
initializeIPA(Registry);<br><br>You might require other library initializations. Have a look at the "opt" source code.
<div>
<div class="h5"><br><br>On 02/12/13 10:36, lucefe wrote:<br></div></div></div>
<blockquote type="cite">
<div>
<div class="h5">
<div>Dear everyone,</div>
<div> </div>
<div>I want to traverse call graph, but I have some trouble .</div>
<div> </div>
<div>In my pass MyPass which need to traverse call graph, I firstly added the CallGraph analysis to the pass requirements by</div>
<div> </div>
<div><strong>AU.addRequired<CallGraph>();</strong></div>
<div> </div>
<div>My pass MyPass then will be added to a pass manager by</div>
<div> </div>
<div><strong>manager.add(new MyPass());</strong></div>
<div> </div>
<div>and then I want to traverse the call graph such as: </div>
<div> </div>
<div>CallGraph CG = this->getAnalysis<CallGraph>;</div>
<div>for (CallGraph::const_iterator i = CG.begin(); i != CG.end(); ++i) {</div>
<div>....</div>
<div>}</div>
<div> </div>
<div>However, I encountered a segmentation fault with the next core dump information. What should I do?</div>
<div> </div>
<div>llvm::PassInfo::createPass() const + 4</div>
<div>llvm::PMTopLevelManager::schedulePass(llvm::Pass*)</div>
<div>llvm::PassManager::add(llvm::Pass*)</div>
<div>...</div>
<div> </div><br>
<fieldset></fieldset> <br></div></div><pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888"></font></span></blockquote><span class="HOEnZb"><font color="#888888"><br><br><pre cols="72">--
Pablo Barrio
Dpt. Electrical Engineering - Technical University of Madrid
Office C-203
Avda. Complutense s/n, 28040 Madrid
Tel. (+34) 915495700 ext. 4234
@: <a href="mailto:pbarrio@die.upm.es" target="_blank">pbarrio@die.upm.es</a>
</pre></font></span></div></blockquote></div><br>