Skip to content

Use function signatures for SILDeclRefs in witness_tables, vtables and witness_method instructions #4048

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 1 commit into from
Jan 26, 2017

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Aug 5, 2016

What's in this pull request?

Resolved bug number: (SR-)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

A smoke test on macOS does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library only for macOS. Simulator standard libraries and
    device standard libraries are not built.
  3. lldb is not built.
  4. The test and validation-test targets are run only for macOS. The optimized
    version of these tests are not run.

A smoke test on Linux does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library incrementally.
  3. lldb is built incrementally.
  4. The swift test and validation-test targets are run. The optimized version of these
    tests are not run.
  5. lldb is tested.

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

Textual SIL was sometimes ambiguous when SILDeclRefs were used, because the textual representation of SILDeclRefs was the same for functions that have the same name, but different signatures.

This patch fixes this problem.

@swiftix
Copy link
Contributor Author

swiftix commented Aug 5, 2016

@swift-ci Please smoke test

@swiftix
Copy link
Contributor Author

swiftix commented Aug 5, 2016

@jckarter Joe, do you mind having a quick look? This is nothing urgent. So, only if you have a couple of spare minutes.

@gottesmm
Copy link
Contributor

gottesmm commented Aug 5, 2016

@swiftix Is this doing the demangled thing?

@swiftix
Copy link
Contributor Author

swiftix commented Aug 5, 2016

@gottesmm No, it adds signatures. So, no cryptic mangled names.

@gottesmm
Copy link
Contributor

gottesmm commented Aug 5, 2016

= D

@swiftix
Copy link
Contributor Author

swiftix commented Aug 5, 2016

@swift-ci Please test

@swiftix swiftix force-pushed the wip-textual-sil-sildeclrefs branch from d925d55 to 7dda6c0 Compare August 5, 2016 22:31
@swiftix
Copy link
Contributor Author

swiftix commented Aug 5, 2016

@swift-ci Please test

@jckarter
Copy link
Contributor

jckarter commented Aug 5, 2016

Looks good, thanks @swiftix .

@shahmishal
Copy link
Member

@swift-ci please test linux

@tkremenek
Copy link
Member

Linux failure looks genuine.

@swiftix
Copy link
Contributor Author

swiftix commented Aug 6, 2016

@swift-ci Please smoke test Linux

@swiftix
Copy link
Contributor Author

swiftix commented Aug 7, 2016

There seems to be a problem with parsing SILDeclRefs which use a Self type. I filed a rdar://27735857 about it.

@jckarter @slavapestov Can one of you have a look at this radar when you have a spare minute?

@swiftix
Copy link
Contributor Author

swiftix commented Aug 9, 2016

This PR is dependent on the #4126.

@slavapestov
Copy link
Contributor

@swiftix The DynamicSelf fix is now merged in master. You don't need it for 3.0 branch do you?

@swiftix swiftix force-pushed the wip-textual-sil-sildeclrefs branch from 7dda6c0 to 9e27ed6 Compare August 10, 2016 04:32
@swiftix
Copy link
Contributor Author

swiftix commented Aug 10, 2016

@slavapestov No, I don't need to for 3.0.

@swiftix
Copy link
Contributor Author

swiftix commented Aug 10, 2016

@swift-ci Please test

@swiftix
Copy link
Contributor Author

swiftix commented Aug 10, 2016

@swift-ci Please smoke test

@swiftix
Copy link
Contributor Author

swiftix commented Aug 10, 2016

@swift-ci Please test

@swiftix
Copy link
Contributor Author

swiftix commented Aug 10, 2016

@swift-ci Please test Linux

3 similar comments
@swiftix
Copy link
Contributor Author

swiftix commented Aug 10, 2016

@swift-ci Please test Linux

@swiftix
Copy link
Contributor Author

swiftix commented Aug 10, 2016

@swift-ci Please test Linux

@swiftix
Copy link
Contributor Author

swiftix commented Aug 10, 2016

@swift-ci Please test Linux

@swiftix
Copy link
Contributor Author

swiftix commented Aug 13, 2016

@akyrtzi I'm blocked by rdar://27794707 now ;-) If you could fix it, it would be nice. But it is not urgent. So, no hurry.

akyrtzi referenced this pull request Aug 15, 2016
…IL printing

Worksaround the issue that type objects do not preserve info to print requirements accurately.

rdar://27794707
@tkremenek
Copy link
Member

@swiftix rdar://27794707 is fixed

@slavapestov
Copy link
Contributor

@swiftix Just saying, it would be awesome if you ever get around to finishing this off :-)

@swiftix swiftix force-pushed the wip-textual-sil-sildeclrefs branch from 9e27ed6 to d503072 Compare January 25, 2017 19:09
@swiftix
Copy link
Contributor Author

swiftix commented Jan 25, 2017

@swift-ci Please smoke test

1 similar comment
@swiftix
Copy link
Contributor Author

swiftix commented Jan 25, 2017

@swift-ci Please smoke test

@shahmishal
Copy link
Member

FYI - CI is down for upgrade.

@swiftix
Copy link
Contributor Author

swiftix commented Jan 26, 2017

@jckarter Do you mind taking a quick look at it? Does it seem reasonable?

@jckarter jckarter self-requested a review January 26, 2017 01:09
@swiftix
Copy link
Contributor Author

swiftix commented Jan 26, 2017

@jckarter I'd like to merge it today. Any objections?

@@ -58,7 +58,7 @@ func direct_to_static_method(_ obj: AnyObject) {
// CHECK-NEXT: [[OBJCOPY:%[0-9]+]] = load_borrow [[PBOBJ]] : $*AnyObject
// CHECK-NEXT: [[OBJMETA:%[0-9]+]] = existential_metatype $@thick AnyObject.Type, [[OBJCOPY]] : $AnyObject
// CHECK-NEXT: [[OPENMETA:%[0-9]+]] = open_existential_metatype [[OBJMETA]] : $@thick AnyObject.Type to $@thick (@opened([[UUID:".*"]]) AnyObject).Type
// CHECK-NEXT: [[METHOD:%[0-9]+]] = dynamic_method [volatile] [[OPENMETA]] : $@thick (@opened([[UUID]]) AnyObject).Type, #X.staticF!1.foreign : (X.Type) -> () -> (), $@convention(objc_method) (@thick (@opened([[UUID]]) AnyObject).Type) -> ()
// CHECK-NEXT: [[METHOD:%[0-9]+]] = dynamic_method [volatile] [[OPENMETA]] : $@thick (@opened([[UUID]]) AnyObject).Type, #X.staticF!1.foreign : (X.Type) -> () -> () , $@convention(objc_method) (@thick (@opened([[UUID]]) AnyObject).Type) -> ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space seems to be printed here

@jckarter
Copy link
Contributor

It'd be nice to have a test with a .sil file that exercises the new syntax. Looks reasonable otherwise.

@gottesmm
Copy link
Contributor

@jckarter We definitely need a .sil file test to ensure that the parser can correctly handle this. I would also be fine with round tripping *.swift through sil-opt.

@gottesmm
Copy link
Contributor

But a *.sil file is a better solution since it creates a mark in the codebase that this code is tested in an expected way.

…d witness_method instructions.

Textual SIL was sometimes ambiguous when SILDeclRefs were used, because the textual representation of SILDeclRefs was the same for functions that have the same name, but different signatures.
@swiftix swiftix force-pushed the wip-textual-sil-sildeclrefs branch from d503072 to bf2dcbf Compare January 26, 2017 22:30
@swiftix
Copy link
Contributor Author

swiftix commented Jan 26, 2017

@swift-ci Please smoke test

1 similar comment
@swiftix
Copy link
Contributor Author

swiftix commented Jan 26, 2017

@swift-ci Please smoke test

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.

6 participants