Skip to content

Preserve 'let'-ness of stored properties in key paths. #18768

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 3 commits into from
Aug 17, 2018

Conversation

jckarter
Copy link
Contributor

Fixes SR-6502 | rdar://problem/35773760.

This will let future compilers that support new key path features backward-deploy logic for interpreting new kinds of key path patterns.
If we know a key path component can be accessed as a stored property, then we should also know whether it's a `let` or not, so it should be safe to encode this in the key path pattern. Stage this change in by changing the number of bits used to store in-line offsets, fixing up the parts of the key path implementation that assumed that it took up the entire payload bitfield.
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1a4e35f85f541d5ed3c8e33105f7c35805b1d11e

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1a4e35f85f541d5ed3c8e33105f7c35805b1d11e

@jckarter
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1a4e35f85f541d5ed3c8e33105f7c35805b1d11e

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1a4e35f85f541d5ed3c8e33105f7c35805b1d11e

@jckarter
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - f15e2f3d8b3721995511561bedd90fe8f2ab55e2

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f15e2f3d8b3721995511561bedd90fe8f2ab55e2

@jckarter
Copy link
Contributor Author

lldb test failure looks unrelated. @fredriss does this ring a bell?

******************** TEST 'lldb-Suite :: lang/swift/conditional_breakpoints/TestSwiftConditionalBreakpoint.py' FAILED ********************
14:13:57 lldb version 6.0.0 (https://github.com/apple/swift-lldb.git revision 7e74b4aa1c65a8723b0e460844642ab34f600da5)
14:13:57   Swift-4.2 (revision e5c4435cb1ecf02bed5c1a42a3379a6ad1d1e636)
14:13:57   clang revision 8a62fbd4fb65b0eeeddc2c64fea20ea2077d2c73
14:13:57   llvm revision e06cb584d8edd5059d29866128700df400e76d25
14:13:57 LLDB library dir: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/lldb-linux-x86_64/bin
14:13:57 LLDB import library dir: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/lldb-linux-x86_64/bin
14:13:57 Libc++ tests will not be run because: Unable to find libc++ installation
14:13:57 Skipping following debug info categories: ['dsym', 'gmodules']
14:13:57 
14:13:57 Session logs for test failures/errors/unexpected successes will go into directory '/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/lldb-linux-x86_64/lldb-test-traces'
14:13:57 Command invoked: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/lldb/test/dotest.py -q --arch= -s /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/lldb-linux-x86_64/lldb-test-traces --build-dir /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/lldb-linux-x86_64/lldb-test-build.noindex -S nm -u CXXFLAGS -u CFLAGS --executable /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/lldb-linux-x86_64/./bin/lldb --dsymutil /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/llvm-linux-x86_64/./bin/dsymutil -C /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/llvm-linux-x86_64/bin/clang --swift-compiler /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/swift-linux-x86_64/bin/swiftc --swift-library /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/swift-linux-x86_64/lib/swift --env ARCHIVER=/usr/bin/ar --env OBJCOPY=/usr/bin/objcopy --build-dir /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/lldb-linux-x86_64/lldb-test-build.noindex --test-subdir lang/swift --skip-category=watchpoint --skip-category=dwo --skip-category=dsym --skip-category=gmodules -E -I/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/foundation-linux-x86_64/Foundation -I/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/foundation-linux-x86_64/Foundation/usr/lib/swift -I/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/swift-corelibs-libdispatch -L/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/foundation-linux-x86_64/Foundation -L/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/libdispatch-linux-x86_64 -L/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/libdispatch-linux-x86_64/src -Xlinker -rpath -Xlinker /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/libdispatch-linux-x86_64/src -Xlinker -rpath -Xlinker /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/foundation-linux-x86_64/Foundation /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/lldb/packages/Python/lldbsuite/test/lang/swift/conditional_breakpoints -p TestSwiftConditionalBreakpoint.py
14:13:57 UNSUPPORTED: LLDB (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/llvm-linux-x86_64/bin/clang-6-x86_64) :: test_swift_conditional_breakpoint_dsym (TestSwiftConditionalBreakpoint.TestSwiftConditionalBreakpoint) (test case does not fall in any category of interest for this run) 
14:13:57 FAIL: LLDB (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/llvm-linux-x86_64/bin/clang-6-x86_64) :: test_swift_conditional_breakpoint_dwarf (TestSwiftConditionalBreakpoint.TestSwiftConditionalBreakpoint)
14:13:57 UNSUPPORTED: LLDB (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/llvm-linux-x86_64/bin/clang-6-x86_64) :: test_swift_conditional_breakpoint_dwo (TestSwiftConditionalBreakpoint.TestSwiftConditionalBreakpoint) (test case does not fall in any category of interest for this run) 
14:13:57 UNSUPPORTED: LLDB (/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/llvm-linux-x86_64/bin/clang-6-x86_64) :: test_swift_conditional_breakpoint_gmodules (TestSwiftConditionalBreakpoint.TestSwiftConditionalBreakpoint) (test case does not fall in any category of interest for this run) 
14:13:57 ======================================================================
14:13:57 FAIL: test_swift_conditional_breakpoint_dwarf (TestSwiftConditionalBreakpoint.TestSwiftConditionalBreakpoint)
14:13:57    Tests that we can set a conditional breakpoint in Swift code
14:13:57 ----------------------------------------------------------------------
14:13:57 Traceback (most recent call last):
14:13:57   File "/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1760, in test_method
14:13:57     return attrvalue(self)
14:13:57   File "/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/lldb/packages/Python/lldbsuite/test/decorators.py", line 144, in wrapper
14:13:57     func(*args, **kwargs)
14:13:57   File "/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/lldb/packages/Python/lldbsuite/test/lang/swift/conditional_breakpoints/TestSwiftConditionalBreakpoint.py", line 30, in test_swift_conditional_breakpoint
14:13:57     self.break_commands()
14:13:57   File "/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/lldb/packages/Python/lldbsuite/test/lang/swift/conditional_breakpoints/TestSwiftConditionalBreakpoint.py", line 48, in break_commands
14:13:57     'stop reason = breakpoint'])
14:13:57   File "/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2188, in expect
14:13:57     inHistory=inHistory)
14:13:57   File "/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2081, in runCmd
14:13:57     msg if msg else CMD_MSG(cmd))
14:13:57 AssertionError: False is not True : Process should be stopped due to breakpoint
14:13:57 Config=x86_64-/home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/llvm-linux-x86_64/bin/clang-6
14:13:57 ----------------------------------------------------------------------
14:13:57 Ran 4 tests in 4.383s
14:13:57 
14:13:57 RESULT: FAILED (0 passes, 1 failures, 0 errors, 3 skipped, 0 expected failures, 0 unexpected successes)

@jckarter
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@fredriss
Copy link
Contributor

@jckarter no, I haven't seen this one.
Multiple tests failed:
14:14:37 lldb-Suite :: lang/swift/conditional_breakpoints/TestSwiftConditionalBreakpoint.py
14:14:37 lldb-Suite :: lang/swift/stepping/TestSwiftStepping.py
14:14:37 lldb-Suite :: lang/swift/struct_init_display/TestSwiftStructInit.py
and I don't think any of those have been flaky in the past...

@fredriss
Copy link
Contributor

(but if your change only impacts keypath, then I agree it's unlikely to be related to your changes)

@fredriss
Copy link
Contributor

And the tests just passed on macOS...

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