diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index ae8b8d5bfad..d0aeeec1fc1 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -273,7 +273,7 @@ time.

      static char ID;
-     Hello() : FunctionPass(&ID) {}
+     Hello() : FunctionPass(ID) {}
 

This declares pass identifier used by LLVM to identify pass. This allows LLVM to @@ -301,7 +301,7 @@ function.

initialization value is not important.

-  INITIALIZE_PASS(Hello, "hello", "Hello World Pass",
+  static RegisterPass X("hello", "Hello World Pass",
                         false /* Only looks at CFG */,
                         false /* Analysis Pass */);
 }  // end of anonymous namespace
@@ -328,7 +328,7 @@ is supplied as fourth argument. 

struct Hello : public FunctionPass { static char ID; - Hello() : FunctionPass(&ID) {} + Hello() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { errs() << "Hello: " << F.getName() << "\n"; @@ -337,7 +337,7 @@ is supplied as fourth argument.

}; char Hello::ID = 0; - INITIALIZE_PASS(Hello, "Hello", "Hello World Pass", false, false); + static RegisterPass X("hello", "Hello World Pass", false, false); }
@@ -361,7 +361,7 @@ them) to be useful.

Now that you have a brand new shiny shared object file, we can use the opt command to run an LLVM program through your pass. Because you -registered your pass with the INITIALIZE_PASS macro, you will be able to +registered your pass with RegisterPass, you will be able to use the opt tool to access it, once loaded.

To test it, follow the example at the end of the Function or its contents from a pass registration works, and discussed some of the reasons that it is used and what it does. Here we discuss how and why passes are registered.

-

As we saw above, passes are registered with the INITIALIZE_PASS -macro. The first parameter is the name of the pass that is to be used on +

As we saw above, passes are registered with the RegisterPass +template. The template 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, with opt or bugpoint). The second argument is the +example, with opt or bugpoint). The first 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.