-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[lldb] add TemplateRange and NameQualifiersRange to DemangledNameInfo #150999
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
Changes from 2 commits
9b3551c
35bb830
a059d51
c2e9516
17f7a5a
9bbde80
8321eb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,6 +30,16 @@ struct DemangledNameInfo { | |||||
/// \endcode | ||||||
std::pair<size_t, size_t> BasenameRange; | ||||||
|
||||||
/// A [start, end) pair for the function template arguments. | ||||||
/// The basename is the name without scope qualifiers | ||||||
/// and without template parameters. E.g., | ||||||
/// \code{.cpp} | ||||||
/// void foo::bar<int>::someFunc<float>(int) const && | ||||||
/// ^ ^ | ||||||
/// start end | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it really start at the opening bracket? I think it starts at the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the CPlusPlusLanguage implementation, this is currently: return demangled_name.slice(info.BasenameRange.second,
info.ArgumentsRange.first); My implementation in Swift is quite similar. So in the example above, it should be Are you saying that we should only return |
||||||
/// \endcode | ||||||
std::pair<size_t, size_t> TemplateRange; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
/// A [start, end) pair for the function scope qualifiers. | ||||||
/// E.g., for | ||||||
/// \code{.cpp} | ||||||
|
@@ -59,6 +69,11 @@ struct DemangledNameInfo { | |||||
/// \endcode | ||||||
std::pair<size_t, size_t> QualifiersRange; | ||||||
|
||||||
/// Indicates the [start, end) of the function's name qualifiers. This is a | ||||||
/// catch-all range for anything in between the basename and the arguments, | ||||||
/// that is not tracked by the rest of the pairs. | ||||||
std::pair<size_t, size_t> NameQualifiersRange; | ||||||
|
||||||
/// Indicates the [start, end) of the function's prefix. This is a | ||||||
/// catch-all range for anything that is not tracked by the rest of | ||||||
/// the pairs. | ||||||
|
@@ -75,6 +90,11 @@ struct DemangledNameInfo { | |||||
return BasenameRange.second > BasenameRange.first; | ||||||
} | ||||||
|
||||||
/// Returns \c true if this object holds a valid template range. | ||||||
bool hasTemplate() const { | ||||||
return TemplateRange.second >= TemplateRange.first; | ||||||
} | ||||||
|
||||||
/// Returns \c true if this object holds a valid scope range. | ||||||
bool hasScope() const { return ScopeRange.second >= ScopeRange.first; } | ||||||
|
||||||
|
@@ -88,6 +108,11 @@ struct DemangledNameInfo { | |||||
return QualifiersRange.second >= QualifiersRange.first; | ||||||
} | ||||||
|
||||||
/// Returns \c true if this object holds a valid name qualifiers range. | ||||||
bool hasNameQualifiers() const { | ||||||
return NameQualifiersRange.second >= NameQualifiersRange.first; | ||||||
} | ||||||
|
||||||
/// Returns \c true if this object holds a valid prefix range. | ||||||
bool hasPrefix() const { return PrefixRange.second >= PrefixRange.first; } | ||||||
|
||||||
|
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.
Lets add a Swift exapmle
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.
Fixed, thanks 👍