diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2009-10-01 13:33:33 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2009-10-01 13:33:33 +0000 |
| commit | 00a665751d0fc185b8470cd300f3f9d830575ccf (patch) | |
| tree | addd97f3d0a61772e75c7d7155b6bb3a52cbc28b /clang/lib/Frontend | |
| parent | 4fb2891396da90f040ce12cd2a4680df5c1d57c5 (diff) | |
| download | bcm5719-llvm-00a665751d0fc185b8470cd300f3f9d830575ccf.tar.gz bcm5719-llvm-00a665751d0fc185b8470cd300f3f9d830575ccf.zip | |
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
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 6c8a8c19012..0f3b4b8236b 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -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) |

