From fee1add2ee677144cda2c809f9b3485b8e58c01b Mon Sep 17 00:00:00 2001
From: Daniel Dunbar <daniel@zuster.org>
Date: Thu, 9 Sep 2010 21:17:44 +0000
Subject: [PATCH] Driver: Mark function as nounwind when -mkernel or
 -fapple-kext is present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113541 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Driver/Tools.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 24d05c1b27b..2ad98ea632e 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1184,7 +1184,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back("-fno-access-control");
 
   // -fexceptions=0 is default.
-  if (needsExceptions(Args, InputType, getToolChain().getTriple()))
+  if (!KernelOrKext &&
+      needsExceptions(Args, InputType, getToolChain().getTriple()))
     CmdArgs.push_back("-fexceptions");
 
   if (getToolChain().UseSjLjExceptions())
-- 
GitLab