Skip to content

[pull] master from apple:master #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 75 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
2a48e19
[SourceKit] Add Effective Scope to Index
rockbruno May 24, 2020
f000639
Improve tests and generate the rest of the output
rockbruno May 25, 2020
9b05823
Remove accessors and add PW tests
rockbruno May 26, 2020
51c0024
Whitelist instead of blacklist
rockbruno May 26, 2020
6ebf0d5
Add a test showing local content being ignored
rockbruno May 26, 2020
b50813a
Run linux only test
rockbruno May 27, 2020
8f2f14b
[CSSimplify] Modify logic on match representations to allow ONLY thic…
LucianoPAlmeida May 30, 2020
bacbc57
[tests] Adding silgen validation tests for SR-12723 to ensure that ce…
LucianoPAlmeida May 30, 2020
baccbde
[CSSimplify] Simplify logic for valiting to thick conversion on subtype
LucianoPAlmeida Jun 2, 2020
d6bf34e
[CSSimplify] Thin to thin is also allowed
LucianoPAlmeida Jun 5, 2020
346771f
Update tools/SourceKit/lib/SwiftLang/SwiftIndexing.cpp
rockbruno Jun 9, 2020
2b47815
IRGen: Lookup the conformance of an archetype in the right substituti…
aschwaighofer Jun 9, 2020
adba283
[CSSimplify] Abstract function conversion validation into static method
LucianoPAlmeida Jun 9, 2020
478e13b
Address review feedback
aschwaighofer Jun 10, 2020
ea8c9b8
gyb: use a stable hash for Syntax
compnerd Jun 10, 2020
8a2bfb0
No need to lookup the conformance we can just take the protocol from …
aschwaighofer Jun 11, 2020
632b5ce
Ignore OnFastPath builtin while looking for valid static initializer …
meg-gupta Jun 11, 2020
0fc6a94
[test/Syntax/round_trip_stdlib.swift] Exclude the test for an ASAN build
akyrtzi Jun 11, 2020
addb432
[TypeCheckType] Avoid diagnose convention representation when functio…
LucianoPAlmeida Jun 11, 2020
384c373
[tests] Add regression test for SR-12955
LucianoPAlmeida Jun 11, 2020
a7b3e37
[build-script] Print out inferred products/build order when --verbose…
gottesmm Jun 12, 2020
0c33206
[Type] Fail early on Type::getForeignRepresentable if type has error
LucianoPAlmeida Jun 12, 2020
8e832b6
Update WindowsBuild.md
compnerd Jun 12, 2020
306cb0d
[Test] Exclude environment_variables.swift from testing against the O…
mikeash Jun 12, 2020
1d53362
vim: treat `associatedtype` as `typealias` for highlighting
compnerd Jun 12, 2020
22006e3
vim: add some missing keywords for highlighting
compnerd Jun 12, 2020
2b5059c
vim: handle `Any` and `AnyObject` as core types
compnerd Jun 12, 2020
20dbe3f
vim: handle `column` and `dsohandle` identifiers
compnerd Jun 12, 2020
36dfd0d
build: remove unnecessary variable (NFC)
compnerd Jun 12, 2020
04c8f0d
IRGen: Don't reify internal vtable entries that are marked overridden.
jckarter Jun 11, 2020
b2e8a60
[TypeCheckType] Lift malformed type check for fnType in resolveASTFun…
LucianoPAlmeida Jun 12, 2020
71d2c37
[cxx-interop] Add support for percent, ampersand, and pipe operators.…
zoecarver Jun 12, 2020
4024e5a
Merge pull request #32348 from mikeash/environment-variables-test-exc…
swift-ci Jun 12, 2020
0d57f3b
[ParseSIL] NFC: fix SILDeclRef grammar comment. (#32347)
dan-zheng Jun 12, 2020
5ec7cb7
[build-script] llvm-dsymutil's component is dsymutil.
gottesmm Jun 12, 2020
55e2506
Merge pull request #32337 from LucianoPAlmeida/SR-12955-avoid-error-t…
LucianoPAlmeida Jun 12, 2020
08ad103
Merge pull request #32346 from apple/compnerd-python-path
CodaFi Jun 12, 2020
6ac810c
Merge pull request #32353 from compnerd/vars
compnerd Jun 12, 2020
a7f9d99
Merge pull request #32329 from jckarter/drop-internal-nonoverridden-v…
jckarter Jun 12, 2020
c5d7611
Merge pull request #32292 from compnerd/syntax-hashing
akyrtzi Jun 12, 2020
2efde25
[Gardening] Ignored Package.resolved for swift-inspect.
nate-chandler Jun 13, 2020
def6e24
Merge pull request #32358 from gottesmm/pr-207b6298d38859b0b850fb9fa9…
gottesmm Jun 13, 2020
318e199
Merge pull request #32341 from gottesmm/pr-2f5315e6db5c454c6021990aa5…
gottesmm Jun 13, 2020
f20d567
Fix the hardcoded Swift AST section / segment name for Mach-O
adrian-prantl Jun 13, 2020
c8ba437
[test] Handle architecture aliasing for OpenBSD.
3405691582 Mar 21, 2020
1564377
[CS] Update splice logic in simplifyLocator to handle situations wher…
theblixguy Jun 13, 2020
8cb1331
Merge pull request #32327 from akyrtzi/exclude-round_trip_stdlib-asan
akyrtzi Jun 13, 2020
16c9c00
Merge pull request #32350 from compnerd/vim-syntax
compnerd Jun 13, 2020
1484360
CS node->type map requires ordering because it can be partially undone,
gregomni Jun 13, 2020
7d7a35e
[Runtime] Zero out the entire witness table during instantiation.
DougGregor Jun 14, 2020
8bfaba7
Update WindowsBuild.md
compnerd Jun 14, 2020
76ca05f
reland: Emit coverage mappings for all modules
keith Jun 12, 2020
e57d375
build: do not assume that XML2 should be enabled
compnerd Jun 14, 2020
26f7823
Merge pull request #32367 from DougGregor/witness-table-instantiation…
DougGregor Jun 15, 2020
77d0919
Merge pull request #32365 from gregomni/solution-node-map
xedin Jun 15, 2020
da53129
[CSSimplify] Adjusting naming and comments of method that validates r…
LucianoPAlmeida Jun 15, 2020
3455ba9
Merge pull request #32377 from apple/compnerd-ICU-67
compnerd Jun 15, 2020
a666d32
Merge pull request #32379 from compnerd/xml2-control
compnerd Jun 15, 2020
e2a20ab
Merge pull request #32360 from nate-chandler/gardening/ignore-swift-i…
nate-chandler Jun 15, 2020
4d705ab
Merge pull request #32319 from meg-gupta/onfastpath
meg-gupta Jun 15, 2020
4849947
Merge pull request #32277 from aschwaighofer/irgen_fix_addAbstractCon…
aschwaighofer Jun 15, 2020
73d8419
Merge pull request #32352 from keith/ks/reland-emit-coverage-mappings…
compnerd Jun 15, 2020
2a377bc
Merge pull request #32363 from 3405691582/Test_OpenBSD_ArchAliasing
compnerd Jun 15, 2020
4b1ffa5
[NameLookup] Ensure extensions are updated after module load
hamishknight Jun 15, 2020
403b2bf
Merge pull request #32362 from adrian-prantl/63991514
adrian-prantl Jun 15, 2020
47554c1
Merge pull request #31942 from rockbruno/allelementsmatter
Jun 15, 2020
80e2b48
[Test] Version cleanup
DougGregor Jun 15, 2020
f155ce8
Merge pull request #32375 from hamishknight/cached-my-last-rain-check
hamishknight Jun 15, 2020
8573d70
[Typechecker] Diagnose use of magic literals as raw value for enum ca…
theblixguy Jun 15, 2020
d22821e
Merge pull request #31814 from LucianoPAlmeida/SR-12723-conventions
LucianoPAlmeida Jun 16, 2020
542721b
[AutoDiff] Disable flaky tests on Linux. (#32394)
dan-zheng Jun 16, 2020
aefeab8
[Basic] Revise version printing
davezarzycki Jun 12, 2020
ced3b39
[SIL] NFC: Fix -Wdeprecated-copy warnings
davezarzycki Jun 16, 2020
ba59ef5
Merge pull request #32345 from davezarzycki/pr32345
davezarzycki Jun 16, 2020
ef1b5a8
Merge pull request #32405 from davezarzycki/pr32405
swift-ci Jun 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions docs/WindowsBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ git clone https://github.com/compnerd/swift-build swift-build
## Acquire ICU, SQLite3, curl, libxml2 and zlib

```
python -m pip install --user msrest azure-devops tabulate
python swift-build\utilities\swift-build.py --build-id ICU --latest-artifacts --filter windows-x64 --download
python swift-build\utilities\swift-build.py --build-id XML2 --latest-artifacts --filter windows-x64 --download
python swift-build\utilities\swift-build.py --build-id CURL --latest-artifacts --filter windows-x64 --download
python swift-build\utilities\swift-build.py --build-id zlib --latest-artifacts --filter windows-x64 --download
python swift-build\utilities\swift-build.py --build-id SQLite --latest-artifacts --filter windows-x64 --download
C:\Python27\python.exe -m pip install --user msrest azure-devops tabulate
C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id ICU --latest-artifacts --filter windows-x64 --download
C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id XML2 --latest-artifacts --filter windows-x64 --download
C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id CURL --latest-artifacts --filter windows-x64 --download
C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id zlib --latest-artifacts --filter windows-x64 --download
C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id SQLite --latest-artifacts --filter windows-x64 --download
```

Extract the zip files, ignoring the top level directory, into `S:/Library`. The directory structure should resemble:

```
/Library
┝ icu-64
┝ icu-67
│ ┕ usr/...
├ libcurl-development
│ ┕ usr/...
Expand Down Expand Up @@ -138,10 +138,10 @@ cmake -B "S:\b\toolchain" ^
-D LLDB_ENABLE_PYTHON=YES ^
-D LLVM_EXTERNAL_SWIFT_SOURCE_DIR="S:/swift" ^
-D LLVM_EXTERNAL_CMARK_SOURCE_DIR="S:/cmark" ^
-D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="S:/Library/icu-64/usr/include" ^
-D SWIFT_WINDOWS_x86_64_ICU_UC="S:/Library/icu-64/usr/lib/icuuc64.lib" ^
-D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="S:/Library/icu-64/usr/include" ^
-D SWIFT_WINDOWS_x86_64_ICU_I18N="S:/Library/icu-64/usr/lib/icuin64.lib" ^
-D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="S:/Library/icu-67/usr/include" ^
-D SWIFT_WINDOWS_x86_64_ICU_UC="S:/Library/icu-67/usr/lib/icuuc67.lib" ^
-D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="S:/Library/icu-67/usr/include" ^
-D SWIFT_WINDOWS_x86_64_ICU_I18N="S:/Library/icu-67/usr/lib/icuin67.lib" ^
-D CMAKE_INSTALL_PREFIX="C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr" ^
-D PYTHON_EXECUTABLE=C:\Python27\python.exe ^
-D SWIFT_BUILD_DYNAMIC_STDLIB=YES ^
Expand All @@ -158,7 +158,7 @@ ninja -C S:\b\toolchain
## Running Swift tests on Windows

```cmd
path S:\Library\icu-64\usr\bin;S:\b\toolchain\bin;S:\b\toolchain\tools\swift\libdispatch-prefix\bin;%PATH%;%ProgramFiles%\Git\usr\bin
path S:\Library\icu-67\usr\bin;S:\b\toolchain\bin;S:\b\toolchain\tools\swift\libdispatch-prefix\bin;%PATH%;%ProgramFiles%\Git\usr\bin
ninja -C S:\b\toolchain check-swift
```

Expand All @@ -178,7 +178,7 @@ ninja -C S:\b\libdispatch check
## Build swift-corelibs-foundation

```cmd
cmake -B S:\b\foundation -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=S:/b/toolchain/bin/clang-cl.exe -D CMAKE_Swift_COMPILER=S:/b/toolchain/bin/swiftc.exe -D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" -D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" -D ICU_ROOT="S:/Library/icu-64" -D ICU_INCLUDE_DIR=S:/Library/icu-64/usr/include -D LIBXML2_LIBRARY="S:/Library/libxml2-development/usr/lib/libxml2s.lib" -D LIBXML2_INCLUDE_DIR="S:/Library/libxml2-development/usr/include/libxml2" -D ENABLE_TESTING=NO -D dispatch_DIR=S:/b/libdispatch/cmake/modules -G Ninja -S S:\swift-corelibs-foundation
cmake -B S:\b\foundation -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=S:/b/toolchain/bin/clang-cl.exe -D CMAKE_Swift_COMPILER=S:/b/toolchain/bin/swiftc.exe -D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" -D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" -D ICU_ROOT="S:/Library/icu-67" -D ICU_INCLUDE_DIR=S:/Library/icu-67/usr/include -D LIBXML2_LIBRARY="S:/Library/libxml2-development/usr/lib/libxml2s.lib" -D LIBXML2_INCLUDE_DIR="S:/Library/libxml2-development/usr/include/libxml2" -D ENABLE_TESTING=NO -D dispatch_DIR=S:/b/libdispatch/cmake/modules -G Ninja -S S:\swift-corelibs-foundation
ninja -C S:\b\foundation
```

Expand Down Expand Up @@ -210,7 +210,7 @@ ninja -C S:\b\xctest check-xctest
## Rebuild Foundation

```cmd
cmake -B S:\b\foundation -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=S:/b/toolchain/bin/clang-cl.exe -D CMAKE_Swift_COMPILER=S:/b/toolchain/bin/swiftc.exe -D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" -D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" -D ICU_ROOT="S:/Library/icu-64" -D LIBXML2_LIBRARY="S:/Library/libxml2-development/usr/lib/libxml2.lib" -D LIBXML2_INCLUDE_DIR="S:/Library/libxml2-development/usr/include" -D ENABLE_TESTING=YES -D dispatch_DIR=S:/b/libdispatch/cmake/modules -D XCTest_DIR=S:/b/xctest/cmake/modules -G Ninja -S S:\swift-corelibs-foundation
cmake -B S:\b\foundation -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=S:/b/toolchain/bin/clang-cl.exe -D CMAKE_Swift_COMPILER=S:/b/toolchain/bin/swiftc.exe -D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" -D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" -D ICU_ROOT="S:/Library/icu-67" -D LIBXML2_LIBRARY="S:/Library/libxml2-development/usr/lib/libxml2.lib" -D LIBXML2_INCLUDE_DIR="S:/Library/libxml2-development/usr/include" -D ENABLE_TESTING=YES -D dispatch_DIR=S:/b/libdispatch/cmake/modules -D XCTest_DIR=S:/b/xctest/cmake/modules -G Ninja -S S:\swift-corelibs-foundation
ninja -C S:\b\foundation
```

Expand Down
3 changes: 3 additions & 0 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -2668,6 +2668,9 @@ ERROR(enum_non_integer_convertible_raw_type_no_value,none,
"expressible by integer or string literal", ())
ERROR(enum_raw_value_not_unique,none,
"raw value for enum case is not unique", ())
ERROR(enum_raw_value_magic_literal,none,
"use of '%0' literal as raw value for enum case is not supported",
(StringRef))
NOTE(enum_raw_value_used_here,none,
"raw value previously used here", ())
NOTE(enum_raw_value_incrementing_from_here,none,
Expand Down
4 changes: 2 additions & 2 deletions include/swift/Basic/Dwarf.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace swift {
/// The DWARF version emitted by the Swift compiler.
const unsigned DWARFVersion = 4;

static const char MachOASTSegmentName[] = "__SWIFT";
static const char MachOASTSectionName[] = "__ast";
static const char MachOASTSegmentName[] = "__DWARF";
static const char MachOASTSectionName[] = "__swift_ast";
static const char ELFASTSectionName[] = ".swift_ast";
static const char COFFASTSectionName[] = "swiftast";
static const char WasmASTSectionName[] = ".swift_ast";
Expand Down
45 changes: 27 additions & 18 deletions include/swift/SIL/OwnershipUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,20 @@ bool isOwnedForwardingInstruction(SILInstruction *inst);
/// previous terminator.
bool isOwnedForwardingValue(SILValue value);

struct BorrowingOperandKind {
enum Kind {
class BorrowingOperandKind {
public:
enum Kind : uint8_t {
BeginBorrow,
BeginApply,
Branch,
};

private:
Kind value;

public:
BorrowingOperandKind(Kind newValue) : value(newValue) {}
BorrowingOperandKind(const BorrowingOperandKind &other)
: value(other.value) {}

operator Kind() const { return value; }

static Optional<BorrowingOperandKind> get(SILInstructionKind kind) {
Expand Down Expand Up @@ -207,15 +209,20 @@ struct BorrowingOperand {
llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
const BorrowingOperand &operand);

struct BorrowedValueKind {
class BorrowedValueKind {
public:
/// Enum we use for exhaustive pattern matching over borrow scope introducers.
enum Kind {
enum Kind : uint8_t {
LoadBorrow,
BeginBorrow,
SILFunctionArgument,
Phi,
};

private:
Kind value;

public:
static Optional<BorrowedValueKind> get(SILValue value) {
if (value.getOwnershipKind() != ValueOwnershipKind::Guaranteed)
return None;
Expand All @@ -240,10 +247,8 @@ struct BorrowedValueKind {
}
}

Kind value;

BorrowedValueKind(Kind newValue) : value(newValue) {}
BorrowedValueKind(const BorrowedValueKind &other) : value(other.value) {}

operator Kind() const { return value; }

/// Is this a borrow scope that begins and ends within the same function and
Expand Down Expand Up @@ -383,18 +388,20 @@ bool getAllBorrowIntroducingValues(SILValue value,
/// introducer, then we return a .some(BorrowScopeIntroducingValue).
Optional<BorrowedValue> getSingleBorrowIntroducingValue(SILValue inputValue);

struct InteriorPointerOperandKind {
class InteriorPointerOperandKind {
public:
enum Kind : uint8_t {
RefElementAddr,
RefTailAddr,
OpenExistentialBox,
};

private:
Kind value;

public:
InteriorPointerOperandKind(Kind newValue) : value(newValue) {}
InteriorPointerOperandKind(const InteriorPointerOperandKind &other)
: value(other.value) {}

operator Kind() const { return value; }

static Optional<InteriorPointerOperandKind> get(Operand *use) {
Expand Down Expand Up @@ -467,8 +474,9 @@ struct InteriorPointerOperand {
: operand(op), kind(kind) {}
};

struct OwnedValueIntroducerKind {
enum Kind {
class OwnedValueIntroducerKind {
public:
enum Kind : uint8_t {
/// An owned value that is a result of an Apply.
Apply,

Expand Down Expand Up @@ -519,6 +527,10 @@ struct OwnedValueIntroducerKind {
AllocRefInit,
};

private:
Kind value;

public:
static Optional<OwnedValueIntroducerKind> get(SILValue value) {
if (value.getOwnershipKind() != ValueOwnershipKind::Owned)
return None;
Expand Down Expand Up @@ -569,11 +581,8 @@ struct OwnedValueIntroducerKind {
llvm_unreachable("Default should have caught this");
}

Kind value;

OwnedValueIntroducerKind(Kind newValue) : value(newValue) {}
OwnedValueIntroducerKind(const OwnedValueIntroducerKind &other)
: value(other.value) {}

operator Kind() const { return value; }

void print(llvm::raw_ostream &os) const;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ class SILModule {
bool deserializeLazily=true);

/// Look up the VTable mapped to the given ClassDecl. Returns null on failure.
SILVTable *lookUpVTable(const ClassDecl *C);
SILVTable *lookUpVTable(const ClassDecl *C, bool deserializeLazily = true);

/// Attempt to lookup the function corresponding to \p Member in the class
/// hierarchy of \p Class.
Expand Down
14 changes: 9 additions & 5 deletions include/swift/SIL/SILVTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ class SILVTableEntry {
/// The function which implements the method for the class and the entry kind.
llvm::PointerIntPair<SILFunction *, 2, unsigned> ImplAndKind;

bool IsNonOverridden;

public:
enum Kind : uint8_t {
/// The vtable entry is for a method defined directly in this class.
Normal,
/// The vtable entry is for a method defined directly in this class, and is
/// never overridden by subclasses.
NormalNonOverridden,
/// The vtable entry is inherited from the superclass.
Inherited,
/// The vtable entry is inherited from the superclass, and overridden
Expand All @@ -67,14 +66,19 @@ class SILVTableEntry {

SILVTableEntry() : ImplAndKind(nullptr, Kind::Normal) {}

SILVTableEntry(SILDeclRef Method, SILFunction *Implementation, Kind TheKind)
: Method(Method), ImplAndKind(Implementation, TheKind) {}
SILVTableEntry(SILDeclRef Method, SILFunction *Implementation, Kind TheKind,
bool NonOverridden)
: Method(Method), ImplAndKind(Implementation, TheKind),
IsNonOverridden(NonOverridden) {}

SILDeclRef getMethod() const { return Method; }

Kind getKind() const { return Kind(ImplAndKind.getInt()); }
void setKind(Kind kind) { ImplAndKind.setInt(kind); }

bool isNonOverridden() const { return IsNonOverridden; }
void setNonOverridden(bool value) { IsNonOverridden = value; }

SILFunction *getImplementation() const { return ImplAndKind.getPointer(); }
};

Expand Down
6 changes: 6 additions & 0 deletions lib/AST/NameLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,12 @@ DirectLookupRequest::evaluate(Evaluator &evaluator,

decl->prepareLookupTable();

// If we're allowed to load extensions, call prepareExtensions to ensure we
// properly invalidate the lazily-complete cache for any extensions brought in
// by modules loaded after-the-fact. This can happen with the LLDB REPL.
if (!disableAdditionalExtensionLoading)
decl->prepareExtensions();

auto &Table = *decl->LookupTable;
if (!useNamedLazyMemberLoading) {
// Make sure we have the complete list of members (in this nominal and in
Expand Down
16 changes: 10 additions & 6 deletions lib/AST/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,16 @@ getObjCObjectRepresentable(Type type, const DeclContext *dc) {
static std::pair<ForeignRepresentableKind, ProtocolConformance *>
getForeignRepresentable(Type type, ForeignLanguage language,
const DeclContext *dc) {
// Local function that simply produces a failing result.
auto failure = []() -> std::pair<ForeignRepresentableKind,
ProtocolConformance *> {
return { ForeignRepresentableKind::None, nullptr };
};

// If type has an error let's fail early.
if (type->hasError())
return failure();

// Look through one level of optional type, but remember that we did.
bool wasOptional = false;
if (auto valueType = type->getOptionalObjectType()) {
Expand All @@ -2222,12 +2232,6 @@ getForeignRepresentable(Type type, ForeignLanguage language,
return { representable, nullptr };
}

// Local function that simply produces a failing result.
auto failure = []() -> std::pair<ForeignRepresentableKind,
ProtocolConformance *> {
return { ForeignRepresentableKind::None, nullptr };
};

// Function types.
if (auto functionType = type->getAs<FunctionType>()) {
// Cannot handle throwing functions.
Expand Down
1 change: 0 additions & 1 deletion lib/Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function(generate_revision_inc revision_inc_var name dir)
endfunction()

generate_revision_inc(llvm_revision_inc LLVM "${LLVM_MAIN_SRC_DIR}")
generate_revision_inc(clang_revision_inc Clang "${CLANG_MAIN_SRC_DIR}")
generate_revision_inc(swift_revision_inc Swift "${SWIFT_SOURCE_DIR}")

add_swift_host_library(swiftBasic STATIC
Expand Down
24 changes: 7 additions & 17 deletions lib/Basic/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,25 @@
#endif

#include "LLVMRevision.inc"
#include "ClangRevision.inc"
#include "SwiftRevision.inc"

namespace swift {
namespace version {

/// Print a string of the form "LLVM xxxxx, Clang yyyyy, Swift zzzzz",
/// where each placeholder is the revision for the associated repository.
/// Print a string of the form "LLVM xxxxx, Swift zzzzz", where each placeholder
/// is the revision for the associated repository.
static void printFullRevisionString(raw_ostream &out) {
// Arbitrarily truncate to 10 characters. This should be enough to unique
// Git hashes for the time being, and certainly enough for SVN revisions,
// while keeping the version string from being ridiculously long.
// Arbitrarily truncate to 15 characters. This should be enough to unique Git
// hashes while keeping the REPL version string from overflowing 80 columns.
#if defined(LLVM_REVISION)
out << "LLVM " << StringRef(LLVM_REVISION).slice(0, 10);
# if defined(CLANG_REVISION) || defined(SWIFT_REVISION)
out << ", ";
# endif
#endif

#if defined(CLANG_REVISION)
out << "Clang " << StringRef(CLANG_REVISION).slice(0, 10);
out << "LLVM " << StringRef(LLVM_REVISION).slice(0, 15);
# if defined(SWIFT_REVISION)
out << ", ";
# endif
#endif

#if defined(SWIFT_REVISION)
out << "Swift " << StringRef(SWIFT_REVISION).slice(0, 10);
out << "Swift " << StringRef(SWIFT_REVISION).slice(0, 15);
#endif
}

Expand Down Expand Up @@ -424,8 +415,7 @@ std::string getSwiftFullVersion(Version effectiveVersion) {
OS << " clang-" CLANG_COMPILER_VERSION;
#endif
OS << ")";
#elif defined(LLVM_REVISION) || defined(CLANG_REVISION) || \
defined(SWIFT_REVISION)
#elif defined(LLVM_REVISION) || defined(SWIFT_REVISION)
OS << " (";
printFullRevisionString(OS);
OS << ")";
Expand Down
3 changes: 3 additions & 0 deletions lib/ClangImporter/ImportName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,9 @@ ImportedName NameImporter::importNameImpl(const clang::NamedDecl *D,
case clang::OverloadedOperatorKind::OO_Minus:
case clang::OverloadedOperatorKind::OO_Star:
case clang::OverloadedOperatorKind::OO_Slash:
case clang::OverloadedOperatorKind::OO_Percent:
case clang::OverloadedOperatorKind::OO_Amp:
case clang::OverloadedOperatorKind::OO_Pipe:
case clang::OverloadedOperatorKind::OO_LessLess:
case clang::OverloadedOperatorKind::OO_GreaterGreater:
case clang::OverloadedOperatorKind::OO_AmpAmp:
Expand Down
Loading