mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Runtime: Start splitting out stubs only needed by the standard library.
Set up a separate libSwiftStubs.a archive for C++ stub functionality that's needed by the standard library but not part of the core runtime interface. Seed it with the Stubs.cpp and LibcShims.cpp files, which consist only of stubs, though a few stubs are still strewn across the runtime code base.
This commit is contained in:
@@ -3,6 +3,7 @@ if(SWIFT_BUILD_STDLIB)
|
||||
# exist at the time we look for them in add_swift_*.
|
||||
add_subdirectory(SwiftShims)
|
||||
add_subdirectory(runtime)
|
||||
add_subdirectory(stubs)
|
||||
add_subdirectory(core)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ set(swift_core_framework_depends)
|
||||
set(swift_core_private_link_libraries)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
list(APPEND swift_core_link_flags "-all_load")
|
||||
list(APPEND swift_core_private_link_libraries swiftRuntime)
|
||||
list(APPEND swift_core_private_link_libraries swiftRuntime swiftStdlibStubs)
|
||||
list(APPEND swift_core_framework_depends Foundation)
|
||||
list(APPEND swift_core_framework_depends CoreFoundation)
|
||||
else()
|
||||
@@ -152,7 +152,7 @@ else()
|
||||
# effort has been completed.
|
||||
#set(LINK_FLAGS
|
||||
# -Wl,--whole-archive swiftRuntime -Wl,--no-whole-archive)
|
||||
list(APPEND swift_core_private_link_libraries swiftRuntime)
|
||||
list(APPEND swift_core_private_link_libraries swiftRuntime swiftStdlibStubs)
|
||||
find_package(ICU REQUIRED COMPONENTS uc i18n)
|
||||
find_package(BSD REQUIRED)
|
||||
list(APPEND swift_core_private_link_libraries
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
|
||||
@@ -66,11 +66,9 @@ add_swift_library(swiftRuntime IS_STDLIB IS_STDLIB_CORE
|
||||
Heap.cpp
|
||||
HeapObject.cpp
|
||||
KnownMetadata.cpp
|
||||
LibcShims.cpp
|
||||
Metadata.cpp
|
||||
Once.cpp
|
||||
Reflection.cpp
|
||||
Stubs.cpp
|
||||
SwiftObject.cpp
|
||||
UnicodeExtendedGraphemeClusters.cpp.gyb
|
||||
${swift_runtime_objc_sources}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "swift/Runtime/HeapObject.h"
|
||||
#include "swift/Runtime/Metadata.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include "ErrorObject.h"
|
||||
#include "ExistentialMetadataImpl.h"
|
||||
#include "Private.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "swift/Basic/Fallthrough.h"
|
||||
#include "swift/Runtime/Metadata.h"
|
||||
#include "swift/Runtime/Enum.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include "Private.h"
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <stdio.h>
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include "ErrorObject.h"
|
||||
#include "Private.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include "ErrorObject.h"
|
||||
#include "Private.h"
|
||||
#include <dlfcn.h>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <stdarg.h>
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <asl.h>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "swift/Runtime/HeapObject.h"
|
||||
#include "swift/Runtime/Heap.h"
|
||||
#include "Private.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace swift;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
#include "MetadataCache.h"
|
||||
#include "Private.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "llvm/ADT/Hashing.h"
|
||||
#include "ErrorObject.h"
|
||||
#include "ExistentialMetadataImpl.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include "Private.h"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "swift/Runtime/Once.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include <type_traits>
|
||||
|
||||
using namespace swift;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "swift/Runtime/Metadata.h"
|
||||
#include "swift/Runtime/Enum.h"
|
||||
#include "swift/Basic/Demangle.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include "Private.h"
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "swift/Strings.h"
|
||||
#include "../SwiftShims/RuntimeShims.h"
|
||||
#include "Private.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
6
stdlib/public/stubs/CMakeLists.txt
Normal file
6
stdlib/public/stubs/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
add_swift_library(swiftStdlibStubs IS_STDLIB IS_STDLIB_CORE
|
||||
LibcShims.cpp
|
||||
Stubs.cpp
|
||||
INSTALL_IN_COMPONENT stdlib)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <xlocale.h>
|
||||
#include <limits>
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "Debug.h"
|
||||
#include "swift/Runtime/Debug.h"
|
||||
|
||||
static uint64_t uint64ToStringImpl(char *Buffer, uint64_t Value,
|
||||
int64_t Radix, bool Uppercase,
|
||||
Reference in New Issue
Block a user