aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2019-02-04 09:30:43 +0000
committerClement Courbet <courbet@google.com>2019-02-04 09:30:43 +0000
commit1bb0e5ccfb07d0c86927273b715e48828d72c516 (patch)
treee5033d1d402b4f49b2e322808092bb212445953a /llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
parent8e933c1ccf1def4a53de7b4414eb4a79c8dc897e (diff)
downloadllvm-1bb0e5ccfb07d0c86927273b715e48828d72c516.zip
llvm-1bb0e5ccfb07d0c86927273b715e48828d72c516.tar.gz
llvm-1bb0e5ccfb07d0c86927273b715e48828d72c516.tar.bz2
[SelectionDAG] Add a BaseIndexOffset::print() method for debugging.
llvm-svn: 353028
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
index 56558e6..e57dabc 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
@@ -177,3 +177,22 @@ BaseIndexOffset BaseIndexOffset::match(const LSBaseSDNode *N,
}
return BaseIndexOffset(Base, Index, Offset, IsIndexSignExt);
}
+
+
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+
+LLVM_DUMP_METHOD void BaseIndexOffset::dump() const {
+ print(dbgs());
+}
+
+void BaseIndexOffset::print(raw_ostream& OS) const {
+ OS << "BaseIndexOffset base=[";
+ Base->print(OS);
+ OS << "] index=[";
+ if (Index)
+ Index->print(OS);
+ OS << "] offset=" << Offset;
+}
+
+#endif
+