From dad991900bf507d573fb0a305be66d1ceec72c46 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 29 Apr 2009 23:46:43 +0000 Subject: [PATCH] Error out with bad optimization level specified. llvm-svn: 70449 --- llvm/tools/llc/llc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp index bb49d32a4ac4..439c22f9d852 100644 --- a/llvm/tools/llc/llc.cpp +++ b/llvm/tools/llc/llc.cpp @@ -58,7 +58,7 @@ static cl::opt Force("f", cl::desc("Overwrite output files")); // Determine optimization level. Level -O0 is equivalent to "fast" code gen. static cl::opt OptLevel("O", - cl::desc("Optimization level. Similar to llvm-gcc -O."), + cl::desc("Optimization level. [-O0, -O1, -O2, -Os, or -O3]"), cl::Prefix, cl::ZeroOrMore, cl::init(' ')); @@ -257,6 +257,8 @@ int main(int argc, char **argv) { switch (OptLevel) { default: + std::cerr << argv[0] << ": invalid optimization level.\n"; + return 1; case ' ': break; case '0': OLvl = CodeGenOpt::None; break; case '1': OLvl = CodeGenOpt::One; break;