From: Dan Gohman Date: Wed, 10 Mar 2010 01:29:39 +0000 (+0000) Subject: Clarify the documentation for MachineFunctionPasses. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9f116aa3b1ece85b863099ffa7ea1cab88ef46a8;p=oota-llvm.git Clarify the documentation for MachineFunctionPasses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98119 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index f2be1fd3bbd..7dbaa9e6bda 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -909,16 +909,22 @@ finalization.

A MachineFunctionPass is a part of the LLVM code generator that executes on the machine-dependent representation of each LLVM function in the -program. A MachineFunctionPass is also a FunctionPass, so all +program.

+ +

Code generator passes are registered and initialized specially by +TargetMachine::addPassesToEmitFile and similar routines, so they +cannot generally be run from the opt or bugpoint +commands.

+ +

A MachineFunctionPass is also a FunctionPass, so all the restrictions that apply to a FunctionPass also apply to it. MachineFunctionPasses also have additional restrictions. In particular, MachineFunctionPasses are not allowed to do any of the following:

    -
  1. Modify any LLVM Instructions, BasicBlocks or Functions.
  2. +
  3. Modify or create any LLVM IR Instructions, BasicBlocks, Arguments, + Functions, GlobalVariables, GlobalAliases, or Modules.
  4. Modify a MachineFunction other than the one currently being processed.
  5. -
  6. Add or remove MachineFunctions from the current Module.
  7. -
  8. Add or remove global variables from the current Module.
  9. Maintain state across invocations of runOnMachineFunction (including global data)