-
Notifications
You must be signed in to change notification settings - Fork 344
Invert the ownership between SwiftASTContext and TypeSystemSwiftTypeR… #3408
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
Invert the ownership between SwiftASTContext and TypeSystemSwiftTypeR… #3408
Conversation
@swift-ci test |
9f2a8f6
to
7be7dbc
Compare
@swift-ci test |
lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp
Outdated
Show resolved
Hide resolved
lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp
Outdated
Show resolved
Hide resolved
lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp
Outdated
Show resolved
Hide resolved
lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp
Outdated
Show resolved
Hide resolved
7be7dbc
to
83676ae
Compare
@swift-ci test |
…ef (NFC) This patch introduces a new subclass SwiftASTContextForModules, which is now owned by TypeSystemSwiftTypeRef and initialized lazily. The TypeSystemSwiftTypeRef that corresponds to the scratch context is still owned by SwiftASTContextForExpressions. rdar://81717792
83676ae
to
744ae39
Compare
@swift-ci test |
module_holder ? module_holder : &ts->GetTypeSystemSwiftTypeRef(), | ||
module_holder ? module_holder->GetSwiftASTContext() | ||
: ts->GetSwiftASTContext(), | ||
dem, mangled_name.GetStringRef()); |
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 remember these ternaries, I wanted to get back to them to remove them. There are two callers of SwiftLanguageRuntimeImpl::GetTypeRef()
, and in both cases, they pass in a type
, and a TypeSystemSwiftTypeRef
derived from that type. Then here, it's derived again.
In other words, the both caller and callee are doing type.GetTypeSystem()->GetTypeSystemSwiftTypeRef()
(ignoring the cast for simplicity). I think these ternaries can be removed.
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 will do this in a follow-up commit.
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.
LGTM
…ef (NFC)
This patch introduces a new subclass SwiftASTContextForModules, which
is now owned by TypeSystemSwiftTypeRef and initialized lazily. The
TypeSystemSwiftTypeRef that corresponds to the scratch context is
still owned by SwiftASTContextForExpressions.
rdar://81717792