X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FWritingAnLLVMPass.html;h=0832a81644762b2f9ece3f03e23b94c4033f6a0d;hb=7eadec6327cc996483aae4c5db8145bc409d694a;hp=7d81c81c0afd826ba08c3564e1aa77480e0d713b;hpb=ed2e7a9ce43f5db51224530197f17f90ef218525;p=oota-llvm.git diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index 7d81c81c0af..0832a816447 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -19,6 +19,7 @@
  • Pass classes and requirements
  • Pass Registration +
       + +The ImmutablePass class +
    @@ -408,7 +436,7 @@ In contrast to direct Pass subclasses, direct FunctionPass subclasses do have a predictable, local behavior that can be expected by the system. All FunctionPass execute on each function in the program -independant of all of the other functions in the program. +independent of all of the other functions in the program. FunctionPass's do not require that they are executed in a particular order, and FunctionPass's do not modify external functions.

    @@ -446,9 +474,9 @@ fast).

    A good example of how this method should be used is the LowerAllocations pass. This pass converts malloc and free instructions into -platform dependant malloc() and free() function calls. It +platform dependent malloc() and free() function calls. It uses the doInitialization method to get a reference to the malloc and -free functions that it needs, adding prototypes to the module if neccesary.

    +free functions that it needs, adding prototypes to the module if necessary.


    The runOnFunction method

    +
       + +The MachineFunctionPass class +


    The +runOnMachineFunction(MachineFunction &MF) method

    @@ -672,14 +747,14 @@ href="http://llvm.cs.uiuc.edu/doxygen/classAnalysisUsage.html">AnalysisUsage// setPreservesAll - Call this if the pass does not modify its input at allvoid AnalysisUsage::setPreservesAll(); - // preservesCFG - This function should be called by the pass, iff they do not: + // setPreservesCFG - This function should be called by the pass, iff they do not: // // 1. Add or remove basic blocks from the function // 2. Modify terminator instructions in any way. // // This is automatically implied for BasicBlockPass's // - void AnalysisUsage::preservesCFG(); + void AnalysisUsage::setPreservesCFG();

    Some examples of how to use these methods are:

    @@ -698,7 +773,7 @@ and:

       // This example modifies the program, but does not modify the CFG
       void LICM::getAnalysisUsage(AnalysisUsage &AU) const {
    -    AU.preservesCFG();
    +    AU.setPreservesCFG();
         AU.addRequired<LoopInfo>();
       }
     

    @@ -1144,7 +1219,7 @@ fast enough: obviously we should allow for a multithreaded compiler. Because of the semantics defined for passes above (specifically they cannot maintain state across invocations of their run* methods), a nice clean way to implement a multithreaded compiler would be for the PassManager class -to create multiple instances of each pass object, and allow the seperate +to create multiple instances of each pass object, and allow the separate instances to be hacking on different parts of the program at the same time.

    This implementation would prevent each of the passes from having to implement @@ -1201,6 +1276,6 @@ href="#Pass">Pass, only the other way around.

    Chris Lattner
    -Last modified: Mon Sep 16 17:37:27 CDT 2002 +Last modified: Tue Jul 22 15:52:30 CDT 2003