[cfe-commits] r129153 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Tools.cpp

Evan Cheng evan.cheng at apple.com
Fri Apr 8 14:37:45 PDT 2011


Author: evancheng
Date: Fri Apr  8 16:37:45 2011
New Revision: 129153

URL: http://llvm.org/viewvc/llvm-project?rev=129153&view=rev
Log:
Rename -mtrap_function= to -ftrap_function= since it's now a target neutral options.

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=129153&r1=129152&r2=129153&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Fri Apr  8 16:37:45 2011
@@ -435,6 +435,8 @@
 def ftime_report : Flag<"-ftime-report">, Group<f_Group>;
 def ftrapv : Flag<"-ftrapv">, Group<f_Group>;
 def ftrapv_handler_EQ : Joined<"-ftrapv-handler=">, Group<f_Group>;
+def ftrap_function_EQ : Joined<"-ftrap-function=">, Group<f_Group>,
+  HelpText<"Issue call to specified function rather than a trap instruction">;
 def funit_at_a_time : Flag<"-funit-at-a-time">, Group<f_Group>;
 def funroll_loops : Flag<"-funroll-loops">, Group<f_Group>;
 def funsigned_bitfields : Flag<"-funsigned-bitfields">, Group<f_Group>;
@@ -542,8 +544,6 @@
 def maes : Flag<"-maes">, Group<m_x86_Features_Group>;
 def mavx : Flag<"-mavx">, Group<m_x86_Features_Group>;
 def mthumb : Flag<"-mthumb">, Group<m_Group>;
-def mtrap_function_EQ : Joined<"-mtrap-function=">, Group<m_Group>,
-  HelpText<"Issue call to specified function rather than a trap instruction">;
 def mtune_EQ : Joined<"-mtune=">, Group<m_Group>;
 def multi__module : Flag<"-multi_module">;
 def multiply__defined__unused : Separate<"-multiply_defined_unused">;

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=129153&r1=129152&r2=129153&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Apr  8 16:37:45 2011
@@ -605,17 +605,6 @@
     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 @@
     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,





More information about the cfe-commits mailing list