X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FWritingAnLLVMPass.html;h=07e736da691e55ae8a2aa1325e72dc0c9e2205f1;hb=26825a84e97790adaffc55c6101b9fe2524fe1b7;hp=61bbba51361939e4b0652b12b17577cb8bbfa83e;hpb=b7632286951f7f7977ebb0ff00a9c7e5dd746153;p=oota-llvm.git diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index 61bbba51361..07e736da691 100644 --- a/docs/WritingAnLLVMPass.html +++ b/docs/WritingAnLLVMPass.html @@ -292,13 +292,19 @@ function.

initialization value is not important.

-  RegisterPass<Hello> X("hello", "Hello World Pass");
+  RegisterPass<Hello> X("hello", "Hello World Pass",
+                        false /* Only looks at CFG */,
+                        false /* Analysis Pass */);
 }  // end of anonymous namespace
 

Lastly, we register our class Hello, giving it a command line -argument "hello", and a name "Hello World Pass".

+argument "hello", and a name "Hello World Pass". +Last two RegisterPass arguments are optional. Their default value is false. +If a pass walks CFG without modifying it then third argument is set to true. +If a pass is an analysis pass, for example dominator tree pass, then true +is supplied as fourth argument.

As a whole, the .cpp file looks like:

@@ -996,7 +1002,7 @@ depended on.

-

One of the main responsibilities of the PassManager is the make sure +

One of the main responsibilities of the PassManager is to make sure that passes interact with each other correctly. Because PassManager tries to optimize the execution of passes it must know how the passes interact with each other and what dependencies exist between @@ -1376,7 +1382,8 @@ the LLVM program representation for a single function at a time, instead of traversing the entire program. It reduces the memory consumption of compiler, because, for example, only one DominatorSet -needs to be calculated at a time. This also makes it possible some interesting enhancements in the future.