summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre@debian.org>2013-11-11 20:51:44 +0000
committerSylvestre Ledru <sylvestre@debian.org>2013-11-11 20:51:44 +0000
commite293b1a8d8e0ca5c24117655b2191c4e46afba57 (patch)
treef3217c85225e00524519a1aa126222ebd97c51dd /clang/lib/Frontend/CompilerInvocation.cpp
parentcc645758c71dc20c223e1464c4d1e8def4c64679 (diff)
downloadbcm5719-llvm-e293b1a8d8e0ca5c24117655b2191c4e46afba57.tar.gz
bcm5719-llvm-e293b1a8d8e0ca5c24117655b2191c4e46afba57.zip
Revert "Using an invalid -O falls back on -O3 instead of an error"
This reverts commit r194403. Was breaking too many tests... llvm-svn: 194420
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index d02e4a3e987..98745aca682 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -299,14 +299,14 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
using namespace options;
bool Success = true;
- Opts.OptimizationLevel = getOptimizationLevel(Args, IK, Diags);
- unsigned MaxOptLevel = 3;
- if (Opts.OptimizationLevel > MaxOptLevel) {
- // If the optimization level is not supported, fall back on the default optimization
- Diags.Report(diag::warn_drv_invalid_value)
- << Args.getLastArg(OPT_O)->getAsString(Args) << "-O" << MaxOptLevel;
- Opts.OptimizationLevel = MaxOptLevel;
+ unsigned OptLevel = getOptimizationLevel(Args, IK, Diags);
+ if (OptLevel > 3) {
+ Diags.Report(diag::err_drv_invalid_value)
+ << Args.getLastArg(OPT_O)->getAsString(Args) << OptLevel;
+ OptLevel = 3;
+ Success = false;
}
+ Opts.OptimizationLevel = OptLevel;
// We must always run at least the always inlining pass.
Opts.setInlining(
OpenPOWER on IntegriCloud