Skip to content

[pull] swiftwasm from master #1033

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

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
edcf764
[NFC] AST: Define and use IterableDeclContext::getAsGenericContext()
AnthonyLatsis May 7, 2020
b3af1a0
[NFC] AST: Relocate takeConformanceDiagnostics & getLocalProtocols to…
AnthonyLatsis May 7, 2020
bfe25fa
[NFC] AST: Relocate getLocalConformances to IterableDeclContext
AnthonyLatsis May 7, 2020
76282b1
[update-checkout] swift-argument-parser 0.0.5 -> 0.06
owenv May 14, 2020
f1ca2e9
[stdlib] sem_t is a nullable pointer on OpenBSD.
3405691582 Jan 3, 2020
3c41489
[IRGen testing] Reapply: Fix bogus FileCheck check-prefix "-SAME" usage
davezarzycki May 16, 2020
ba4da8e
LICM: enable more stores to moved out of a loop
eeckstein May 13, 2020
0c403fe
[build] Pass target argument to the linker if needed (#31794)
edymtt May 18, 2020
a5646e1
Serialization: permit the directory layout on non-Apple targets
compnerd May 18, 2020
dca0209
Merge pull request #31807 from eeckstein/licm-improvement
eeckstein May 18, 2020
cb3db19
Merge pull request #31790 from owenv/update-the-update-script
shahmishal May 18, 2020
f0413f6
build: remove last `llvm::` reference in stdlib
compnerd May 18, 2020
e774feb
test: loosen the IRGen test
compnerd May 17, 2020
55447e6
Merge pull request #31645 from AnthonyLatsis/relocate-to-iterabledc
AnthonyLatsis May 18, 2020
0a3d2d5
[docs] Update Testing.md
benrimmington May 18, 2020
67a98c5
Swap Different with Same
May 18, 2020
7e00f7e
Merge pull request #31853 from 3405691582/Semaphore_Typealias_OpenBSD
CodaFi May 18, 2020
a461a48
stdlib: Make non-native ArrayBuffer.capacity smaller
meg-gupta May 18, 2020
37b0f58
[Diagnostics] Rely on clang headers for .dia block and record IDs
owenv May 17, 2020
a92894c
test: ensure that we do not regress the standard library isolation
compnerd May 18, 2020
68a6773
Merge pull request #31864 from compnerd/demangling
compnerd May 18, 2020
1d48e63
Fixes example snippets in Quadrature.swift
valeriyvan May 16, 2020
30afc6c
Consolidated four CoreGraphics execution tests
gribozavr May 18, 2020
0a77ce3
Remove @inline(always) from Array's nonNative getter
meg-gupta May 18, 2020
94916de
[AST] Restore getSourceRange() on DefaultArgumentExpr.
May 18, 2020
f42a62b
Update llvm-support-odr-violation.test-sh
compnerd May 18, 2020
51be974
Merge pull request #31857 from davezarzycki/pr31857
davezarzycki May 18, 2020
5121349
NFC: Move implementation-only import checking to ImportResolution
hamishknight May 18, 2020
851f640
Lift implementation-only import checking into a request
hamishknight May 18, 2020
f3cc6a5
Merge pull request #31849 from owenv/dia-updates
owenv May 18, 2020
cba3c23
Merge pull request #31865 from pi1024e/Clang-Fix
CodaFi May 19, 2020
01fce92
Merge pull request #31866 from benrimmington/docs-testing-iphone-5
CodaFi May 19, 2020
50809ef
Merge pull request #31844 from valeriyvan/FixExampleSnippetsQuadratur…
CodaFi May 19, 2020
b255a2f
[update-checkout] Add alias for swift/master-next branch
shahmishal May 19, 2020
0e008e0
Merge pull request #31861 from nathawes/default-arg-location-source-loc
May 19, 2020
bf1b17d
Merge pull request #31872 from hamishknight/implementation-details
hamishknight May 19, 2020
f8810ab
[Gardening] Remove InImmediateMode
CodaFi May 19, 2020
921180f
[NFC] Remove DelayWholeModuleChecking
CodaFi May 19, 2020
854d6ee
[NFC] Remove forEachSourceFileIn
CodaFi May 19, 2020
976890d
Merge pull request #31877 from apple/shahmishal/add-alias-for-swift-m…
swift-ci May 19, 2020
1fd2ac5
Merge pull request #31879 from CodaFi/mtimes-often-lie
CodaFi May 19, 2020
e055b4b
Merge pull request #31859 from gribozavr/merge-coregraphics
gribozavr May 19, 2020
0968d16
Merge pull request #31868 from meg-gupta/endindex
meg-gupta May 19, 2020
78d2301
SILInstructions: remove two unused fields.
eeckstein May 19, 2020
2582bc4
Merge pull request #31885 from eeckstein/fix-warning
swift-ci May 19, 2020
bfb65ec
Merge pull request #31870 from compnerd/stdlib-insurance
compnerd May 19, 2020
84ff38f
Merge pull request #31860 from compnerd/directory-layout-unification
compnerd May 19, 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
9 changes: 9 additions & 0 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,15 @@ function(add_swift_host_library name)
target_link_options(${name} PRIVATE
"LINKER:-current_version,${SWIFT_COMPILER_VERSION}")
endif()

set(DEPLOYMENT_VERSION "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}")
# MSVC, clang-cl, gcc don't understand -target.
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT SWIFT_COMPILER_IS_MSVC_LIKE)
get_target_triple(target target_variant "${SWIFT_HOST_VARIANT_SDK}" "${SWIFT_HOST_VARIANT_ARCH}"
MACCATALYST_BUILD_FLAVOR ""
DEPLOYMENT_VERSION "${DEPLOYMENT_VERSION}")
target_link_options(${name} PRIVATE -target;${target})
endif()
endif()

add_dependencies(dev ${name})
Expand Down
18 changes: 18 additions & 0 deletions docs/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ We use multiple approaches to test the Swift toolchain.
locally before committing. (Usually on a single platform, and not necessarily
all tests.)
* Buildbots run all tests, on all supported platforms.
[Smoke testing](ContinuousIntegration.md#smoke-testing)
skips the iOS, tvOS, and watchOS platforms.

The [test/lit.cfg](https://github.com/apple/swift/blob/master/test/lit.cfg)
uses an iOS 10.3 simulator configuration named "iPhone 5" for 32-bit testing.

1. Download and install the iOS 10.3 simulator runtime, in Xcode's
[Components](https://help.apple.com/xcode/#/deva7379ae35) preferences.

2. Create an "iPhone 5" simulator configuration, either in Xcode's
[Devices and Simulators](https://help.apple.com/xcode/#/devf225e58da)
window, or with the command line:

```sh
xcrun simctl create 'iPhone 5' 'com.apple.CoreSimulator.SimDeviceType.iPhone-5'
```

3. Append `--ios` to the `utils/build-script` command line (see below).

### Testsuite subsets

Expand Down
2 changes: 1 addition & 1 deletion include/swift/ABI/TypeIdentity.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class ParsedTypeIdentity {
StringRef FullIdentity;

/// Any extended information that type might have.
Optional<TypeImportInfo<StringRef>> ImportInfo;
llvm::Optional<TypeImportInfo<StringRef>> ImportInfo;

/// The ABI name of the type.
StringRef getABIName() const {
Expand Down
67 changes: 32 additions & 35 deletions include/swift/AST/DeclContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace swift {
class Expr;
class GenericParamList;
class LazyMemberLoader;
class GenericContext;
class GenericSignature;
class GenericTypeParamDecl;
class GenericTypeParamType;
Expand Down Expand Up @@ -566,41 +567,6 @@ class alignas(1 << DeclContextAlignInBits) DeclContext {
LLVM_READONLY
ASTContext &getASTContext() const;

/// Retrieve the set of protocols whose conformances will be
/// associated with this declaration context.
///
/// This function differs from \c getLocalConformances() in that it
/// returns protocol declarations, not protocol conformances, and
/// therefore does not require the protocol conformances to be
/// formed.
///
/// \param lookupKind The kind of lookup to perform.
///
/// FIXME: This likely makes more sense on IterableDeclContext or
/// something similar.
SmallVector<ProtocolDecl *, 2>
getLocalProtocols(ConformanceLookupKind lookupKind
= ConformanceLookupKind::All) const;

/// Retrieve the set of protocol conformances associated with this
/// declaration context.
///
/// \param lookupKind The kind of lookup to perform.
///
/// FIXME: This likely makes more sense on IterableDeclContext or
/// something similar.
SmallVector<ProtocolConformance *, 2>
getLocalConformances(ConformanceLookupKind lookupKind
= ConformanceLookupKind::All) const;

/// Retrieve diagnostics discovered while expanding conformances for this
/// declaration context. This operation then removes those diagnostics from
/// consideration, so subsequent calls to this function with the same
/// declaration context that have not had any new extensions bound
/// will see an empty array.
SmallVector<ConformanceDiagnostic, 4>
takeConformanceDiagnostics() const;

/// Retrieves a list of separately imported overlays which are shadowing
/// \p declaring. If any \p overlays are returned, qualified lookups into
/// \p declaring should be performed into \p overlays instead; since they
Expand Down Expand Up @@ -815,9 +781,40 @@ class IterableDeclContext {
/// valid).
bool wasDeserialized() const;

/// Retrieve the set of protocols whose conformances will be
/// associated with this declaration context.
///
/// This function differs from \c getLocalConformances() in that it
/// returns protocol declarations, not protocol conformances, and
/// therefore does not require the protocol conformances to be
/// formed.
///
/// \param lookupKind The kind of lookup to perform.
SmallVector<ProtocolDecl *, 2>
getLocalProtocols(ConformanceLookupKind lookupKind
= ConformanceLookupKind::All) const;

/// Retrieve the set of protocol conformances associated with this
/// declaration context.
///
/// \param lookupKind The kind of lookup to perform.
SmallVector<ProtocolConformance *, 2>
getLocalConformances(ConformanceLookupKind lookupKind
= ConformanceLookupKind::All) const;

/// Retrieve diagnostics discovered while expanding conformances for this
/// declaration context. This operation then removes those diagnostics from
/// consideration, so subsequent calls to this function with the same
/// declaration context that have not had any new extensions bound
/// will see an empty array.
SmallVector<ConformanceDiagnostic, 4> takeConformanceDiagnostics() const;

/// Return 'this' as a \c Decl.
const Decl *getDecl() const;

/// Return 'this' as a \c GenericContext.
const GenericContext *getAsGenericContext() const;

/// Get the DeclID this Decl was deserialized from.
serialization::DeclID getDeclID() const {
assert(wasDeserialized());
Expand Down
4 changes: 1 addition & 3 deletions include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4227,9 +4227,7 @@ class DefaultArgumentExpr final : public Expr {
DefaultArgsOwner(defaultArgsOwner), ParamIndex(paramIndex), Loc(loc),
ContextOrCallerSideExpr(dc) { }

SourceRange getSourceRange() const { return {}; }

SourceLoc getArgumentListLoc() const { return Loc; }
SourceRange getSourceRange() const { return Loc; }

ConcreteDeclRef getDefaultArgsOwner() const {
return DefaultArgsOwner;
Expand Down
31 changes: 29 additions & 2 deletions include/swift/AST/TypeCheckRequests.h
Original file line number Diff line number Diff line change
Expand Up @@ -2259,7 +2259,8 @@ void simple_display(llvm::raw_ostream &out, ConformanceLookupKind kind);
/// must also be reported so it can be checked as well.
class LookupAllConformancesInContextRequest
: public SimpleRequest<LookupAllConformancesInContextRequest,
ProtocolConformanceLookupResult(const DeclContext *),
ProtocolConformanceLookupResult(
const IterableDeclContext *),
RequestFlags::Uncached |
RequestFlags::DependencySink |
RequestFlags::DependencySource> {
Expand All @@ -2271,7 +2272,7 @@ class LookupAllConformancesInContextRequest

// Evaluation.
ProtocolConformanceLookupResult
evaluate(Evaluator &evaluator, const DeclContext *DC) const;
evaluate(Evaluator &evaluator, const IterableDeclContext *IDC) const;

public:
// Incremental dependencies
Expand Down Expand Up @@ -2429,6 +2430,32 @@ class ResolveTypeRequest
void simple_display(llvm::raw_ostream &out, const TypeResolution *resolution);
SourceLoc extractNearestSourceLoc(const TypeRepr *repr);

/// Checks to see if any of the imports in a module use `@_implementationOnly`
/// in one file and not in another.
///
/// Like redeclaration checking, but for imports.
///
/// This is a request purely to ensure that we don't need to perform the same
/// checking for each file we resolve imports for.
/// FIXME: Once import resolution operates at module-level, this checking can
/// integrated into it.
class CheckInconsistentImplementationOnlyImportsRequest
: public SimpleRequest<CheckInconsistentImplementationOnlyImportsRequest,
evaluator::SideEffect(ModuleDecl *),
RequestFlags::Cached> {
public:
using SimpleRequest::SimpleRequest;

private:
friend SimpleRequest;

evaluator::SideEffect evaluate(Evaluator &evaluator, ModuleDecl *mod) const;

public:
// Cached.
bool isCached() const { return true; }
};

// Allow AnyValue to compare two Type values, even though Type doesn't
// support ==.
template<>
Expand Down
4 changes: 3 additions & 1 deletion include/swift/AST/TypeCheckerTypeIDZone.def
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ SWIFT_REQUEST(TypeChecker, AttachedPropertyWrappersRequest,
NoLocationInfo)
SWIFT_REQUEST(TypeChecker, CallerSideDefaultArgExprRequest,
Expr *(DefaultArgumentExpr *), SeparatelyCached, NoLocationInfo)
SWIFT_REQUEST(TypeChecker, CheckInconsistentImplementationOnlyImportsRequest,
evaluator::SideEffect(ModuleDecl *), Cached, NoLocationInfo)
SWIFT_REQUEST(TypeChecker, CheckRedeclarationRequest,
evaluator::SideEffect(ValueDecl *),
Uncached, NoLocationInfo)
Expand Down Expand Up @@ -256,7 +258,7 @@ SWIFT_REQUEST(TypeChecker, ScopedImportLookupRequest,
SWIFT_REQUEST(TypeChecker, ClosureHasExplicitResultRequest,
bool(ClosureExpr *), Cached, NoLocationInfo)
SWIFT_REQUEST(TypeChecker, LookupAllConformancesInContextRequest,
ProtocolConformanceLookupResult(const DeclContext *),
ProtocolConformanceLookupResult(const IterableDeclContext *),
Uncached, NoLocationInfo)
SWIFT_REQUEST(TypeChecker, SimpleDidSetRequest,
bool(AccessorDecl *), Cached, NoLocationInfo)
4 changes: 4 additions & 0 deletions include/swift/Basic/LLVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ namespace llvm {
template<typename T> class MutableArrayRef;
#endif
template<typename T> class TinyPtrVector;
#if !defined(swiftCore_EXPORTS)
template<typename T> class Optional;
#endif
template <typename ...PTs> class PointerUnion;
template <typename IteratorT> class iterator_range;
class SmallBitVector;
Expand Down Expand Up @@ -75,7 +77,9 @@ namespace swift {
#endif
using llvm::iterator_range;
using llvm::None;
#if !defined(swiftCore_EXPORTS)
using llvm::Optional;
#endif
using llvm::PointerUnion;
using llvm::SmallBitVector;
using llvm::SmallPtrSet;
Expand Down
11 changes: 1 addition & 10 deletions include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,7 @@ namespace swift {
/// 4.2 GHz Intel Core i7.
/// (It's arbitrary, but will keep the compiler from taking too much time.)
unsigned SwitchCheckingInvocationThreshold = 200000;

/// Whether to delay checking that benefits from having the entire
/// module parsed, e.g., Objective-C method override checking.
bool DelayWholeModuleChecking = false;


/// If true, the time it takes to type-check each function will be dumped
/// to llvm::errs().
bool DebugTimeFunctionBodies = false;
Expand All @@ -497,11 +493,6 @@ namespace swift {
/// dumped to llvm::errs().
bool DebugTimeExpressions = false;

/// Indicate that the type checker is checking code that will be
/// immediately executed. This will suppress certain warnings
/// when executing scripts.
bool InImmediateMode = false;

/// Indicate that the type checker should skip type-checking non-inlinable
/// function bodies.
bool SkipNonInlinableFunctionBodies = false;
Expand Down
9 changes: 4 additions & 5 deletions include/swift/Basic/STLExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,19 +528,18 @@ makeOptionalTransformRange(Range range, OptionalTransform op) {
/// the result in an optional to indicate success or failure.
template<typename Subclass>
struct DowncastAsOptional {
template<typename Superclass>
template <typename Superclass>
auto operator()(Superclass &value) const
-> Optional<decltype(llvm::cast<Subclass>(value))> {
-> llvm::Optional<decltype(llvm::cast<Subclass>(value))> {
if (auto result = llvm::dyn_cast<Subclass>(value))
return result;

return None;
}

template<typename Superclass>
template <typename Superclass>
auto operator()(const Superclass &value) const
-> Optional<decltype(llvm::cast<Subclass>(value))>
{
-> llvm::Optional<decltype(llvm::cast<Subclass>(value))> {
if (auto result = llvm::dyn_cast<Subclass>(value))
return result;

Expand Down
20 changes: 10 additions & 10 deletions include/swift/Demangling/TypeDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ enum class ImplParameterDifferentiability {
NotDifferentiable
};

static inline Optional<ImplParameterDifferentiability>
static inline llvm::Optional<ImplParameterDifferentiability>
getDifferentiabilityFromString(StringRef string) {
if (string.empty())
return ImplParameterDifferentiability::DifferentiableOrNotApplicable;
Expand All @@ -115,7 +115,7 @@ class ImplFunctionParam {
using ConventionType = ImplParameterConvention;
using DifferentiabilityType = ImplParameterDifferentiability;

static Optional<ConventionType>
static llvm::Optional<ConventionType>
getConventionFromString(StringRef conventionString) {
if (conventionString == "@in")
return ConventionType::Indirect_In;
Expand Down Expand Up @@ -168,7 +168,7 @@ class ImplFunctionResult {
public:
using ConventionType = ImplResultConvention;

static Optional<ConventionType>
static llvm::Optional<ConventionType>
getConventionFromString(StringRef conventionString) {
if (conventionString == "@out")
return ConventionType::Indirect;
Expand Down Expand Up @@ -268,8 +268,8 @@ class ImplFunctionTypeFlags {
#if SWIFT_OBJC_INTEROP
/// For a mangled node that refers to an Objective-C class or protocol,
/// return the class or protocol name.
static inline Optional<StringRef> getObjCClassOrProtocolName(
NodePointer node) {
static inline llvm::Optional<StringRef>
getObjCClassOrProtocolName(NodePointer node) {
if (node->getKind() != Demangle::Node::Kind::Class &&
node->getKind() != Demangle::Node::Kind::Protocol)
return None;
Expand Down Expand Up @@ -435,7 +435,7 @@ class TypeDecoder {
case NodeKind::Metatype:
case NodeKind::ExistentialMetatype: {
unsigned i = 0;
Optional<ImplMetatypeRepresentation> repr;
llvm::Optional<ImplMetatypeRepresentation> repr;

// Handle lowered metatypes in a hackish way. If the representation
// was not thin, force the resulting typeref to have a non-empty
Expand Down Expand Up @@ -650,7 +650,7 @@ class TypeDecoder {
}
}

Optional<ImplFunctionResult<BuiltType>> errorResult;
llvm::Optional<ImplFunctionResult<BuiltType>> errorResult;
switch (errorResults.size()) {
case 0:
break;
Expand Down Expand Up @@ -905,7 +905,7 @@ class TypeDecoder {
return true;

StringRef conventionString = node->getChild(0)->getText();
Optional<typename T::ConventionType> convention =
llvm::Optional<typename T::ConventionType> convention =
T::getConventionFromString(conventionString);
if (!convention)
return true;
Expand Down Expand Up @@ -1072,8 +1072,8 @@ class TypeDecoder {
return true;
};

auto decodeParam = [&](NodePointer paramNode)
-> Optional<FunctionParam<BuiltType>> {
auto decodeParam =
[&](NodePointer paramNode) -> llvm::Optional<FunctionParam<BuiltType>> {
if (paramNode->getKind() != NodeKind::TupleElement)
return None;

Expand Down
Loading