From: Reid Kleckner Date: Wed, 8 May 2019 22:01:20 +0000 (+0000) Subject: Revert Include corecrt.h in stddef.h and vcruntime.h in stdarg.h to improve MS compat... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1dec30c3f9f1a20ba4ae7bf577e7cdae683f28c3;p=clang Revert Include corecrt.h in stddef.h and vcruntime.h in stdarg.h to improve MS compatibility. This reverts r360271 (git commit a0933bd8ec1515167ea653f7ee788b8bbde27d51) There are concerns on the review that this breaks EFI builds and that the transitive includes (sal.h) are actually heavy enough that we might care. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360291 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/stdarg.h b/lib/Headers/stdarg.h index 97b3c082ec..0bc39408c1 100644 --- a/lib/Headers/stdarg.h +++ b/lib/Headers/stdarg.h @@ -10,11 +10,6 @@ #ifndef __STDARG_H #define __STDARG_H -#if defined(_MSC_VER) -/* Include otherwise unneeded header for MSVC compatibility. */ -#include -#endif - #ifndef _VA_LIST typedef __builtin_va_list va_list; #define _VA_LIST diff --git a/lib/Headers/stddef.h b/lib/Headers/stddef.h index 860c909eff..15acd4427c 100644 --- a/lib/Headers/stddef.h +++ b/lib/Headers/stddef.h @@ -18,12 +18,6 @@ #if !__has_feature(modules) #define __STDDEF_H #endif - -#if defined(_MSC_VER) -/* Include otherwise unneeded header for MSVC compatibility. */ -#include -#endif - #define __need_ptrdiff_t #define __need_size_t #define __need_wchar_t diff --git a/test/Headers/Inputs/include/cmath b/test/Headers/Inputs/include/cmath deleted file mode 100644 index 4ba1795137..0000000000 --- a/test/Headers/Inputs/include/cmath +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -double sqrt(double); -double pow(double, double); -double modf(double, double*); diff --git a/test/Headers/Inputs/include/complex.h b/test/Headers/Inputs/include/complex.h deleted file mode 100644 index 1ed5f53092..0000000000 --- a/test/Headers/Inputs/include/complex.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#define complex _Complex diff --git a/test/Headers/Inputs/include/limits b/test/Headers/Inputs/include/limits deleted file mode 100644 index fbee11ef11..0000000000 --- a/test/Headers/Inputs/include/limits +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -namespace std -{ -struct __numeric_limits_base - {}; -template - struct numeric_limits : public __numeric_limits_base - {}; -} diff --git a/test/Headers/Inputs/include/math.h b/test/Headers/Inputs/include/math.h deleted file mode 100644 index 4ba1795137..0000000000 --- a/test/Headers/Inputs/include/math.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -double sqrt(double); -double pow(double, double); -double modf(double, double*); diff --git a/test/Headers/Inputs/include/setjmp.h b/test/Headers/Inputs/include/setjmp.h deleted file mode 100644 index 3d5e903eff..0000000000 --- a/test/Headers/Inputs/include/setjmp.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SETJMP_H -#define SETJMP_H - -typedef struct { - int x[42]; -} jmp_buf; - -#endif diff --git a/test/Headers/Inputs/include/stdint.h b/test/Headers/Inputs/include/stdint.h deleted file mode 100644 index 5bf26a7b67..0000000000 --- a/test/Headers/Inputs/include/stdint.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef STDINT_H -#define STDINT_H - -#ifdef __INT32_TYPE__ -typedef unsigned __INT32_TYPE__ uint32_t; -#endif - -#ifdef __INT64_TYPE__ -typedef unsigned __INT64_TYPE__ uint64_t; -#endif - -#ifdef __INTPTR_TYPE__ -typedef __INTPTR_TYPE__ intptr_t; -typedef unsigned __INTPTR_TYPE__ uintptr_t; -#else -#error Every target should have __INTPTR_TYPE__ -#endif - -#endif /* STDINT_H */ diff --git a/test/Headers/Inputs/include/stdlib.h b/test/Headers/Inputs/include/stdlib.h deleted file mode 100644 index 296b6239f6..0000000000 --- a/test/Headers/Inputs/include/stdlib.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -typedef __SIZE_TYPE__ size_t; diff --git a/test/Headers/Inputs/ms-crt/corecrt.h b/test/Headers/Inputs/ms-crt/corecrt.h deleted file mode 100644 index 6f70f09bee..0000000000 --- a/test/Headers/Inputs/ms-crt/corecrt.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/test/Headers/Inputs/ms-crt/vcruntime.h b/test/Headers/Inputs/ms-crt/vcruntime.h deleted file mode 100644 index 6f70f09bee..0000000000 --- a/test/Headers/Inputs/ms-crt/vcruntime.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/test/Headers/Inputs/usr/include/float.h b/test/Headers/Inputs/usr/include/float.h deleted file mode 100644 index 9dab891b97..0000000000 --- a/test/Headers/Inputs/usr/include/float.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SYSFLOAT_H -#define SYSFLOAT_H - -#define FLT_HAS_SUBNORM 1 - -#endif /* SYSFLOAT_H */ diff --git a/test/Headers/Inputs/usr/include/math.h b/test/Headers/Inputs/usr/include/math.h deleted file mode 100644 index 4171d4febc..0000000000 --- a/test/Headers/Inputs/usr/include/math.h +++ /dev/null @@ -1 +0,0 @@ -// math.h diff --git a/test/Headers/Inputs/usr/include/tgmath.h b/test/Headers/Inputs/usr/include/tgmath.h deleted file mode 100644 index 897962d9e1..0000000000 --- a/test/Headers/Inputs/usr/include/tgmath.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef SYS_TGMATH_H -#define SYS_TGMATH_H - -#endif /* SYS_TGMATH_H */ diff --git a/test/Headers/c11.c b/test/Headers/c11.c index e5e8ae425f..6594823c27 100644 --- a/test/Headers/c11.c +++ b/test/Headers/c11.c @@ -2,8 +2,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 %s // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -fmodules -fmodules-cache-path=%t %s -D__STDC_WANT_LIB_EXT1__=1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s -// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -triple i686-pc-win32 \ -// RUN: -fms-compatibility-version=17.00 -isystem %S/Inputs/ms-crt %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -triple i686-pc-win32 -fms-compatibility-version=17.00 %s noreturn int f(); // expected-error 1+{{}} diff --git a/test/Headers/ms-additional-includes.cpp b/test/Headers/ms-additional-includes.cpp deleted file mode 100644 index 3c6506a5a5..0000000000 --- a/test/Headers/ms-additional-includes.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %clang_cc1 -fsyntax-only --show-includes -triple i686-pc-win32 \ -// RUN: -isystem %S/Inputs/ms-crt -fms-compatibility-version=17.00 %s \ -// RUN: | FileCheck %s - -#include -// CHECK: including file:{{.*}}stddef.h -// CHECK: including file:{{.*}}corecrt.h -#include -// CHECK: including file:{{.*}}stdarg.h -// CHECK: including file:{{.*}}vcruntime.h diff --git a/test/Headers/ms-null-ms-header-vs-stddef.cpp b/test/Headers/ms-null-ms-header-vs-stddef.cpp index bd81b6287b..f39a0cafaa 100644 --- a/test/Headers/ms-null-ms-header-vs-stddef.cpp +++ b/test/Headers/ms-null-ms-header-vs-stddef.cpp @@ -1,5 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -fms-compatibility \ -// RUN: -isystem %S/Inputs/ms-crt -fms-compatibility-version=17.00 %s +// RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -fms-compatibility -fms-compatibility-version=17.00 %s // RUN: %clang_cc1 -fsyntax-only -triple i386-mingw32 %s // Something in MSVC's headers (pulled in e.g. by ) defines __null