From c5402408576898449c5545bac7e111faa7546647 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Thu, 15 Jan 2004 18:34:11 +0000 Subject: [PATCH] * HTML 4.01 Strict DTD compliance * Use stylesheets instead of adhoc formatting * Fix broken links in doxygen due to llvm namespace git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10881 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/WritingAnLLVMPass.html | 1144 ++++++++++++++++++++--------------- 1 file changed, 645 insertions(+), 499 deletions(-) diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index dc70d036c8a..3570717b75e 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -1,146 +1,158 @@ - -Writing an LLVM Pass - - - - - -
  Writing an LLVM Pass
- + + + + Writing an LLVM Pass + + + + +
+ Writing an LLVM Pass +
    -
  1. Introduction - What is a pass? +
  2. Introduction - What is a pass?
  3. Quick Start - Writing hello world + or analyze
  4. +
  5. Pass classes and requirements
  6. The FunctionPass class + &) method
  7. +
  8. The BasicBlockPass class + &) method
  9. +
  10. The MachineFunctionPass class + runOnMachineFunction(MachineFunction &) method
  11. +
  12. Pass Registration +
  13. The print method
  14. +
  15. Specifying interactions between passes +
  16. The getAnalysisUsage + method
  17. +
  18. The getAnalysis method
  19. +
  20. Implementing Analysis Groups +
  21. Analysis Group Concepts
  22. +
  23. Using RegisterAnalysisGroup
  24. +
  25. What PassManager does +
  26. The releaseMemory method
  27. +
  28. Using GDB with dynamically loaded passes +
  29. Setting a breakpoint in your pass
  30. +
  31. Miscellaneous Problems
  32. +
  33. Future extensions planned - +
  34. Multithreaded LLVM
  35. +
  36. A new ModuleSource interface
  37. +
  38. Passes requiring + FunctionPasses
  39. + +
+ +

Written by Chris Lattner

-

- - +

- -
-Introduction - What is a pass? -
-
-Quick Start - Writing hello world -
-
   - -Setting up the build environment -


-
   - -Basic code required -
-
   - -Running a pass with opt or analyze -
-
-Pass classes and requirements -
-
   - -The ImmutablePass class -
-
   - -The Pass class -


The run method

-
   - -The FunctionPass class -


The -doInitialization(Module &) method


The runOnFunction method


The doFinalization(Module &) method

-
   - -The BasicBlockPass class -


The -doInitialization(Function &) method


The runOnBasicBlock method


The doFinalization(Function -&) method

-
   - -The MachineFunctionPass class -


The -runOnMachineFunction(MachineFunction &MF) method

-
-Pass registration -
+ +

Regardless of how you register your pass, you must specify at least two parameters. The first parameter is the name of the pass that is to be used on the command line to specify that the pass should be added to a program (for example opt or analyze). The second argument is the name of the pass, which is to be used for the --help output of programs, as -well as for debug output generated by the --debug-pass option.

+well as for debug output generated by the --debug-pass option.

-If you pass is constructed by its default constructor, you only ever have to +

If you pass is constructed by its default constructor, you only ever have to pass these two arguments. If, on the other hand, you require other information (like target specific information), you must pass an additional argument. This argument is a pointer to a function used to create the pass. For an example of how this works, look at the LowerAllocations.cpp -file.

+file.

-If a pass is registered to be used by the analyze utility, you should -implement the virtual print method:

+

If a pass is registered to be used by the analyze utility, you +should implement the virtual print method:

+ + -


The print method

-
-Specifying interactions between passes -


The getAnalysisUsage method


The getAnalysis<> method

-
-Implementing Analysis Groups -


Analysis Group Concepts


Using RegisterAnalysisGroup

-
-What PassManager does -


The releaseMemory method

-
-Using GDB with dynamically loaded passes -


Setting a breakpoint in your pass


Miscellaneous Problems

-
-Future extensions planned -


Multithreaded LLVM


A new ModuleSource interface


Pass's requiring FunctionPass's

- - -
-
Chris Lattner
-The LLVM Compiler Infrastructure -
- - -Last modified: Mon Oct 27 12:00:00 CDT 2003 - -
+
+
+ Valid CSS! + Valid HTML 4.01! + + Chris Lattner
+ The LLVM Compiler Infrastructure
+ Last modified: $Date$ +
+ + + -- 2.34.1