pass argument to a FunctionPass

Hello
is there any way to pass argument to my own Function pass

I mean I wrote a Function pass (like Hello) that give me somme analyzes about the code source and I need to pass somme argument to the Pass like the size of data…

I want some think like this

opt -load …/…/…/Debug/lib/LLVMHello.so -hello2 < test.bc > /dev/null arg1 arg2 …

So how to get inside the Function pass the arg1 and arg 2 ??

Thank you

K.H

khaled hamidouche wrote:

Hello
is there any way to pass argument to my own Function pass

Add a command-line option to your pass using the LLVM command-line library: http://llvm.org/docs/CommandLine.html. You can find examples in the LLVM source; the inlining optimization pass (in lib/Transforms/IPO, I believe) does this.

If you add command-line options using this library, they get registered when loaded into opt and bugpoint.

-- John T.