[PATCH] D72557: Add pretty printers for llvm::PointerIntPair and llvm::PointerUnion.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 25 16:17:50 PST 2020


dblaikie added inline comments.


================
Comment at: llvm/utils/gdb-scripts/prettyprinters.py:349
+  """Factory for an llvm::PointerIntPair printer."""
+  for (pointer, value) in get_pointer_int_pair(val):
+    pointer_type = val.type.template_argument(0)
----------------
Is this an idiomatic way to handle the "function that returns a thing or nothing"? It looks a bit quirky (it's a loop that's only ever intended to iterate once) & I wouldn't mind understanding better how/if this is idiomatic python (if you've got a link to some references about this) before committing it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72557





More information about the llvm-commits mailing list