summaryrefslogtreecommitdiff
path: root/lldb/source/Core/DemangledNameInfo.cpp
diff options
context:
space:
mode:
authorMichael Buch <michaelbuch12@gmail.com>2025-08-07 14:39:52 +0100
committerGitHub <noreply@github.com>2025-08-07 14:39:52 +0100
commitfac7453d2ca7ebe33dec3d60211c0374a2bb69cd (patch)
treeffb0e198e63acc4f32ac78afe45fbded1521eb0b /lldb/source/Core/DemangledNameInfo.cpp
parent900d20d0dc7b228cba9df98ed3ec713098c79342 (diff)
[lldb][Mangled] Move SuffixRange computation into TrackingOutputBuffer (#152483)
This way all the tracking is self-contained in `TrackingOutputBuffer` and we can test the `SuffixRange` properly.
Diffstat (limited to 'lldb/source/Core/DemangledNameInfo.cpp')
-rw-r--r--lldb/source/Core/DemangledNameInfo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Core/DemangledNameInfo.cpp b/lldb/source/Core/DemangledNameInfo.cpp
index 00227f02bbff..76f8987c5149 100644
--- a/lldb/source/Core/DemangledNameInfo.cpp
+++ b/lldb/source/Core/DemangledNameInfo.cpp
@@ -111,6 +111,11 @@ void TrackingOutputBuffer::finalizeEnd() {
if (NameInfo.ScopeRange.first > NameInfo.ScopeRange.second)
NameInfo.ScopeRange.second = NameInfo.ScopeRange.first;
NameInfo.BasenameRange.first = NameInfo.ScopeRange.second;
+
+ // We call anything past the FunctionEncoding the "suffix".
+ // In practice this would be nodes like `DotSuffix` that wrap
+ // a FunctionEncoding.
+ NameInfo.SuffixRange.first = getCurrentPosition();
}
ScopedOverride<unsigned> TrackingOutputBuffer::enterFunctionTypePrinting() {
@@ -138,6 +143,9 @@ void TrackingOutputBuffer::printLeft(const Node &N) {
default:
OutputBuffer::printLeft(N);
}
+
+ // Keep updating suffix until we reach the end.
+ NameInfo.SuffixRange.second = getCurrentPosition();
}
void TrackingOutputBuffer::printRight(const Node &N) {
@@ -151,6 +159,9 @@ void TrackingOutputBuffer::printRight(const Node &N) {
default:
OutputBuffer::printRight(N);
}
+
+ // Keep updating suffix until we reach the end.
+ NameInfo.SuffixRange.second = getCurrentPosition();
}
void TrackingOutputBuffer::printLeftImpl(const FunctionType &N) {