profile
viewpoint
Brent Royal-Gordon brentdax @apple Cupertino, CA Figuring out how to be a compiler engineer.

brentdax/appnetkit 20

Objective-C library for working with App.net.

brentdax/PrediKit 15

A shorthand for building NSPredicates in Swift.

brentdax/FallibleKit 11

A better way to handle errors in Swift.

brentdax/GenderKit 11

Types, controls, and functions for expressing the gender identities of human beings

brentdax/ArchDirectoryObserver 6

A framework that makes FSEvents easier to use.

brentdax/HelpBook 5

A VoodooPad plugin for creating Apple help books.

brentdax/PatternKit 3

An experiment in sophisticated Swift collection pattern matching.

brentdax/ArchRole 2

Role/trait support for Objective-C

brentdax/class-dbi 1

Simple Database Abstraction in Perl

brentdax/coda_preview 1

Make Coda 2 preview do something reasonable in Rails projects.

PullRequestReviewEvent

pull request commentapple/swift

[NFC] Tweak formatting of _Concurrency module CMakeLists.txt

@swift-ci smoke test and merge

brentdax

comment created time in 8 days

PR opened apple/swift

[NFC] Tweak formatting of _Concurrency module CMakeLists.txt

Helps fix rdar://66414410.

(We don't usually commit pure formatting changes; I'm making an exception here because this should help avoid merge conflicts with Mac Catalyst build configuration settings that can't be upstreamed yet.)

+2 -1

0 comment

1 changed file

pr created time in 8 days

create barnchbrentdax/swift

branch : a-catalyst-for-nothing

created branch time in 8 days

push eventapple/swift

Simon Evans

commit sha 8c3081c750f2b22075e9bb2efc8ab3647996b7b8

test: Remove duplicate test for -static-executable - test/Driver/static-executable-linux.swift is duplicated by test/Driver/static-executable.swift so remove it. - Additionally, test/Driver/static-executable-linux.swift uses 'file' instead of 'lvm-readelf' to detect if the executable is statically linked and this breaks on Centos7.

view details

Brent Royal-Gordon

commit sha 04606d5424e01b0e29d1450bb851e99a9ae6ca4e

Merge pull request #34275 from spevans/pr_remove_duplicate_test test: Remove duplicate test for -static-executable

view details

push time in 9 days

PR merged apple/swift

test: Remove duplicate test for -static-executable
  • test/Driver/static-executable-linux.swift is duplicated by test/Driver/static-executable.swift

  • Additionally, test/Driver/static-executable-linux.swift uses 'FILE' instead of 'ELF-NOT' to detect if the executable is statically linked and this breaks on Centos7.

+0 -10

4 comments

1 changed file

spevans

pr closed time in 9 days

pull request commentapple/swift

test: Remove duplicate test for -static-executable

I'm going to force-merge this early—it's passed on Linux and should have even less effect on macOS, and it should clear at least one bot.

spevans

comment created time in 9 days

pull request commentapple/swift

XFAIL Incremental/CrossModule tests

@swift-ci smoke test and merge

brentdax

comment created time in 10 days

PR opened apple/swift

XFAIL Incremental/CrossModule tests

These are failing in multiple configurations; it looks like they need a little more time to bake.

(cc @CodaFi)

+9 -0

0 comment

3 changed files

pr created time in 10 days

create barnchbrentdax/swift

branch : xfail-70175753

created branch time in 10 days

push eventapple/llvm-project

Brent Royal-Gordon

commit sha dbef9ec2ea9f41bd4455032a4057e2ab61759d26

[lldb] Update to match apple/swift#33935

view details

Brent Royal-Gordon

commit sha 9f1d8f2d933d3482821c813dd6029caa56d8d878

Merge pull request #1937 from brentdax/these-imports-are-testing-my-patience [lldb] Update to match apple/swift#33935

view details

push time in 10 days

push eventapple/swift

Brent Royal-Gordon

commit sha b440ab73315b4d4bb288078e241d974ae8a6e7d4

[NFC] Move several types/functions to Import.h To help consolidate our various types describing imports, this commit moves the following types and methods to Import.h: * ImplicitImports * ImplicitStdlibKind * ImplicitImportInfo * ModuleDecl::ImportedModule * ModuleDecl::OrderImportedModules (as ImportedModule::Order) * ModuleDecl::removeDuplicateImports() (as ImportedModule::removeDuplicates()) * SourceFile::ImportFlags * SourceFile::ImportOptions * SourceFile::ImportedModuleDesc This commit is large and intentionally kept mechanical—nothing interesting to see here.

view details

Brent Royal-Gordon

commit sha f3d99cefbb63960fdcd2b177b418d2a9a43930df

[NFC] Turn ImportedModuleDesc into AttributedImport Rename ImportedModuleDesc to AttributedImport and make it a template that’s parameterized on the representation of the module. This will allow us to reduce duplicated representations of “abstract” ImportDecls.

view details

Brent Royal-Gordon

commit sha c489fffb796432c4c463b4cb11a2d88f23b8b508

[NFC] Rename and document fields of AttributedImport Also renames a member in ImportResolution.cpp to align with this naming.

view details

Brent Royal-Gordon

commit sha 8070e8aaedf662bceea1483840cf0f61d5a8b8a4

[NFC] Use AttributedImport in import resolution Removes what amount to redundant definitions from UnboundImport.

view details

Brent Royal-Gordon

commit sha d55c5bd549fa17769c23be9708c33c8de9ed0ef1

[NFC] Add type for ModuleDecl::getImplicitImports() This doesn’t really change the design yet.

view details

Brent Royal-Gordon

commit sha 563386b06d8c1cf863be71c38345fcaefa00e423

[NFC] Eliminate ImplicitImport Instead, we will use AttributedImport<ImportedModule>, a common currency type which supports a superset of ImplicitImport’s current behavior.

view details

Brent Royal-Gordon

commit sha c13067a0e0e9a1ea474a307c10d177c27e57fd58

[NFC] Rework ImplicitImportInfo::ModuleNames Replace with an array of AttributedImport<UnloadedImportedModule> to add flexibility.

view details

Brent Royal-Gordon

commit sha d02b34cccc3edf3fece4c112bc8637ed94b1d407

[NFC] Add conveniences to clean up import code

view details

Brent Royal-Gordon

commit sha 7f14affda09fb57414fa7d0203a886845dbd47fc

[NFC] Give NullablePtr some PointerLikeTypeTraits Allows it to be used in PointerIntPair and PointerUnion.

view details

Brent Royal-Gordon

commit sha bf074b093ea9b8ef4dcb90a5494343edbef39939

Run some implicit imports through import resolution Unloaded implicit imports (e.g. the `-import-module` flag) will now be processed by import resolution, and will be fully validated and cross-imported. Preloaded imports, like the standard library import, are still not run through full import resolution, but this is a definite improvement over the status quo. This also folds `-import-underlying-module` and `@_exported import <ParentModule>` into a single code path, slightly changing the diagnostic for a failed overlay-style underlying module import.

view details

Brent Royal-Gordon

commit sha f71923778b6ddbb50500744e1460bca96ea35ff5

Add -testable-import-module frontend flag This is just like -import-module, but it does an @testable import. Simple, right? Fixes rdar://66544654.

view details

Brent Royal-Gordon

commit sha 48b866b8fe179faa49f2c407a9920f28539c496c

[NFC] Compare spiGroups in DenseMapInfo This ought to result in more consistent behavior.

view details

Brent Royal-Gordon

commit sha 944ad8845582e9de58745a99cf98dd9ced60864c

[NFC] Improve simple_display for AttributedImport

view details

Brent Royal-Gordon

commit sha e843a16649123165de100d17b7d25fa13cc7b019

Merge pull request #33935 from brentdax/these-imports-are-testing-my-patience Add -testable-import-module frontend flag (+ refactoring)

view details

push time in 10 days

PR merged apple/llvm-project

[lldb] Update to match apple/swift#33935

apple/swift#33935 refactors some types that LLDB uses to implicitly import modules when compiling expressions. This PR updates this code to match.

+3 -2

1 comment

2 changed files

brentdax

pr closed time in 10 days

PR merged apple/swift

Reviewers
Add -testable-import-module frontend flag (+ refactoring)

This PR has two functional changes:

  1. Implicit imports specified using the -import-module flag are now processed by import resolution. This means they are fully validated and cross-imported. The -import-underlying-module flag is now also processed via this route, and it gets the same benefits (for what they're worth).
  2. There is now a -testable-import-module frontend flag to match -import-module. As you might guess, this adds an implicit @testable import to every file, instead of an implicit ordinary import.

Those two functional changes are in the last two commits; they represent maybe 5% of the changes here. The other 95% of the PR enables these changes by refactoring the data types used to represent imports:

  • Centralizes more import-related types in AST/Import.h.
  • Creates one common currency type representing "an import with all of the options and attributes that can be specified by a user" and adopts it everywhere relevant. The new type can be used with either an unloaded module's name or a loaded module.
  • Allows the full range of import options through more of import resolution handling.

Fixes rdar://66544654.


Review suggestions: Probably best reviewed by commit. A lot of commits (especially the first one) are very mechanical, with lots of boring renaming at use sites. You can probably skim those bits. The commit messages may give some guidance on this.

The reason for a given change is not always clear until several commits later. In particular:

  • We un-nest and move types related to ModuleDecl::ImportedModule and SourceFile::ImportedModuleDesc because types currently in these two headers will become interdependent by the time we're finished.
  • We make AttributedImport a template because we will eventually use both the existing ImportedModule and a new type with a module name and access path instead. The template lets us have three types instead of four or five.
  • We introduce the ImplicitImportList type which just wraps ArrayRef<ImplicitImport> because (a) shifting to AttributedImport will complicate its definition enough to require a type, and (b) introducing that type at the outset avoids multiple rounds of renaming several use sites.
  • We start using AttributedImport in implicit imports to (a) allow the frontend to specify additional behaviors, and (b) make it easier to shift responsibility for loading implicit imports into ImportResolver.
  • We make ImportResolver resolve implicit imports because (a) this makes it validate the implicit @testable attribute added by -testable-import-module, and (b) it simplifies the code and is the right way to do things anyway.

@hamishknight, you worked a lot on import resolution recently and might have some opinions about what I'm doing. @CodaFi, you're most likely familiar with Hamish's work, but unlike him you're currently working on the compiler full-time. @varungandhi-apple, you clearly have opinions about names in this area.

+843 -590

6 comments

49 changed files

brentdax

pr closed time in 10 days

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 void ImportResolver::addImport(const UnboundImport &I, ModuleDecl *M) { // MARK: Import module loading //===----------------------------------------------------------------------===// -ModuleDecl *-ImportResolver::getModule(ImportPath::Module modulePath) {+static ModuleDecl *+getModuleImpl(ImportPath::Module modulePath, ModuleDecl *loadingModule,+              bool canImportBuiltin) {

We don't strictly need it, but I think the code is a bit cleaner with this logic disentangled from UnboundImport, so why re-entangle it?

brentdax

comment created time in 10 days

PullRequestReviewEvent

pull request commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

With apple/llvm-project#1937

@swift-ci please smoke test

brentdax

comment created time in 11 days

pull request commentapple/llvm-project

[lldb] Update to match apple/swift#33935

With apple/swift#33935

@swift-ci test

brentdax

comment created time in 11 days

PR opened apple/llvm-project

Reviewers
[lldb] Update to match apple/swift#33935

apple/swift#33935 refactors some types that LLDB uses to implicitly import modules when compiling expressions. This PR updates this code to match.

+3 -2

0 comment

2 changed files

pr created time in 11 days

create barnchbrentdax/llvm-project

branch : these-imports-are-testing-my-patience

created branch time in 11 days

pull request commentapple/swift

Linux: Fix -static-executable and remove swiftImageInspectionShared

@spevans @compnerd Hiya. It looks like this change may have broken static linking on at least CentOS:

******************** TEST 'Swift(linux-x86_64) :: Driver/static-executable-linux.swift' FAILED ********************
Script:
--
: 'RUN: at line 5';   rm -rf "/home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp" && mkdir -p "/home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp"
: 'RUN: at line 6';   /home/build-user/build/buildbot_linux/swift-linux-x86_64/bin/swiftc -target x86_64-unknown-linux-gnu -toolchain-stdlib-rpath  -module-cache-path '/home/build-user/build/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' -static-executable -o /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp/static-executable /home/build-user/swift/test/Driver/static-executable-linux.swift
: 'RUN: at line 7';   /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp/static-executable | /usr/bin/python3.6 '/home/build-user/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/home/build-user/build/buildbot_linux/swift-linux-x86_64' --sanitize SOURCE_DIR='/home/build-user/swift' --use-filecheck '/home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck'  /home/build-user/swift/test/Driver/static-executable-linux.swift
: 'RUN: at line 8';   file /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp/static-executable | /usr/bin/python3.6 '/home/build-user/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/home/build-user/build/buildbot_linux/swift-linux-x86_64' --sanitize SOURCE_DIR='/home/build-user/swift' --use-filecheck '/home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck'  /home/build-user/swift/test/Driver/static-executable-linux.swift --check-prefix=FILE
--
Exit Code: 2

Command Output (stderr):
--
/home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.script: line 4: file: command not found
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck /home/build-user/swift/test/Driver/static-executable-linux.swift --check-prefix=FILE

--

********************
spevans

comment created time in 11 days

pull request commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

[snip]/llvm-project/lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp:1192:16: error: no member named 'AdditionalModules' in 'swift::ImplicitImportInfo'
20:08:25     importInfo.AdditionalModules.emplace_back(module, /*exported*/ false);
20:08:25     ~~~~~~~~~~ ^

Of course, I’ll need to update this.

brentdax

comment created time in 12 days

pull request commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

@swift-ci please smoke test

brentdax

comment created time in 12 days

push eventbrentdax/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

Mike Ash

commit sha ece0399d601eec1069131f465bdbe7e16f4c6a50

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

view details

Pavel Yaskevich

commit sha 8c6098a3de956ca058d55a0d4875b29e3ce38498

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

view details

Kuba Mracek

commit sha a20118b54deebb2aa768294b19ef25de62339b23

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

view details

Andrew Trick

commit sha 28294725d4c468d41da49c48f0323d494f314a03

Change SIL ref_element_addr getFieldNo() to return a unique index. I don't have a test case for this bug based on the current code. But the fix is clearly needed to have a unique AccessStorage object for each property. The AccessPath commits will contain test cases for this functionality.

view details

Doug Gregor

commit sha 6fe5245899d6613e0d7e35a1ee539d8a84114678

Fix grammatical error in a new comment

view details

Andrew Trick

commit sha 5ae231eaabc96939c0141c5388617df84018ca31

Rename getFieldNo() to getFieldIndex(). Do I really need to justify this?

view details

Artem Chikin

commit sha d913fc609f191a01bc131f37858b00b87d94a328

[Build Script] Pass down a CMake path to swift-driver's build script

view details

Robert Widmann

commit sha 7917d723c3cb0b9b794819797bb5ac53c76d2b13

Teach the Driver to Read Fine-Grained Dependency Graphs in Swiftdeps Files

view details

Robert Widmann

commit sha e35f0601443636cfa9ee75f1ede41e4cd09b9782

Install Incremental External Dependency Integration Code An incremental build involving incremental external dependencies behaves as a hybrid between an external dependency and a normal swiftdeps-laden Swift file. In the simplest case, we will fall back to the behavior of a plain external dependency today. That is, we will check its timestamp, then schedule all jobs that involve these external dependencies if it is out of date. Where things get interesting is when cross-module incremental builds are enabled. In such a case, we know that a previous compiler has already emitted serialized swiftdeps information inside of a swiftmodule file. Moreover, we know that that swiftmodule file was loaded by the build of the current swift module. Finally, thanks to the previous stack of commits, we now know exactly how to extract this information from the swiftmodule file. To bring this all home, we unpack incremental dependency information from external dependencies, then integrate them into the current dependency graph - as though they were any other swiftdeps file. This neatly extends the single-module incremental logic to the multi-module case.

view details

Doug Gregor

commit sha f07c7d15feb4444c603e404f8e10274f275a7104

[Type checker] Eliminate a use-after-free due to C++ temporaries. Found by Brent using ASan, thank you!

view details

Meghana Gupta

commit sha 49d93c58a71eaa5690621bd2eec922d47a05f662

Revert "[ownership] Move OME after CopyForwarding (#33106)" This reverts commit ef972eb34de9b540971ebfd4d6b2718ad32931cb.

view details

Meghana Gupta

commit sha 77a76a842206ac320881d4759c2fbc08b0c609d7

Revert "Merge pull request #33205 from meg-gupta/ometofunctionpass" This reverts commit 8dbac48c18c343de3150dda26b3a6d5d8d8714f6, reversing changes made to c22ba90700a7123365f01b1ea4776051e4af198c.

view details

Egor Zhdan

commit sha 70a6d2c7c524c1c9576ba1f0d31f53dfa0191b4a

WinSDK: extract version into a separate submodule Currently winver.h gets included into `WinSDK.WinSock2`, however its usages might not be related to sockets, and it requires linking against `Version.Lib`

view details

Alexis Laferrière

commit sha 14e6772dc04cf778ba393bebc21a0a8b8ada3603

Consider inherited platform unavailability to silence diagnostics rdar://68597591

view details

swift-ci

commit sha 5f92463a0b89ca03042c11e0203939a2dee35ea7

Merge pull request #34084 from meg-gupta/revertomefuncpassandcopyfwd

view details

Andrew Trick

commit sha ea0da3fcdb4e04626632880a8a4aac0fab8714d2

Merge pull request #34074 from atrick/make-fieldidx-unique Change SIL ref_element_addr getFieldNo() to return a unique index.

view details

push time in 12 days

push eventbrentdax/swift

Brent Royal-Gordon

commit sha 788ff8d97c3e74e1c577fb5bc564c6d3d2b3ed4a

[NFC] Eliminate ImplicitImport Instead, we will use AttributedImport<ImportedModule>, a common currency type which supports a superset of ImplicitImport’s current behavior.

view details

Brent Royal-Gordon

commit sha 48913210fde95c67c3d1bbe0794a42596f299f6d

[NFC] Rework ImplicitImportInfo::ModuleNames Replace with an array of AttributedImport<UnloadedImportedModule> to add flexibility.

view details

Brent Royal-Gordon

commit sha 75519e74d09e1a3abb44bd2abd85910c17d8883a

[NFC] Add conveniences to clean up import code

view details

Brent Royal-Gordon

commit sha 6792039f51a3a144bed8f215ce38048bced09a70

[NFC] Give NullablePtr some PointerLikeTypeTraits Allows it to be used in PointerIntPair and PointerUnion.

view details

Brent Royal-Gordon

commit sha d9f2ab6f1ac0bf2c0c147ad3aa1c67ca6085747f

Run some implicit imports through import resolution Unloaded implicit imports (e.g. the `-import-module` flag) will now be processed by import resolution, and will be fully validated and cross-imported. Preloaded imports, like the standard library import, are still not run through full import resolution, but this is a definite improvement over the status quo. This also folds `-import-underlying-module` and `@_exported import <ParentModule>` into a single code path, slightly changing the diagnostic for a failed overlay-style underlying module import.

view details

Brent Royal-Gordon

commit sha 46bb47659609b42cf2eda674ed993e88e2513770

Add -testable-import-module frontend flag This is just like -import-module, but it does an @testable import. Simple, right? Fixes rdar://66544654.

view details

Brent Royal-Gordon

commit sha 72a432755200b4bf87bfb09cdf2808a02e05480e

[NFC] Compare spiGroups in DenseMapInfo This ought to result in more consistent behavior.

view details

Brent Royal-Gordon

commit sha 6aedab216fa2130c55da26f1a4a1039745dc3099

[NFC] Improve simple_display for AttributedImport

view details

push time in 12 days

push eventbrentdax/swift

Brent Royal-Gordon

commit sha d7d0d2ad86cd932f82262ad4dce87af4ebdf4287

[NFC] Use AttributedImport in import resolution Removes what amount to redundant definitions from UnboundImport.

view details

Brent Royal-Gordon

commit sha 40fe3b1cc5bd886d7fccba3a26d101aa71924249

[NFC] Add type for ModuleDecl::getImplicitImports() This doesn’t really change the design yet.

view details

Brent Royal-Gordon

commit sha 21780a391a297b1ea401d9678b0dc1144475da73

[NFC] Eliminate ImplicitImport Instead, we will use AttributedImport<ImportedModule>, a common currency type which supports a superset of ImplicitImport’s current behavior.

view details

Brent Royal-Gordon

commit sha ec08ffd11591381e6fca03d9ef21b3c9d17b8b9b

[NFC] Rework ImplicitImportInfo::ModuleNames Replace with an array of AttributedImport<UnloadedImportedModule> to add flexibility.

view details

Brent Royal-Gordon

commit sha 3ce96d9d51a6c85168819004a4b139bdd904b883

[NFC] Add conveniences to clean up import code

view details

Brent Royal-Gordon

commit sha 03d70b23df4b69e347a341e4b0996369a4c6c5ee

[NFC] Give NullablePtr some PointerLikeTypeTraits Allows it to be used in PointerIntPair and PointerUnion.

view details

Brent Royal-Gordon

commit sha 851bb19f469f2aa41314bc74091fa4bc913d140d

Run some implicit imports through import resolution Unloaded implicit imports (e.g. the `-import-module` flag) will now be processed by import resolution, and will be fully validated and cross-imported. Preloaded imports, like the standard library import, are still not run through full import resolution, but this is a definite improvement over the status quo. This also folds `-import-underlying-module` and `@_exported import <ParentModule>` into a single code path, slightly changing the diagnostic for a failed overlay-style underlying module import.

view details

Brent Royal-Gordon

commit sha c0ced55c7b71c67eca50052f3a18d053004e7211

Add -testable-import-module frontend flag This is just like -import-module, but it does an @testable import. Simple, right? Fixes rdar://66544654.

view details

Brent Royal-Gordon

commit sha 72fb1975bb217202daa8c69deecc455a457bec4e

[NFC] Compare spiGroups in DenseMapInfo This ought to result in more consistent behavior.

view details

Brent Royal-Gordon

commit sha 2dd993e43040a78261f80e59f676860dca559eb8

[NFC] Improve simple_display for AttributedImport

view details

push time in 12 days

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 bool CompilerInstance::loadPartialModulesAndImplicitImports(   assert(DefaultSerializedLoader && "Expected module loader in Compiler Instance");   FrontendStatsTracer tracer(getStatsReporter(),                              "load-partial-modules-and-implicit-imports");-  // Force loading implicit imports. This is currently needed to allow-  // deserialization to resolve cross references into bridging headers.-  // FIXME: Once deserialization loads all the modules it needs for cross-  // references, this can be removed.

Will return to its original location.

brentdax

comment created time in 12 days

PullRequestReviewEvent

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 bool CompilerInstance::loadPartialModulesAndImplicitImports(   assert(DefaultSerializedLoader && "Expected module loader in Compiler Instance");   FrontendStatsTracer tracer(getStatsReporter(),                              "load-partial-modules-and-implicit-imports");-  // Force loading implicit imports. This is currently needed to allow-  // deserialization to resolve cross references into bridging headers.-  // FIXME: Once deserialization loads all the modules it needs for cross-  // references, this can be removed.-  (void)mod->getImplicitImports();++  swift::forceImplicitImportLoading(mod);

It looks like it does still suffice; I'll go back to that, since it lets me get rid of some code.

brentdax

comment created time in 12 days

PullRequestReviewEvent

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 class DenseMapInfo<swift::ImportedModule> {   } }; -template<>-struct DenseMapInfo<swift::ImportedModuleDesc> {-  using ImportedModuleDesc = swift::ImportedModuleDesc;+template<typename ModuleInfo>+struct DenseMapInfo<swift::AttributedImport<ModuleInfo>> {+  using AttributedImport = swift::AttributedImport<ModuleInfo>; -  using ImportedModuleDMI = DenseMapInfo<swift::ImportedModule>;+  using ModuleInfoDMI = DenseMapInfo<ModuleInfo>;   using ImportOptionsDMI = DenseMapInfo<swift::ImportOptions>;   using StringRefDMI = DenseMapInfo<StringRef>;+  // FIXME: SPI groups not used by DenseMapInfo???

I'll include the SPI groups in isEqual(), but not in the hash value.

brentdax

comment created time in 12 days

PullRequestReviewEvent

pull request commentapple/swift

SIL: Verify invariants of async_continuation instructions.

Restarting doomed Linux tests.

@swift-ci please test Linux platform

jckarter

comment created time in 12 days

pull request commentapple/swift

[Sema] Fix availability checking in inlinable code

Restarting doomed Linux tests.

@swift-ci please smoke test Linux platform

xymus

comment created time in 12 days

pull request commentapple/swift

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

Restarting doomed Linux tests.

@swift-ci please smoke test Linux platform

nathawes

comment created time in 12 days

pull request commentapple/swift

Add test case and changelog entry for local function overloading

Restarting doomed Linux tests.

@swift-ci please smoke test Linux platform

slavapestov

comment created time in 12 days

pull request commentapple/swift

[parser lib build] For the "parser lib only" build, avoid building unnecessary llvm libraries that clangBasic brings

Restarting doomed Linux tests.

@swift-ci smoke test Linux platform

akyrtzi

comment created time in 12 days

pull request commentapple/swift

[Build Script] Pass Foundation and Dispatch build directories to the swift-driver build

Restarting doomed Linux tests.

With apple/swift-driver#291

@swift-ci please smoke test Linux platform

artemcm

comment created time in 12 days

pull request commentapple/swift

[Dependency Scanner] Refactor ModuleDependencies to represent binary-only Swift modules explicitly

Restarting doomed Linux tests.

@swift-ci please smoke test Linux platform

artemcm

comment created time in 12 days

pull request commentapple/swift

Fix a ptrauth test that I broke in #34213

Killed the test, as it was hanging. Fortunately, the fix should have landed in SwiftPM by now.

@swift-ci please smoke test Linux platform

rjmccall

comment created time in 12 days

PR closed apple/swift-tools-support-core

Reviewers
Revert "build: allow building with Foundation from the toolchain"

Reverts apple/swift-tools-support-core#141, as I suspect it broke TSC tests on Linux.

TSC tests last passed at 11:33 pm am; then we have a couple builds that fail earlier while trying to build the Swift runtime. Starting at 1:55 pm, TSC tests on Linux begin failing or timing out with many "read error: Bad file descriptor (9)" and "close error: Unknown error -1" messages.

I'm not sure how #141 could have caused these symptoms, but it entered the build during this timeframe and it could have an effect on Linux, and I can't figure out how Foundation_FOUND would be set.

+4 -8

4 comments

2 changed files

brentdax

pr closed time in 13 days

pull request commentapple/swift-tools-support-core

Revert "build: allow building with Foundation from the toolchain"

Probably not it.

brentdax

comment created time in 13 days

pull request commentapple/swift-tools-support-core

Revert "build: allow building with Foundation from the toolchain"

https://ci.swift.org/job/swift-PR-Linux/24002/console is testing a previously blocked PR with this change to see if it makes a difference.

brentdax

comment created time in 13 days

PR opened apple/swift-tools-support-core

Reviewers
Revert "build: allow building with Foundation from the toolchain"

Reverts apple/swift-tools-support-core#141, as I suspect it broke TSC tests on Linux.

TSC tests last passed at 11:33 pm; then we have a couple builds that fail earlier while trying to build the Swift runtime. Starting at 1:55 pm, TSC tests on Linux begin failing or timing out with many "read error: Bad file descriptor (9)" and "close error: Unknown error -1" messages.

I'm not sure how #141 could have caused these symptoms, but it entered the build during this timeframe and it could have an effect on Linux, and I can't figure out how Foundation_FOUND would be set.

+4 -8

0 comment

2 changed files

pr created time in 13 days

create barnchapple/swift-tools-support-core

branch : revert-141-staged

created branch time in 13 days

PR closed apple/swift

Revert "[build] Support installing swift-driver without swiftpm"

Reverts apple/swift#34186

+1 -1

3 comments

1 changed file

shahmishal

pr closed time in 14 days

pull request commentapple/swift

Revert "[build] Support installing swift-driver without swiftpm"

The reverted PR did not cause the regression in the source compatibility suite.

shahmishal

comment created time in 14 days

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 class ImportPath : public detail::ImportPathBase<ImportPath> {   /// including submodules, assuming the \c ImportDecl has the indicated   /// \c importKind.   Module getModulePath(ImportKind importKind) const {-    return getModulePath(importKind != ImportKind::Module);+    return getModulePath(isScopedImportKind(importKind));   }    /// Extracts the portion of the \c ImportPath which represents a scope for the   /// import, assuming the \c ImportDecl has the indicated \c importKind.   Access getAccessPath(ImportKind importKind) const {-    return getAccessPath(importKind != ImportKind::Module);+    return getAccessPath(isScopedImportKind(importKind));   } };  // MARK: - Abstractions of imports +/// Convenience struct to keep track of an import path and whether or not it+/// is scoped.+class UnloadedImportedModule {

ModuleDecls are, by definition, already loaded.

brentdax

comment created time in 16 days

PullRequestReviewEvent

create barnchbrentdax/llvm-project

branch : merged-into-an-umbrella-corporation

created branch time in 22 days

pull request commentapple/llvm-project

Manually merge apple/stable/20200714 -> swift/main

With apple/swift#34108

@swift-ci test

brentdax

comment created time in 22 days

pull request commentapple/swift

[ClangImporter] Update umbrella header diagnostic handling

With apple/llvm-project#1878

@swift-ci smoke test

brentdax

comment created time in 22 days

PR opened apple/llvm-project

Manually merge apple/stable/20200714 -> swift/main

This needs to be coordinated with a Swift-side bug fix and test update in apple/swift#34108.

Fixes rdar://69707827.

+1754 -187

0 comment

84 changed files

pr created time in 22 days

pull request commentapple/swift

[ClangImporter] Update umbrella header diagnostic handling

The failing test will pass once the automerger is cleared.

brentdax

comment created time in 22 days

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 class ImportPath : public detail::ImportPathBase<ImportPath> {   /// including submodules, assuming the \c ImportDecl has the indicated   /// \c importKind.   Module getModulePath(ImportKind importKind) const {-    return getModulePath(importKind != ImportKind::Module);+    return getModulePath(isScopedImportKind(importKind));   }    /// Extracts the portion of the \c ImportPath which represents a scope for the   /// import, assuming the \c ImportDecl has the indicated \c importKind.   Access getAccessPath(ImportKind importKind) const {-    return getAccessPath(importKind != ImportKind::Module);+    return getAccessPath(isScopedImportKind(importKind));+  }+};++// MARK: - Abstractions of imports++/// Convenience struct to keep track of an import path and whether or not it+/// is scoped.+class UnloadedImportedModule {+  // This is basically an ArrayRef with a bit stolen from the size.+  ImportPath::Raw::iterator data;+  ImportPath::Raw::size_type isScoped : 1;+  ImportPath::Raw::size_type length : sizeof(ImportPath::Raw::size_type)*CHAR_BIT - 1;

Yup, that's what I'll be doing.

brentdax

comment created time in 22 days

PullRequestReviewEvent

Pull request review commentapple/swift

SR-13098 Diagnostic improvement: encountering an unexpected statement at type scope

 Parser::parseDecl(ParseDeclOptions Flags,         break;       } -      const bool IsProbablyFuncDecl =-          Tok.isIdentifierOrUnderscore() || Tok.isAnyOperator();+      bool IsProbablyFuncDecl = false;++      if (Tok.isIdentifierOrUnderscore() || Tok.isAnyOperator()) {++        // This is a probe, so backtrack when we're done+        // and don't emit diagnostics.+        BacktrackingScope backtrackingScope(*this);+        DiagnosticSuppression diagnosticSuppression(Diags);++        // TODO make sure we can't get these from the environment+        SourceLoc staticLoc; +        StaticSpellingKind staticSpelling = StaticSpellingKind::None;+        DeclAttributes attributes;+        bool hasFuncKeyword = false;++        ParserResult<FuncDecl> parserResult =+          parseDeclFunc(staticLoc,+            staticSpelling,+            Flags,+            attributes,+            hasFuncKeyword);++        // it looks like we always get a good parse result.+        // But if there are no parentheses+        // the left and right parens will be at the beginning of+        // the expression and will be equal so we use+        // this to reject degenerate declarations.++        if (parserResult.isNonNull()) {+          auto parameterList = parserResult.get()->getParameters();+          if (parameterList->getLParenLoc() != parameterList->getRParenLoc()) {+            IsProbablyFuncDecl = true;+          }+        }+        // backtrackingScope and diagnostic suppression are both RAII+        // when they go out of scope, Tok returns to the beginning of+        // the identifier, and diagnostics are unsuppressed.

I agree with you that the specific comment you’re marking here (about RAII variables) is unnecessary, but I actually think the comments about probing are helpful “why” comments. (Maybe they could be shortened slightly—“This is a probe, so we will always backtrack after we’re done.” is definitely a helpful “why” comment.)

dfsweeney

comment created time in 22 days

PullRequestReviewEvent

pull request commentapple/swift

[ClangImporter] Update umbrella header diagnostic handling

@swift-ci please smoke test

brentdax

comment created time in 23 days

PR opened apple/swift

[ClangImporter] Update umbrella header diagnostic handling

In apple/llvm-project#1860, the diagnostic for a missing import in an umbrella header was improved by moving it to the end of the file and including a fix-it suggesting the import that would be needed. This breaks two things on the Swift side:

  • One Swift test assumes the old source location will be used.
  • The ClangSourceBufferImporter doesn’t work correctly when a diagnostic is emitted at EOF. It tries to create a virtual file covering EOF..<EOF, but it’s not actually valid to start a virtual file at EOF—it would always be empty.

This commit corrects these issues, which should unblock the automerger.

Fixes rdar://69707827.

+12 -6

0 comment

2 changed files

pr created time in 23 days

create barnchbrentdax/swift

branch : merged-into-an-umbrella-corporation

created branch time in 23 days

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 class ImportPath : public detail::ImportPathBase<ImportPath> {   /// including submodules, assuming the \c ImportDecl has the indicated   /// \c importKind.   Module getModulePath(ImportKind importKind) const {-    return getModulePath(importKind != ImportKind::Module);+    return getModulePath(isScopedImportKind(importKind));   }    /// Extracts the portion of the \c ImportPath which represents a scope for the   /// import, assuming the \c ImportDecl has the indicated \c importKind.   Access getAccessPath(ImportKind importKind) const {-    return getAccessPath(importKind != ImportKind::Module);+    return getAccessPath(isScopedImportKind(importKind));+  }+};++// MARK: - Abstractions of imports++/// Convenience struct to keep track of an import path and whether or not it+/// is scoped.+class UnloadedImportedModule {+  // This is basically an ArrayRef with a bit stolen from the size.+  ImportPath::Raw::iterator data;+  ImportPath::Raw::size_type isScoped : 1;+  ImportPath::Raw::size_type length : sizeof(ImportPath::Raw::size_type)*CHAR_BIT - 1;

What happened here is that I felt that, if I did go to the trouble of stealing the extra bit from the pointer, I'd then want to extract the resulting logic into some kind of ArrayRefIntPair type, which would be an enormous pain. So instead I went in the other direction and stole the bit from the count, which was the easiest option.

This is probably a really stupid reason not to just implement what I need now and, y'know, stop at that point.

brentdax

comment created time in 23 days

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 bool CompilerInstance::loadPartialModulesAndImplicitImports(   assert(DefaultSerializedLoader && "Expected module loader in Compiler Instance");   FrontendStatsTracer tracer(getStatsReporter(),                              "load-partial-modules-and-implicit-imports");-  // Force loading implicit imports. This is currently needed to allow-  // deserialization to resolve cross references into bridging headers.-  // FIXME: Once deserialization loads all the modules it needs for cross-  // references, this can be removed.-  (void)mod->getImplicitImports();++  swift::forceImplicitImportLoading(mod);

It's possible that it's still sufficient—I'll check.

brentdax

comment created time in 23 days

PullRequestReviewEvent

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 class ImportPath : public detail::ImportPathBase<ImportPath> {   /// including submodules, assuming the \c ImportDecl has the indicated   /// \c importKind.   Module getModulePath(ImportKind importKind) const {-    return getModulePath(importKind != ImportKind::Module);+    return getModulePath(isScopedImportKind(importKind));   }    /// Extracts the portion of the \c ImportPath which represents a scope for the   /// import, assuming the \c ImportDecl has the indicated \c importKind.   Access getAccessPath(ImportKind importKind) const {-    return getAccessPath(importKind != ImportKind::Module);+    return getAccessPath(isScopedImportKind(importKind));   } };  // MARK: - Abstractions of imports +/// Convenience struct to keep track of an import path and whether or not it+/// is scoped.+class UnloadedImportedModule {

Think of it this way. We have these three public types which are used throughout the compiler:

  • ImportedModule is basically just a ModuleDecl * and an access path. It's the minimum information you need to, for instance, figure out if a particular declaration is visible through that import.

  • UnloadedImportedModule is basically the name of a module and an access path. You use it in place of ImportedModule when you haven't actually loaded a ModuleDecl * yet.

  • AttributedImport<ImportedModule or UnloadedImportedModule> adds to that type abstract information about the attributes of an import (like whether it's exported, implementation-only, which SPIs it imports, etc.).

And we have one other type that's private to ImportResolution.cpp:

  • UnboundImport contains state and logic used to process a single import. (Could be an ImportDecl, a cross-import overlay we need to import, or now an implicit import.) In terms of state, it includes an AttributedImport<UnloadedImportedModule> plus a couple extra things that are used when emitting diagnostics. But its primary purpose is to perform certain steps of import resolution on a particular import, not to store state. (Arguably it should actually be UnresolvedImport; when I wrote this class, "import resolution" was called "name binding".)
brentdax

comment created time in a month

PullRequestReviewEvent

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 struct alignas(uint64_t) ImportedModule {   }; }; -struct ImportedModuleDesc {-  ImportedModule module;+template<class ModuleInfo>+struct AttributedImport {

I did, I think maybe in the next commit:

/// Augments a type representing an import to also include information about the
 /// import's attributes. This is usually used with either \c ImportedModule or
 /// \c UnloadedImportedModule.
brentdax

comment created time in a month

PullRequestReviewEvent

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 class DenseMapInfo<swift::ImportedModule> {   } }; -template<>-struct DenseMapInfo<swift::ImportedModuleDesc> {-  using ImportedModuleDesc = swift::ImportedModuleDesc;+template<typename ModuleInfo>+struct DenseMapInfo<swift::AttributedImport<ModuleInfo>> {+  using AttributedImport = swift::AttributedImport<ModuleInfo>; -  using ImportedModuleDMI = DenseMapInfo<swift::ImportedModule>;+  using ModuleInfoDMI = DenseMapInfo<ModuleInfo>;   using ImportOptionsDMI = DenseMapInfo<swift::ImportOptions>;   using StringRefDMI = DenseMapInfo<StringRef>;+  // FIXME: SPI groups not used by DenseMapInfo???

The only use of DenseMapInfo with AttributedImport keys that I can find is during cross-importing (in the form of a SmallSetVector). I think it could mean that, if you wrote something like:

@_spi(treasureMaps) import MapKit
@_spi(illuminatiBases) import MapKit
import SwiftUI

We would only consider the @_spi(treasureMaps) import MapKit, ignoring the second import.

Come to think of it, though, I don't think we've actually defined how cross-import overlays should interact with @_spi. I'll look into that on Monday—might ping you for input at that time.

brentdax

comment created time in a month

PullRequestReviewEvent

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 struct ImportedModuleDesc {   } }; +using ImportedModuleDesc = AttributedImport<ImportedModule>;

That was temporary; it was removed in a later commit.

brentdax

comment created time in a month

PullRequestReviewEvent

pull request commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

@swift-ci please test

brentdax

comment created time in a month

Pull request review commentapple/swift

Add -testable-import-module frontend flag (+ refactoring)

 class DenseMapInfo<swift::ImportedModule> {   } }; -template<>-struct DenseMapInfo<swift::ImportedModuleDesc> {-  using ImportedModuleDesc = swift::ImportedModuleDesc;+template<typename ModuleInfo>+struct DenseMapInfo<swift::AttributedImport<ModuleInfo>> {+  using AttributedImport = swift::AttributedImport<ModuleInfo>; -  using ImportedModuleDMI = DenseMapInfo<swift::ImportedModule>;+  using ModuleInfoDMI = DenseMapInfo<ModuleInfo>;   using ImportOptionsDMI = DenseMapInfo<swift::ImportOptions>;   using StringRefDMI = DenseMapInfo<StringRef>;+  // FIXME: SPI groups not used by DenseMapInfo???

I was very surprised by this. @xymus, is this intentional?

brentdax

comment created time in a month

PullRequestReviewEvent

push eventbrentdax/swift

Brent Royal-Gordon

commit sha b2801e190b73970e3664f62ccf321a03ebf21c4e

[NFC] Move several types/functions to Import.h To help consolidate our various types describing imports, this commit moves the following types and methods to Import.h: * ImplicitImports * ImplicitStdlibKind * ImplicitImportInfo * ModuleDecl::ImportedModule * ModuleDecl::OrderImportedModules (as ImportedModule::Order) * ModuleDecl::removeDuplicateImports() (as ImportedModule::removeDuplicates()) * SourceFile::ImportFlags * SourceFile::ImportOptions * SourceFile::ImportedModuleDesc This commit is large and intentionally kept mechanical—nothing interesting to see here.

view details

Brent Royal-Gordon

commit sha 6b04329dcf4c82a51fa065bc65143642491c90f7

[NFC] Turn ImportedModuleDesc into AttributedImport Rename ImportedModuleDesc to AttributedImport and make it a template that’s parameterized on the representation of the module. This will allow us to reduce duplicated representations of “abstract” ImportDecls.

view details

Brent Royal-Gordon

commit sha 8b5e40221cd24b38591bac1c1df9af97b77a0b15

[NFC] Rename and document fields of AttributedImport Also renames a member in ImportResolution.cpp to align with this naming.

view details

Brent Royal-Gordon

commit sha 49f5fa4fd7bdf910c8432107d16be0dcce2a30cc

[NFC] Use AttributedImport in import resolution Removes what amount to redundant definitions from UnboundImport.

view details

Brent Royal-Gordon

commit sha e0c7ee02b34b18c07fa737a3ff14d5e61678bedd

[NFC] Add type for ModuleDecl::getImplicitImports() This doesn’t really change the design yet.

view details

Brent Royal-Gordon

commit sha 03190b21daff0fffab270989314b11faad135b6e

[NFC] Eliminate ImplicitImport Instead, we will use AttributedImport<ImportedModule>, a common currency type which supports a superset of ImplicitImport’s current behavior.

view details

Brent Royal-Gordon

commit sha 486af87bb2b898240062c3c3d3d54c6fc78803bb

[NFC] Rework ImplicitImportInfo::ModuleNames Replace with an array of AttributedImport<UnloadedImportedModule> to add flexibility.

view details

Brent Royal-Gordon

commit sha 800722342d074294a9cb27281da9fa367026e48b

[NFC] Add conveniences to clean up import code

view details

Brent Royal-Gordon

commit sha 581d00a353a5e1aae3c4e0b81729c899c90ecd02

[NFC] Give NullablePtr some PointerLikeTypeTraits Allows it to be used in PointerIntPair and PointerUnion.

view details

Brent Royal-Gordon

commit sha 3d82698b4b27886e7668a210004e905ff14dabd1

Run some implicit imports through import resolution Unloaded implicit imports (e.g. the `-import-module` flag) will now be processed by import resolution, and will be fully validated and cross-imported. Preloaded imports, like the standard library import, are still not run through full import resolution, but this is a definite improvement over the status quo. This also folds `-import-underlying-module` and `@_exported import <ParentModule>` into a single code path, slightly changing the diagnostic for a failed overlay-style underlying module import.

view details

Brent Royal-Gordon

commit sha 3a60f09cf3929cef82cef2aa5f92dab050790d5b

Add -testable-import-module frontend flag This is just like -import-module, but it does an @testable import. Simple, right? Fixes rdar://66544654.

view details

push time in a month

push eventbrentdax/swift

Xiaodi Wu

commit sha 94887747a4e2746163e85438934a78a8c165fa8f

[benchmark] Add another test to floating point conversion benchmark

view details

Xiaodi Wu

commit sha 26f3c81e44d9cb53abdf51ed2f6a637bae5a3a77

[benchmark] Add another floating point conversion benchmark

view details

Xiaodi Wu

commit sha cb96bfbfdf0045383f11ed4c87e8142aafddf538

[benchmark] Tweak naming and workload for two new tests

view details

3405691582

commit sha 62a13e9ecd31da5ef335f245b66be826d6b5b4ff

[test] Erase SDKROOT since env -u is not portable. The `env -u` flag is not portable and not available on all platforms, so this unit test will fail when the feature is unavailable. Instead of trying to unset the field, just erase it instead, since trying to copy the entire invoked environment is difficult.

view details

Anthony Latsis

commit sha 103a8218380c9d72160f9ca3aa7d1e0ba4d8f1bc

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

view details

3405691582

commit sha 42a3da29d77810fed0374ea7efe2faff02f0aef2

[test] Mark failing reflection tests XFAIL. See SR-12893. swift-reflection-dump does not properly handle offsets in ELF executable images that, when interpreted as vaddrs, belong in segments part of the image. This just empirically XFAIL's the unit tests that are crashing or failing, even though the other tests are just happening to pass anyway. There's no clear workaround; disable the expected failures for the moment.

view details

Arnold Schwaighofer

commit sha 383d47fd0061dcd01f4801eda5ba6b66148f4358

IRGen: Scalar type layouts need to profile the SIL type It might contain archetypes whose type metadata is required. rdar://68972976 SR-13555

view details

Egor Zhdan

commit sha 7ba7d9b5c1749df62cdde2d5b3184fb23d27382b

WinSDK: extract Printing submodule Currently winspool.h gets included into `WinSDK.WinSock2` via windows.h

view details

Egor Zhdan

commit sha 42dcb6948ba2332f30b833bef4913885725148ff

WinSDK: extract Multimedia submodule Some of the headers in the Multimedia subsystem were not included in any other submodule of WinSDK. This change adds them to WinSDK.

view details

Meghana Gupta

commit sha 010c1cd91f26f7f8ec1dea1a06f26cf94972debf

Convert OME into a function transform

view details

Meghana Gupta

commit sha 81a2157a7253197319bd429c4749ca5b2ca5ecd8

Handle conversion of unchecked_value_cast to non-ossa in SILCloner

view details

Meghana Gupta

commit sha 9c9a8ef2241d2be4a9d47bd2a4bbdd8b2da344b3

Allow OME to run mandatorily

view details

Mishal Shah

commit sha 40024718acf0bed26638c40abe9a61816cb2bac4

Update doc and links to support new main branch

view details

Erik Eckstein

commit sha e4e5484ab4180608efd5d0a0e25ad48e427b4d2b

LLVM-Passes: add pointer authentication to Swift's function merge pass. If during merging a function pointer is passed as a parameter to the merged function, it needs to be signed on arm64e. rdar://problem/66797689

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

Pavel Yaskevich

commit sha 90e6fd47923e60f0ceb45c798c05a4d277adb696

[CSGen] Check whether parent has a contextual type before diagnosing `nil` use Before considering `nil` to be used without a context, let's check whether parent expression (semantic significance of which is not important) has a contextual type associated with it, otherwise it's possible to misdiagnose cases like: ```swift func test() -> Int? { return (nil) } ```

view details

Alex Lorenz

commit sha a4c39632f4057befc38a9c55f7e40055aa25995b

[build-script] copy over the compiler-rt .a archives from the toolchian only when necessary

view details

Mishal Shah

commit sha 2d1cb7df80e126483521fb1eee7ea223532c8849

Remove old scheme from update-checkout

view details

Varun Gandhi

commit sha d3369f77116ba405c36c35a9a192955e6156f553

[NFC] Rename ImportFilterKind cases to be clearer.

view details

Varun Gandhi

commit sha 4b5d8851147bed1f0945b7e23cbf788ce7869891

[NFC] Clarify semantics of getImportedModules. The lack of clarity manifested as unexpected behavior when using getImportedModules to create the module import graph. The new behavior makes SPI-ness and Shadowing-ness behave similarly in terms of filtering. We also check if a filter is well-formed to avoid accidental empty import lists.

view details

push time in a month

PullRequestReviewEvent

push eventbrentdax/swift

Brent Royal-Gordon

commit sha 8304b79e4c48bc89d850e0f4d31543b670a97236

[NFC] Use AttributedImport in import resolution Removes what amount to redundant definitions from UnboundImport.

view details

Brent Royal-Gordon

commit sha 5e862422135c8764af16e9b09313ff9706892df0

[NFC] Rename and document fields of AttributedImport

view details

Brent Royal-Gordon

commit sha a3d5505f2c91bbecd2c70d4cdb39f9281374f851

[NFC] Eliminate ImplicitImport Instead, we will use AttributedImport<ImportedModule>, a common currency type which supports a superset of ImplicitImport’s current behavior.

view details

Brent Royal-Gordon

commit sha ccbe1083100a5ff6c3a4018062b60e1656f87156

[NFC] Rework ImplicitImportInfo::ModuleNames Replace with an array of AttributedImport<UnloadedImportedModule> to add flexibility.

view details

Brent Royal-Gordon

commit sha c2af4796a725210e73566d8f4f5ca2fa1b54cf8d

[NFC] Add conveniences to clean up import code

view details

Brent Royal-Gordon

commit sha f48ab9ce2f3593de66b61380d5436903135b3397

[NFC] Give NullablePtr some PointerLikeTypeTraits Allows it to be used in PointerIntPair and PointerUnion.

view details

Brent Royal-Gordon

commit sha 57c837bb342470fa46393a81460be56751f4df71

[NFC] Add type for ModuleDecl::getImplicitImports() This doesn’t change any behavior yet.

view details

Brent Royal-Gordon

commit sha 53ddbd6f04ce17eb2cea09b10af8fbb417056b56

Run some implicit imports through import resolution Unloaded implicit imports (e.g. the `-import-module` flag) will now be processed by import resolution, and will be fully validated and cross-imported. Preloaded imports, like the standard library import, are still not run through full import resolution, but this is a definite improvement over the status quo. This also folds `-import-underlying-module` and `@_exported import <ParentModule>` into a single code path, slightly changing the diagnostic for a failed overlay-style underlying module import.

view details

Brent Royal-Gordon

commit sha 958a1f0b28946d5f64f7b7e9f20cd6e2a70e2c69

Add -testable-import-module frontend flag This is just like -import-module, but it does an @testable import. Simple, right? Fixes rdar://66544654.

view details

push time in a month

push eventapple/swift

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

Brent Royal-Gordon

commit sha df2924e558e8e13cb55e00641f7fb53a0c901318

Merge pull request #34068 from brentdax/technically-its-more-of-a-concurrency-experiment Emit -enable-experimental-concurrency into module interfaces

view details

push time in a month

PR merged apple/swift

Emit -enable-experimental-concurrency into module interfaces

…when the module is built with that flag. Fixes rdar://69322538.

+25 -4

1 comment

2 changed files

brentdax

pr closed time in a month

PullRequestReviewEvent

pull request commentapple/swift

Emit -enable-experimental-concurrency into module interfaces

@swift-ci please smoke test

brentdax

comment created time in a month

PR opened apple/swift

Reviewers
Emit -enable-experimental-concurrency into module interfaces

…when the module is built with that flag. Fixes rdar://69322538.

+25 -4

0 comment

2 changed files

pr created time in a month

push eventbrentdax/swift

Yuta Saito

commit sha d6cddaabb59958737e048ff1a5dd4d283c555661

[LTO] Support LLVM LTO for driver This commit adds LTO support for handling linker options and LLVM BC emission. Even for ELF, swift-autolink-extract is unnecessary because linker options are embeded in LLVM BC content when LTO.

view details

Michael Gottesman

commit sha c8d4d168f7981fc0b6cadedd71c2e340c622bcb3

Revert "build-script: remove dead CMake options for Swift" This reverts commit 95102bc258a6b30ba2349d561ef56ea48c601cae. This is actually a dead option that is relied upon for some configurations. I am going to add a note to not touch the option. I talked with compnerd about this and they are cool with this. I think that we can redo this in a nicer way when we are further into the build-script-impl refactoring. I added a note to the code to explain that it isn't dead.

view details

Varun Gandhi

commit sha e48469d03c87f8c1b87a2462fa3cd8c27c4d685f

[NFC] Add missing invariant checks for ExtInfoBuilders.

view details

Varun Gandhi

commit sha 384edd1f2b9c64d96dec169460b232f4ce14223f

[docs] Link 'The Swift Runtime' blog posts in ExternalResources.md.

view details

freddi

commit sha 495087f26f4a0288a8cf66be1829304ac403c43b

[sil-opt] Fix to satisfy all trapping instruction case at SILInstruction::mayTrap

view details

freddi

commit sha 2676839087baebf11d8f5b996249f61240bce411

[sil-opt] added test for unconditional_checked_cast_addr and unconditional_checked_cast_value at side-effect.sil

view details

Erik Eckstein

commit sha 063929b3f022190bb578e3888215788e2e090bcf

Demangler: fix a crash when re-mangling retroactive conformances If there are multiple retroactive conformances in the mangling tree, they are put under a TypeList node. This case was not handled by the re-mangler. The crash shows up in an assert-build of the compiler, because the re-mangler is used for mangling verification. rdar://problem/68467435

view details

stevapple

commit sha fa6a8eceff308402420c3d3b559f9cdf2160b4cc

[test] Fix line-directive on Windows

view details

Holly Borla

commit sha 1f426773eed1bbed59dfdbbcc4288e92454b2b07

[Property Wrappers] Lower assign_by_wrapper to re-assignment of the backing property wrapper before all of self is initialized if the wrapper has already been initialized.

view details

Richard Wei

commit sha 4fe8dda893fd8ad5daedb9da1cf81ff61f6a2add

[AutoDiff] [Docs] Clarify 'Differentiable' derived conformances conditions. Clarify `Differentiable` derived conformances synthesis conditions.

view details

Xi Ge

commit sha 950eb74e67fd6240b58e6c4dc73187a36e3fb57a

ABI Checker: use lower-cased decl keywords to be consistent with source. NFC

view details

Pavel Yaskevich

commit sha c56ae1e33640efc15cc6ebfcb7bf67297f1b12a3

Merge pull request #33851 from freddi-kit/fix/may-trap-condition [sil-opt] Fix covering all-case of trapping instruction of SILInstruction::mayTrap

view details

3405691582

commit sha 88167e74d1b8e1714ac2f108764ce265cae0ead5

[test] diff --strip-trailing-cr is non-standard. This flag is a GNU extension, and would cause misleading test failures on other platforms where this extension is not available. However, the necessity to switch line endings is only required on Windows when testing. We could use sed to canonicalize line endings before comparing, but that may cause higher amounts of filesystem traffic on Windows which would slow down testing. Instead, move the substitution for diff in SourceKit's lit.local.cfg up to the top level, and conditionalize the substitution which has the flag on Windows, but not on other platforms (where it should not be required).

view details

Saleem Abdulrasool

commit sha bdb3da805cdafd3276b08ac6201668ef427ca63d

Frontend: allow directory layout for Swift on non-Darwin platforms Adjust the serialized module loader to allow directory layouts for the Swift module on non-Darwin targets, unifying the layout across all the platforms. It also eases cross-architecture and cross-platform development by having the same layout, which can enable more similar flag usage.

view details

Egor Zhdan

commit sha b63dbbc3f04184f78218fe74d7968bf22e7d4e1d

WinSDK: extract Internationalization submodule Currently winnls.h & imm.h get included into `WinSDK.WinSock2`, however their usages might not be related to sockets

view details

Saleem Abdulrasool

commit sha af868e5c8fc2ed5728618a7a8ab53cf463c0b49b

build: migrate towards the unified directory layout for modules This changes the install layout to be similar across Darwin and non-Darwin platforms. This will enable simplifying the user experience, build infrastructure, and the driver as the SDK layout converges towards a single layout on all the platforms.

view details

Xi Ge

commit sha c11cb4463decaefba56780e3cb0a016c5950ef27

Merge pull request #33928 from nkcsgexi/lower-case-keyword ABI Checker: use lower-cased decl keywords to be consistent with source. NFC

view details

Max Desiatov

commit sha 0c8b86601c9ac23a0e7f9e09c8371601b508542c

test: Replace _silgen_name w/ _cdecl in CommandLineStressTest This test abuses @_silgen_name unnecessarily according to https://forums.swift.org/t/how-can-my-c-main-function-call-swift/40244/2

view details

Saleem Abdulrasool

commit sha 76a716008eeb604dc58bf527243e301434539a76

Merge pull request #33931 from 3405691582/SedThenDiff [test] diff --strip-trailing-cr is non-standard.

view details

Dave Lee

commit sha 157505196ada10528d2f6a221f1fed25ddfe50d8

[build-script] Disable pkg-config for Darwin hosts

view details

push time in a month

push eventbrentdax/swift

Brent Royal-Gordon

commit sha 61f74bff73c1ae758bba15d30e2585a53c85e3a9

Test import decision remarks

view details

Brent Royal-Gordon

commit sha 086cc09a60265e89886209d8fe369d0a0676b5fe

Emit import decision remarks for subscripts

view details

push time in a month

push eventbrentdax/swift

Brent Royal-Gordon

commit sha b2a39b459ec7a41e3ff233bd2d5dd3d9155845c2

Test import decision remarks

view details

push time in a month

push eventapple/swift

Brent Royal-Gordon

commit sha 9dcec053099272922fcb052282fa2c305314a444

Fix non-public imported declaration diagnostic bug When DiagnosticEngine needs to diagnose something about an imported declaration, it uses ASTPrinter to print the declaration’s interface into a source buffer and then diagnoses it there. However, this code only printed public declarations, so it failed to account for features like `@testable import` which allow less-than-public declarations to be imported. Errors involving these declarations would therefore be diagnosed at <unknown>:0. This commit changes DiagnosticEngine to determine the access level of the declaration it needs to print and, if it is below `Public`, instead prints a separate interface whose minimum access level is low enough to include the desired declaration.

view details

Brent Royal-Gordon

commit sha 806125d6f82fe7ea5b39f6039df94c161d279630

Favor private imports during name lookup Private imports are intended to make the file performing the import more or less source-compatible with the file being imported from, so that code from the original file can be modified by relatively simple syntactic transformations. However, their name shadowing behavior was very different from the original file. In the original file, other declarations in the same module would have shadowed declarations imported from any other module; in a file using a @_private import, they would all be considered imports, and thus all would be preferred equally. This could cause ambiguity in a file using a @_private import that was not present in the original file. This commit changes that behavior by favoring @_private imports over other imports, so that if a name is visible through both a private and a non-private import, the one visible through the private import will shadow the other. This shadowing takes a higher priority than a scoped import, but a lower priority than the check for whether one of the modules is only visible through the other. Fixes rdar://68312053.

view details

Brent Royal-Gordon

commit sha 4aabd2735bdcd8891d202309663932b83cac3fd3

Merge pull request #33864 from brentdax/imported-by-the-east-aldenard-trading-company Fix non-public imported declaration diagnostic bug + Favor private imports during name lookup

view details

push time in a month

PR merged apple/swift

Fix non-public imported declaration diagnostic bug + Favor private imports during name lookup

This PR contains two changes; the first fixes a bug discovered while writing the tests for the second.

  1. Previously, diagnostics emitted on a non-public imported declaration (via e.g. testable or private import) would show as being at an invalid source location. Now they are emitted in a version of the generated interface which includes declarations of their access level.
  2. @_private(sourceFile:) import should, to the extent practicable, preserve source compatibility with the original file. However, name lookup ended up working very differently. In the original file, declarations in the same module would shadow declarations from any other module; in the file importing it, the declarations from the original file's module would be considered just as imported as any other module's, so there would be new name lookup ambiguities. To address this, we add a shadowing rule which favors modules with a private import in the DeclContext's file over other modules visible from that file.

The first change is a pure bug fix. The second is a behavior change, but in a compiler-internal feature.

+189 -10

13 comments

11 changed files

brentdax

pr closed time in a month

pull request commentapple/swift

Fix non-public imported declaration diagnostic bug + Favor private imports during name lookup

Seems to have missed Windows. Trying again:

@swift-ci please smoke test

brentdax

comment created time in a month

pull request commentapple/swift

Fix non-public imported declaration diagnostic bug + Favor private imports during name lookup

@swift-ci please smoke test

brentdax

comment created time in a month

pull request commentapple/swift

Fix non-public imported declaration diagnostic bug + Favor private imports during name lookup

Rebased onto main instead of master; no other changes.

@swift-ci please smoke test

brentdax

comment created time in a month

push eventbrentdax/swift

Brian Gontowski

commit sha 3425a6dbb16e5fa7ad4b735eff4533c279d61442

Added protocol to support CVarArg objects that need to be retained

view details

Brian Gontowski

commit sha 0e7749bcde5eb1bc9fec82ef0eb3896ec8d6de6f

Fixed comment

view details

Yuta Saito

commit sha d6cddaabb59958737e048ff1a5dd4d283c555661

[LTO] Support LLVM LTO for driver This commit adds LTO support for handling linker options and LLVM BC emission. Even for ELF, swift-autolink-extract is unnecessary because linker options are embeded in LLVM BC content when LTO.

view details

Brian Gontowski

commit sha 17c77ba703b32c11e127573d414d31c9ec635188

Only use _CVarArgObject on non-ObjC platforms

view details

Brian Gontowski

commit sha 515c371be434ff49debfd145ebd9047bd148d47f

Avoid a warning when not modifying arg

view details

Nathan Hawes

commit sha cf60b2fe610616dd8f3dd7838a0cee7f0090eee7

[CodeCompletion] Pass the CodeCompletionExpr rather than just the base expression to the DotExpr completion callback.

view details

Nathan Hawes

commit sha fe9df72d554aa15d2d0ccc933c213938953c1c79

[CodeCompletion] Add initial implementation of solver-based member completion. This hooks up member completion to the new typeCheckForCodeCompletion API to generate completions from all solutions the constraint solver produces (include ones requiring fixes) rather than relying purely the single solution being applied to the AST (if any). This lets us still give completion results in ambiguous and invalid code.

view details

Pavel Yaskevich

commit sha a49404d593c36056158cded398f97aeb3b37c8e6

[CodeCompletion] Adjust `DotExprLookup::sawSolution` to use new `Solution` APIs

view details

Pavel Yaskevich

commit sha 5bd19d28ac82b137d266909cdf90946fa02ae738

[CSSolver] add debug logging to `solveForCodeCompletion`

view details

Pavel Yaskevich

commit sha 53de10fd3cb7d10eb7d2845e922029867b24da60

[CSSolver] Update expression after constraint generation while solving for code completion

view details

Nathan Hawes

commit sha 3d8561502bee5644c23f7fa2fe26143c50f72b3f

[CodeCompletion] Move CompletionCollector to ASTContext + bug fixes.

view details

Pavel Yaskevich

commit sha 5872cef2ff8a096612b0e5cccd1ebfbc69967236

[CSSolver/CodeCompletion] If pre-check fails extract code completion expression and use it If there was an invalid reference which was caught by pre-check, let's remove all context besides code completion itself and use it to produce code completion results.

view details

Pavel Yaskevich

commit sha 97de1781519a58022429224089f09dea47a5baeb

[CSSolver] Solution: Resolve holes as underlying generic parameters for code completion To aid code completion, we need to attempt to convert type holes back into underlying generic parameters if possible, since type of the code completion expression is used as "expected" (or contextual) type so it's helpful to know what requirements it has to filter the list of possible member candidates e.g. ```swift func test<T: P>(_: [T]) {} test(42.#^MEMBERS^#) ``` It's impossible to resolve `T` in this case but code completion expression should still have a type of `[T]` instead of `[<<hole>>]` because it helps to produce correct contextual member list based on a conformance requirement associated with generic parameter `T`.

view details

Nathan Hawes

commit sha 5100de42935bcc853047b7e1b99ade17953f5c5e

[CodeCompletion] Fallback to typechecking just the completion expression in cases where typeCheckExpression is never called. This happens when, e.g. an expression being switched on is invalid so expression patterns in the switch cases (which may contain the completion expression) are not checked. Also setup the Lookup object to handle member completion in ObjC selector expressions correctly, and fix passing the wrong expression when computing isStaticallyDerivedMetatype().

view details

Pavel Yaskevich

commit sha b71fdb5704e4c969ff49baabd8f146c0b9b38ef4

[CSSolver] Augment `solveForCodeCompletion` to indicate when it fails

view details

Pavel Yaskevich

commit sha d6d083ecf87718ba78007a76e719adc437dbd00d

[TypeChecker] Mode code completion fallback to `typeCheckForCodeCompletion` If an expression fails pre-check or constraint generation, code completion should be performed directly on the `CodeCompletionExpr` as a fallback. Let's factor that logic out from `solveForCodeCompletion` and put it directly into `typeCheckForCodeCompletion` because it's easier to establish fault conditions there.

view details

Pavel Yaskevich

commit sha 74f0ec5b973edea1311226978124c9cc9c17fd16

[TypeChecker/CodeCompletion] Allow `{typeCheck, solve}ForCodeCompletion` to operate on target instead of expression Using `SolutionApplicationTarget` make it easier to propage contextual information and avoid mistakes of using incorrect accessors for constraint generation.

view details

Pavel Yaskevich

commit sha d97a7f3d19d813540a2f42c11b29ef988afadad7

[TypeChecker/CodeCompletion] Make viability checking responsibility of `typeCheckForCodeCompletion` There is no way to separate viability/applicability checking from `TypeChecker::typeCheckForCodeCompletion` because multi-statement closures could be either type-checked together with enclosing context (e.g. when closure represents a function builder body), or separately - when it's just a regular closure. Due to this "duality" we need to attempt to run code completion code to determine whether body of the closure participated in type-check and if it didn't, fallback to a `typeCheckExpression`.

view details

Pavel Yaskevich

commit sha 7a9c59a4cad9013dfaad590993860066bb98cbf3

[ConstraintSystem] Add `Solution::hasType(ASTNode)`

view details

Pavel Yaskevich

commit sha 8d5c94f232a244355292ace32e9d6322f0a9a16c

[TypeChecker/CodeCompletion] Implement a fallback from code completion to `typeCheckExpression` This fallback to `typeCheckExpression` is triggered when it's determined that code completion expression is located inside of a multi-statement closure and its body is going going to participate in type-check.

view details

push time in a month

Pull request review commentapple/swift

[NFC] Clarify import filtering logic and naming.

 class ModuleDecl : public DeclContext, public TypeDecl {   /// \sa getImportedModules   enum class ImportFilterKind {     /// Include imports declared with `@_exported`.-    Public = 1 << 0,+    Exported = 1 << 0,     /// Include "regular" imports with no special annotation.     Private = 1 << 1,     /// Include imports declared with `@_implementationOnly`.     ImplementationOnly = 1 << 2,-    /// Include imports of SPIs declared with `@_spi`+    /// Include imports of SPIs declared with `@_spi`. Non-SPI imports are+    /// included whether or not this flag is specified.     SPIAccessControl = 1 << 3,-    /// Include imports shadowed by a separately-imported overlay (i.e. a-    /// cross-import overlay). Unshadowed imports are included whether or not-    /// this flag is specified.-    ShadowedBySeparateOverlay = 1 << 4+    /// Include imports shadowed by a cross-import overlay. Unshadowed imports+    /// are included whether or not this flag is specified.+    ShadowedByCrossImportOverlay = 1 << 4

Sure, that's fine.

varungandhi-apple

comment created time in a month

PullRequestReviewEvent

Pull request review commentapple/swift

[NFC] Clarify import filtering logic and naming.

 class ModuleDecl : public DeclContext, public TypeDecl {   /// \sa getImportedModules   enum class ImportFilterKind {     /// Include imports declared with `@_exported`.-    Public = 1 << 0,+    Exported = 1 << 0,     /// Include "regular" imports with no special annotation.     Private = 1 << 1,

Default is fine. Interface might work too (contrasting with ImplementationOnly).

varungandhi-apple

comment created time in a month

PullRequestReviewEvent

push eventbrentdax/swift

Brent Royal-Gordon

commit sha 7db60122d2274f16c39f49be13d24ee07defad24

[WIP] Test import decision remarks

view details

push time in a month

more