<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">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.<br>
<br>
On 02/12/13 10:36, lucefe wrote:<br>
</div>
<blockquote
cite="mid:CABxNNEeSa6PNBmyWkjxgX4nVQSB=NcttwFLU-Pwmtd9j9X0nNw@mail.gmail.com"
type="cite">
<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 class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" 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 class="moz-txt-link-abbreviated" href="mailto:pbarrio@die.upm.es">pbarrio@die.upm.es</a>
</pre>
</body>
</html>