Move the "needs exception support" logic to clang. This also fixes

-fno-exceptions in C++ code. We used to always define __EXCEPTIONS in
C++.

llvm-svn: 83199
This commit is contained in:
Rafael Espindola
2009-10-01 13:33:33 +00:00
parent 4fb2891396
commit 00a665751d
2 changed files with 32 additions and 11 deletions

View File

@@ -274,7 +274,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
if (LangOpts.ObjCNonFragileABI) {
DefineBuiltinMacro(Buf, "__OBJC2__=1");
DefineBuiltinMacro(Buf, "OBJC_ZEROCOST_EXCEPTIONS=1");
DefineBuiltinMacro(Buf, "__EXCEPTIONS=1");
}
if (LangOpts.getGCMode() != LangOptions::NonGC)
@@ -299,9 +298,11 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
DefineBuiltinMacro(Buf, "__BLOCKS__=1");
}
if (LangOpts.Exceptions)
DefineBuiltinMacro(Buf, "__EXCEPTIONS=1");
if (LangOpts.CPlusPlus) {
DefineBuiltinMacro(Buf, "__DEPRECATED=1");
DefineBuiltinMacro(Buf, "__EXCEPTIONS=1");
DefineBuiltinMacro(Buf, "__GNUG__=4");
DefineBuiltinMacro(Buf, "__GXX_WEAK__=1");
if (LangOpts.GNUMode)