Skip to content

Serialize fewer archetypes and tidy up casts #7139

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

Conversation

slavapestov
Copy link
Contributor

No description provided.

Storing this separately is unnecessary since we already
serialize the enum element's interface type. Also, this
eliminates one of the few remaining cases where we serialize
archetypes during AST serialization.
…eBase}::getKind()

Also add some FIXMEs for some code in debug info emission that
looks incorrect.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

/// LValues, inout args, and Archetypes are implicitly indirect by
/// virtue of their DWARF type.
//
// FIXME: Should this check if the lowered SILType is address only
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adrian-prantl What do you think? Should we be checking the SIL type lowering instead?

Also class-bound archetypes are not passed indirectly, so it's wrong in that case too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please go ahead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How can I construct a test case to verify my hypothesis? I don't want to start blindly changing this stuff without understanding what's going on :)

@@ -3278,9 +3278,13 @@ void IRGenSILFunction::visitDebugValueAddrInst(DebugValueAddrInst *i) {
auto RealType = SILTy.getSwiftType();
// Unwrap implicitly indirect types and types that are passed by
// reference only at the SIL level and below.
//
// FIXME: Should this check if the lowered SILType is address only
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

Previously, hasArgumentType() would silently return false if the
EnumElementDecl had not yet been typechecked, but now,
getArgumentInterfaceType() asserts in this case.

As the FIXME comment suggests, this warrants further investigation,
but for now add the workaround.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 8062f18 into swiftlang:master Jan 30, 2017
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