[Lldb-commits] [PATCH] D129490: [lldb/libc++] Simplify the libc++ string formatter
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 11 08:10:19 PDT 2022
labath created this revision.
labath added reviewers: JDevlieghere, mib.
Herald added a project: All.
labath requested review of this revision.
Herald added a project: LLDB.
Precise string layout has changed a lot recently, but a long of these
changes did not have any effect on the usages of its fields -- e.g.
introduction/removal of an anonymous struct or union does not change the
way one can access the field in C++. Our name-based variable lookup
rules (deliberately) copy the C++ semantics, which means these changes
would have been invisible to the them, if only we were using name-based
lookup.
This patch replaces the opaque child index accesses with name-based
lookups, which allows us to greatly simplify the data formatter code.
The formatter continues to support all the string layouts that it
previously supported.
It is unclear why the formatter was not using this approach from the
beginning. I would speculate that the original version was working
around some (now fixed) issue with anonymous members or base classes,
and the subsequent revisions stuck with that approach out of inertia.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D129490
Files:
lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129490.443648.patch
Type: text/x-patch
Size: 7024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220711/91553c2c/attachment.bin>
More information about the lldb-commits
mailing list