[LLVMdev] command line option

Chris Lattner sabre at nondot.org
Sat Apr 14 11:44:25 PDT 2007

On Sat, 14 Apr 2007, Fernando Magno Quintao Pereira wrote:
> the info I was looking for. Could any of you tell me a little about it?
> I mean, do I have to write something like:
>   static cl::opt<bool>
>   EnableJoining("join-liveintervals",
>                 cl::desc("Join compatible live intervals"),
>                 cl::init(true));
> in some .h, and then include it in every pass that would read
> EnableJoining? Is there a standard way of doing this?

You want to use "external storage" so that the bool value gets put into 
some other global variable, then you declare the global in the public 
header.  Take a look at how llvm/Target/TargetOptions.h works.



More information about the llvm-dev mailing list