From 158332c08886fdd0e7a7f0750d605f3f52cc1b8c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 4 Jun 2020 10:50:29 -0700 Subject: [PATCH] runtime: remove `llvm/DataTypes.h`, `llvm-c/DataTypes.h` Inline the standard headers that they included and remove the extra include path. --- include/swift/Remote/MetadataReader.h | 2 + stdlib/include/llvm-c/DataTypes.h | 84 ------------------- stdlib/include/llvm/ADT/Hashing.h | 2 +- stdlib/include/llvm/Support/Atomic.h | 2 +- stdlib/include/llvm/Support/DataTypes.h | 16 ---- .../llvm/Support/PointerLikeTypeTraits.h | 2 +- stdlib/public/runtime/Demangle.cpp | 1 + stdlib/public/runtime/Exclusivity.cpp | 1 + stdlib/public/runtime/SwiftObject.mm | 1 + 9 files changed, 8 insertions(+), 103 deletions(-) delete mode 100644 stdlib/include/llvm-c/DataTypes.h delete mode 100644 stdlib/include/llvm/Support/DataTypes.h diff --git a/include/swift/Remote/MetadataReader.h b/include/swift/Remote/MetadataReader.h index 1f091dfd66065..963bcf6386691 100644 --- a/include/swift/Remote/MetadataReader.h +++ b/include/swift/Remote/MetadataReader.h @@ -33,6 +33,8 @@ #include #include +#include + namespace swift { namespace remote { diff --git a/stdlib/include/llvm-c/DataTypes.h b/stdlib/include/llvm-c/DataTypes.h deleted file mode 100644 index 0f27ba81865e0..0000000000000 --- a/stdlib/include/llvm-c/DataTypes.h +++ /dev/null @@ -1,84 +0,0 @@ -/*===-- include/llvm-c/DataTypes.h - Define fixed size types ------*- C -*-===*\ -|* *| -|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| -|* Exceptions. *| -|* See https://llvm.org/LICENSE.txt for license information. *| -|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* This file contains definitions to figure out the size of _HOST_ data types.*| -|* This file is important because different host OS's define different macros,*| -|* which makes portability tough. This file exports the following *| -|* definitions: *| -|* *| -|* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*| -|* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *| -|* *| -|* No library is required when using these functions. *| -|* *| -|*===----------------------------------------------------------------------===*/ - -/* Please leave this file C-compatible. */ - -#ifndef LLVM_C_DATATYPES_H -#define LLVM_C_DATATYPES_H - -#include -#include - -#ifndef _MSC_VER - -#if !defined(UINT32_MAX) -# error "The standard header is not C++11 compliant. Must #define "\ - "__STDC_LIMIT_MACROS before #including llvm-c/DataTypes.h" -#endif - -#if !defined(UINT32_C) -# error "The standard header is not C++11 compliant. Must #define "\ - "__STDC_CONSTANT_MACROS before #including llvm-c/DataTypes.h" -#endif - -/* Note that includes , if this is a C99 system. */ -#include - -#ifdef _AIX -// GCC is strict about defining large constants: they must have LL modifier. -#undef INT64_MAX -#undef INT64_MIN -#endif - -#else /* _MSC_VER */ -#ifdef __cplusplus -#include -#include -#else -#include -#include -#endif -#include - -#if defined(_WIN64) -typedef signed __int64 ssize_t; -#else -typedef signed int ssize_t; -#endif /* _WIN64 */ - -#endif /* _MSC_VER */ - -/* Set defaults for constants which we cannot find. */ -#if !defined(INT64_MAX) -# define INT64_MAX 9223372036854775807LL -#endif -#if !defined(INT64_MIN) -# define INT64_MIN ((-INT64_MAX)-1) -#endif -#if !defined(UINT64_MAX) -# define UINT64_MAX 0xffffffffffffffffULL -#endif - -#ifndef HUGE_VALF -#define HUGE_VALF (float)HUGE_VAL -#endif - -#endif /* LLVM_C_DATATYPES_H */ diff --git a/stdlib/include/llvm/ADT/Hashing.h b/stdlib/include/llvm/ADT/Hashing.h index 3cc288bc73b91..7418fd0161bc7 100644 --- a/stdlib/include/llvm/ADT/Hashing.h +++ b/stdlib/include/llvm/ADT/Hashing.h @@ -44,13 +44,13 @@ #ifndef LLVM_ADT_HASHING_H #define LLVM_ADT_HASHING_H -#include "llvm/Support/DataTypes.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/SwapByteOrder.h" #include "llvm/Support/type_traits.h" #include #include #include +#include #include #include diff --git a/stdlib/include/llvm/Support/Atomic.h b/stdlib/include/llvm/Support/Atomic.h index 1c531931c7495..cee4b4d254f0e 100644 --- a/stdlib/include/llvm/Support/Atomic.h +++ b/stdlib/include/llvm/Support/Atomic.h @@ -17,7 +17,7 @@ #ifndef LLVM_SUPPORT_ATOMIC_H #define LLVM_SUPPORT_ATOMIC_H -#include "llvm/Support/DataTypes.h" +#include // Windows will at times define MemoryFence. #ifdef MemoryFence diff --git a/stdlib/include/llvm/Support/DataTypes.h b/stdlib/include/llvm/Support/DataTypes.h deleted file mode 100644 index a3fcc82531b71..0000000000000 --- a/stdlib/include/llvm/Support/DataTypes.h +++ /dev/null @@ -1,16 +0,0 @@ -//===-- llvm/Support/DataTypes.h - Define fixed size types ------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// Due to layering constraints (Support depends on llvm-c) this is a thin -// wrapper around the implementation that lives in llvm-c, though most clients -// can/should think of this as being provided by Support for simplicity (not -// many clients are aware of their dependency on llvm-c). -// -//===----------------------------------------------------------------------===// - -#include "llvm-c/DataTypes.h" diff --git a/stdlib/include/llvm/Support/PointerLikeTypeTraits.h b/stdlib/include/llvm/Support/PointerLikeTypeTraits.h index e6683ab0fc27c..e1ca42dc6fcd5 100644 --- a/stdlib/include/llvm/Support/PointerLikeTypeTraits.h +++ b/stdlib/include/llvm/Support/PointerLikeTypeTraits.h @@ -14,8 +14,8 @@ #ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H #define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H -#include "llvm/Support/DataTypes.h" #include +#include #include inline namespace __swift { inline namespace __runtime { diff --git a/stdlib/public/runtime/Demangle.cpp b/stdlib/public/runtime/Demangle.cpp index 0e820890d5882..f5bf92357f35b 100644 --- a/stdlib/public/runtime/Demangle.cpp +++ b/stdlib/public/runtime/Demangle.cpp @@ -19,6 +19,7 @@ #include "swift/Strings.h" #include +#include #if SWIFT_OBJC_INTEROP #include diff --git a/stdlib/public/runtime/Exclusivity.cpp b/stdlib/public/runtime/Exclusivity.cpp index aa6993d29284f..4d8d0d23eea7b 100644 --- a/stdlib/public/runtime/Exclusivity.cpp +++ b/stdlib/public/runtime/Exclusivity.cpp @@ -30,6 +30,7 @@ #include "swift/Runtime/Debug.h" #include "swift/Runtime/Metadata.h" #include +#include #include // Pick a return-address strategy diff --git a/stdlib/public/runtime/SwiftObject.mm b/stdlib/public/runtime/SwiftObject.mm index 09cd6c312b3b2..af7489d33cb11 100644 --- a/stdlib/public/runtime/SwiftObject.mm +++ b/stdlib/public/runtime/SwiftObject.mm @@ -43,6 +43,7 @@ #if SWIFT_OBJC_INTEROP #include #endif +#include #include #include #include