[LLVMdev] Problems with Passing agrument to a Pass

Samaneh snavabpo at uwaterloo.ca
Wed Sep 1 17:00:20 PDT 2010


Hi,

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 :)

Sam
-- 
View this message in context: http://old.nabble.com/Problems-with-Passing-agrument-to-a-Pass-tp29599541p29599541.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list