[llvm-commits] [llvm] r74668 - /llvm/trunk/docs/WritingAnLLVMPass.html

Daniel Dunbar daniel at zuster.org
Wed Jul 1 16:38:44 PDT 2009


Author: ddunbar
Date: Wed Jul  1 18:38:44 2009
New Revision: 74668

URL: http://llvm.org/viewvc/llvm-project?rev=74668&view=rev
Log:
Try to clarify a point about getting DominatorTree info from a module pass.

Modified:
    llvm/trunk/docs/WritingAnLLVMPass.html

Modified: llvm/trunk/docs/WritingAnLLVMPass.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=74668&r1=74667&r2=74668&view=diff

==============================================================================
--- llvm/trunk/docs/WritingAnLLVMPass.html (original)
+++ llvm/trunk/docs/WritingAnLLVMPass.html Wed Jul  1 18:38:44 2009
@@ -491,10 +491,15 @@
 <tt>ModulePass</tt> indicates that your pass uses the entire program as a unit,
 refering to function bodies in no predictable order, or adding and removing
 functions.  Because nothing is known about the behavior of <tt>ModulePass</tt>
-subclasses, no optimization can be done for their execution. A module pass
-can use function level passes (e.g. dominators) using getAnalysis interface
-<tt> getAnalysis<DominatorTree>(Function)</tt>, if the function pass
-does not require any module passes. </p> 
+subclasses, no optimization can be done for their execution.</p>
+
+<p>A module pass can use function level passes (e.g. dominators) using
+the getAnalysis interface
+<tt>getAnalysis<DominatorTree>(llvm::Function *)</tt> to provide the
+function to retrieve analysis result for, if the function pass does not require
+any module passes. Note that this can only be done for functions for which the
+analysis ran, e.g. in the case of dominators you should only ask for the
+DominatorTree for function definitions, not declarations.</p>
 
 <p>To write a correct <tt>ModulePass</tt> subclass, derive from
 <tt>ModulePass</tt> and overload the <tt>runOnModule</tt> method with the





More information about the llvm-commits mailing list