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

Dan Gohman gohman at apple.com
Tue Mar 9 17:29:40 PST 2010


Author: djg
Date: Tue Mar  9 19:29:39 2010
New Revision: 98119

URL: http://llvm.org/viewvc/llvm-project?rev=98119&view=rev
Log:
Clarify the documentation for MachineFunctionPasses.

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=98119&r1=98118&r2=98119&view=diff
==============================================================================
--- llvm/trunk/docs/WritingAnLLVMPass.html (original)
+++ llvm/trunk/docs/WritingAnLLVMPass.html Tue Mar  9 19:29:39 2010
@@ -909,16 +909,22 @@
 
 <p>A <tt>MachineFunctionPass</tt> is a part of the LLVM code generator that
 executes on the machine-dependent representation of each LLVM function in the
-program.  A <tt>MachineFunctionPass</tt> is also a <tt>FunctionPass</tt>, so all
+program.</p>
+
+<p>Code generator passes are registered and initialized specially by
+<tt>TargetMachine::addPassesToEmitFile</tt> and similar routines, so they
+cannot generally be run from the <tt>opt</tt> or <tt>bugpoint</tt>
+commands.</p>
+
+<p>A <tt>MachineFunctionPass</tt> is also a <tt>FunctionPass</tt>, so all
 the restrictions that apply to a <tt>FunctionPass</tt> also apply to it.
 <tt>MachineFunctionPass</tt>es also have additional restrictions. In particular,
 <tt>MachineFunctionPass</tt>es are not allowed to do any of the following:</p>
 
 <ol>
-<li>Modify any LLVM Instructions, BasicBlocks or Functions.</li>
+<li>Modify or create any LLVM IR Instructions, BasicBlocks, Arguments,
+    Functions, GlobalVariables, GlobalAliases, or Modules.</li>
 <li>Modify a MachineFunction other than the one currently being processed.</li>
-<li>Add or remove MachineFunctions from the current Module.</li>
-<li>Add or remove global variables from the current Module.</li>
 <li>Maintain state across invocations of <a
 href="#runOnMachineFunction"><tt>runOnMachineFunction</tt></a> (including global
 data)</li>





More information about the llvm-commits mailing list