From 9f116aa3b1ece85b863099ffa7ea1cab88ef46a8 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 10 Mar 2010 01:29:39 +0000 Subject: Clarify the documentation for MachineFunctionPasses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98119 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/WritingAnLLVMPass.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index f2be1fd3bb..7dbaa9e6bd 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)
  10. -- cgit v1.2.3