[cfe-commits] r83209 - /cfe/trunk/lib/Driver/Tools.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Oct 1 13:30:46 PDT 2009
Author: fjahanian
Date: Thu Oct 1 15:30:46 2009
New Revision: 83209
URL: http://llvm.org/viewvc/llvm-project?rev=83209&view=rev
Log:
Set __EXCEPTIONS by checking on darwin's triple.
Patch by Rafael Espindola.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=83209&r1=83208&r2=83209&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Oct 1 15:30:46 2009
@@ -472,7 +472,8 @@
}
}
-static bool needsExceptions(const ArgList &Args, types::ID InputType) {
+static bool needsExceptions(const ArgList &Args, types::ID InputType,
+ const llvm::Triple &Triple) {
if (Arg *A = Args.getLastArg(options::OPT_fexceptions,
options::OPT_fno_exceptions)) {
if (A->getOption().matches(options::OPT_fexceptions))
@@ -486,12 +487,16 @@
case types::TY_ObjCXX: case types::TY_ObjCXXHeader:
case types::TY_PP_ObjCXX: case types::TY_PP_ObjCXXHeader:
return true;
+
case types::TY_ObjC: case types::TY_ObjCHeader:
case types::TY_PP_ObjC: case types::TY_PP_ObjCHeader:
if (Args.hasArg(options::OPT_fobjc_nonfragile_abi))
return true;
- else
+ if (Triple.getOS() != llvm::Triple::Darwin)
return false;
+ return (Triple.getDarwinMajorNumber() >= 9 &&
+ Triple.getArch() == llvm::Triple::x86_64);
+
default:
return false;
}
@@ -833,7 +838,7 @@
CmdArgs.push_back("-fblocks=0");
}
- if (needsExceptions(Args, InputType))
+ if (needsExceptions(Args, InputType, getToolChain().getTriple()))
CmdArgs.push_back("-fexceptions");
else
CmdArgs.push_back("-fexceptions=0");
More information about the cfe-commits
mailing list