-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Introduce an ImportedDeclaration and [lldb] Handle @_originallyDefinedIn #9657
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
[lldb] Introduce an ImportedDeclaration and [lldb] Handle @_originallyDefinedIn #9657
Conversation
Introduce a debug info independent type, ImportedDeclaration, which is analogous to DWARF's DW_AT_imported_declaration, as well as a way to search them by name.
Types annotated with @_originallyDefinedIn don't live in the module listed in their mangled name. To account for this, the compiler emits a DW_TAG_imported_declaration for those types under the name of the swiftmodule these types can be found at. This patch implements the logic required to produce the mangled name that can be used in type reconstruction to successfully find these types. rdar://137146961
47f104b
to
b9f47ba
Compare
/// \param[in] find_one | ||
/// If set to true, the search will stop after the first imported | ||
/// declaration is found. | ||
void FindImportedDeclarations(ConstString name, |
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.
This API should probably exist upstream, too.
/// If set to true, the search will stop after the first imported | ||
/// declaration is found. | ||
void FindImportedDeclarations(ConstString name, | ||
std::vector<ImportedDeclaration> &results, |
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.
Unless you need to append to the same vector multiple times, it should probably be a return type.
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.
You do append to the vector multiple times as part of the implementation (for example on SymbolFileDWARFDebugMap
). This is also how all of the other query APIs in Module and SymbolFile do it, so I'd rather keep it this way to stay consistent.
@@ -0,0 +1,18 @@ | |||
//===-- Symbol.cpp --------------------------------------------------------===// |
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.
update comment
Closed in favor of #9745 |
This PR contains two commits:
[lldb] Introduce an ImportedDeclaration
Introduce a debug info independent type, ImportedDeclaration, which is
analogous to DWARF's DW_AT_imported_declaration, as well as a way to
search them by name.
[lldb] Handle @_originallyDefinedIn
Types annotated with @_originallyDefinedIn don't live in the module
listed in their mangled name. To account for this, the compiler emits a
DW_TAG_imported_declaration for those types under the name of the
swiftmodule these types can be found at. This patch implements the logic
required to produce the mangled name that can be used in type
reconstruction to successfully find these types.
rdar://137146961