This patch moves general LLVMSupport options from Debug.cpp and
Signals.cpp into CommandLine.cpp so they are only constructed if
CommandLine.o is actually loaded when statically linked. This can
help in following cases:
- LLVMSupport gets linked in multiple times, e.g., in a library and also in the final application, which will fail with an assert "Option 'X' registered more than once!". This is true whether or not any symbols from CommandLine.cpp are referenced in the final application, e.g., parseCommandLineOptions.
- Applications that don't reference any symbols from CommandLine.cpp don't have to pay for constructing unused static Options -- these general options all use cl::location, so the options are only needed for parsing. This can result in smaller binaries and faster startup times.
This patch depends on D71169.
There are other options in LLVMSupport, e.g., timing, statistics,
debug counters, etc, but they mostly used outside of LLVMSupport,
and aren't applicable to this patch.
Why did you keep that definition here?