Skip to content

Commit 37b9276

Browse files
committed
---
yaml --- r: 348956 b: refs/heads/master c: 4bafc77 h: refs/heads/master
1 parent 67d5a4e commit 37b9276

File tree

11 files changed

+42
-79
lines changed

11 files changed

+42
-79
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: 1cb3d7c1f7b3a7fb024d5dd7b4256aae36ef45fe
2+
refs/heads/master: 4bafc7718e3c155999806b0b3103088fffde4bdb
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/cmake/modules/SwiftSource.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,6 @@ function(_compile_swift_files
333333
"-emit-module-interface-path" "${interface_file}")
334334
endif()
335335

336-
if (NOT SWIFTFILE_IS_STDLIB_CORE)
337-
list(APPEND swift_module_flags
338-
"-Xfrontend" "-experimental-skip-non-inlinable-function-bodies")
339-
endif()
340-
341336
# If we have extra regexp flags, check if we match any of the regexps. If so
342337
# add the relevant flags to our swift_flags.
343338
if (SWIFT_EXPERIMENTAL_EXTRA_REGEXP_FLAGS OR SWIFT_EXPERIMENTAL_EXTRA_NEGATIVE_REGEXP_FLAGS)

trunk/lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,6 +2853,7 @@ namespace {
28532853
auto enumDecl = Impl.createDeclWithClangNode<EnumDecl>(
28542854
decl, AccessLevel::Public, loc, enumName,
28552855
Impl.importSourceLoc(decl->getLocation()), None, nullptr, enumDC);
2856+
enumDecl->setHasFixedRawValues();
28562857
enumDecl->computeType();
28572858

28582859
// Annotate as 'frozen' if appropriate.

trunk/lib/IRGen/LoadableByAddress.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,20 +1426,6 @@ static void convertBBArgType(SILBuilder &argBuilder, SILType newSILType,
14261426
}
14271427
}
14281428

1429-
static bool containsFunctionType(CanType ty) {
1430-
if (auto tuple = dyn_cast<TupleType>(ty)) {
1431-
for (auto elt : tuple.getElementTypes()) {
1432-
if (containsFunctionType(elt))
1433-
return true;
1434-
}
1435-
return false;
1436-
}
1437-
if (auto optionalType = ty.getOptionalObjectType()) {
1438-
return containsFunctionType(optionalType);
1439-
}
1440-
return isa<SILFunctionType>(ty);
1441-
}
1442-
14431429
void LoadableStorageAllocation::convertApplyResults() {
14441430
for (auto &BB : *pass.F) {
14451431
for (auto &II : BB) {
@@ -1464,7 +1450,16 @@ void LoadableStorageAllocation::convertApplyResults() {
14641450
auto numFuncTy = llvm::count_if(origSILFunctionType->getResults(),
14651451
[](const SILResultInfo &origResult) {
14661452
auto resultStorageTy = origResult.getSILStorageType();
1467-
return containsFunctionType(resultStorageTy.getASTType());
1453+
// Check if it is a function type
1454+
if (resultStorageTy.is<SILFunctionType>()) {
1455+
return true;
1456+
}
1457+
// Check if it is an optional function type
1458+
auto optionalType = resultStorageTy.getOptionalObjectType();
1459+
if (optionalType && optionalType.is<SILFunctionType>()) {
1460+
return true;
1461+
}
1462+
return false;
14681463
});
14691464
assert(numFuncTy != 0 &&
14701465
"Expected a SILFunctionType inside the result Type");

trunk/lib/Sema/TypeCheckDecl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,13 @@ EnumRawValuesRequest::evaluate(Evaluator &eval, EnumDecl *ED,
16541654
continue;
16551655
}
16561656

1657+
// If the raw values of the enum case are fixed, then we trust our callers
1658+
// to have set things up correctly. This comes up with imported enums
1659+
// and deserialized @objc enums which always have their raw values setup
1660+
// beforehand.
1661+
if (ED->LazySemanticInfo.hasFixedRawValues())
1662+
continue;
1663+
16571664
// Check that the raw value is unique.
16581665
RawValueKey key{prevValue};
16591666
RawValueSource source{elt, lastExplicitValueElt};

trunk/stdlib/public/runtime/HeapObject.cpp

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,6 @@ static inline bool isValidPointerForNativeRetain(const void *p) {
7272
#endif
7373
}
7474

75-
// Call the appropriate implementation of the `name` function, passing `args`
76-
// to the call. This checks for an override in the function pointer. If an
77-
// override is present, it calls that override. Otherwise it directly calls
78-
// the default implementation. This allows the compiler to inline the default
79-
// implementation and avoid the performance penalty of indirecting through
80-
// the function pointer in the common case.
81-
#define CALL_IMPL(name, args) do { \
82-
if (SWIFT_UNLIKELY(_ ## name != _ ## name ## _)) \
83-
return _ ## name args; \
84-
return _ ## name ## _ args; \
85-
} while(0)
86-
87-
8875
static HeapObject *_swift_allocObject_(HeapMetadata const *metadata,
8976
size_t requiredSize,
9077
size_t requiredAlignmentMask) {
@@ -108,7 +95,9 @@ static HeapObject *_swift_allocObject_(HeapMetadata const *metadata,
10895
HeapObject *swift::swift_allocObject(HeapMetadata const *metadata,
10996
size_t requiredSize,
11097
size_t requiredAlignmentMask) {
111-
CALL_IMPL(swift_allocObject, (metadata, requiredSize, requiredAlignmentMask));
98+
if (SWIFT_UNLIKELY(_swift_allocObject != _swift_allocObject_))
99+
return _swift_allocObject(metadata, requiredSize, requiredAlignmentMask);
100+
return _swift_allocObject_(metadata, requiredSize, requiredAlignmentMask);
112101
}
113102

114103
HeapObject *(*swift::_swift_allocObject)(HeapMetadata const *metadata,
@@ -316,7 +305,9 @@ static HeapObject *_swift_retain_(HeapObject *object) {
316305
}
317306

318307
HeapObject *swift::swift_retain(HeapObject *object) {
319-
CALL_IMPL(swift_retain, (object));
308+
if (SWIFT_UNLIKELY(_swift_retain != _swift_retain_))
309+
return _swift_retain(object);
310+
return _swift_retain_(object);
320311
}
321312

322313
HeapObject *(*swift::_swift_retain)(HeapObject *object) = _swift_retain_;
@@ -336,7 +327,9 @@ static HeapObject *_swift_retain_n_(HeapObject *object, uint32_t n) {
336327
}
337328

338329
HeapObject *swift::swift_retain_n(HeapObject *object, uint32_t n) {
339-
CALL_IMPL(swift_retain_n, (object, n));
330+
if (SWIFT_UNLIKELY(_swift_retain_n != _swift_retain_n_))
331+
return _swift_retain_n(object, n);
332+
return _swift_retain_n_(object, n);
340333
}
341334

342335
HeapObject *(*swift::_swift_retain_n)(HeapObject *object, uint32_t n) =
@@ -356,7 +349,9 @@ static void _swift_release_(HeapObject *object) {
356349
}
357350

358351
void swift::swift_release(HeapObject *object) {
359-
CALL_IMPL(swift_release, (object));
352+
if (SWIFT_UNLIKELY(_swift_release != _swift_release_))
353+
_swift_release(object);
354+
_swift_release_(object);
360355
}
361356

362357
void (*swift::_swift_release)(HeapObject *object) = _swift_release_;
@@ -374,7 +369,9 @@ static void _swift_release_n_(HeapObject *object, uint32_t n) {
374369
}
375370

376371
void swift::swift_release_n(HeapObject *object, uint32_t n) {
377-
CALL_IMPL(swift_release_n, (object, n));
372+
if (SWIFT_UNLIKELY(_swift_release_n != _swift_release_n_))
373+
return _swift_release_n(object, n);
374+
return _swift_release_n_(object, n);
378375
}
379376

380377
void (*swift::_swift_release_n)(HeapObject *object, uint32_t n) =
@@ -512,7 +509,9 @@ static HeapObject *_swift_tryRetain_(HeapObject *object) {
512509
}
513510

514511
HeapObject *swift::swift_tryRetain(HeapObject *object) {
515-
CALL_IMPL(swift_tryRetain, (object));
512+
if (SWIFT_UNLIKELY(_swift_tryRetain != _swift_tryRetain_))
513+
return _swift_tryRetain(object);
514+
return _swift_tryRetain_(object);
516515
}
517516

518517
HeapObject *(*swift::_swift_tryRetain)(HeapObject *object) = _swift_tryRetain_;

trunk/stdlib/toolchain/Compatibility50/ProtocolConformance.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "Overrides.h"
2121
#include "../../public/runtime/Private.h"
2222
#include "swift/Basic/Lazy.h"
23-
#include <dlfcn.h>
2423
#include <mach-o/dyld.h>
2524
#include <mach-o/getsect.h>
2625
#include <objc/runtime.h>
@@ -90,25 +89,13 @@ static void registerAddImageCallback(void *) {
9089
_dyld_register_func_for_add_image(addImageCallback);
9190
}
9291

93-
static const Metadata *getObjCClassMetadata(const ClassMetadata *c) {
94-
// Look up swift_getObjCClassMetadata dynamically. This handles the case
95-
// where the main executable can't link against libswiftCore.dylib because
96-
// it will be loaded dynamically from a location that isn't known at build
97-
// time.
98-
using FPtr = const Metadata *(*)(const ClassMetadata *);
99-
FPtr func = SWIFT_LAZY_CONSTANT(
100-
reinterpret_cast<FPtr>(dlsym(RTLD_DEFAULT, "swift_getObjCClassMetadata")));
101-
102-
return func(c);
103-
}
104-
10592
// Clone of private helper swift::_swiftoverride_class_getSuperclass
10693
// for use in the override implementation.
10794
static const Metadata *_swift50override_class_getSuperclass(
10895
const Metadata *theClass) {
10996
if (const ClassMetadata *classType = theClass->getClassObject()) {
11097
if (classHasSuperclass(classType))
111-
return getObjCClassMetadata(classType->Superclass);
98+
return getMetadataForClass(classType->Superclass);
11299
}
113100

114101
if (const ForeignClassMetadata *foreignClassType

trunk/test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ foreach(SDK ${SWIFT_SDKS})
205205

206206
# NOTE create a stub BlocksRuntime library that can be used for the
207207
# reflection tests
208-
file(WRITE ${test_bin_dir}/Inputs/BlocksRuntime.c
208+
file(WRITE ${test_bin_dir}/BlocksRuntime.c
209209
"void
210210
#if defined(_WIN32)
211211
__declspec(dllexport)
@@ -220,7 +220,7 @@ _Block_release(void) { }\n")
220220
ARCHITECTURE ${ARCH}
221221
SDK ${SDK}
222222
INSTALL_IN_COMPONENT dev
223-
${test_bin_dir}/Inputs/BlocksRuntime.c)
223+
${test_bin_dir}/BlocksRuntime.c)
224224
set_target_properties(BlocksRuntimeStub${VARIANT_SUFFIX} PROPERTIES
225225
ARCHIVE_OUTPUT_DIRECTORY ${test_bin_dir}
226226
LIBRARY_OUTPUT_DIRECTORY ${test_bin_dir}

trunk/test/IRGen/big_types_corner_cases.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,3 @@ public extension sr8076_QueryHandler {
346346
return try body(query)
347347
}
348348
}
349-
350-
public func foo() -> Optional<(a: Int?, b: Bool, c: (Int?)->BigStruct?)> {
351-
return nil
352-
}
353-
354-
public func dontAssert() {
355-
let _ = foo()
356-
}

trunk/test/lit.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ config.test_format = swift_test.SwiftTest(coverage_mode=config.coverage_mode,
178178
execute_external=not use_lit_shell)
179179

180180
# suffixes: A list of file extensions to treat as test files.
181-
config.suffixes = ['.swift', '.ll', '.sil', '.gyb', '.m', '.c',
182-
'.swiftinterface', '.test-sh']
181+
config.suffixes = ['.swift', '.ll', '.sil', '.gyb', '.m', '.swiftinterface',
182+
'.test-sh']
183183

184184
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
185185
# subdirectories contain auxiliary inputs for various tests in their parent

trunk/test/stdlib/Compatibility50Linking.c

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

0 commit comments

Comments
 (0)