[LLVMdev] question about the 3th and 4th arguments in the registration function

Hui Zhang wayne.huizhang at gmail.com
Mon Feb 2 08:32:30 PST 2015


Hello,

I'm a little confused about the 3th and 4th arguments in the registration
function, explained here:
http://llvm.org/releases/3.3/docs/WritingAnLLVMPass.html

e.g

static RegisterPass<Hello> X("hello", "Hello World Pass",
                             false /* Only looks at CFG */,
                             false /* Analysis Pass */);


"Lastly, we *register our class*
<http://llvm.org/releases/3.3/docs/WritingAnLLVMPass.html#writing-an-llvm-pass-registration>
Hello, giving it a command line argument “hello”, and a name “Hello World
Pass”. The last two arguments describe its behavior: if a pass walks CFG
without modifying it then the third argument is set to true; if a pass is
an analysis pass, for example dominator tree pass, then true is supplied as
the fourth argument."

In this simple "Hello" pass, it only look at all the functions and print
out their name. So what's the difference between 3th and 4th argument here
??

And since Hello pass didn't modify the module but analized it(as I
understand), shouldn't both of them be true instead of false in the example
??

thanks

-- 
Best regards


Hui Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150202/b715239c/attachment.html>


More information about the llvm-dev mailing list