Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Thanks for adding to/improving the GDB pretty printer support! Just a few questions/thoughts to try to understand how this works similarly/differently from other related printers!
utils/gdb-scripts/prettyprinters.py | ||
---|---|---|
134 ↗ | (On Diff #152561) | dereference() is done here, but not in the Optional pretty printer below - any idea if there's a reason for that inconsistency? (maybe they're implemented differently in a way that I'm missing/not understanding right now) |
137 ↗ | (On Diff #152561) | llvm::Optional pretty printer doesn't include the template argument (& neither does the built-in std::vector printer, I think?). Probably, for consistency & to avoid being overly verbose, do similarly here & skip the template argument? |
Still not quite sure why the change in implementation of Optional - what the difference is between how it was done & how it's done now/with this patch, etc. But I'm not too fussed - if it works for you :)
I find the same trick is used in /usr/share/gcc-8/python/libstdcxx/v6/printers.py. The base class defines some boilerplate (__iter__, Python 2 compatible def next) so that the nested _iterator class can be flattened into the outer class.