]> granicus.if.org Git - clang/commitdiff
[Mips] Follow-up to r179481. Reduce code duplication. Use
authorSimon Atanasyan <simon@atanasyan.com>
Sun, 14 Apr 2013 14:07:36 +0000 (14:07 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Sun, 14 Apr 2013 14:07:36 +0000 (14:07 +0000)
AddTargetFeature() routine to handle -msingle-float / -mdouble-float
options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179487 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index c144a588ac36e9c30fe3e1681ece3d94a446d99b..6068d45bd82d70ef48401d1f19b0080634d1720f 100644 (file)
@@ -984,16 +984,9 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args,
     CmdArgs.push_back("hard");
   }
 
-  if (Arg *A = Args.getLastArg(options::OPT_msingle_float,
-                               options::OPT_mdouble_float)) {
-    if (A->getOption().matches(options::OPT_msingle_float)) {
-      // Restrict the use of hardware floating-point
-      // instructions to 32-bit operations.
-      CmdArgs.push_back("-target-feature");
-      CmdArgs.push_back("+single-float");
-    }
-  }
-
+  AddTargetFeature(Args, CmdArgs,
+                   options::OPT_msingle_float, options::OPT_mdouble_float,
+                   "single-float");
   AddTargetFeature(Args, CmdArgs,
                    options::OPT_mips16, options::OPT_mno_mips16,
                    "mips16");