profile
viewpoint

apple/swift 54003

The Swift Programming Language

apple/swift-evolution 11567

This maintains proposals for changes and user-visible enhancements to the Swift Programming Language.

apple/swift-package-manager 8012

The Package Manager for the Swift Programming Language

apple/swift-corelibs-foundation 4039

The Foundation Project, providing core utilities, internationalization, and OS independence

apple/swift-corelibs-xctest 862

The XCTest Project, A Swift core library for providing unit test support

apple/swift-llbuild 799

A low-level build system, used by Xcode and the Swift Package Manager

apple/swift-lldb 645

This is the version of LLDB that supports the Swift programming language & REPL.

rintaro/Plack-Middleware-CSRFBlock 11

CSRF are never propageted to app

push eventapple/swift

Rintaro Ishizaki

commit sha 84205e3c97e04efa06cf45c71e0febc119343f5f

[CodeCompletion] Fix a crash in collectPossibleReturnTypesFromContext Avoid re-typechecking for nested closures. For example: Something { Other { #^COMPLETE^# } } If 'Something' is successfully type checked but 'Other' is failed, the outer closure has type, but the inner closure doesn't. In such state, when the type of 'Other' is requested, the outer closure used to be re-typechecked. That may cause crash because it may contain expressions CSGen doesn't expect. rdar://problem/69246891

view details

Rintaro Ishizaki

commit sha a69502e6b1fc331cec4033d54723807d6c19b3e9

Merge pull request #34486 from rintaro/ide-completion-rdar69246891 [CodeCompletion] Fix a crash in collectPossibleReturnTypesFromContext

view details

push time in 4 minutes

PR merged apple/swift

[CodeCompletion] Fix a crash in collectPossibleReturnTypesFromContext

Avoid re-typechecking for nested closures. For example:

  Something {
    Other {
      #^COMPLETE^#
    }
  }

If Something is successfully type checked but Other is failed, the outer closure has type, but the inner closure doesn't. In such state, when the type of Other is requested, the outer closure used to be re-typechecked. That may cause a crash because it may contain expressions CSGen doesn't expect.

rdar://problem/69246891

+18 -4

1 comment

2 changed files

rintaro

pr closed time in 4 minutes

pull request commentapple/swift

[CodeCompletion] Fix a crash in collectPossibleReturnTypesFromContext

@swift-ci Please smoke test

rintaro

comment created time in 18 hours

PR opened apple/swift

[CodeCompletion] Fix a crash in collectPossibleReturnTypesFromContext

Avoid re-typechecking for nested closures. For example:

  Something {
    Other {
      #^COMPLETE^#
    }
  }

If 'Something' is successfully type checked but 'Other' is failed, the outer closure has type, but the inner closure doesn't. In such state, when the type of 'Other' is requested, the outer closure used to be re-typechecked. That may cause crash because it may contain expressions CSGen doesn't expect.

rdar://problem/69246891

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+18 -4

0 comment

2 changed files

pr created time in 18 hours

create barnchrintaro/swift

branch : ide-completion-rdar69246891

created branch time in 18 hours

PullRequestReviewEvent

pull request commentapple/swift

Parser: Highlight 'self' and 'Self' correctly when allowed to be an identifier

Also

struct S<Self> {
  func foo() -> Self {
    Self
  }
}

The parser doesn't know these Self in the function mean whether the current type (keyword) or the generic parameter. It's semantic thing. So I feel like, for syntax coloring, we should keep parse them as keywords.

AnthonyLatsis

comment created time in a day

push eventapple/swift

maustinstar

commit sha 1d2c4262397ae38e9004ac1c35a458688cfb352e

Distinguish raw stringd from multiline delimiters [SR-10011]

view details

maustinstar

commit sha fe4f7a5f48d213675a3b9f85ac4e7e37da318d73

Test cases for false multiline delimiters

view details

maustinstar

commit sha e53290de0ef27fa5520c63332a893fd5044567a9

Remove redundant false delimiter check

view details

maustinstar

commit sha b72fb1c02bce1ba21e45c18cfae35694a761db91

Test zero-width chars nested within false delimiter

view details

Michael Verges

commit sha d6d01aa85a77ceaa0d7e607bee079c8d8d1acf28

Consistent comment format for test description

view details

Michael Verges

commit sha 75eed47f9191bcdb339cadc8aa58aba8c3e5d088

Note for zero-width chars in multiline delimiter Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>

view details

Rintaro Ishizaki

commit sha 9269c5cb8cda1095eea7e0eb75cd55ab63e3bb81

Merge pull request #34414 from maustinstar/sr-10011 [SR-10011] [Lexer] Raw Strings escape character sequence resembling multiline delimiter

view details

push time in 2 days

PR merged apple/swift

[SR-10011] [Lexer] Raw Strings escape character sequence resembling multiline delimiter

Summary

The Lexer currently treats triple-quotes as a multiline delimiter for Strings. This PR allows the multiline delimiter (""") to be escaped in raw Strings when a valid closing custom delimiter (e.g. #) is found before a newline.

Problem

The Lexer does not register some strings that are technically valid according to the documented regex on string literals.

For example: #"""# Gives the errors: Multi-line string literal content must begin on a new line & Unterminated string literal

Impact

This change does not impact any Strings that are already valid, rather, this PR enables a new set of String literals to be considered valid.

After merging this PR: #"""# is now equivalent to "\"" #"""text"# equates to "\"\"text" #""" is still the beginning of a multiline raw string.

Links

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-10011. Replaces my previous PR attempt: #23115

Tagging @rintaro and @xwu from activity in my previous PR #23115.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+98 -19

5 comments

3 changed files

maustinstar

pr closed time in 2 days

PullRequestReviewEvent

pull request commentapple/swift

Parser: Highlight 'self' and 'Self' correctly when allowed to be an identifier

I see. But I think this change affects too broad. For example:

struct S {
  func foo() {
    self.foo()
  }
}

This self should be parsed as a keyword but it uses consumeIdentifier().

AnthonyLatsis

comment created time in 2 days

pull request commentapple/swift

[SR-10011] [Lexer] Raw Strings escape character sequence resembling multiline delimiter

@swift-ci Please test Windows

maustinstar

comment created time in 2 days

pull request commentapple/swift

[NameLookup] Retain invalid decls when filtering using access path

@swift-ci Please test Windows

bnbarham

comment created time in 2 days

pull request commentapple/swift

Parser: Highlight 'self' and 'Self' correctly when allowed to be an identifier

Could you clarify the motivation for this patch? What's the issue?

AnthonyLatsis

comment created time in 2 days

pull request commentapple/swift

[SR-10011] [Lexer] Raw Strings escape character sequence resembling multiline delimiter

@swift-ci Please test Windows

maustinstar

comment created time in 2 days

pull request commentapple/swift

[NameLookup] Retain invalid decls when filtering using access path

@swift-ci Please smoke test

bnbarham

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentapple/swift

CodeCompletion: Annotate archetypes, generic parameters and dependent…

-import Foo+ import Foo

Unrelated change

AnthonyLatsis

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentapple/swift

[SR-10011] [Lexer] Raw Strings escape character sequence resembling multiline delimiter

@swift-ci Please smoke test

maustinstar

comment created time in 3 days

push eventrintaro/swift

Alexey Komnin

commit sha 4fa17bf59774ae6543a33b1a29f01320705f4dfe

SR-12022: refactor LiteralExpr to combine common initializer code

view details

Michael Gottesman

commit sha d3e6ffdbad9ed2af857508891a4530b7f11d4c6e

[lldb-toolbox] Add the ability to disassemble-to-file a specific function from a target without running the target. The routine already supports dumping the assembly to file if we are at a breakpoint using the current frame. This adds a -n option so one can without running just dump the assembly to a file of a specific function in a binary.

view details

Dave Lee

commit sha 27330f169df5d2dcb018ab2c6615d66be91d04e2

[build] Remove unused lldb cmake

view details

Anthony Latsis

commit sha 8f43d888b8fd88540c5ba3d770a857928ac0b3a7

Sema: Disallow usage of settable Self-returning storage requirements on existential base

view details

Keith Smiley

commit sha ae0c380f1b0f37e11b111a06634dd4c64e67b96c

Improve -*prefix-map help text Before: ``` -coverage-prefix-map <value> -debug-prefix-map <value> ``` After: ``` -coverage-prefix-map <prefix=replacement> -debug-prefix-map <prefix=replacement> ```

view details

Artem Chikin

commit sha 939f547d517a2f9f6906d739dbb9da5a231be8aa

[Build Script] Pass Foundation and Dispatch build directories to the swift-driver build This is required in order to build swift-driver using CMake on Linux

view details

Pavel Yaskevich

commit sha 767c1a0ed6377470c2afdcd2a53281d13e88a099

[ConstraintSystem] NFC: Move `SolutionResult.h` to `include/swift/Sema`

view details

Pavel Yaskevich

commit sha 087906a013ad278deae80c2a64dcfe7a49f41b90

[ConstraintSystem] NFC: Move `OverloadChoice.h` to `include/swift/Sema`

view details

Pavel Yaskevich

commit sha f2614dec4a2fecef64de73e3e6c50df5effc25d3

[ConstraintSystem] NFC: Move `ConstraintLocator.h` to `include/swift/Sema`

view details

Pavel Yaskevich

commit sha ab951c208ab0f9bf8127ee1049dfd7c1174bfa2d

[ConstraintSystem] NFC: Move `ConstraintGraph{Scope}.h` to `include/swift/Sema`

view details

Pavel Yaskevich

commit sha 4954763524b92fcac638efdee3f84233c4dbc9bf

[ConstraintSystem] NFC: Move `CSFix.h` to `include/swift/Sema`

view details

Pavel Yaskevich

commit sha 6ba7ecb7c2d525f1f84dace06336669e37c5556d

[ConstraintSystem] NFC: Move `Constraint.h` to `include/swift/Sema`

view details

Pavel Yaskevich

commit sha 461eafff54b44a59ac4a1f8e1c3ee536b94ff895

[ConstraintSystem] NFC: Move `ConstraintSystem.h` to `include/swift/Sema`

view details

Mike Ash

commit sha 630aff7b19b80f29445b645424e20fd1bb6bd551

[Runtime] Change SimpleGlobalCache to use ConcurrentReadableHashMap instead of ConcurrentMap. This gives us faster lookups and a small advantage in memory usage. Most of these maps need stable addresses for their entries, so we add a level of indirection to ConcurrentReadableHashMap for these cases to accommodate that. This costs some extra memory, but it's still a net win. A new StableAddressConcurrentReadableHashMap type handles this indirection and adds a convenience getOrInsert to take advantage of it. ConcurrentReadableHashMap is tweaked to avoid any global constructors or destructors when using it as a global variable. ForeignWitnessTables does not need stable addresses and it now uses ConcurrentReadableHashMap directly. rdar://problem/70056398

view details

Daniel Rodríguez Troitiño

commit sha 8470a6624f08283719af2cbc6fdc10a2163d4888

[windows] Avoid %r for quoting module-cache-path in Windows. %r returns a representation of the object that is valid Python syntax. For numbers and strings this representation is very compatible with Unix shells, but for Windows, the quoting performed by Python will not be compatible. For example the Windows path separator `\` will be escaped as `\\`, which is not necessary for Windows and might make some tests that try to match path fail. Python 3.3 has `shlex.quote`, which was previously available as `pipes.quote` in earlier Python versions. `pipes.quote` was indeed used in several points of the `lit.cfg` file. For Windows, one need to do their own quoting. This change introduces `shell_quote` which uses `shlex.quote` or `pipes.quote` in Unix depending on the Python version, and provides an implementation of `shell_quote` for Windows. It replaces every usage of `pipes.quotes` for `shell_quote`, and modifies the value of `mcp_opt` to use `shell_quote` and not `%r`. This should fix the test `Driver\working-directory.swift` in the Windows Visual Studio 2017 builder.

view details

Slava Pestov

commit sha c5e138824544531fdf55935061afea1e999cc4b1

ASTScope: Remove cull()

view details

Slava Pestov

commit sha 89ea51e90ce69e62cd169b453db2e2d4d63b6728

ASTScope: Remove isLocalizable()

view details

Slava Pestov

commit sha ea9f84f66ee9f010cbedb2eff17e956ffe5db450

ASTScope: Remove addSiblingsToScopeTree()

view details

Slava Pestov

commit sha 885f6ebba3c39fe2b097631769b2ac8451e01e82

ASTScope: Rename addChildrenForAllLocalizableAccessorsInSourceOrder()

view details

Slava Pestov

commit sha b720c04f4b8f03dc93a00943ca9c3048f6305d42

ASTScope: Simplify a couple of getSourceRangeOfThisASTNode() methods

view details

push time in 9 days

PullRequestReviewEvent

delete branch rintaro/swift

delete branch : ide-completion-rdar67102794

delete time in 13 days

push eventapple/swift-syntax

Rintaro Ishizaki

commit sha bac8d8cfcc40a093500dad6731d4ad9f4c2a3481

Revert "Add Double and Int Convenience Properties (#239)" This reverts commit 94fc5ae3f34fac87380756b9c17ea7c6752a227b. This couldn't handle integer literal syntax more than Int.max e.g. 0x9e3779b97f4a0000

view details

Rintaro Ishizaki

commit sha d5182595655fd24a63d561c0b563ba95ca68e60b

Merge pull request #242 from rintaro/revert-pr238 Revert "Add Double and Int Convenience Properties (#239)"

view details

push time in 16 days

PR merged apple/swift-syntax

Revert "Add Double and Int Convenience Properties (#239)"

This reverts commit #239 This couldn't handle integer literal syntax more than Int.max e.g. 0x9e3779b97f4a0000

+44 -316

2 comments

20 changed files

rintaro

pr closed time in 16 days

push eventapple/swift

Rintaro Ishizaki

commit sha 4ab3cb15323e1a01fe45496109c6fd506fd6d6b7

Revert "Implements SR-11580" This reverts commit c311e451951b28afacebae69107cef28e4af9e44.

view details

Rintaro Ishizaki

commit sha 6f7235deaa501573c1f9bacd718077b39bb1e6da

Merge pull request #34292 from rintaro/revert-pr33948 Revert "Implements SR-11580"

view details

push time in 16 days

PR merged apple/swift

Revert "Implements SR-11580"

This reverts #33948 .

+3 -8

1 comment

2 changed files

rintaro

pr closed time in 16 days

pull request commentapple/swift-syntax

Revert "Add Double and Int Convenience Properties (#239)"

@vermont42 Sorry, I have to revert it for now. This causes an error for valid UInt64 integer literals. like: https://github.com/apple/swift-argument-parser/blob/d424bca0ec66ec0e3888ebdc118379d348a67da3/Examples/roll/SplitMix64.swift#L19-L25

rintaro

comment created time in 16 days

pull request commentapple/swift-syntax

Revert "Add Double and Int Convenience Properties (#239)"

https://github.com/apple/swift/pull/34292 @swift-ci Please test

rintaro

comment created time in 16 days

pull request commentapple/swift

Revert "Implements SR-11580"

https://github.com/apple/swift-syntax/pull/242 @swift-ci Please smoke test

rintaro

comment created time in 16 days

PR opened apple/swift-syntax

Revert "Add Double and Int Convenience Properties (#239)"

This reverts commit #239 This couldn't handle integer literal syntax more than Int.max e.g. 0x9e3779b97f4a0000

+44 -316

0 comment

20 changed files

pr created time in 16 days

PR opened apple/swift

Revert "Implements SR-11580"

This reverts #33948 .

+3 -8

0 comment

2 changed files

pr created time in 16 days

create barnchrintaro/swift-syntax

branch : revert-pr238

created branch time in 16 days

create barnchrintaro/swift

branch : revert-pr33948

created branch time in 16 days

PullRequestReviewEvent

push eventapple/swift

Rintaro Ishizaki

commit sha d9963596eafeceb7d4c8ddae68e64af1797e03bd

[Parse] Parse opaque result types in closure signature position 'canParseType()' didn't use to handle 'some'. Also, use 'isContexttualKeyword("some")' for checking 'some' keyword. https://bugs.swift.org/browse/SR-10769

view details

Rintaro Ishizaki

commit sha 54fc26f6bda136b7ecf0cdc11dfd62ac088efdba

Merge pull request #34282 from rintaro/parse-opaque-closure [Parse] Parse opaque result types in closure signature position

view details

push time in 17 days

PR merged apple/swift

[Parse] Parse opaque result types in closure signature position

e.g.

let _ = { () -> some Collection in
  ...
}

canParseType() didn't use to handle some.

Also, use isContexttualKeyword("some") for checking some keyword.

https://bugs.swift.org/browse/SR-10769

+7 -4

3 comments

2 changed files

rintaro

pr closed time in 17 days

PullRequestReviewEvent

pull request commentapple/swift

[Parse] Parse opaque result types in closure signature position

@jckarter I'm just fixing Parser. Do you have concern about this in type checker?

rintaro

comment created time in 17 days

pull request commentapple/swift

[Parse] Parse opaque result types in closure signature position

@swift-ci Please smoke test

rintaro

comment created time in 17 days

PR opened apple/swift

[Parse] Parse opaque result types in closure signature position

canParseType() didn't use to handle some.

Also, use isContexttualKeyword("some") for checking some keyword.

https://bugs.swift.org/browse/SR-10769

+7 -4

0 comment

2 changed files

pr created time in 17 days

push eventrintaro/swift

Rintaro Ishizaki

commit sha d9963596eafeceb7d4c8ddae68e64af1797e03bd

[Parse] Parse opaque result types in closure signature position 'canParseType()' didn't use to handle 'some'. Also, use 'isContexttualKeyword("some")' for checking 'some' keyword. https://bugs.swift.org/browse/SR-10769

view details

push time in 17 days

create barnchrintaro/swift

branch : parse-opaque-closure

created branch time in 17 days

delete branch rintaro/swift

delete branch : ide-completion-rdar69890297

delete time in 17 days

Pull request review commentapple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

 static bool areAnyDependentFilesInvalidated(       }); } +/// Get interface hash of \p SF including the type members in the file.+///+/// This is needed because SouceFile::getIntefaceHash() doesn't digest type body+/// fingerprints in the file.+void getInterfaceHashIncludingTypeMembers(SourceFile *SF,+                                          llvm::SmallString<32> &str) {+  /// FIXME: Gross. Hashing multiple "hash" values.+  llvm::MD5 hash;+  SF->getInterfaceHash(str);+  hash.update(str);++  std::function<void(IterableDeclContext *)> hashTypeBodyFingerprints =+      [&](IterableDeclContext *IDC) {+        if (auto fp = IDC->getBodyFingerprint())+          hash.update(*fp);+        for (auto *member : IDC->getParsedMembers())+          if (auto *childIDC = dyn_cast<IterableDeclContext>(member))+            hashTypeBodyFingerprints(childIDC);+      };++  for (auto *D : SF->getTopLevelDecls()) {+    if (auto IDC = dyn_cast<IterableDeclContext>(D))+      hashTypeBodyFingerprints(IDC);+  }++  llvm::MD5::MD5Result result;+  hash.final(result);+  str = result.digest();+}+

For fast-completion inside function bodies, the whole function body is re-parsed. So a struct in closure (which is in the function body) is "refreshed" anyway.

rintaro

comment created time in 17 days

PullRequestReviewEvent

push eventapple/swift

Rintaro Ishizaki

commit sha df94c4f46414937856386d0e300f0348176197ba

[CodeCompletion] Remove parser hacks regarding type body fingerprints Take type body fingerprints into account for inteface hash checking. Since `SourceFile.getInterfacehash()` doesn't digest the type body fingerprints in the file, enabling type body fingerprints regressed fast-completion. rdar://problem/69890297

view details

Rintaro Ishizaki

commit sha 1696f4d3ef6f2e10b6a40cd548617f07d92c54ed

Merge pull request #34256 from rintaro/ide-completion-rdar69890297 [CodeCompletion] Remove parser hacks regarding type body fingerprints

view details

push time in 17 days

PR merged apple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

Address https://github.com/apple/swift/pull/34151/files#diff-a5731a934e0c085bf4b84dabd27a6ffdR4555-R4557

Take type body fingerprints into account for inteface hash checking. Since SourceFile.getInterfacehash() doesn't digest the type body fingerprints in the file, enabling type body fingerprints regressed fast-completion.

rdar://problem/69890297

+52 -11

4 comments

2 changed files

rintaro

pr closed time in 17 days

push eventrintaro/swift

Antoine Cœur

commit sha 4c30f8bd6de5487603ed645cc4dd2a2983f4f0ba

appendingPathComponent(:isDirectory:) should account for isDirectory

view details

Owen Voorhees

commit sha 6b6b640e133ca547139c6586eb0dcbf7933b46ec

[Driver] Don't test for null source locations in driver diagnostics swift-driver doesn't emit these, and there's no reason to check that they're present when using the integrated driver.

view details

Xiaodi Wu

commit sha 26cda274ca78b1df246521ba1eeea33285b57d5f

[stdlib] Simplify 'BinaryFloatingPoint.init?<T: BinaryFloatingPoint>(exactly: T)'

view details

Joe Groff

commit sha 023066c1966c63ab3b7a4baee31ac24d29b7de36

SILGen: Relax assertion that incorrectly tripped on lowered opaque capture types. When lowering the SILConstantInfo for a closure implementation type with captures, we are more conservative about substituting opaque types in the capture, since the underlying types may only be available in the local context. This means the SILConstantInfo type may not in fact be exactly what you get from `SILFunction::getFunctionTypeInContext` referencing the implementation function from its originating context, since those opaque types will be substituted in the local context. Fixes SR-13480 | rdar://problem/68159831.

view details

Anthony Latsis

commit sha 103a8218380c9d72160f9ca3aa7d1e0ba4d8f1bc

Sema: Allow non-final classes to satisfy properties and subscripts with covariant Self

view details

Anthony Latsis

commit sha 33401ae147a04ce628cf246504b67729063358e5

CS: Use the curried opened type when building a VarDecl member ref This ensures that we erase opened archetypes before closing an existential result

view details

Anthony Latsis

commit sha 9f58968fa394444115a3bef9e72a4b7a146fa0d0

Add silgen and run-time tests

view details

Jonas Devlieghere

commit sha 7a128470bd281b254525008131e5cf639ccedaeb

[test] Re-enable linux-fatal-backtrace.swift This was fixed by #33235 rdar://66389949

view details

Egor Zhdan

commit sha 30f7b9ecef834a6ca0fa1fb8f1ae37815569a126

WinSDK: extract Performance submodule Currently some of the headers get included into `WinSDK.WinSock2` via windows.h

view details

Mike Ash

commit sha ece0399d601eec1069131f465bdbe7e16f4c6a50

[Runtime] Have ConcurrentReadableHashMap use 1-byte or 2-byte indices when possible.

view details

Doug Gregor

commit sha 9b808c67faf951c08e28626432188cf68c4a1024

[Concurrency] Import "did" delegate methods as @asyncHandler. Infer @asyncHandler on a protocol methods that follow the delegate convention of reporting that something happened via a "did" method, so long as they also meet the constraints for an @asyncHandler method in Swift. This enables inference of @asyncHandler for witnesses of these methods.

view details

Doug Gregor

commit sha a000375881ce37668c136fdaed71c997b194cebe

Remove unused new diagnostic

view details

Brent Royal-Gordon

commit sha 0a94737ff1496e048bbda720f9d8b2184b7d4aa8

Emit -enable-experimental-concurrency into module interfaces …when the module is built with that flag. Fixes rdar://69322538.

view details

Pavel Yaskevich

commit sha 8c6098a3de956ca058d55a0d4875b29e3ce38498

[CSFix] Add a fix to detect when type of couldn't be inferred

view details

Robert Widmann

commit sha 48415ad2288ba0449b62456634395edfd98adfcf

[NFC] Stage in driver flags for experimental cross-module incremental builds

view details

Robert Widmann

commit sha 574ee39397a36be8dc9fb1efd65551f188fed089

Stage in frontend flags for experimental cross-module incremental builds

view details

Kuba Mracek

commit sha a20118b54deebb2aa768294b19ef25de62339b23

When building modules on secondary threads via RunSafelyOnThread, request 8 MB of stack

view details

Robert Widmann

commit sha 7566e9f561e1460cd599eee9668165bc295d550d

Merge pull request #34070 from CodaFi/an-iron-cross Stage in Frontend/Driver Feature Flags for Cross-Module Incremental Builds

view details

Robert Widmann

commit sha f1f5961e0f7c2aa359586b94da4aa55c34199bc8

[NFC] Add Incremental Info Bits to ModuleDecl

view details

Robert Widmann

commit sha 8e73d213a0ded811e53acf81fdb2f0dd9db08df8

[NFC] Add Incremental Info Bits to ModuleFileSharedCore

view details

push time in 19 days

Pull request review commentapple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

 static bool areAnyDependentFilesInvalidated(       }); } +/// Get interface hash of \p SF including the type members in the file.+///+/// This is needed because SouceFile::getIntefaceHash() doesn't digest type body+/// fingerprints in the file.+void getInterfaceHashIncludingTypeMembers(SourceFile *SF,+                                          llvm::SmallString<32> &str) {+  /// FIXME: Gross. Hashing multiple "hash" values.+  llvm::MD5 hash;+  SF->getInterfaceHash(str);+  hash.update(str);++  std::function<void(IterableDeclContext *)> hashTypeBodyFingerprints =+      [&](IterableDeclContext *IDC) {+        if (auto fp = IDC->getBodyFingerprint())+          hash.update(*fp);+        for (auto *member : IDC->getParsedMembers())+          if (auto *childIDC = dyn_cast<IterableDeclContext>(member))+            hashTypeBodyFingerprints(childIDC);+      };++  for (auto *D : SF->getTopLevelDecls()) {+    if (auto IDC = dyn_cast<IterableDeclContext>(D))+      hashTypeBodyFingerprints(IDC);+  }++  llvm::MD5::MD5Result result;+  hash.final(result);+  str = result.digest();+}+

Updated the doc-comment

rintaro

comment created time in 19 days

PullRequestReviewEvent

pull request commentapple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

@swift-ci Please smoke test

rintaro

comment created time in 19 days

push eventrintaro/swift

Rintaro Ishizaki

commit sha df94c4f46414937856386d0e300f0348176197ba

[CodeCompletion] Remove parser hacks regarding type body fingerprints Take type body fingerprints into account for inteface hash checking. Since `SourceFile.getInterfacehash()` doesn't digest the type body fingerprints in the file, enabling type body fingerprints regressed fast-completion. rdar://problem/69890297

view details

push time in 19 days

delete branch rintaro/swift

delete branch : syntax-typeexpr-rdar70101520

delete time in 19 days

push eventapple/swift

Rintaro Ishizaki

commit sha 411751218c82f22ac4d9193be3a28dc2eaf56701

[Syntax] Parse attributed types in expr position as TypeExprSyntax rdar://problem/70101520 https://bugs.swift.org/browse/SR-13711

view details

Rintaro Ishizaki

commit sha 1de9668e906283653890fee98d6a24645d0ef8aa

Merge pull request #34257 from rintaro/syntax-typeexpr-rdar70101520 [Syntax] Parse attributed types in expr position as TypeExprSyntax

view details

push time in 19 days

PR merged apple/swift

[Syntax] Parse attributed types in expr position as TypeExprSyntax

rdar://problem/70101520 https://bugs.swift.org/browse/SR-13711

+3 -0

2 comments

3 changed files

rintaro

pr closed time in 19 days

Pull request review commentapple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

 static bool areAnyDependentFilesInvalidated(       }); } +/// Get interface hash of \p SF including the type members in the file.+///+/// This is needed because SouceFile::getIntefaceHash() doesn't digest type body+/// fingerprints in the file.+void getInterfaceHashIncludingTypeMembers(SourceFile *SF,+                                          llvm::SmallString<32> &str) {+  /// FIXME: Gross. Hashing multiple "hash" values.+  llvm::MD5 hash;+  SF->getInterfaceHash(str);+  hash.update(str);++  std::function<void(IterableDeclContext *)> hashTypeBodyFingerprints =+      [&](IterableDeclContext *IDC) {+        if (auto fp = IDC->getBodyFingerprint())+          hash.update(*fp);+        for (auto *member : IDC->getParsedMembers())+          if (auto *childIDC = dyn_cast<IterableDeclContext>(member))+            hashTypeBodyFingerprints(childIDC);+      };++  for (auto *D : SF->getTopLevelDecls()) {+    if (auto IDC = dyn_cast<IterableDeclContext>(D))+      hashTypeBodyFingerprints(IDC);+  }++  llvm::MD5::MD5Result result;+  hash.final(result);+  str = result.digest();+}+
  1. Thanks for suggestion. I will update the comment.
  2. In this use case, local types and their members aren't considered "interface". They are not visible from outside.
rintaro

comment created time in 19 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentapple/swift

[Syntax] Parse attributed types in expr position as TypeExprSyntax

@swift-ci Please smoke test

rintaro

comment created time in 20 days

Pull request review commentapple/swift

[Syntax] Parse attributed types in expr position as TypeExprSyntax

 class C <MemberDeclBlock>{<MemberDeclListItem><FunctionDecl>    func foo3<FunctionSignature><ParameterClause>() </ParameterClause></FunctionSignature><CodeBlock>{<SequenceExpr><DiscardAssignmentExpr>     _ </DiscardAssignmentExpr><AssignmentExpr>= </AssignmentExpr><FunctionCallExpr><ArrayExpr>[<ArrayElement><TypeExpr><SimpleTypeIdentifier>Any</SimpleTypeIdentifier></TypeExpr></ArrayElement>]</ArrayExpr>()</FunctionCallExpr></SequenceExpr><SequenceExpr><DiscardAssignmentExpr>+    _ </DiscardAssignmentExpr><AssignmentExpr>= </AssignmentExpr><MemberAccessExpr><TupleExpr>(<TupleExprElement><AttributedType><Attribute>@convention(c) </Attribute><FunctionType>(<TupleTypeElement><SimpleTypeIdentifier>Int</SimpleTypeIdentifier></TupleTypeElement>) -> <SimpleTypeIdentifier>Void</SimpleTypeIdentifier></FunctionType></AttributedType></TupleExprElement>)</TupleExpr>.self</MemberAccessExpr></SequenceExpr><SequenceExpr><DiscardAssignmentExpr>

Updated

rintaro

comment created time in 20 days

PullRequestReviewEvent

push eventrintaro/swift

Rintaro Ishizaki

commit sha 411751218c82f22ac4d9193be3a28dc2eaf56701

[Syntax] Parse attributed types in expr position as TypeExprSyntax rdar://problem/70101520 https://bugs.swift.org/browse/SR-13711

view details

push time in 20 days

Pull request review commentapple/swift

[Syntax] Parse attributed types in expr position as TypeExprSyntax

 class C <MemberDeclBlock>{<MemberDeclListItem><FunctionDecl>    func foo3<FunctionSignature><ParameterClause>() </ParameterClause></FunctionSignature><CodeBlock>{<SequenceExpr><DiscardAssignmentExpr>     _ </DiscardAssignmentExpr><AssignmentExpr>= </AssignmentExpr><FunctionCallExpr><ArrayExpr>[<ArrayElement><TypeExpr><SimpleTypeIdentifier>Any</SimpleTypeIdentifier></TypeExpr></ArrayElement>]</ArrayExpr>()</FunctionCallExpr></SequenceExpr><SequenceExpr><DiscardAssignmentExpr>+    _ </DiscardAssignmentExpr><AssignmentExpr>= </AssignmentExpr><MemberAccessExpr><TupleExpr>(<TupleExprElement><AttributedType><Attribute>@convention(c) </Attribute><FunctionType>(<TupleTypeElement><SimpleTypeIdentifier>Int</SimpleTypeIdentifier></TupleTypeElement>) -> <SimpleTypeIdentifier>Void</SimpleTypeIdentifier></FunctionType></AttributedType></TupleExprElement>)</TupleExpr>.self</MemberAccessExpr></SequenceExpr><SequenceExpr><DiscardAssignmentExpr>

Ah sorry, the test result file is outdated (I forgot to git add I believe).

rintaro

comment created time in 20 days

PullRequestReviewEvent

pull request commentapple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

@swift-ci Please smoke test

rintaro

comment created time in 20 days

push eventrintaro/swift

Rintaro Ishizaki

commit sha ce4cf9c63418336203e5c90dac071951c4bac345

[CodeCompletion] Remove parser hacks regarding type body fingerprints Take type body fingerprints into account for inteface hash checking. Since `SourceFile.getInterfacehash()` doesn't digest the type body fingerprints in the file, enabling type body fingerprints regressed fast-completion. rdar://problem/69890297

view details

push time in 20 days

Pull request review commentapple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

 static bool areAnyDependentFilesInvalidated(       }); } +/// Get interface hash of \p SF including the type members in the file.+///+/// This is needed because SouceFile::getIntefaceHash() doesn't digest type body+/// fingerprints in the file.+void getInterfaceHashIncludingTypeMembers(SourceFile *SF,+                                          llvm::SmallString<32> &str) {+  /// FIXME: Gross. Hashing multiple "hash" values.+  llvm::MD5 hash;+  SF->getInterfaceHash(str);+  hash.update(str);++  class FingerprintCollector: public ASTWalker {+    llvm::MD5 &Hash;++  public:+    FingerprintCollector(llvm::MD5 &Hash): Hash(Hash) {}++    bool walkToDeclPre(Decl *D) override {+      if (auto *IDC = dyn_cast<IterableDeclContext>(D)) {+        if (auto fp = IDC->getBodyFingerprint())+          Hash.update(*fp);+      }+      return true;+    }+  } collector(hash);++  SF->walk(collector);

Updated to only walk into IterableDeclContext.

rintaro

comment created time in 20 days

PullRequestReviewEvent

push eventrintaro/swift

Rintaro Ishizaki

commit sha 3efe0ac55681256cf566a2cce4603ae32bc8e1a6

[CodeCompletion] Remove parser hacks regarding type body fingerprints Take type body fingerprints into account for inteface hash checking. Since `SourceFile.getInterfacehash()` doesn't digest the type body fingerprints in the file, enabling type body fingerprints regressed fast-completion. rdar://problem/69890297

view details

push time in 20 days

create barnchrintaro/swift

branch : main

created branch time in 20 days

Pull request review commentapple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

 static bool areAnyDependentFilesInvalidated(       }); } +/// Get interface hash of \p SF including the type members in the file.+///+/// This is needed because SouceFile::getIntefaceHash() doesn't digest type body+/// fingerprints in the file.+void getInterfaceHashIncludingTypeMembers(SourceFile *SF,+                                          llvm::SmallString<32> &str) {+  /// FIXME: Gross. Hashing multiple "hash" values.+  llvm::MD5 hash;+  SF->getInterfaceHash(str);+  hash.update(str);++  class FingerprintCollector: public ASTWalker {+    llvm::MD5 &Hash;++  public:+    FingerprintCollector(llvm::MD5 &Hash): Hash(Hash) {}++    bool walkToDeclPre(Decl *D) override {+      if (auto *IDC = dyn_cast<IterableDeclContext>(D)) {+        if (auto fp = IDC->getBodyFingerprint())+          Hash.update(*fp);+      }+      return true;+    }+  } collector(hash);++  SF->walk(collector);

Ah, you mean function bodies, right? It's not good.

rintaro

comment created time in 20 days

PullRequestReviewEvent

PR opened apple/swift

[Syntax] Parse attributed types in expr position as TypeExprSyntax

rdar://problem/70101520 https://bugs.swift.org/browse/SR-13711

+3 -0

0 comment

3 changed files

pr created time in 20 days

create barnchrintaro/swift

branch : syntax-typeexpr-rdar70101520

created branch time in 20 days

pull request commentapple/swift

[CodeCompletion] Remove parser hacks regarding type body fingerprints

@swift-ci Please smoke test

rintaro

comment created time in 20 days

push eventrintaro/swift

Rintaro Ishizaki

commit sha 9868b524ed73ba9e6a95bc958b06387ef646569f

[CodeCompletion] Remove parser hacks regarding type body fingerprints Take type body fingerprints into account for inteface hash checking. Since `SourceFile.getInterfacehash()` doesn't digest the type body fingerprints in the file, enabling type body fingerprints regressed fast-completion. rdar://problem/69890297

view details

push time in 20 days

pull request commentapple/swift

[Syntax] Parse attributed types in expr position as TypeExprSyntax

@swift-ci Please smoke test

rintaro

comment created time in 20 days

PullRequestReviewEvent

create barnchrintaro/swift

branch : ide-completion-rdar69890297

created branch time in 20 days

PR opened apple/swift

Reviewers
[CodeCompletion] Remove parser hacks regarding type body fingerprints

Address https://github.com/apple/swift/pull/34151/files#diff-a5731a934e0c085bf4b84dabd27a6ffdR4555-R4557

Take type body fingerprints into account for inteface hash checking. Since SourceFile.getInterfacehash() doesn't digest the type body fingerprints in the file, enabling type body fingerprints regressed fast-completion.

rdar://problem/69890297

+41 -11

0 comment

2 changed files

pr created time in 20 days

Pull request review commentapple/swift

[Parse][CodeCompletion] Don't special case code completion when forming single-expression closures/function bodies (NFC)

 bool CodeCompletionCallbacksImpl::trySolverCompletion() {   } } +// FIXME: Remove this once all expression position completions are migrated+// to work via TypeCheckCompletionCallback.+static void undoSingleExpressionReturn(DeclContext *DC) {+  auto updateBody = [](BraceStmt *BS, ASTContext &Ctx) -> bool {+    if (Ctx.CompletionCallback)+      return false;++    SourceManager &SM = Ctx.SourceMgr;+    ASTNode FirstElem = BS->getFirstElement();+    auto *RS = dyn_cast_or_null<ReturnStmt>(FirstElem.dyn_cast<Stmt*>());++    if (!RS || !RS->isImplicit())+      return false;++    SourceRange Range = RS->getSourceRange();+    if (Range.isInvalid())+      return false;++    if (!SM.rangeContainsCodeCompletionLoc(Range))+      return false;

It's not clear why we need to compare the range. We know completion is happening inside this DC, right? Are these return false actually reachable? If so, could you give me some examples?

Also, if we really need to check it, RS->getResult()->getSourceRange() is more relevant I think.

nathawes

comment created time in 20 days

PullRequestReviewEvent

Pull request review commentapple/swift

[CodeCompletion][CSGen] Treat ErrorExprs as holes when generating constraints for code completion

 namespace {     ConstraintSystem &getConstraintSystem() const { return CS; }      virtual Type visitErrorExpr(ErrorExpr *E) {-      // FIXME: Can we do anything with error expressions at this point?-      return nullptr;+      if (!CS.isForCodeCompletion())+        return nullptr;++      // For code completion, treat error expressions that don't contain+      // the completion location itself as holes.+      SourceRange range = E->getSourceRange();+      if (range.isInvalid() ||

If the completion position is inside ErrorExpr, could we walk into OriginalExpr to generate constraints for them? So that we could get rid of the fallback typechecking? I'm not sure that is a good solution, but just curios.

nathawes

comment created time in 20 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

push eventapple/swift

Rintaro Ishizaki

commit sha 77a76c9900b6c1efeac0ac278210763402655a9f

[LookupVisibleDecls] Use correct BaseTy to check the decls are applicable 'lookupTypeMembers()' accepts 'BaseTy' to check found value decls are applicable to the type. When looking into super classes, it used to use the interface type of the super class which was not good. Instead, use the original "base type" consistently. rdar://problem/69308207 https://bugs.swift.org/browse/SR-13574

view details

Rintaro Ishizaki

commit sha 0ff5f60cae8535a15d446044b9bd22348026057e

Merge pull request #34110 from rintaro/ide-completion-rdar69308207 [LookupVisibleDecls] Use correct BaseTy to check the decls are applicable

view details

push time in a month

PR merged apple/swift

[LookupVisibleDecls] Use correct BaseTy to check the decls are applicable

lookupTypeMembers() receives BaseTy to check if the found value decls are applicable to the type. When looking into super classes, it used to use the interface type of the super class which was not good. Instead, use the original "base type" consistently.

rdar://problem/69308207 https://bugs.swift.org/browse/SR-13574

+38 -5

2 comments

2 changed files

rintaro

pr closed time in a month

pull request commentapple/swift

[LookupVisibleDecls] Use correct BaseTy to check the decls are applicable

@swift-ci Please smoke test Linux

rintaro

comment created time in a month

pull request commentapple/swift

[LookupVisibleDecls] Use correct BaseTy to check the decls are applicable

@swift-ci Please smoke test

rintaro

comment created time in a month

PR opened apple/swift

[LookupVisibleDecls] Use correct BaseTy to check the decls are applicable

lookupTypeMembers() receives BaseTy to check if the found value decls are applicable to the type. When looking into super classes, it used to use the interface type of the super class which was not good. Instead, use the original "base type" consistently.

rdar://problem/69308207 https://bugs.swift.org/browse/SR-13574

+38 -5

0 comment

2 changed files

pr created time in a month

create barnchrintaro/swift

branch : ide-completion-rdar69308207

created branch time in a month

push eventrintaro/swift

Rintaro Ishizaki

commit sha 205e9cd79a66ad0cfb00fe49fff00da1c792f04c

wip

view details

push time in a month

more