-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[WIP] Enhance -assume-single-threaded option #7421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This change updates the branch mappings for the Swift-LLDB repository to match the LLVM & Clang model which LLDB is adopting.
The correct/canonical ConcreteType and ConcreteTypeSource are both stored in the Representative, but previously only the getter for the former was tranversing the chain.
This is the "canonical" representation of the type-level requirements of a protocol, and we intend to use it pervasively in the compiler.
The requirement signature is far more compact than looking at all the members.
When using the requirement signature in the archetype builder, not all nested types are resolved (i.e. added to their parent PA's NestedTypes map) when a protocol conformance is added. Equating a PA to a concrete type would previously rely on the NestedTypes map being complete, to recursively equate those nested types to the type implied by their parent being concrete. The lazier resolution now also includes resolving nested PA's to concrete types, if their parents are concrete.
This change depends on: swiftlang/swift-cmark#4
…ynthesized` again. This reverts part of #4038 which made the compiler consider it to be an `Explicit` conformance, breaking source code that was accepted in Swift 3.0 which declared a raw type as well as explicit conformance to `RawRepresentable` (reported as rdar://problem/30386658). While I'm here, a couple of spot fixes: - Ensure an enum's raw value exprs are type-checked before checking conformances of any of its extensions, since the RawRepresentable conformance derivation will blow up if the raw value exprs haven't been checked. Fixes an order dependency issue if `extension Foo: RawRepresentable {}` gets checked before `enum Foo: Int { ... }`. - Don't display the custom `enum_declares_rawrep_with_raw_type` diagnostic if the source location for the enum's inheritance clause is invalid, so that we don't emit a dislocated diagnostic.
Previously, these were only diagnosed in some situations, but the compiler is becoming more flexible about when things get fed into different places, and so can crop up elsewhere.
Default this option to its previous value (whether libxml2 was found), but allow us to independently turn it off.
This just moves a bunch of queries that used information on SILFunction to determine this property to just call a helper on SILFunctionType itself. Centralized logic is good. rdar://29791263
This is just refactoring code from DiagnoseUnreachable into a centralized location. rdar://29791263
… <rdar://problem/30271691>
The requirement signature covers this functionality, when it matters.
…an a char pointer + length This avoids doing a strlen in lldb when calling this function. rdar://problem/30062026
Matching two dependent member types has nothing to do with matching the bases; they're independent type parameters.
…nts. Rather than using "isEqual" to match same-type constraints among concrete types, use a full type matched to recursively decompose the structure. This allows us to support same-type constraints that end up being of the form X<T> == X<U>, where T and U are type parameters of some sort. Fixes rdar://problem/29333056.
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
|
If you want to test on the PR bots, you can add in a commit on your branch a change to the preset that the bot will invoke or add an additional preset. There is support in swift-ci for invoking arbitrary presets. |
You can add a preset by looking in ./utils/build-presets.ini. I would just copy the section under: [preset: buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx] And create a preset maybe with the name: [preset: buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,single-thread] and add your flag to that after the em-dash to ensure that it is passed to build-script-impl if you need to do so. |
I merged upstream into my fork, created a new topic branch, applied all my changes in a single commit, pushed the branch to my fork, and tried to create a new PR from it. However, I discarded the PR since it still included many commits from other people. I need help from github expert for solving the problem. |
Here is what I usually do:
Please let me know if it helps or if you need more help. |
Instead of merging upstream into your branch, rebase your branch on top of upstream:
|
@swiftix Your suggestion to create a clean PR worked perfectly. Thanks! |
(This PR was replaced with #7557)
This PR is part of SR-3945 which extends the scope of
-assume-single-threaded
option to value types.This PR is not fully integrated with swift build system yet. The same environment variable
SWIFT_ASSUME_SINGLE_THREADED
is used at compile time to configure swift compiler to generate single threaded code and, as well as at runtime to configure swift native runtime for single threaded code.To use this PR, set an arbitrary text to
SWIFT_ASSUME_SINGLE_THREADED
while runningbuild-script
as well as running your program. Without the variable defined, this PR should have no effect.