[PATCH] D90309: [NFC][IntrRefLDV] Improve the Value printing

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 07:24:23 PDT 2020


djtodoro created this revision.
djtodoro added a reviewer: jmorse.
djtodoro added a project: debug-info.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
djtodoro requested review of this revision.

Basically, this just improves the dump of the Value stored within a location.

If the defining instruction number is zero, it means it is "live-in".

Before the patch:

  ESI --> bb 0 inst 0 loc ESI

After:

  ESI --> Value{bb: 0, inst: live-in, loc: ESI}

This is an NFC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90309

Files:
  llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp


Index: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
===================================================================
--- llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -343,9 +343,12 @@
   bool operator!=(const ValueIDNum &Other) const { return !(*this == Other); }
 
   std::string asString(const std::string &mlocname) const {
-    return Twine("bb ")
-        .concat(Twine(BlockNo).concat(Twine(" inst ").concat(
-            Twine(InstNo).concat(Twine(" loc ").concat(Twine(mlocname))))))
+    return Twine("Value{bb: ")
+        .concat(Twine(BlockNo).concat(
+            Twine(", inst: ")
+                .concat((InstNo ? Twine(InstNo) : Twine("live-in"))
+                            .concat(Twine(", loc: ").concat(Twine(mlocname)))
+                            .concat(Twine("}")))))
         .str();
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90309.301276.patch
Type: text/x-patch
Size: 904 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201028/7a1b9af2/attachment.bin>


More information about the llvm-commits mailing list