Skip to content

[pull] swiftwasm from master #639

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 17 commits into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 3 additions & 23 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,6 @@ function(_add_swift_host_library_single target)
message(FATAL_ERROR "Either SHARED or STATIC must be specified")
endif()

# Determine the subdirectory where this library will be installed.
set(ASHLS_SUBDIR
"${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH}")

# Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
set(embed_bitcode_arg)
if(SWIFT_EMBED_BITCODE_SECTION)
Expand Down Expand Up @@ -656,19 +652,7 @@ function(_add_swift_host_library_single target)
set(c_compile_flags ${ASHLS_C_COMPILE_FLAGS})
set(link_flags)

set(library_search_subdir "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
set(library_search_directories
"${SWIFTLIB_DIR}/${ASHLS_SUBDIR}"
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${ASHLS_SUBDIR}"
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")

# In certain cases when building, the environment variable SDKROOT is set to override
# where the sdk root is located in the system. If that environment variable has been
# set by the user, respect it and add the specified SDKROOT directory to the
# library_search_directories so we are able to link against those libraries
if(DEFINED ENV{SDKROOT} AND EXISTS "$ENV{SDKROOT}/usr/lib/swift")
list(APPEND library_search_directories "$ENV{SDKROOT}/usr/lib/swift")
endif()
set(library_search_directories)

_add_variant_c_compile_flags(
SDK "${SWIFT_HOST_VARIANT_SDK}"
Expand Down Expand Up @@ -843,8 +827,6 @@ function(_add_swift_host_executable_single name)
ARCHITECTURE
SDK)
set(multiple_parameter_options
COMPILE_FLAGS
DEPENDS
LLVM_LINK_COMPONENTS)
cmake_parse_arguments(SWIFTEXE_SINGLE
"${options}"
Expand Down Expand Up @@ -892,10 +874,8 @@ function(_add_swift_host_executable_single name)
${SWIFTEXE_SINGLE_EXTERNAL_SOURCES})

add_dependencies_multiple_targets(
TARGETS "${name}"
DEPENDS
${LLVM_COMMON_DEPENDS}
${SWIFTEXE_SINGLE_DEPENDS})
TARGETS ${name}
DEPENDS ${LLVM_COMMON_DEPENDS})
llvm_update_compile_flags("${name}")

if(SWIFTEXE_SINGLE_SDK STREQUAL WINDOWS)
Expand Down
3 changes: 2 additions & 1 deletion lib/AST/ASTScopeCreation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,10 @@ class ScopeCreator final {
ASTScopeAssert(!n.isDecl(DeclKind::Accessor),
"Should not see accessors here");
// Can occur in illegal code
// non-empty brace stmt could define a new insertion point
if (auto *const s = n.dyn_cast<Stmt *>()) {
if (auto *const bs = dyn_cast<BraceStmt>(s))
ASTScopeAssert(bs->empty(), "Might mess up insertion point");
return !bs->empty();
}
return !n.isDecl(DeclKind::Var);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Frontend/DiagnosticVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ DiagnosticVerifier::Result DiagnosticVerifier::verifyFile(unsigned BufferID) {
// Verify educational notes
for (auto &foundName : FoundDiagnostic.EducationalNotes) {
llvm::erase_if(expectedNotes->Names,
[&](std::string item) { return item == foundName; });
[&](StringRef item) { return item.equals(foundName); });
}

if (!expectedNotes->Names.empty()) {
Expand Down Expand Up @@ -950,7 +950,7 @@ void DiagnosticVerifier::handleDiagnostic(SourceManager &SM,

llvm::SmallVector<std::string, 1> eduNotes;
for (auto &notePath : Info.EducationalNotePaths) {
eduNotes.push_back(llvm::sys::path::stem(notePath));
eduNotes.push_back(llvm::sys::path::stem(notePath).str());
}

llvm::SmallString<128> message;
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/FloatingPointTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ extension ${Self}: _ExpressibleByBuiltinIntegerLiteral, ExpressibleByIntegerLite
}

% if bits != 80:
#if !os(Windows) && (arch(i386) || arch(x86_64))
#if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
% end

% builtinFloatLiteralBits = 80
Expand Down
4 changes: 2 additions & 2 deletions test/IRGen/class_resilience_dynamic_replacement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ public class ResilientClass {
// The dynamic replacement key should be public even though the method
// implementation is hidden.

// CHECK-LABEL: @"$s36class_resilience_dynamic_replacement14ResilientClassC15resilientMethodyyFTx" = {{(protected )?}}constant %swift.dyn_repl_key
// CHECK-LABEL: define hidden swiftcc void @"$s36class_resilience_dynamic_replacement14ResilientClassC15resilientMethodyyF"
// CHECK-LABEL: @"$s36class_resilience_dynamic_replacement14ResilientClassC15resilientMethodyyFTx" = {{(dllexport |protected )?}}constant %swift.dyn_repl_key
// CHECK-LABEL: define hidden swiftcc void @"$s36class_resilience_dynamic_replacement14ResilientClassC15resilientMethodyyF"
12 changes: 12 additions & 0 deletions test/NameLookup/nonempty-brace-in-brace.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// RUN: not %target-swift-frontend -typecheck %s 2>&1 | %FileCheck %s --check-prefix=CHECK-NO-ASSERTION

// Used to trip an assertion

public struct Foo {
func bar() {
var copySelf = self
repeat { copySelf

private extension String {}

// CHECK-NO-ASSERTION-NOT: Assertion
1 change: 1 addition & 0 deletions utils/vim/syntax/sil.vim
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ syn keyword silConventions
\ c
\ method
\ objc_method
\ sil_differentiability_witness
\ thick
\ thin
\ witness_method
Expand Down