<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
To get definitions before uses (apart from PHI nodes), use
ReversePostOrderTraversal:<br>
<br>
#include <llvm/ADT/PostOrderIterator.h><br>
<br>
ReversePostOrderTraversal<Function*> rpot((Function
*)&func);<br>
for (ReversePostOrderTraversal<Function*>::rpo_iterator bi =<br>
rpot.begin(), be = rpot.end(); bi != be; ++bi)<br>
{<br>
(*bi)->dump();<br>
}<br>
<br>
On 03/19/2013 10:46 AM, Alexandru Ionut Diaconescu wrote:
<blockquote
cite="mid:CAPBXs32aGg3VZPPKBku_EjiBEGcdgHT8tgmTvCQ0pNqkLUL3iw@mail.gmail.com"
type="cite">Hi,<br>
<br>
<span class="comment-copy">Example on how to iterate over CFG,
take a look at <code>DominanceFrontier.cpp</code>.</span><br>
<br>
You can further implement easily a traverse graph algorithm.<br>
<br>
<div class="gmail_quote">
On Tue, Mar 19, 2013 at 2:35 PM, Ashish Kulkarni <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:ashish-kulkarni@hotmail.com" target="_blank">ashish-kulkarni@hotmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div>
<div dir="ltr">Hi LLVM Delveloper,<br>
i've been working on LLVM and Clang to get basic
block information. The CFG supports Visitors (CFG.h) but i
might want to ask that<font color="#8c0095"> is there any
code sample available </font>so that i can get the
things easily..<br>
<br>
Regards,<br>
Kulkarni Ashish A.<br>
College of engineering, Pune<br>
India.<br>
</div>
</div>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
<a moz-do-not-send="true"
href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a moz-do-not-send="true"
href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<font style="background-color: rgb(255, 255, 255); color: rgb(153,
153, 153);">Best regards,</font><br style="background-color:
rgb(255, 255, 255); color: rgb(153, 153, 153);">
<font style="background-color: rgb(255, 255, 255); color: rgb(153,
153, 153);">Alexandru Ionut Diaconescu</font><br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
</body>
</html>