[llvm] 6384378 - [NFC][IntrRefLDV] Improve the Value printing
Djordje Todorovic via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 28 07:39:29 PDT 2020
Author: Djordje Todorovic
Date: 2020-10-28T07:39:08-07:00
New Revision: 6384378582b429ff86ea10a7e48b4ab2001b1e4b
URL: https://github.com/llvm/llvm-project/commit/6384378582b429ff86ea10a7e48b4ab2001b1e4b
DIFF: https://github.com/llvm/llvm-project/commit/6384378582b429ff86ea10a7e48b4ab2001b1e4b.diff
LOG: [NFC][IntrRefLDV] Improve the Value printing
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.
Differential Revision: https://reviews.llvm.org/D90309
Added:
Modified:
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index e737e9595514..7d593ec5d517 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -343,9 +343,12 @@ class ValueIDNum {
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();
}
More information about the llvm-commits
mailing list