Rework LDMD command-line translation and add -verrors-spec

Simplify LDMD quite a bit by translating the few different command-line
options directly in-place. This puts some more stress onto LDC's
command-line parsing, especially due to multiple occurrences of a single
Boolean option (e.g., '-o-') or mixtures of `-m64` and `-m32` etc. for
dmd-testsuite.

Also add new command-line option `-verrors-spec` showing gagged errors
(DMD's equivalent is `-verrors=<spec|limit>`) and sync the usage text with
DMD. LDMD now also recognizes `-h` (and `/?` on Windows).
This commit is contained in:
Martin 2017-02-05 23:57:19 +01:00
parent 99795b8a57
commit 84e74e3932
4 changed files with 332 additions and 719 deletions

View file

@ -107,10 +107,10 @@ static cl::opt<bool> stripDebug(
cl::opt<opts::SanitizerCheck> opts::sanitize(
"sanitize", cl::desc("Enable runtime instrumentation for bug detection"),
cl::init(opts::None),
clEnumValues(clEnumValN(opts::AddressSanitizer, "address", "memory errors"),
clEnumValN(opts::MemorySanitizer, "memory", "memory errors"),
clEnumValues(clEnumValN(opts::AddressSanitizer, "address", "Memory errors"),
clEnumValN(opts::MemorySanitizer, "memory", "Memory errors"),
clEnumValN(opts::ThreadSanitizer, "thread",
"race detection")));
"Race detection")));
static cl::opt<bool> disableLoopUnrolling(
"disable-loop-unrolling",