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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 08:12:32 PST 2020


dblaikie added inline comments.


================
Comment at: debuginfo-tests/llvm-prettyprinters/gdb/prettyprinters.gdb:42-47
+# CHECK: llvm::PointerIntPair = {pointer = {{.*}}, value = 1}
+p PointerIntPair
+
+# CHECK: llvm::PointerUnion containing int * = {pointer = {{.*}}}
+p PointerUnion
+
----------------
dblaikie wrote:
> If you aren't testing the pointer value anyway, you could make it null & then you can test directly for that?
Alternatively (a bit dodgy) you could hardcode a pointer value with a reinterpret cast, to check that the specific value does round-trip through the pretty printer.

Or you could dereference the pointer value in the pretty printing test to demonstrate you can reach the thing it's meant to point to.

Given the bit twiddling, it does seem like it might be nice to verify that the specific pointer value comes out unharmed.


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