<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Dear Zubin,<br>
<br>
If I were you, I would write a ModulePass that uses the CallGraph
analysis to get a call graph. I would then iterate over the nodes
in the call graph and propagate information from callees to
callers.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
On 11/29/17 4:02 PM, Zubin Pahuja via llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:CAPaspQ7yJMtw4BEjCnfdhrS7XQuDmPbKre1kbdekpP=OLv6OgQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>I am trying to count IR instructions in a function for
static analysis using llvm pass. In contrast with existing
examples, I am trying to include instruction counts of all the
callees of the function.</div>
<div><br>
</div>
<div>Counting the instructions of a function is easy using
passes, but iterating through the module's CallGraph is
proving to be confusing. I believe I have to use
CallGraphWrapperPass to get both module pass and its
CallGraph. How do I iterate through the CallGraph in
runOnModule()? A simple print callee names example would be
highly appreciated.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Zubin</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>