aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-05-13 17:25:04 -0700
committerFangrui Song <maskray@google.com>2020-05-18 15:53:41 -0700
commit82904401e3278c3f3a54481d6cd06cc43b801e3b (patch)
tree4f273ed2daea85ce7cd83febb6ff6956a4d7e316 /clang/lib/Frontend/CompilerInvocation.cpp
parent682e739638a9c569d4c5c358ab75365175a95efc (diff)
downloadllvm-82904401e3278c3f3a54481d6cd06cc43b801e3b.zip
llvm-82904401e3278c3f3a54481d6cd06cc43b801e3b.tar.gz
llvm-82904401e3278c3f3a54481d6cd06cc43b801e3b.tar.bz2
Map -O to -O1 instead of -O2
rL82131 changed -O from -O1 to -O2, because -O1 was not different from -O2 at that time. GCC treats -O as -O1 and there is now work to make -O1 meaningful. We can change -O back to -O1 again. Reviewed By: echristo, dexonsmith, arphaman Differential Revision: https://reviews.llvm.org/D79916
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 2ce71a9..a30cb2a 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -137,7 +137,7 @@ static unsigned getOptimizationLevel(ArgList &Args, InputKind IK,
assert(A->getOption().matches(options::OPT_O));
StringRef S(A->getValue());
- if (S == "s" || S == "z" || S.empty())
+ if (S == "s" || S == "z")
return llvm::CodeGenOpt::Default;
if (S == "g")