Skip to content

Emit bind optional fixes #15248

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

Merged
merged 5 commits into from
Mar 16, 2018
Merged

Conversation

gottesmm
Copy link
Contributor

This fixes the remaining issues with bind optional by changing select_enum usage to switch_enum.

rdar://34222540

@gottesmm gottesmm force-pushed the emit_bind_optional_fixes branch from fd0515b to 15e1a4f Compare March 14, 2018 23:27
@gottesmm
Copy link
Contributor Author

(doing a quick rebase)

@gottesmm gottesmm force-pushed the emit_bind_optional_fixes branch from 15e1a4f to 439ee4e Compare March 14, 2018 23:43
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm gottesmm force-pushed the emit_bind_optional_fixes branch from 439ee4e to e3dc1e7 Compare March 15, 2018 05:31
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm gottesmm force-pushed the emit_bind_optional_fixes branch from e3dc1e7 to 9ee55a4 Compare March 15, 2018 21:13
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

6 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

... I guess I need to update the linux one separately. = /.

@gottesmm gottesmm force-pushed the emit_bind_optional_fixes branch from 9ee55a4 to c6e651f Compare March 15, 2018 23:31
@gottesmm
Copy link
Contributor Author

Lets try this one last time.

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

... introduced a merge conflict on my own branch sigh.

…eFullExpr as movable rvalues.

This fits more with the notion of the API, that the user is being given a scope
that was already setup for them and that they must decide when to pop.
….None cases.

I also used it to clean up a few uses of SwitchEnumBuilder.
…reachableExit from the Switch Case Scope.

This will allow me to enforce with an assert that the switch case scope is
always exitted in an explicit way.
@gottesmm gottesmm force-pushed the emit_bind_optional_fixes branch from c6e651f to dde4f58 Compare March 16, 2018 00:29
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

6 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 6df106e into swiftlang:master Mar 16, 2018
@gottesmm gottesmm deleted the emit_bind_optional_fixes branch March 16, 2018 01:16
@davezarzycki
Copy link
Contributor

Hi @gottesmm – Commit dde4f58625d2bee728667654c5a5b5ac5a826b17 broke a test on my Linux box. You can find the test output here:

http://znu.io/opaque_values_silgen.swift.out

And the output from lit here:

/home/dave/s/u/tools/swift/test/SILGen/opaque_values_silgen.swift:822:11: error: expected string not found in input
// CHECK: [[SENUM:%.*]] = select_enum [[COPY__ARG]]
          ^
<stdin>:1440:21: note: scanning from here
 %5 = copy_value %4 : $Optional<@callee_guaranteed () -> @out T> // users: %6, %8, %13
                    ^
<stdin>:1440:21: note: with variable "COPY__ARG" equal to "%5"
 %5 = copy_value %4 : $Optional<@callee_guaranteed () -> @out T> // users: %6, %8, %13
                    ^
<stdin>:1456:2: note: possible intended match here
 %13 = unchecked_enum_data %5 : $Optional<@callee_guaranteed () -> @out T>, #Optional.some!enumelt.1 // users: %14, %16, %18
 ^

@gottesmm
Copy link
Contributor Author

I wonder why it didn't trigger on the bots.

@davezarzycki
Copy link
Contributor

I'm not running the same distribution of Linux (Fedora versus Ubuntu), which could cause tiny differences.

@gottesmm
Copy link
Contributor Author

@davezarzycki Can you provide more information about the OS you are using. I want to try and reproduce. What version of Fedora are you using, versions of tools/etc.

@davezarzycki
Copy link
Contributor

davezarzycki commented Mar 17, 2018

Just a bit. Let me eliminate some variables first. If you really want to go down this route, you can start by installing Fedora 27: https://getfedora.org/en/workstation/download/

Then sudo dnf update to install updates, and sudo dnf install clang lldb lld libcxx libcxx-devel cmake ninja-build libuuid libuuid-devel libicu libicu-devel to get ensure that various LLVM goodies and dependencies are installed. You can use dnf search to find packages that you need that aren't installed.

@davezarzycki
Copy link
Contributor

Ugh. My first few guesses were wrong. I think this is one of those rare build-script versus unified build bugs. Please hold off while I dig further.

@davezarzycki
Copy link
Contributor

Okay, apparently the opaque_values_silgen.swift test assumes -DSWIFT_STDLIB_ENABLE_RESILIENCE=TRUE. Is -DSWIFT_STDLIB_ENABLE_RESILIENCE=FALSE no longer supported?

@davezarzycki
Copy link
Contributor

In either case, sorry for the noise @gottesmm!

@gottesmm
Copy link
Contributor Author

@davezarzycki No worries! = )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants