Hi Robert,<div><br><div>Function passes are expected to have local behavior that can be scheduled on a per-function basis in no particular order. To get the behavior you want, you probably want to make "FunctionPass1" a Module pass and have it iterate through all of the functions in the module.</div>
<div><br></div><div>You can find more information about passes and how to choose a type of pass in the llvm documentation at <a href="http://llvm.org/docs/WritingAnLLVMPass.html">http://llvm.org/docs/WritingAnLLVMPass.html</a>.</div>
<div><br></div><div><div>Cheers,<br>Scott</div>
<br><br><div class="gmail_quote">On Sat, Feb 23, 2013 at 1:37 AM, Robert Sandra <span dir="ltr"><<a href="mailto:robert.sandra0712@gmail.com" target="_blank">robert.sandra0712@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi all,<div><br></div><div>I am trying to run a case as follows:</div><div><br></div><div>FunctionPass1:  try to get all function's names and store them to a global array</div><div>FunctionPass2:  get information from the global array </div>


<div>In FunctionPass2, I use <span style="font-family:Monaco;font-size:13px">getAnalysisUsage() to set that to run FunctionPass2, FunctionPass1 should be executed first.</span></div><div><span style="font-family:Monaco;font-size:13px"><br>


</span></div><div><span style="font-family:Monaco;font-size:13px">But according to the running result, I found that these two passes are executing at the same time,</span></div><div><span style="font-family:Monaco;font-size:13px">which means After FunctionPass1 iterate one function, then FunctionPass2 will be executed to iterate one function; then FunctionPass1 continues to run, and then FunctionPass2....</span></div>


<div><span style="font-family:Monaco;font-size:13px"><br></span></div><div><font face="Monaco">While, what I expected is that the FunctionPass1 will complete first, then FunctionPass2 will be executed. Am I understanding wrong?</font></div>


<div><font face="Monaco"><br></font></div><div><font face="Monaco">Thanks.</font></div><span><font color="#888888"><div><font face="Monaco">Robert</font></div>
</font></span><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<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><br>
<a 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>
</div></div>