]> granicus.if.org Git - clang/commitdiff
Simplify CompilerInvocation::toArgs, now that LangOptions handling is more predictable.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 17 Nov 2009 09:15:57 +0000 (09:15 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 17 Nov 2009 09:15:57 +0000 (09:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89074 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInvocation.cpp

index 3537bc58dabd81102132532adac668300409d0d6..ed6d0b71a51bee1532d61a2b0ef0a4748339ebd4 100644 (file)
@@ -377,8 +377,8 @@ static void LangOptsToArgs(const LangOptions &Opts,
   //   BCPLComment, C99, CPlusPlus0x, Digraphs, GNUInline, ImplicitInt, GNUMode
   if (Opts.DollarIdents)
     Res.push_back("-fdollars-in-identifiers");
-  Res.push_back("-fms-extensions");
-  Res.push_back(Opts.Microsoft ? "1" : "0");
+  if (Opts.Microsoft)
+    Res.push_back("-fms-extensions=1");
   if (Opts.ObjCNonFragileABI)
     Res.push_back("-fobjc-nonfragile-abi");
   // NoInline is implicit.
@@ -406,12 +406,12 @@ static void LangOptsToArgs(const LangOptions &Opts,
     llvm::llvm_report_error("FIXME: Not yet implemented!");
   if (Opts.POSIXThreads)
     Res.push_back("-pthread");
-  Res.push_back("-fblocks");
-  Res.push_back(Opts.Blocks ? "1" : "0");
+  if (Opts.Blocks)
+    Res.push_back("-fblocks=1");
   if (Opts.EmitAllDecls)
     Res.push_back("-femit-all-decls");
-  Res.push_back("-fmath-errno");
-  Res.push_back(Opts.MathErrno ? "1" : "0");
+  if (!Opts.MathErrno)
+    Res.push_back("-fmath-errno=0");
   if (Opts.OverflowChecking)
     Res.push_back("-ftrapv");
   if (Opts.HeinousExtensions)