From c758209153ca0f6da6737f25ada269c573fba456 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 19 Mar 2008 21:56:59 +0000 Subject: PassInfo keep tracks whether a pass is an analysis pass or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48554 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/WritingAnLLVMPass.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index 4ae039d..07e736d 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:

-- cgit v1.1