Skip to content

Commit

Permalink
Merge pull request #430 from swiftwasm/master
Browse files Browse the repository at this point in the history
[pull] swiftwasm from master
  • Loading branch information
kateinoigakukun authored Mar 19, 2020
2 parents 3999a2e + e1b6eb6 commit fb56bb9
Show file tree
Hide file tree
Showing 155 changed files with 2,230 additions and 1,894 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ Swift Next
// OK, <U where U: Equatable> has broader visibility than <T where T == Int>
override func foo() where U: Equatable { ... }
}

* [SR-75][]:

Unapplied references to protocol methods are now supported. Previously this
only worked for methods defined in structs, enums and classes.

```swift
protocol Cat {
func play(catToy: Toy)
}

let fn = Cat.play(catToy:)
fn(myCat)(myToy)
```

* [SE-0266][]:
Expand Down Expand Up @@ -7939,6 +7952,7 @@ Swift 1.0
[SE-0267]: <https://github.com/apple/swift-evolution/blob/master/proposals/0267-where-on-contextually-generic.md>
[SE-0269]: <https://github.com/apple/swift-evolution/blob/master/proposals/0269-implicit-self-explicit-capture.md>

[SR-75]: <https://bugs.swift.org/browse/SR-75>
[SR-106]: <https://bugs.swift.org/browse/SR-106>
[SR-419]: <https://bugs.swift.org/browse/SR-419>
[SR-631]: <https://bugs.swift.org/browse/SR-631>
Expand Down
2 changes: 1 addition & 1 deletion docs/Lexicon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
}
}

`Outer` is the parent type of `Inner`.
``Outer`` is the parent type of ``Inner``.

Note that the terms "parent type" and "superclass" refer to completely
different concepts.
Expand Down
17 changes: 17 additions & 0 deletions include/swift/AST/SourceFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ class SourceFile final : public FileUnit {
/// mechanism which is not SourceFile-dependent.)
SeparatelyImportedOverlayMap separatelyImportedOverlays;

using SeparatelyImportedOverlayReverseMap =
llvm::SmallDenseMap<ModuleDecl *, ModuleDecl *>;

/// A lazily populated mapping from a separately imported overlay to its
/// underlying shadowed module.
///
/// This is used by tooling to substitute the name of the underlying module
/// wherever the overlay's name would otherwise be reported.
SeparatelyImportedOverlayReverseMap separatelyImportedOverlaysReversed;

/// A pointer to PersistentParserState with a function reference to its
/// deleter to handle the fact that it's forward declared.
using ParserStatePtr =
Expand Down Expand Up @@ -382,6 +392,7 @@ class SourceFile final : public FileUnit {
/// \returns true if the overlay was added; false if it already existed.
bool addSeparatelyImportedOverlay(ModuleDecl *overlay,
ModuleDecl *declaring) {
separatelyImportedOverlaysReversed.clear();
return std::get<1>(separatelyImportedOverlays[declaring].insert(overlay));
}

Expand All @@ -399,6 +410,12 @@ class SourceFile final : public FileUnit {
overlays.append(value.begin(), value.end());
}

/// Retrieves a module shadowed by the provided separately imported overlay
/// \p shadowed. If such a module is returned, it should be presented to users
/// as owning the symbols in \p overlay.
ModuleDecl *
getModuleShadowedBySeparatelyImportedOverlay(const ModuleDecl *overlay);

void cacheVisibleDecls(SmallVectorImpl<ValueDecl *> &&globals) const;
const SmallVectorImpl<ValueDecl *> &getCachedVisibleDecls() const;

Expand Down
5 changes: 5 additions & 0 deletions include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ namespace swift {
/// incrementals parsing.
bool BuildSyntaxTree = false;

/// Whether parsing is occurring for creation of syntax tree only, and no typechecking will occur after
/// parsing e.g. when parsing for SwiftSyntax. This is intended to affect parsing, e.g. disable
/// unnecessary name lookups that are not useful for pure syntactic parsing.
bool ParseForSyntaxTreeOnly = false;

/// Whether to verify the parsed syntax tree and emit related diagnostics.
bool VerifySyntaxTree = false;

Expand Down
2 changes: 1 addition & 1 deletion include/swift/Basic/PathRemapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PathRemapper {
/// Adds a mapping such that any paths starting with `FromPrefix` have that
/// portion replaced with `ToPrefix`.
void addMapping(StringRef FromPrefix, StringRef ToPrefix) {
PathMappings.emplace_back(FromPrefix, ToPrefix);
PathMappings.emplace_back(FromPrefix.str(), ToPrefix.str());
}

/// Returns a remapped `Path` if it starts with a prefix in the map; otherwise
Expand Down
3 changes: 3 additions & 0 deletions include/swift/Frontend/PrintingDiagnosticConsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class PrintingDiagnosticConsumer : public DiagnosticConsumer {
// implicitly associated with it. Uses `std::unique_ptr` so that
// `AnnotatedSourceSnippet` can be forward declared.
std::unique_ptr<AnnotatedSourceSnippet> currentSnippet;
// Educational notes which are buffered until the consumer is finished
// constructing a snippet.
SmallVector<std::string, 1> BufferedEducationalNotes;

public:
PrintingDiagnosticConsumer(llvm::raw_ostream &stream = llvm::errs());
Expand Down
Loading

0 comments on commit fb56bb9

Please sign in to comment.