[PATCH] D30994: Add pretty-printer for llvm::Twine type

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 13:30:48 PDT 2017


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Looks good (one minor thing to fix up further - the elifs) & thanks for explaining the stringification issue. Maybe add some comments there about why it's needed/useful, if you like (& why the type comparison is difficult/awkward)



================
Comment at: utils/gdb-scripts/prettyprinters.py:232-264
+    elif kind == 'llvm::Twine::TwineKind':
+      return self.string_from_twine_object(child['twine'].dereference())
+    elif kind == 'llvm::Twine::CStringKind':
+      return child['cString'].string()
+    elif kind == 'llvm::Twine::StdStringKind':
+      val = child['stdString'].dereference()
+      return self.string_from_pretty_printer_lookup(val)
----------------
Remove the "el"/elses here - since each condition unconditionally returns:

  if ...:
    return
  if ...:
    return
  return '(unhandled...




Repository:
  rL LLVM

https://reviews.llvm.org/D30994





More information about the llvm-commits mailing list