From 82904401e3278c3f3a54481d6cd06cc43b801e3b Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 13 May 2020 17:25:04 -0700 Subject: 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 --- clang/lib/Frontend/CompilerInvocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') 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") -- cgit v1.1