[llvm] r353028 - [SelectionDAG] Add a BaseIndexOffset::print() method for debugging.
Clement Courbet via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 4 01:30:44 PST 2019
Author: courbet
Date: Mon Feb 4 01:30:43 2019
New Revision: 353028
URL: http://llvm.org/viewvc/llvm-project?rev=353028&view=rev
Log:
[SelectionDAG] Add a BaseIndexOffset::print() method for debugging.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h?rev=353028&r1=353027&r2=353028&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h Mon Feb 4 01:30:43 2019
@@ -59,6 +59,9 @@ public:
/// Parses tree in Ptr for base, index, offset addresses.
static BaseIndexOffset match(const LSBaseSDNode *N, const SelectionDAG &DAG);
+
+ void print(raw_ostream& OS) const;
+ void dump() const;
};
} // end namespace llvm
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp?rev=353028&r1=353027&r2=353028&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp Mon Feb 4 01:30:43 2019
@@ -177,3 +177,22 @@ BaseIndexOffset BaseIndexOffset::match(c
}
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
+
More information about the llvm-commits
mailing list