forked from OSchip/llvm-project
Avoid definining more GCC specific predefined macros in clang-cl
Reviewers: hansw, rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4419 llvm-svn: 212753
This commit is contained in:
parent
cceed090d2
commit
f3a896bd22
|
@ -481,7 +481,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
|||
if (!LangOpts.GNUMode && !LangOpts.MSVCCompat)
|
||||
Builder.defineMacro("__STRICT_ANSI__");
|
||||
|
||||
if (LangOpts.CPlusPlus11)
|
||||
if (!LangOpts.MSVCCompat && LangOpts.CPlusPlus11)
|
||||
Builder.defineMacro("__GXX_EXPERIMENTAL_CXX0X__");
|
||||
|
||||
if (LangOpts.ObjC1) {
|
||||
|
@ -541,7 +541,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
|||
|
||||
if (!LangOpts.MSVCCompat && LangOpts.CXXExceptions)
|
||||
Builder.defineMacro("__EXCEPTIONS");
|
||||
if (LangOpts.RTTI)
|
||||
if (!LangOpts.MSVCCompat && LangOpts.RTTI)
|
||||
Builder.defineMacro("__GXX_RTTI");
|
||||
if (LangOpts.SjLjExceptions)
|
||||
Builder.defineMacro("__USING_SJLJ_EXCEPTIONS__");
|
||||
|
@ -549,7 +549,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
|||
if (LangOpts.Deprecated)
|
||||
Builder.defineMacro("__DEPRECATED");
|
||||
|
||||
if (LangOpts.CPlusPlus) {
|
||||
if (!LangOpts.MSVCCompat && LangOpts.CPlusPlus) {
|
||||
Builder.defineMacro("__GNUG__", "4");
|
||||
Builder.defineMacro("__GXX_WEAK__");
|
||||
Builder.defineMacro("__private_extern__", "extern");
|
||||
|
@ -746,6 +746,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
|||
else
|
||||
Builder.defineMacro("__FINITE_MATH_ONLY__", "0");
|
||||
|
||||
if (!LangOpts.MSVCCompat) {
|
||||
if (LangOpts.GNUInline)
|
||||
Builder.defineMacro("__GNUC_GNU_INLINE__");
|
||||
else
|
||||
|
@ -776,6 +777,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
|||
TI.getPointerAlign(0),
|
||||
InlineWidthBits));
|
||||
#undef DEFINE_LOCK_FREE_MACRO
|
||||
}
|
||||
|
||||
if (LangOpts.NoInlineDefine)
|
||||
Builder.defineMacro("__NO_INLINE__");
|
||||
|
|
|
@ -8,8 +8,23 @@
|
|||
// CHECK-MS: #define _M_IX86 600
|
||||
// CHECK-MS: #define _M_IX86_FP
|
||||
// CHECK-MS: #define _WIN32 1
|
||||
// CHECK-MS-NOT: #define __GNUC__
|
||||
// CHECK-MS-NOT: #define __STRICT_ANSI__
|
||||
// CHECK-MS-NOT: GCC
|
||||
// CHECK-MS-NOT: GNU
|
||||
// CHECK-MS-NOT: GXX
|
||||
//
|
||||
// RUN: %clang_cc1 %s -E -dM -triple x86_64-pc-win32 -fms-extensions -fms-compatibility \
|
||||
// RUN: -fmsc-version=1300 -o - | FileCheck %s --check-prefix=CHECK-MS64
|
||||
// CHECK-MS64: #define _INTEGRAL_MAX_BITS 64
|
||||
// CHECK-MS64: #define _MSC_EXTENSIONS 1
|
||||
// CHECK-MS64: #define _MSC_VER 1300
|
||||
// CHECK-MS64: #define _M_AMD64 1
|
||||
// CHECK-MS64: #define _M_X64 1
|
||||
// CHECK-MS64: #define _WIN64 1
|
||||
// CHECK-MS64-NOT: #define __STRICT_ANSI__
|
||||
// CHECK-MS64-NOT: GCC
|
||||
// CHECK-MS64-NOT: GNU
|
||||
// CHECK-MS64-NOT: GXX
|
||||
//
|
||||
// RUN: %clang_cc1 %s -E -dM -triple i686-pc-win32 -fms-compatibility \
|
||||
// RUN: -o - | FileCheck %s --check-prefix=CHECK-MS-STDINT
|
||||
|
|
Loading…
Reference in New Issue