Clarify the documentation for MachineFunctionPasses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-03-10 01:29:39 +00:00
parent 00685bb5cf
commit 9f116aa3b1

View File

@ -909,16 +909,22 @@ finalization.</p>
<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>