-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Conversation
@swift-ci please test |
Don't merge this yet, this need a change in LLDB. |
Build failed |
Build failed |
// Determine whether this type is an Archetype itself. | ||
bool isArchetype() const { | ||
return Type->getLValueOrInOutObjectType() | ||
->getDesugaredType() |
There was a problem hiding this comment.
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>()
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type->is<InOutType>()
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
8c1dcd9
to
565b914
Compare
@swift-ci please test |
Build failed |
Build failed |
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>
565b914
to
6633ae0
Compare
@swift-ci please test and merge |
@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? |
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