mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-05 12:51:16 +00:00
Frontend: Define __EXCEPTIONS if -fexceptions is passed
GCC defines __EXCEPTIONS, regardless of language mode, if -fexceptions is passed. We should do the same. This fixes PR21358. llvm-svn: 220714
This commit is contained in:
parent
7ccebec668
commit
8ef921a48b
@ -550,7 +550,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
||||
Builder.defineMacro("__BLOCKS__");
|
||||
}
|
||||
|
||||
if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions)
|
||||
if (!LangOpts.MSVCCompat && LangOpts.Exceptions)
|
||||
Builder.defineMacro("__EXCEPTIONS");
|
||||
if (!LangOpts.MSVCCompat && LangOpts.RTTI)
|
||||
Builder.defineMacro("__GXX_RTTI");
|
||||
|
@ -1,6 +1,9 @@
|
||||
// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -verify %s
|
||||
// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -DMS_MODE -verify %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
#if defined(__EXCEPTIONS)
|
||||
// RUN: %clang_cc1 -fms-compatibility -fexceptions -verify %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
#if defined(MS_MODE) && defined(__EXCEPTIONS)
|
||||
#error __EXCEPTIONS should not be defined.
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
// RUN: %clang_cc1 -x objective-c -fobjc-exceptions -fexceptions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-NOCXX %s
|
||||
// CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
|
||||
// CHECK-OBJC-NOCXX-NOT: #define __EXCEPTIONS 1
|
||||
// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1
|
||||
|
||||
// RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-exceptions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s
|
||||
// CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
|
||||
|
Loading…
Reference in New Issue
Block a user