Skip to content

SwiftCompilerSources: diagnostics bridging #69144

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
Oct 13, 2023

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Oct 12, 2023

For lifetime dependence prototyping.

@atrick atrick requested a review from eeckstein as a code owner October 12, 2023 07:28
@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@swift-ci test

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

basically lgtm, just a few minor comments


OptionalBridgedSILDebugVariable(
OptionalSILDebugVariable &&debugVariable) {
static_assert(sizeof(OptionalSILDebugVariable) <= 16*8);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not static_assert(sizeof(OptionalSILDebugVariable) <= sizeof(OptionalBridgedSILDebugVariable))?

}

public protocol DebugVariableInst : VarDeclInst {
var debugVariable: OptionalBridgedSILDebugVariable { get }
Copy link
Contributor

@eeckstein eeckstein Oct 12, 2023

Choose a reason for hiding this comment

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

I assume you didn't wrap OptionalBridgedSILDebugVariable into a swift type because it will be just passed to other functions. Can you add a typealias, e.g. typealias DebugVariable = OptionalBridgedSILDebugVariable and use that in the APIs? I guess, the "Optional" prefix is not relevant on the swift side.

}

// See C++ VarDeclCarryingInst
public protocol VarDeclInst {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: So far we named concrete instruction classes "...Inst" and base classes/protocols "...Instruction" (with the exception of TermInst). Maybe this is coincidence, but IMO it makes sense, because then it's immediately clear if it's a concrete instruction or not.

@@ -1000,8 +1053,12 @@ final public class DestructureTupleInst : MultipleValueInstruction, UnaryInstruc

final public class BeginApplyInst : MultipleValueInstruction, FullApplySite {
public var numArguments: Int { bridged.BeginApplyInst_numArguments() }

Copy link
Contributor

Choose a reason for hiding this comment

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

added space

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I got this one. But I generally don't take time to edit auto-inserted spaces. When we have a precheckin swift-format script that works, I'll use that.

@eeckstein
Copy link
Contributor

Sorry, I caused you a conflict. I renamed BridgedDiagnosticEngine -> BridgedDiagEngine

@atrick atrick force-pushed the bridge-diagnostics branch from 843c8e1 to 6da5dd7 Compare October 12, 2023 19:20
@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@swift-ci smoke test

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm!

@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@swift-ci smoke test linux

1 similar comment
@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@swift-ci smoke test linux

@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@eeckstein I'm not sure how to pass PR testing after the bridging rework. Linux builds have failed 3 times in a row complaining about missing declarations that clearly included in the PR.

@eeckstein retrying with SWIFT_IMPORT_UNSAFE on those APIs...

@atrick atrick force-pushed the bridge-diagnostics branch from 6da5dd7 to 972a69f Compare October 12, 2023 22:15
@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@swift-ci Please clean smoke test Linux platform

@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@swift-ci smoke test macOS

@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@swift-ci smoke test Windows

@atrick
Copy link
Contributor Author

atrick commented Oct 12, 2023

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 80c89fc into swiftlang:main Oct 13, 2023
@atrick atrick deleted the bridge-diagnostics branch October 13, 2023 03:51
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