aboutsummaryrefslogtreecommitdiffstats
path: root/docs/WritingAnLLVMPass.html
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-01 23:38:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-01 23:38:44 +0000
commitb7750c5325d8bb3260462b21ee46e2dc675c6a3c (patch)
tree1de683d68c82171f02aefd6ceee27ba04fab104c /docs/WritingAnLLVMPass.html
parent3960163e9cb9e5685f8ae321ed57eb0aec5f4c8b (diff)
downloadexternal_llvm-b7750c5325d8bb3260462b21ee46e2dc675c6a3c.zip
external_llvm-b7750c5325d8bb3260462b21ee46e2dc675c6a3c.tar.gz
external_llvm-b7750c5325d8bb3260462b21ee46e2dc675c6a3c.tar.bz2
Try to clarify a point about getting DominatorTree info from a module pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/WritingAnLLVMPass.html')
-rw-r--r--docs/WritingAnLLVMPass.html13
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html
index 8374bfa..b8ac9e9 100644
--- a/docs/WritingAnLLVMPass.html
+++ b/docs/WritingAnLLVMPass.html
@@ -491,10 +491,15 @@ class is the most general of all superclasses that you can use. Deriving from
<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&lt;DominatorTree&gt;(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&lt;DominatorTree&gt;(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