From 04c9429f34f6d91c36d2482b4316946a1067009e Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 8 Apr 2011 21:37:45 +0000 Subject: [PATCH] Rename -mtrap_function= to -ftrap_function= since it's now a target neutral options. llvm-svn: 129153 --- clang/include/clang/Driver/Options.td | 4 ++-- clang/lib/Driver/Tools.cpp | 18 +++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 9eac83536be1..21492326e8d4 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -435,6 +435,8 @@ def fthreadsafe_statics : Flag<"-fthreadsafe-statics">, Group; def ftime_report : Flag<"-ftime-report">, Group; def ftrapv : Flag<"-ftrapv">, Group; def ftrapv_handler_EQ : Joined<"-ftrapv-handler=">, Group; +def ftrap_function_EQ : Joined<"-ftrap-function=">, Group, + HelpText<"Issue call to specified function rather than a trap instruction">; def funit_at_a_time : Flag<"-funit-at-a-time">, Group; def funroll_loops : Flag<"-funroll-loops">, Group; def funsigned_bitfields : Flag<"-funsigned-bitfields">, Group; @@ -542,8 +544,6 @@ def mssse3 : Flag<"-mssse3">, Group; def maes : Flag<"-maes">, Group; def mavx : Flag<"-mavx">, Group; def mthumb : Flag<"-mthumb">, Group; -def mtrap_function_EQ : Joined<"-mtrap-function=">, Group, - HelpText<"Issue call to specified function rather than a trap instruction">; def mtune_EQ : Joined<"-mtune=">, Group; def multi__module : Flag<"-multi_module">; def multiply__defined__unused : Separate<"-multiply_defined_unused">; diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 29f8f8356bf9..fa7896766d40 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -605,17 +605,6 @@ void Clang::AddARMTargetArgs(const ArgList &Args, CmdArgs.push_back("-neon"); } - // Forward -mtrap_function= options to the backend. - for (arg_iterator it = Args.filtered_begin(options::OPT_mtrap_function_EQ), - ie = Args.filtered_end(); it != ie; ++it) { - const Arg *A = *it; - A->claim(); - assert(A->getNumValues() == 1 && "-mtrap_function= expects one argument."); - llvm::StringRef FuncName = A->getValue(Args, 0); - CmdArgs.push_back("-backend-option"); - CmdArgs.push_back(Args.MakeArgString("-arm-trap-func=" + FuncName)); - } - // Kernel code has more strict alignment requirements. if (KernelOrKext) { CmdArgs.push_back("-backend-option"); @@ -1462,6 +1451,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(A->getValue(Args)); } + // Forward -ftrap_function= options to the backend. + if (Arg *A = Args.getLastArg(options::OPT_ftrap_function_EQ)) { + llvm::StringRef FuncName = A->getValue(Args); + CmdArgs.push_back("-backend-option"); + CmdArgs.push_back(Args.MakeArgString("-trap-func=" + FuncName)); + } + // -fno-strict-overflow implies -fwrapv if it isn't disabled, but // -fstrict-overflow won't turn off an explicitly enabled -fwrapv. if (Arg *A = Args.getLastArg(options::OPT_fwrapv,