Skip to content

Commit e93ca5d

Browse files
authored
---
yaml --- r: 340685 b: refs/heads/rxwei-patch-1 c: c4adb9b h: refs/heads/master i: 340683: 4994e19
1 parent 6d98901 commit e93ca5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2146
-280
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 9575a6e05c1d958a8021ec9fe91b89b24be0165b
1018+
refs/heads/rxwei-patch-1: c4adb9bd16661ef941629a23477fa8cabfd77868
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/cmake/modules/AddSwift.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,8 @@ function(_add_variant_link_flags)
463463
list(APPEND result "-Wl,-Bsymbolic")
464464
elseif("${LFLAGS_SDK}" STREQUAL "ANDROID")
465465
list(APPEND link_libraries "dl" "log" "atomic" "icudataswift" "icui18nswift" "icuucswift")
466-
# We provide our own C++ below, so we ask the linker not to do it. However,
467-
# we need to add the math library, which is linked implicitly by libc++.
468-
list(APPEND result "-nostdlib++" "-lm")
466+
# We need to add the math library, which is linked implicitly by libc++
467+
list(APPEND result "-lm")
469468
if("${LFLAGS_ARCH}" MATCHES armv7)
470469
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a")
471470
elseif("${LFLAGS_ARCH}" MATCHES aarch64)
@@ -1371,8 +1370,16 @@ function(_add_swift_library_single target name)
13711370
${SWIFTLIB_SINGLE_PRIVATE_LINK_LIBRARIES})
13721371
endif()
13731372

1374-
set_property(TARGET "${target}" PROPERTY
1373+
# NOTE(compnerd) use the C linker language to invoke `clang` rather than
1374+
# `clang++` as we explicitly link against the C++ runtime. We were previously
1375+
# actually passing `-nostdlib++` to avoid the C++ runtime linkage.
1376+
if(SWIFTLIB_SINGLE_SDK STREQUAL ANDROID)
1377+
set_property(TARGET "${target}" PROPERTY
1378+
LINKER_LANGUAGE "C")
1379+
else()
1380+
set_property(TARGET "${target}" PROPERTY
13751381
LINKER_LANGUAGE "CXX")
1382+
endif()
13761383

13771384
if(target_static)
13781385
set_property(TARGET "${target_static}" APPEND_STRING PROPERTY

branches/rxwei-patch-1/docs/WindowsBuild.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ cmake -G Ninja^
355355
-DFOUNDATION_BUILD_DIR=S:\b\foundation^
356356
-DLIBDISPATCH_BUILD_DIR=S:\b\libdispatch^
357357
-DLIBDISPATCH_SOURCE_DIR=S:\swift-corelibs-libdispatch^
358-
-DLLBUILD_PATH_TO_SQLITE_SOURCE=S:\sqlite-amalgamation-3270200^
359-
-DLLBUILD_PATH_TO_SQLITE_BUILD=S:\b\sqlite^
358+
-DSQLite3_INCLUDE_DIR=S:\sqlite-amalgamation-3270200^
359+
-DSQLite3_LIBRARY=S:\b\sqlite\sqlite3.lib^
360360
-DLLBUILD_SUPPORT_BINDINGS=Swift^
361361
S:\llbuild
362362
ninja

branches/rxwei-patch-1/include/swift/AST/PrintOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ struct PrintOptions {
494494
/// consistent and well-formed.
495495
///
496496
/// \see swift::emitParseableInterface
497-
static PrintOptions printParseableInterfaceFile();
497+
static PrintOptions printParseableInterfaceFile(bool preferTypeRepr);
498498

499499
static PrintOptions printModuleInterface();
500500
static PrintOptions printTypeInterface(Type T);

branches/rxwei-patch-1/include/swift/Frontend/ParseableInterfaceSupport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class ModuleDecl;
2727

2828
/// Options for controlling the generation of the .swiftinterface output.
2929
struct ParseableInterfaceOptions {
30+
/// Should we prefer printing TypeReprs when writing out types in a module
31+
/// interface, or should we fully-qualify them?
32+
bool PreserveTypesAsWritten = false;
33+
3034
/// Copy of all the command-line flags passed at .swiftinterface
3135
/// generation time, re-applied to CompilerInvocation when reading
3236
/// back .swiftinterface and reconstructing .swiftmodule.

branches/rxwei-patch-1/include/swift/Option/FrontendOptions.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,11 @@ def build_module_from_parseable_interface :
535535
Alias<compile_module_from_interface>,
536536
ModeOpt;
537537

538+
def module_interface_preserve_types_as_written :
539+
Flag<["-"], "module-interface-preserve-types-as-written">,
540+
HelpText<"When emitting a module interface, preserve types as they were "
541+
"written in the source">;
542+
538543
def prebuilt_module_cache_path :
539544
Separate<["-"], "prebuilt-module-cache-path">,
540545
HelpText<"Directory of prebuilt modules for loading module interfaces">;

branches/rxwei-patch-1/include/swift/SIL/SILBuilder.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,6 +2232,9 @@ class SILBuilderWithScope : public SILBuilder {
22322232
explicit SILBuilderWithScope(SILBasicBlock::iterator I)
22332233
: SILBuilderWithScope(&*I) {}
22342234

2235+
explicit SILBuilderWithScope(SILBasicBlock::iterator I, SILBuilder &B)
2236+
: SILBuilder(&*I, &*I->getDebugScope(), B.getBuilderContext()) {}
2237+
22352238
explicit SILBuilderWithScope(SILInstruction *I,
22362239
SILInstruction *InheritScopeFrom)
22372240
: SILBuilderWithScope(I) {

branches/rxwei-patch-1/lib/AST/ASTPrinter.cpp

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static bool contributesToParentTypeStorage(const AbstractStorageDecl *ASD) {
9494
return !ND->isResilient() && ASD->hasStorage() && !ASD->isStatic();
9595
}
9696

97-
PrintOptions PrintOptions::printParseableInterfaceFile() {
97+
PrintOptions PrintOptions::printParseableInterfaceFile(bool preferTypeRepr) {
9898
PrintOptions result;
9999
result.PrintLongAttrsOnSeparateLines = true;
100100
result.TypeDefinitions = true;
@@ -110,6 +110,7 @@ PrintOptions PrintOptions::printParseableInterfaceFile() {
110110
result.EnumRawValues = EnumRawValueMode::PrintObjCOnly;
111111
result.OpaqueReturnTypePrinting =
112112
OpaqueReturnTypePrintingMode::StableReference;
113+
result.PreferTypeRepr = preferTypeRepr;
113114

114115
// We should print __consuming, __owned, etc for the module interface file.
115116
result.SkipUnderscoredKeywords = false;
@@ -1004,7 +1005,18 @@ void PrintAST::printAttributes(const Decl *D) {
10041005
void PrintAST::printTypedPattern(const TypedPattern *TP) {
10051006
printPattern(TP->getSubPattern());
10061007
Printer << ": ";
1007-
printTypeLoc(TP->getTypeLoc());
1008+
1009+
// Make sure to check if the underlying var decl is an implicitly unwrapped
1010+
// optional.
1011+
bool isIUO = false;
1012+
if (auto *named = dyn_cast<NamedPattern>(TP->getSubPattern()))
1013+
if (auto decl = named->getDecl())
1014+
isIUO = decl->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>();
1015+
1016+
if (isIUO)
1017+
printTypeLocForImplicitlyUnwrappedOptional(TP->getTypeLoc());
1018+
else
1019+
printTypeLoc(TP->getTypeLoc());
10081020
}
10091021

10101022
/// Determines if we are required to print the name of a property declaration,
@@ -2530,6 +2542,14 @@ void PrintAST::visitVarDecl(VarDecl *decl) {
25302542
tyLoc = TypeLoc::withoutLoc(decl->getInterfaceType());
25312543

25322544
Printer.printDeclResultTypePre(decl, tyLoc);
2545+
2546+
// HACK: When printing result types for vars with opaque result types,
2547+
// always print them using the `some` keyword instead of printing
2548+
// the full stable reference.
2549+
llvm::SaveAndRestore<PrintOptions::OpaqueReturnTypePrintingMode>
2550+
x(Options.OpaqueReturnTypePrinting,
2551+
PrintOptions::OpaqueReturnTypePrintingMode::WithOpaqueKeyword);
2552+
25332553
if (decl->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>())
25342554
printTypeLocForImplicitlyUnwrappedOptional(tyLoc);
25352555
else
@@ -2805,6 +2825,14 @@ void PrintAST::visitFuncDecl(FuncDecl *decl) {
28052825

28062826
Printer.printDeclResultTypePre(decl, ResultTyLoc);
28072827
Printer.callPrintStructurePre(PrintStructureKind::FunctionReturnType);
2828+
2829+
// HACK: When printing result types for funcs with opaque result types,
2830+
// always print them using the `some` keyword instead of printing
2831+
// the full stable reference.
2832+
llvm::SaveAndRestore<PrintOptions::OpaqueReturnTypePrintingMode>
2833+
x(Options.OpaqueReturnTypePrinting,
2834+
PrintOptions::OpaqueReturnTypePrintingMode::WithOpaqueKeyword);
2835+
28082836
if (decl->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>())
28092837
printTypeLocForImplicitlyUnwrappedOptional(ResultTyLoc);
28102838
else
@@ -2947,6 +2975,14 @@ void PrintAST::visitSubscriptDecl(SubscriptDecl *decl) {
29472975
Printer.callPrintStructurePre(PrintStructureKind::FunctionReturnType);
29482976
if (!elementTy.getTypeRepr())
29492977
elementTy = TypeLoc::withoutLoc(decl->getElementInterfaceType());
2978+
2979+
// HACK: When printing result types for subscripts with opaque result types,
2980+
// always print them using the `some` keyword instead of printing
2981+
// the full stable reference.
2982+
llvm::SaveAndRestore<PrintOptions::OpaqueReturnTypePrintingMode>
2983+
x(Options.OpaqueReturnTypePrinting,
2984+
PrintOptions::OpaqueReturnTypePrintingMode::WithOpaqueKeyword);
2985+
29502986
if (decl->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>())
29512987
printTypeLocForImplicitlyUnwrappedOptional(elementTy);
29522988
else

branches/rxwei-patch-1/lib/AST/GenericSignatureBuilder.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,17 +2046,8 @@ TypeDecl *EquivalenceClass::lookupNestedType(
20462046
continue;
20472047
}
20482048

2049-
// If this is another type declaration, determine whether we should
2050-
// record it.
2049+
// If this is another type declaration, record it.
20512050
if (auto type = dyn_cast<TypeDecl>(member)) {
2052-
// FIXME: Filter out type declarations that aren't in the same
2053-
// module as the protocol itself. This is an unprincipled hack, but
2054-
// provides consistent lookup semantics for the generic signature
2055-
// builder in all contents.
2056-
if (type->getDeclContext()->getParentModule()
2057-
!= proto->getParentModule())
2058-
continue;
2059-
20602051
concreteDecls.push_back(type);
20612052
continue;
20622053
}

branches/rxwei-patch-1/lib/Frontend/CompilerInvocation.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ static void PrintArg(raw_ostream &OS, const char *Arg, StringRef TempDir) {
197197
OS << '"';
198198
}
199199

200+
static void ParseParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
201+
ArgList &Args) {
202+
using namespace options;
203+
204+
Opts.PreserveTypesAsWritten |=
205+
Args.hasArg(OPT_module_interface_preserve_types_as_written);
206+
}
207+
200208
/// Save a copy of any flags marked as ModuleInterfaceOption, if running
201209
/// in a mode that is going to emit a .swiftinterface file.
202210
static void SaveParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
@@ -1306,6 +1314,7 @@ bool CompilerInvocation::parseArgs(
13061314
return true;
13071315
}
13081316

1317+
ParseParseableInterfaceArgs(ParseableInterfaceOpts, ParsedArgs);
13091318
SaveParseableInterfaceArgs(ParseableInterfaceOpts, FrontendOpts,
13101319
ParsedArgs, Diags);
13111320

branches/rxwei-patch-1/lib/Frontend/ParseableInterfaceSupport.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ bool swift::emitParseableInterface(raw_ostream &out,
411411
printToolVersionAndFlagsComment(out, Opts, M);
412412
printImports(out, M);
413413

414-
const PrintOptions printOptions = PrintOptions::printParseableInterfaceFile();
414+
const PrintOptions printOptions = PrintOptions::printParseableInterfaceFile(
415+
Opts.PreserveTypesAsWritten);
415416
InheritedProtocolCollector::PerTypeMap inheritedProtocolMap;
416417

417418
SmallVector<Decl *, 16> topLevelDecls;

branches/rxwei-patch-1/lib/SILGen/SILGenThunk.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,15 @@ getOrCreateReabstractionThunk(CanSILFunctionType thunkType,
311311
->getCanonicalType();
312312
auto toInterfaceType = toType->mapTypeOutOfContext()
313313
->getCanonicalType();
314+
CanType dynamicSelfInterfaceType;
315+
if (dynamicSelfType)
316+
dynamicSelfInterfaceType = dynamicSelfType->mapTypeOutOfContext()
317+
->getCanonicalType();
314318

315319
Mangle::ASTMangler NewMangler;
316320
std::string name = NewMangler.mangleReabstractionThunkHelper(thunkType,
317-
fromInterfaceType, toInterfaceType, dynamicSelfType,
321+
fromInterfaceType, toInterfaceType,
322+
dynamicSelfInterfaceType,
318323
M.getSwiftModule());
319324

320325
auto loc = RegularLocation::getAutoGeneratedLocation();

branches/rxwei-patch-1/lib/SILOptimizer/Utils/CastOptimizer.cpp

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,18 @@ convertObjectToLoadableBridgeableType(SILBuilderWithScope &builder,
111111
return {cast, cast};
112112
}
113113

114+
SILBasicBlock *castSuccessBB =
115+
f->createBasicBlockAfter(dynamicCast.getInstruction()->getParent());
116+
castSuccessBB->createPhiArgument(silBridgedTy, ValueOwnershipKind::Owned);
117+
114118
// If we /are/ conditional and we do not need to bridge the load to the sil,
115119
// then we just create our cast success block and branch from the end of the
116120
// cast instruction block to the cast success block. We leave our insertion
117121
// point in the cast success block since when we return, we are going to
118122
// insert the bridge call/switch there. We return the argument of the cast
119123
// success block as the value to be passed to the bridging function.
120124
if (load->getType() == silBridgedTy) {
121-
SILBasicBlock *castSuccessBB = f->createBasicBlock();
122-
castSuccessBB->createPhiArgument(silBridgedTy, ValueOwnershipKind::Owned);
125+
castSuccessBB->moveAfter(dynamicCast.getInstruction()->getParent());
123126
builder.createBranch(loc, castSuccessBB, load);
124127
builder.setInsertionPoint(castSuccessBB);
125128
return {castSuccessBB->getArgument(0), nullptr};
@@ -132,15 +135,51 @@ convertObjectToLoadableBridgeableType(SILBuilderWithScope &builder,
132135
nullptr, nullptr);
133136
}());
134137

135-
// Ok, we need to perform the full cast optimization. This means that we are
136-
// going to replace the cast terminator in inst_block with a
137-
// checked_cast_br. This in turn means
138-
auto *castSuccessBB = f->createBasicBlock();
139-
castSuccessBB->createPhiArgument(silBridgedTy, ValueOwnershipKind::Owned);
138+
// Now that we have created the failure bb, move our cast success block right
139+
// after the checked_cast_br bb.
140+
castSuccessBB->moveAfter(dynamicCast.getInstruction()->getParent());
140141

142+
// Ok, we need to perform the full cast optimization. This means that we are
143+
// going to replace the cast terminator in inst_block with a checked_cast_br.
141144
auto *ccbi = builder.createCheckedCastBranch(loc, false, load, silBridgedTy,
142145
castSuccessBB, castFailBB);
143146
splitEdge(ccbi, /* EdgeIdx to CastFailBB */ 1);
147+
148+
// Now that we have split the edge to cast fail bb, add the default argument
149+
// for the checked_cast_br. Then we need to handle our error conditions,
150+
// namely we destroy on take_always and otherwise store the value back into
151+
// the memory location that we took it out of.
152+
{
153+
auto *newFailureBlock = ccbi->getFailureBB();
154+
SILValue defaultArg;
155+
if (builder.hasOwnership()) {
156+
defaultArg = newFailureBlock->createPhiArgument(
157+
load->getType(), ValueOwnershipKind::Owned);
158+
} else {
159+
defaultArg = ccbi->getOperand();
160+
}
161+
162+
// This block should be properly terminated already due to our method of
163+
// splitting the failure block, so we can use begin() safely.
164+
SILBuilderWithScope failureBuilder(newFailureBlock->begin());
165+
166+
switch (dynamicCast.getBridgedConsumptionKind()) {
167+
case CastConsumptionKind::TakeAlways:
168+
failureBuilder.emitDestroyValueOperation(loc, defaultArg);
169+
break;
170+
case CastConsumptionKind::TakeOnSuccess:
171+
case CastConsumptionKind::CopyOnSuccess:
172+
// Without ownership, we do not need to consume the taken value.
173+
if (failureBuilder.hasOwnership()) {
174+
failureBuilder.emitStoreValueOperation(loc, defaultArg, src,
175+
StoreOwnershipQualifier::Init);
176+
}
177+
break;
178+
case CastConsumptionKind::BorrowAlways:
179+
llvm_unreachable("this should never occur here");
180+
}
181+
}
182+
144183
builder.setInsertionPoint(castSuccessBB);
145184
return {castSuccessBB->getArgument(0), ccbi};
146185
}
@@ -370,12 +409,13 @@ CastOptimizer::optimizeBridgedObjCToSwiftCast(SILDynamicCastInst dynamicCast) {
370409
// Load from the optional.
371410
auto *SomeDecl = Builder.getASTContext().getOptionalSomeDecl();
372411

373-
SILBasicBlock *BridgeSuccessBB = Inst->getFunction()->createBasicBlock();
412+
auto *BridgeSuccessBB =
413+
Inst->getFunction()->createBasicBlockAfter(Builder.getInsertionBB());
374414
SmallVector<std::pair<EnumElementDecl *, SILBasicBlock *>, 2> CaseBBs;
415+
CaseBBs.emplace_back(SomeDecl, BridgeSuccessBB);
375416
CaseBBs.emplace_back(mod.getASTContext().getOptionalNoneDecl(), FailureBB);
376417

377-
Builder.createSwitchEnumAddr(Loc, InOutOptionalParam, BridgeSuccessBB,
378-
CaseBBs);
418+
Builder.createSwitchEnumAddr(Loc, InOutOptionalParam, nullptr, CaseBBs);
379419

380420
Builder.setInsertionPoint(FailureBB->begin());
381421
Builder.createDeallocStack(Loc, Tmp);

branches/rxwei-patch-1/lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,16 @@ SILValue SILInlineCloner::borrowFunctionArgument(SILValue callArg,
563563
SILBuilderWithScope beginBuilder(AI.getInstruction(), getBuilder());
564564
auto *borrow = beginBuilder.createBeginBorrow(AI.getLoc(), callArg);
565565
if (auto *tryAI = dyn_cast<TryApplyInst>(AI)) {
566-
SILBuilderWithScope returnBuilder(tryAI->getNormalBB()->begin());
566+
SILBuilderWithScope returnBuilder(tryAI->getNormalBB()->begin(),
567+
getBuilder());
567568
returnBuilder.createEndBorrow(AI.getLoc(), borrow, callArg);
568569

569-
SILBuilderWithScope throwBuilder(tryAI->getErrorBB()->begin());
570+
SILBuilderWithScope throwBuilder(tryAI->getErrorBB()->begin(),
571+
getBuilder());
570572
throwBuilder.createEndBorrow(AI.getLoc(), borrow, callArg);
571573
} else {
572574
SILBuilderWithScope returnBuilder(
573-
std::next(AI.getInstruction()->getIterator()));
575+
std::next(AI.getInstruction()->getIterator()), getBuilder());
574576
returnBuilder.createEndBorrow(AI.getLoc(), borrow, callArg);
575577
}
576578
return borrow;

branches/rxwei-patch-1/lib/Sema/CodeSynthesis.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,9 +1693,15 @@ static VarDecl *synthesizePropertyWrapperStorageWrapperProperty(
16931693
addMemberToContextIfNeeded(pbd, dc, var);
16941694
pbd->setStatic(var->isStatic());
16951695

1696-
// The property is always private.
1697-
property->overwriteAccess(AccessLevel::Private);
1698-
property->overwriteSetterAccess(AccessLevel::Private);
1696+
// Determine the access level for the property.
1697+
AccessLevel access =
1698+
std::min(AccessLevel::Internal, var->getFormalAccess());
1699+
property->overwriteAccess(access);
1700+
1701+
// Determine setter access.
1702+
AccessLevel setterAccess =
1703+
std::min(AccessLevel::Internal, var->getSetterFormalAccess());
1704+
property->overwriteSetterAccess(setterAccess);
16991705

17001706
// Add the accessors we need.
17011707
bool hasSetter = wrapperVar->isSettable(nullptr) &&

branches/rxwei-patch-1/stdlib/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ include(AddSwiftStdlib)
77

88
# Create convenience targets for the Swift standard library.
99

10+
# NOTE(compnerd) this will pass the *build* configuration to the *host*
11+
# libraries. Explicitly indicate to CMake that it should **NOT** track the
12+
# implicit language runtimes. This can go away once we migrate to an external
13+
# project with its own configure with the CMAKE_SYSTEM_NAME set rather than
14+
# using the custom cross-compilation solution
15+
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")
16+
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
17+
18+
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "")
19+
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
20+
1021
# NOTE(compnerd) save the original compiler for the host swiftReflection that
1122
# we build
1223
set(HOST_CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})

0 commit comments

Comments
 (0)