[PATCH] D73609: Change to individual pretty printer classes, remove generic `make_printer`.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 11:58:20 PST 2020


dblaikie added inline comments.


================
Comment at: llvm/utils/gdb-scripts/prettyprinters.py:322-325
   try:
     enum_type = gdb.lookup_type(info_name + '::MaskAndShiftConstants')
   except gdb.error:
     return (None, None)
----------------
csigg wrote:
> dblaikie wrote:
> > I think I asked this elsewhere, but not sure there was an answer (apologies if I forgot - might be worth a comment) - what is this error case for? Are there types in LLVM that don't provide this expected nested type?
> > 
> > Might be nice if it could be removed & then wouldn't need the factory layer of indirection for PointerIntPair and PointerUnion below.
> GDB gets confused about template arguments of 'std::_u::pair' (not sure I remember the exact name), and the lookup_type may fail.
> 
> Unfortunately GDB spews the console when a printer factory throws an exception, so it's better to catch it and handle it.
> 
> I will add a comment.
Where does std::pair come into this? The 4th template argument to PointerIntPair is the  PointerLikeTypeTraits, right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73609/new/

https://reviews.llvm.org/D73609





More information about the llvm-commits mailing list