[LLVMdev] passing parameters for a analysis pass
kryptonite_ubc
annathomas87 at gmail.com
Tue Nov 29 12:29:59 PST 2011
As a follow up question, I am having problems when specifying cl::opt with
strings. I have seen the LoopUnrollPass, which uses cl::opt with unsigned.
I have tried exactly the same option:
cl::opt<string> with the parameter name as "fileName".
The code:
static cl::opt<std::string>metaFile("fileName", cl::desc("The llvm metadata
file to this pass"),cl::value_desc("llvmfile"));
When running opt, I use the pass argument : -fileName=file_metadata.
opt -load ~/llvm-2.9/Release/lib/LLVMInject.so -analysisInject
-fileName=file_metadata < input_ll_file.ll
However, the filename does not change to "file_metadata".
Any pointers on what could be wrong?
Thanks,
Anna
Will Dietz wrote:
>
> If you think a commandline option is the way to go, LLVM makes it
> pretty easy to do so, see the documentation here:
> http://llvm.org/docs/CommandLine.html .
>
> Mostly you can just add an appropriate "cl::opt<string>" option (for
> your filename, for example) and you're on your way.
>
> ~Will
>
>
--
View this message in context: http://old.nabble.com/passing-parameters-for-a-analysis-pass-tp29102147p32882284.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
More information about the llvm-dev
mailing list