Problems with Passing agrument to a Pass


I have a very naive question. I've written a pass that gets an argument from
the command line with the following code:

static cl::opt<int> LineNum("line-number", cl::Hidden,
cl::Required,cl::desc("line of variable being observed"));

Now when I run it, it seems like it cant see that I've put in an argument on
the command line:

opt -load /Users/sam/llvm/llvm-2.6/Release/lib/LLVMHello.dylib -hello2
goo3.bc 18

which "18" is the argument. Stupidly enough I've put this argument any where
in the command line and it wont work it keeps telling me:

opt: Too many positional arguments specified!
Can specify at most 1 positional arguments: See: opt --help
opt: for the -line-number option: must be specified at least once!

Can someone please help me out. Thank you :slight_smile:


Ok, me again,

just found out the problem, I got to explicitly specify -line-number 18 to
make it work :wistle:.


Samaneh wrote: