From 258e4f6e4c2ae0877a41438b2cabaccb5a262c05 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 18 Sep 2018 21:12:39 +0000 Subject: [PATCH] Driver: hoist `-mlimit-float-precision` (NFC) 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index ef9fb8c..7b71bc8 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -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); -- 2.7.4