aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
diff options
context:
space:
mode:
authorMichael Buch <michaelbuch12@gmail.com>2025-11-07 07:52:03 +0000
committerGitHub <noreply@github.com>2025-11-07 07:52:03 +0000
commit54c9ddddd1da353b0303df1e86cf444c5363733d (patch)
tree78d0efaba461676a566f345bca0ff5e6e71841d1 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
parentfc5e0c071bfba9c8cc86ecff926b84a999970613 (diff)
downloadllvm-54c9ddddd1da353b0303df1e86cf444c5363733d.zip
llvm-54c9ddddd1da353b0303df1e86cf444c5363733d.tar.gz
llvm-54c9ddddd1da353b0303df1e86cf444c5363733d.tar.bz2
[libcxxabi][ItaniumDemangle] Separate GtIsGt counter into more states (#166578)
Currently `OutputBuffer::GtIsGt` is used to tell us if we're inside template arguments and have printed a '(' without a closing ')'. If so, we don't need to quote '<' when printing it as part of a binary expression inside a template argument. Otherwise we need to. E.g., ``` foo<a<(b < c)>> // Quotes around binary expression needed. ``` LLDB's `TrackingOutputBuffer` has heuristics that rely on checking whether we are inside template arguments, regardless of the current parentheses depth. We've been using `isGtInsideTemplateArgs` for this, but that isn't correct. Resulting in us incorrectly tracking the basename of function like: ``` void func<(foo::Enum)1>() ``` Here `GtIsGt > 0` despite us being inside template arguments (because we incremented it when seeing '('). This patch adds a `isInsideTemplateArgs` API which LLDB will use to more accurately track parts of the demangled name. To make sure this API doesn't go untested in the actual libcxxabi test-suite, I changed the existing `GtIsGt` logic to use it. Also renamed the various variables/APIs involved to make it (in my opinion) more straightforward to understand what's going on. But happy to rename it back if people disagree. Also adjusted LLDB to use the newly introduced API (and added a unit-test that would previously fail).
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
0 files changed, 0 insertions, 0 deletions