Skip to content

Clean up the constructors of DebugTypeInfo #6632

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 2 commits into from
Jan 16, 2017

Conversation

adrian-prantl
Copy link
Contributor

and ensure that the DeclContext of the SILFunction is used when
mangling substituted archetypes found in inlined variable declarations
that have been reparented into the caller

rdar://problem/28859432

@adrian-prantl
Copy link
Contributor Author

@swift-ci please test

@adrian-prantl
Copy link
Contributor Author

Don't merge this yet, this need a change in LLDB.

@swift-ci
Copy link
Contributor

swift-ci commented Jan 7, 2017

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 8c1dcd9a72fbd20053aa804733a43a468d3f021c
Test requested by - @adrian-prantl

@swift-ci
Copy link
Contributor

swift-ci commented Jan 7, 2017

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8c1dcd9a72fbd20053aa804733a43a468d3f021c
Test requested by - @adrian-prantl

// Determine whether this type is an Archetype itself.
bool isArchetype() const {
return Type->getLValueOrInOutObjectType()
->getDesugaredType()
Copy link
Contributor

@slavapestov slavapestov Jan 7, 2017

Choose a reason for hiding this comment

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

Replace "getDesugaredType()->getKind()" with is<ArchetypeType>()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

/// virtue of their DWARF type.
bool isImplicitlyIndirect() const {
return Type->isLValueType() || isArchetype() ||
(Type->getKind() == TypeKind::InOut);
Copy link
Contributor

Choose a reason for hiding this comment

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

Type->is<InOutType>()

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand this check. An optional of an archetype, resilient types and existentials are also indirect. Can't you use SIL or IRGen type lowering?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to a matching comment in IRGenSIL.cpp visitDebugValueAddrInst(), these types are passed by reference in SIL and below (but not in the Swift type system). Because LLDB's expression evaluator needs to construct a Swift type for a memory object, we emit a DWARF deref operation for objects of these types so the Swift type matches the dereferenced memory.

What do you mean by using SIL or IRGen type lowering?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Side note: I would like to follow-up on this separately from this patch, this line only had clang-format changes on it and was otherwise unchanged.
That said, I'm very interested in cleaning all of this up! Thanks for looking.

@adrian-prantl
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 8c1dcd9a72fbd20053aa804733a43a468d3f021c
Test requested by - @adrian-prantl

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8c1dcd9a72fbd20053aa804733a43a468d3f021c
Test requested by - @adrian-prantl

and ensure that the DeclContext of the SILFunction is used when
mangling substituted archetypes found in inlined variable declarations
that have been reparented into the caller

<rdar://problem/28859432>
…jects.

Prior to this patch, debug info was storing the original swift type
for function objects. This could be very wrong in optimized code. This
patch stores the lowered function type in the debug info and adds the
necessary type reconstruction code (tested via the LLDB testsuite) to
allow reconstructing a Swift type from a mangled lowered type.

<rdar://problem/28859432>
@adrian-prantl
Copy link
Contributor Author

@swift-ci please test and merge

@swiftix
Copy link
Contributor

swiftix commented Jan 14, 2017

@adrian-prantl Adrian, GitHub shows that all CI tests are green, but it hasn't merged for some reason. If you want to merge, could you try again?

@adrian-prantl adrian-prantl merged commit f267521 into swiftlang:master Jan 16, 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.

4 participants