Skip to content

Commit 2b55d6a

Browse files
committed
---
yaml --- r: 347127 b: refs/heads/master c: 64d0e6b h: refs/heads/master i: 347125: a555f1f 347123: 6ed5082 347119: 556d8a9
1 parent ac9b14b commit 2b55d6a

File tree

23 files changed

+40
-931
lines changed

23 files changed

+40
-931
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 002f45cce83d1e16dbfd6b42af015cba2345acd8
2+
refs/heads/master: 64d0e6bbc558c53e7bb50de9c9d7897d35c444eb
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
235235
FALSE)
236236

237237
option(SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
238-
"Enable the Swift stable ABI's class marker bit for new deployment targets"
239-
TRUE)
238+
"Enable the Swift stable ABI's class marker bit"
239+
FALSE)
240240

241241
set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
242242
"The name of the toolchain to pass to 'xcrun'")

trunk/include/swift/ABI/Metadata.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,31 +1192,6 @@ struct TargetClassMetadata : public TargetAnyClassMetadata<Runtime> {
11921192
return bounds;
11931193
}
11941194

1195-
/// Given a statically-emitted metadata template, this sets the correct
1196-
/// "is Swift" bit for the current runtime. Depending on the deployment
1197-
/// target a binary was compiled for, statically emitted metadata templates
1198-
/// may have a different bit set from the one that this runtime canonically
1199-
/// considers the "is Swift" bit.
1200-
void setAsTypeMetadata() {
1201-
// If the wrong "is Swift" bit is set, set the correct one.
1202-
//
1203-
// Note that the only time we should see the "new" bit set while
1204-
// expecting the "old" one is when running a binary built for a
1205-
// new OS on an old OS, which is not supported, however we do
1206-
// have tests that exercise this scenario.
1207-
auto otherSwiftBit = (3ULL - SWIFT_CLASS_IS_SWIFT_MASK);
1208-
assert(otherSwiftBit == 1ULL || otherSwiftBit == 2ULL);
1209-
1210-
if ((this->Data & 3) == otherSwiftBit) {
1211-
this->Data ^= 3;
1212-
}
1213-
1214-
// Otherwise there should be nothing to do, since only the old "is
1215-
// Swift" bit is used for backward-deployed runtimes.
1216-
1217-
assert(isTypeMetadata());
1218-
}
1219-
12201195
static bool classof(const TargetMetadata<Runtime> *metadata) {
12211196
return metadata->getKind() == MetadataKind::Class;
12221197
}

trunk/include/swift/Runtime/BackDeployment.h

Lines changed: 0 additions & 45 deletions
This file was deleted.

trunk/include/swift/Runtime/CMakeConfig.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@
55
#define SWIFT_RUNTIME_CMAKECONFIG_H
66

77
#cmakedefine01 SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
8-
#cmakedefine01 SWIFT_BNI_OS_BUILD
9-
#cmakedefine01 SWIFT_BNI_XCODE_BUILD
108

119
#endif
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
1-
# Detect B&I builds.
2-
set(SWIFT_BNI_OS_BUILD FALSE)
3-
set(SWIFT_BNI_XCODE_BUILD FALSE)
4-
if(DEFINED ENV{RC_XBS})
5-
if(NOT DEFINED ENV{RC_XCODE} OR NOT "$ENV{RC_XCODE}")
6-
set(SWIFT_BNI_OS_BUILD TRUE)
7-
else()
8-
set(SWIFT_BNI_XCODE_BUILD TRUE)
9-
endif()
10-
endif()
11-
121
configure_file(CMakeConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeConfig.h
132
ESCAPE_QUOTES @ONLY)

trunk/include/swift/Runtime/Config.h

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -141,27 +141,10 @@
141141
/// Which bits in the class metadata are used to distinguish Swift classes
142142
/// from ObjC classes?
143143
#ifndef SWIFT_CLASS_IS_SWIFT_MASK
144-
145-
// Non-Apple platforms always use 1.
146-
# if !defined(__APPLE__)
147-
# define SWIFT_CLASS_IS_SWIFT_MASK 1ULL
148-
149-
// Builds for Swift-in-the-OS always use 2.
150-
# elif SWIFT_BNI_OS_BUILD
144+
# if defined(__APPLE__) && SWIFT_OBJC_INTEROP && SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
151145
# define SWIFT_CLASS_IS_SWIFT_MASK 2ULL
152-
153-
// Builds for Xcode always use 1.
154-
# elif SWIFT_BNI_XCODE_BUILD
155-
# define SWIFT_CLASS_IS_SWIFT_MASK 1ULL
156-
157-
// Other builds (such as local builds on developers' computers)
158-
// dynamically choose the bit at runtime based on the current OS
159-
// version.
160146
# else
161-
# define SWIFT_CLASS_IS_SWIFT_MASK _swift_classIsSwiftMask
162-
# define SWIFT_CLASS_IS_SWIFT_MASK_GLOBAL_VARIABLE 1
163-
# include "BackDeployment.h"
164-
147+
# define SWIFT_CLASS_IS_SWIFT_MASK 1ULL
165148
# endif
166149
#endif
167150

trunk/include/swift/SwiftRemoteMirror/SwiftRemoteMirror.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
extern "C" {
3838
#endif
3939

40-
extern unsigned long long swift_reflection_classIsSwiftMask;
41-
4240
/// Get the metadata version supported by the Remote Mirror library.
4341
SWIFT_REMOTE_MIRROR_LINKAGE
4442
uint16_t swift_reflection_getSupportedMetadataVersion(void);

trunk/lib/ClangImporter/ClangImporter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,8 +1011,7 @@ ClangImporter::create(ASTContext &ctx,
10111011
clangDiags.setSeverity(clang::diag::err_module_not_built,
10121012
clang::diag::Severity::Error,
10131013
clang::SourceLocation());
1014-
clangDiags.setSuppressAfterFatalError(
1015-
!ctx.Diags.getShowDiagnosticsAfterFatalError());
1014+
clangDiags.setFatalsAsError(ctx.Diags.getShowDiagnosticsAfterFatalError());
10161015

10171016

10181017
// Create the associated action.

trunk/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
429429
Opts.EnableSILOpaqueValues |= Args.hasArg(OPT_enable_sil_opaque_values);
430430

431431
#if SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
432-
Opts.UseDarwinPreStableABIBit =
433-
(Target.isMacOSX() && Target.isMacOSXVersionLT(10, 14, 4)) ||
434-
(Target.isiOS() && Target.isOSVersionLT(12, 2)) ||
435-
(Target.isTvOS() && Target.isOSVersionLT(12, 2)) ||
436-
(Target.isWatchOS() && Target.isOSVersionLT(5, 2));
432+
Opts.UseDarwinPreStableABIBit = false;
437433
#else
438434
Opts.UseDarwinPreStableABIBit = true;
439435
#endif

trunk/lib/SILGen/SILGenPattern.cpp

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,18 +2325,16 @@ void PatternMatchEmission::initSharedCaseBlockDest(CaseStmt *caseBlock,
23252325
}
23262326

23272327
auto pattern = caseBlock->getCaseLabelItems()[0].getPattern();
2328-
SmallVector<VarDecl *, 4> patternVarDecls;
2329-
pattern->collectVariables(patternVarDecls);
2330-
for (auto *vd : patternVarDecls) {
2331-
if (!vd->hasName())
2332-
continue;
2328+
pattern->forEachVariable([&](VarDecl *V) {
2329+
if (!V->hasName())
2330+
return;
23332331

23342332
// We don't pass address-only values in basic block arguments.
2335-
SILType ty = SGF.getLoweredType(vd->getType());
2333+
SILType ty = SGF.getLoweredType(V->getType());
23362334
if (ty.isAddressOnly(SGF.F.getModule()))
2337-
continue;
2338-
block->createPhiArgument(ty, ValueOwnershipKind::Owned, vd);
2339-
}
2335+
return;
2336+
block->createPhiArgument(ty, ValueOwnershipKind::Owned, V);
2337+
});
23402338
}
23412339

23422340
/// Retrieve the jump destination for a shared case block.
@@ -2364,11 +2362,9 @@ void PatternMatchEmission::emitAddressOnlyAllocations() {
23642362
// to point to the incoming args and setup initialization so any args needing
23652363
// cleanup will get that as well.
23662364
auto pattern = caseBlock->getCaseLabelItems()[0].getPattern();
2367-
SmallVector<VarDecl *, 4> patternVarDecls;
2368-
pattern->collectVariables(patternVarDecls);
2369-
for (auto *vd : patternVarDecls) {
2365+
pattern->forEachVariable([&](VarDecl *vd) {
23702366
if (!vd->hasName())
2371-
continue;
2367+
return;
23722368

23732369
SILType ty = SGF.getLoweredType(vd->getType());
23742370
if (ty.isNull()) {
@@ -2387,11 +2383,12 @@ void PatternMatchEmission::emitAddressOnlyAllocations() {
23872383
}
23882384
}
23892385

2390-
if (!ty.isAddressOnly(SGF.F.getModule()))
2391-
continue;
2392-
assert(!Temporaries[vd]);
2393-
Temporaries[vd] = SGF.emitTemporaryAllocation(vd, ty);
2394-
}
2386+
if (ty.isAddressOnly(SGF.F.getModule())) {
2387+
assert(!Temporaries[vd]);
2388+
Temporaries[vd] = SGF.emitTemporaryAllocation(vd, ty);
2389+
return;
2390+
}
2391+
});
23952392
}
23962393

23972394
// Now we have all of our cleanups entered, so we can record the
@@ -2461,14 +2458,12 @@ void PatternMatchEmission::emitSharedCaseBlocks() {
24612458
// needing cleanup will get that as well.
24622459
Scope scope(SGF.Cleanups, CleanupLocation(caseBlock));
24632460
auto pattern = caseBlock->getCaseLabelItems()[0].getPattern();
2464-
SmallVector<VarDecl *, 4> patternVarDecls;
2465-
pattern->collectVariables(patternVarDecls);
24662461
unsigned argIndex = 0;
2467-
for (auto *vd : patternVarDecls) {
2468-
if (!vd->hasName())
2469-
continue;
2462+
pattern->forEachVariable([&](VarDecl *V) {
2463+
if (!V->hasName())
2464+
return;
24702465

2471-
SILType ty = SGF.getLoweredType(vd->getType());
2466+
SILType ty = SGF.getLoweredType(V->getType());
24722467

24732468
// Initialize mv at +1. We always pass values in at +1 for today into
24742469
// shared blocks.
@@ -2483,7 +2478,7 @@ void PatternMatchEmission::emitSharedCaseBlocks() {
24832478
//
24842479
// There's nothing to do here, since the value should already have
24852480
// been initialized on entry.
2486-
auto found = Temporaries.find(vd);
2481+
auto found = Temporaries.find(V);
24872482
assert(found != Temporaries.end());
24882483
mv = SGF.emitManagedRValueWithCleanup(found->second);
24892484
} else {
@@ -2493,20 +2488,20 @@ void PatternMatchEmission::emitSharedCaseBlocks() {
24932488
mv = SGF.emitManagedRValueWithCleanup(arg);
24942489
}
24952490

2496-
if (vd->isLet()) {
2491+
if (V->isLet()) {
24972492
// Just emit a let and leave the cleanup alone.
2498-
SGF.VarLocs[vd].value = mv.getValue();
2499-
continue;
2493+
SGF.VarLocs[V].value = mv.getValue();
2494+
return;
25002495
}
25012496

25022497
// Otherwise, the pattern variables were all emitted as lets and one got
25032498
// passed in. Since we have a var, alloc a box for the var and forward in
25042499
// the chosen value.
2505-
SGF.VarLocs.erase(vd);
2506-
auto newVar = SGF.emitInitializationForVarDecl(vd, vd->isLet());
2507-
newVar->copyOrInitValueInto(SGF, vd, mv, /*isInit*/ true);
2500+
SGF.VarLocs.erase(V);
2501+
auto newVar = SGF.emitInitializationForVarDecl(V, V->isLet());
2502+
newVar->copyOrInitValueInto(SGF, V, mv, /*isInit*/ true);
25082503
newVar->finishInitialization(SGF);
2509-
}
2504+
});
25102505

25112506
// Now that we have setup all of the VarLocs correctly, emit the shared case
25122507
// body.

trunk/stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#define SWIFT_CLASS_IS_SWIFT_MASK swift_reflection_classIsSwiftMask
14-
extern "C" unsigned long long swift_reflection_classIsSwiftMask = 2;
15-
1613
#include "swift/Reflection/ReflectionContext.h"
1714
#include "swift/Reflection/TypeLowering.h"
1815
#include "swift/Remote/CMemoryReader.h"

trunk/stdlib/public/runtime/BackDeployment.cpp

Lines changed: 0 additions & 64 deletions
This file was deleted.

trunk/stdlib/public/runtime/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ set(swift_runtime_objc_sources
3131
set(swift_runtime_sources
3232
AnyHashableSupport.cpp
3333
Array.cpp
34-
BackDeployment.cpp
3534
Casting.cpp
3635
CompatibilityOverride.cpp
3736
CygwinPort.cpp

trunk/stdlib/public/runtime/Metadata.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,7 @@ Metadata *TargetSingletonMetadataInitialization<InProcess>::allocate(
9696
// If this is a class, we have to initialize the value witness table early
9797
// so that two-phase initialization can proceed as if this metadata is
9898
// complete for layout purposes when it appears as part of an aggregate type.
99-
//
100-
// Note that we can't use (dyn_)cast<ClassMetadata> here because the static
101-
// template may have the "wrong" isSwift bit set in its Data pointer, if the
102-
// binary was built to deploy back to pre-stable-Swift Objective-C runtimes.
103-
// Such a template will fail the `isTypeMetadata` test and we'll think that it
104-
// isn't Swift metadata but a plain old ObjC class instead.
105-
if (metadata->getKind() == MetadataKind::Class) {
106-
auto *classMetadata = static_cast<ClassMetadata*>(metadata);
107-
classMetadata->setAsTypeMetadata();
99+
if (auto *classMetadata = dyn_cast<ClassMetadata>(metadata)) {
108100
auto *fullMetadata = asFullMetadata(metadata);
109101

110102
// Begin by initializing the value witness table; everything else is

0 commit comments

Comments
 (0)