Setting options when using libraries

Hi,

just a quick question, how do you set options when you are linking with the LLVM libraries?
for example, the option:

   cl::opt<bool> DisablePatternISel("disable-pattern-isel", cl::Hidden,
                                  cl::desc("Disable the pattern isel XXX FIXME"),
                                    cl::init(true));

How do I change it from within our application?

Up to now I've been changing the defaults in the LLVM sources and recompiling, but it seems a very very stupid way of doing it, but I could not find anything in the documentation about how to set options through the API..

m.

just a quick question, how do you set options when you are linking with the LLVM libraries?
for example, the option:

cl::opt<bool> DisablePatternISel("disable-pattern-isel", cl::Hidden,
                                cl::desc("Disable the pattern isel XXX FIXME"),
                                  cl::init(true));

How do I change it from within our application?

Probably the easiest way to do this is to just do something like this:

const char *args = { "-disable-pattern-isel", "false", 0 };
cl::ParseCommandLineOptions(2, args);

Up to now I've been changing the defaults in the LLVM sources and recompiling, but it seems a very very stupid way of doing it, but I could not find anything in the documentation about how to set options through the API..

The other way to do it would be to add a boolean somewhere that overrides this...

-Chris