Skip to content

SwiftCompilerSources: refactor and verify conformances to ForwardingInstruction #71723

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 6 commits into from
Feb 22, 2024

Conversation

eeckstein
Copy link
Contributor

  • add the ability to implement SIL verification in swift
  • add all missing instruction classes and require that all new instructions must be added and registered in SwiftCompilerSources as well
  • add ForwardingInstruction conformances to missing forwarding instruction classes
  • move all the forwarding instruction conformance definitions into ForwardingInstructions.swift

@eeckstein eeckstein requested a review from atrick February 19, 2024 13:28
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

Awesome. I've been wanting this verification.

Tangentially, it would be nice to verify statically that all instructions added to SILNodes.def exist in Instruction.swift

@atrick
Copy link
Contributor

atrick commented Feb 21, 2024

Note that I had made some of the same fixes here:
#71703

So I rebased on top of this PR and am now waiting for it to be merged first.

@atrick
Copy link
Contributor

atrick commented Feb 21, 2024

@swift-ci test linux platform

@atrick
Copy link
Contributor

atrick commented Feb 21, 2024

Rerunning linux tests since the old build log is no longer available.

It's not needed because UnaryInstruction is "derived" from Instruction which has this property.
And require that all new instructions must be added and registered in SwiftCompilerSources as well.
Because it can only appear in the initializer list of a global variable.
* add ForwardingInstruction conformances to missing forwarding instruction classes
* move all the forwarding instruction conformance definitions into ForwardingInstructions.swift
* remove the default implementations of the requirements, so that every instruction needs to specify them
Verify that the C++ view of forwarding instructions agrees with the swift ForwardInstruction conformances.
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit 47ae9bd into swiftlang:main Feb 22, 2024
@eeckstein eeckstein deleted the swift-verifier branch February 22, 2024 11:29
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.

2 participants