Driver: hoist `-mlimit-float-precision` (NFC)
authorSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 18 Sep 2018 21:12:39 +0000 (21:12 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 18 Sep 2018 21:12:39 +0000 (21:12 +0000)
Move the floating point argument handling into the RenderFloatingPointOptions
helper.  This relocation just puts the floating point related options into a
single location.

llvm-svn: 342512

clang/lib/Driver/ToolChains/Clang.cpp

index ef9fb8c..7b71bc8 100644 (file)
@@ -2085,6 +2085,11 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
   StringRef DenormalFPMath = "";
   StringRef FPContract = "";
 
+  if (const Arg *A = Args.getLastArg(options::OPT_flimited_precision_EQ)) {
+    CmdArgs.push_back("-mlimit-float-precision");
+    CmdArgs.push_back(A->getValue());
+  }
+
   for (const Arg *A : Args) {
     switch (A->getOption().getID()) {
     // If this isn't an FP option skip the claim below
@@ -3662,11 +3667,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   getToolChain().addClangTargetOptions(Args, CmdArgs,
                                        JA.getOffloadingDeviceKind());
 
-  if (Arg *A = Args.getLastArg(options::OPT_flimited_precision_EQ)) {
-    CmdArgs.push_back("-mlimit-float-precision");
-    CmdArgs.push_back(A->getValue());
-  }
-
   // FIXME: Handle -mtune=.
   (void)Args.hasArg(options::OPT_mtune_EQ);