[PATCH] Disable EHABI when -fno-exceptions option is chosen.

Renato Golin renato.golin at linaro.org
Fri Jan 31 04:38:00 PST 2014


  Simpler check (thanks Joey) and test.

Hi samsonov, rnk, keith.walker.arm,

http://llvm-reviews.chandlerc.com/D2666

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D2666?vs=6792&id=6794#toc

Files:
  lib/Driver/Tools.cpp
  test/Driver/arm-no-exception.c

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -830,6 +830,10 @@
       CmdArgs.push_back("-backend-option");
       CmdArgs.push_back("-arm-reserve-r9");
     }
+
+    // Exception handling
+    if (Args.hasArg(options::OPT_fno_exceptions))
+      CmdArgs.push_back("-arm-disable-ehabi");
 }
 
 // Get CPU and ABI names. They are not independent
Index: test/Driver/arm-no-exception.c
===================================================================
--- /dev/null
+++ test/Driver/arm-no-exception.c
@@ -0,0 +1,4 @@
+// RUN: %clang -target arm-none-gnueeabi -fno-exceptions -### %s 2> %t
+// RUN: FileCheck --check-prefix=CHECK-NOEH < %t %s
+
+// CHECK-NOEH: "-arm-disable-ehabi"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2666.2.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140131/722134ec/attachment.bin>


More information about the cfe-commits mailing list