From: Saleem Abdulrasool Date: Tue, 18 Sep 2018 21:12:39 +0000 (+0000) Subject: Driver: hoist `-mlimit-float-precision` (NFC) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51fd40c31f7573cb6fd3e9169528e25076bc3b15;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342512 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index ef9fb8cffe..7b71bc8e38 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/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);