-
Notifications
You must be signed in to change notification settings - Fork 14.2k
[Demangling] Refactor Demangler range tracking #140762
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
cc3c6d1
296a105
32c5095
69e86fd
ce31f3a
68e3fd7
0acb2a4
c74d879
85416f9
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 |
---|---|---|
|
@@ -39,7 +39,7 @@ struct DemangledNameInfo { | |
/// \endcode | ||
std::pair<size_t, size_t> ScopeRange; | ||
|
||
/// Indicates the [start, end) of the function argument lits. | ||
/// Indicates the [start, end) of the function argument list. | ||
/// E.g., | ||
/// \code{.cpp} | ||
/// int (*getFunc<float>(float, double))(int, int) | ||
|
@@ -59,10 +59,24 @@ struct DemangledNameInfo { | |
/// \endcode | ||
std::pair<size_t, size_t> QualifiersRange; | ||
|
||
/// 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. | ||
std::pair<size_t, size_t> PrefixRange; | ||
|
||
/// Indicates the [start, end) of the function's suffix. This is a | ||
/// catch-all range for anything that is not tracked by the rest of | ||
/// the pairs. | ||
std::pair<size_t, size_t> SuffixRange; | ||
|
||
/// Returns \c true if this object holds a valid basename range. | ||
bool hasBasename() const { | ||
return BasenameRange.second > BasenameRange.first && | ||
BasenameRange.second > 0; | ||
return BasenameRange.second > BasenameRange.first; | ||
} | ||
|
||
/// Returns \c true if this object holds a valid arguments range. | ||
bool hasArguments() const { | ||
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. This seems unused? 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. Yes, it's only used in the Apple fork, I have removed the change now. |
||
return ArgumentsRange.second > ArgumentsRange.first; | ||
} | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ struct Entry { | |
FunctionNameWithArgs, | ||
FunctionNameNoArgs, | ||
FunctionMangledName, | ||
FunctionPrefix, | ||
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. If we add a new variable here we will need to update the documentation under 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. Fixed, thanks 👍 |
||
FunctionScope, | ||
FunctionBasename, | ||
FunctionTemplateArguments, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ add_lldb_unittest(LLDBCoreTests | |
DumpDataExtractorTest.cpp | ||
DumpRegisterInfoTest.cpp | ||
FormatEntityTest.cpp | ||
MangledTest.cpp | ||
ItaniumMangledTest.cpp | ||
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. I don't mind renaming the file but there are already swift mangling tests in this file, so 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. The rename was to separate the Swift tests from the Itanium tests. But as you said, it does not make much sense here. I will instead rename the tests to SwiftTests in the Apple fork. |
||
ModuleSpecTest.cpp | ||
PluginManagerTest.cpp | ||
ProgressReportTest.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.
Can you elaborate why this was needed?
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.
It was not needed but since I added the
hasArguments
method I wanted to remove the redundant>0
check.Since the start and end range are unsigned, if
end > start
, thenend
is always greater than0
, which is why I removed the second check. I might be missing something.