[LLVMdev] Support/CommandLine.h exposed through Pass.h?

Reid Spencer reid at x10sys.com
Tue Aug 24 09:20:11 PDT 2004


Hi,

In writing llvmc, I need to link in the Bytecode reader in order to
extract the "dependent libraries" from the bytecode files. And, bytecode
reader needs vmcore. And, vmcore has a static cl::opt<bool> named
"EnableTiming" for the -time-passes option. This conflicts at runtime
with llvmc's -time-passes option (which it passes through to
sub-tools).  

So, my solution is to declare the EnableTiming global var in Pass.h,
remove its "static" keyword in Pass.cpp and expose
"Support/CommandLine.h" in Pass.h.

This compiles and works fine in all tools, but its a bit gross to expose
CommandLine.h via Pass.h.

Anyone object?

An alternative is to remove EnableTiming from VMCore completely (it
really doesn't belong there) and have callers pass in a boolean if they
want timing. Then each of the tools can define their own option and
provide the boolean value as a constructor argument for a Pass?

Anyone got any better ideas?

Reid.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040824/a1b24383/attachment.sig>


More information about the llvm-dev mailing list