]> granicus.if.org Git - clang/commitdiff
Driver: Update -O -> -O2 replacement for addition of -O0 option.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 27 May 2010 06:51:08 +0000 (06:51 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 27 May 2010 06:51:08 +0000 (06:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104823 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index ab00f96a83dc6a0e8a47868e3cfef6d87da1f9be..918f0d9715e73c2e6717a8f2cbb0e39beef5c42a 100644 (file)
@@ -1046,7 +1046,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
     if (A->getOption().matches(options::OPT_O4))
       CmdArgs.push_back("-O3");
-    else if (A->getValue(Args)[0] == '\0')
+    else if (A->getOption().matches(options::OPT_O) &&
+             A->getValue(Args)[0] == '\0')
       CmdArgs.push_back("-O2");
     else
       A->render(Args, CmdArgs);