Skip to content

Commit f71af6c

Browse files
authored
Merge pull request #639 from swiftwasm/master
[pull] swiftwasm from master
2 parents 84199cf + 3d1bfde commit f71af6c

File tree

8 files changed

+23
-29
lines changed

8 files changed

+23
-29
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,6 @@ function(_add_swift_host_library_single target)
552552
message(FATAL_ERROR "Either SHARED or STATIC must be specified")
553553
endif()
554554

555-
# Determine the subdirectory where this library will be installed.
556-
set(ASHLS_SUBDIR
557-
"${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH}")
558-
559555
# Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
560556
set(embed_bitcode_arg)
561557
if(SWIFT_EMBED_BITCODE_SECTION)
@@ -660,19 +656,7 @@ function(_add_swift_host_library_single target)
660656
set(c_compile_flags ${ASHLS_C_COMPILE_FLAGS})
661657
set(link_flags)
662658

663-
set(library_search_subdir "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
664-
set(library_search_directories
665-
"${SWIFTLIB_DIR}/${ASHLS_SUBDIR}"
666-
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${ASHLS_SUBDIR}"
667-
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
668-
669-
# In certain cases when building, the environment variable SDKROOT is set to override
670-
# where the sdk root is located in the system. If that environment variable has been
671-
# set by the user, respect it and add the specified SDKROOT directory to the
672-
# library_search_directories so we are able to link against those libraries
673-
if(DEFINED ENV{SDKROOT} AND EXISTS "$ENV{SDKROOT}/usr/lib/swift")
674-
list(APPEND library_search_directories "$ENV{SDKROOT}/usr/lib/swift")
675-
endif()
659+
set(library_search_directories)
676660

677661
_add_variant_c_compile_flags(
678662
SDK "${SWIFT_HOST_VARIANT_SDK}"
@@ -853,8 +837,6 @@ function(_add_swift_host_executable_single name)
853837
ARCHITECTURE
854838
SDK)
855839
set(multiple_parameter_options
856-
COMPILE_FLAGS
857-
DEPENDS
858840
LLVM_LINK_COMPONENTS)
859841
cmake_parse_arguments(SWIFTEXE_SINGLE
860842
"${options}"
@@ -902,10 +884,8 @@ function(_add_swift_host_executable_single name)
902884
${SWIFTEXE_SINGLE_EXTERNAL_SOURCES})
903885

904886
add_dependencies_multiple_targets(
905-
TARGETS "${name}"
906-
DEPENDS
907-
${LLVM_COMMON_DEPENDS}
908-
${SWIFTEXE_SINGLE_DEPENDS})
887+
TARGETS ${name}
888+
DEPENDS ${LLVM_COMMON_DEPENDS})
909889
llvm_update_compile_flags("${name}")
910890

911891
if(SWIFTEXE_SINGLE_SDK STREQUAL WINDOWS)

lib/AST/ASTScopeCreation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,10 @@ class ScopeCreator final {
658658
ASTScopeAssert(!n.isDecl(DeclKind::Accessor),
659659
"Should not see accessors here");
660660
// Can occur in illegal code
661+
// non-empty brace stmt could define a new insertion point
661662
if (auto *const s = n.dyn_cast<Stmt *>()) {
662663
if (auto *const bs = dyn_cast<BraceStmt>(s))
663-
ASTScopeAssert(bs->empty(), "Might mess up insertion point");
664+
return !bs->empty();
664665
}
665666
return !n.isDecl(DeclKind::Var);
666667
}

lib/Frontend/DiagnosticVerifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ DiagnosticVerifier::Result DiagnosticVerifier::verifyFile(unsigned BufferID) {
740740
// Verify educational notes
741741
for (auto &foundName : FoundDiagnostic.EducationalNotes) {
742742
llvm::erase_if(expectedNotes->Names,
743-
[&](std::string item) { return item == foundName; });
743+
[&](StringRef item) { return item.equals(foundName); });
744744
}
745745

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

951951
llvm::SmallVector<std::string, 1> eduNotes;
952952
for (auto &notePath : Info.EducationalNotePaths) {
953-
eduNotes.push_back(llvm::sys::path::stem(notePath));
953+
eduNotes.push_back(llvm::sys::path::stem(notePath).str());
954954
}
955955

956956
llvm::SmallString<128> message;

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ extension ${Self}: _ExpressibleByBuiltinIntegerLiteral, ExpressibleByIntegerLite
903903
}
904904

905905
% if bits != 80:
906-
#if !os(Windows) && (arch(i386) || arch(x86_64))
906+
#if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
907907
% end
908908

909909
% builtinFloatLiteralBits = 80

test/IRGen/class_resilience_dynamic_replacement.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ public class ResilientClass {
77
// The dynamic replacement key should be public even though the method
88
// implementation is hidden.
99

10-
// CHECK-LABEL: @"$s36class_resilience_dynamic_replacement14ResilientClassC15resilientMethodyyFTx" = {{(protected )?}}constant %swift.dyn_repl_key
11-
// CHECK-LABEL: define hidden swiftcc void @"$s36class_resilience_dynamic_replacement14ResilientClassC15resilientMethodyyF"
10+
// CHECK-LABEL: @"$s36class_resilience_dynamic_replacement14ResilientClassC15resilientMethodyyFTx" = {{(dllexport |protected )?}}constant %swift.dyn_repl_key
11+
// CHECK-LABEL: define hidden swiftcc void @"$s36class_resilience_dynamic_replacement14ResilientClassC15resilientMethodyyF"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: not %target-swift-frontend -typecheck %s 2>&1 | %FileCheck %s --check-prefix=CHECK-NO-ASSERTION
2+
3+
// Used to trip an assertion
4+
5+
public struct Foo {
6+
func bar() {
7+
var copySelf = self
8+
repeat { copySelf
9+
10+
private extension String {}
11+
12+
// CHECK-NO-ASSERTION-NOT: Assertion

utils/vim/syntax/sil.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ syn keyword silConventions
3131
\ c
3232
\ method
3333
\ objc_method
34+
\ sil_differentiability_witness
3435
\ thick
3536
\ thin
3637
\ witness_method

0 commit comments

Comments
 (0)