[llvm] r345623 - [DAG] Add const variants for BaseIndexOffset functions.
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 30 11:26:43 PDT 2018
Author: niravd
Date: Tue Oct 30 11:26:43 2018
New Revision: 345623
URL: http://llvm.org/viewvc/llvm-project?rev=345623&view=rev
Log:
[DAG] Add const variants for BaseIndexOffset functions.
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=345623&r1=345622&r2=345623&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h Tue Oct 30 11:26:43 2018
@@ -45,18 +45,21 @@ public:
IsIndexSignExt(IsIndexSignExt) {}
SDValue getBase() { return Base; }
+ SDValue getBase() const { return Base; }
SDValue getIndex() { return Index; }
+ SDValue getIndex() const { return Index; }
- bool equalBaseIndex(BaseIndexOffset &Other, const SelectionDAG &DAG) {
+ bool equalBaseIndex(const BaseIndexOffset &Other,
+ const SelectionDAG &DAG) const {
int64_t Off;
return equalBaseIndex(Other, DAG, Off);
}
- bool equalBaseIndex(BaseIndexOffset &Other, const SelectionDAG &DAG,
- int64_t &Off);
+ bool equalBaseIndex(const BaseIndexOffset &Other, const SelectionDAG &DAG,
+ int64_t &Off) const;
/// Parses tree in Ptr for base, index, offset addresses.
- static BaseIndexOffset match(LSBaseSDNode *N, const SelectionDAG &DAG);
+ static BaseIndexOffset match(const LSBaseSDNode *N, const SelectionDAG &DAG);
};
} // 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=345623&r1=345622&r2=345623&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp Tue Oct 30 11:26:43 2018
@@ -19,8 +19,9 @@
using namespace llvm;
-bool BaseIndexOffset::equalBaseIndex(BaseIndexOffset &Other,
- const SelectionDAG &DAG, int64_t &Off) {
+bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
+ const SelectionDAG &DAG,
+ int64_t &Off) const {
// Conservatively fail if we a match failed..
if (!Base.getNode() || !Other.Base.getNode())
return false;
@@ -75,7 +76,7 @@ bool BaseIndexOffset::equalBaseIndex(Bas
}
/// Parses tree in Ptr for base, index, offset addresses.
-BaseIndexOffset BaseIndexOffset::match(LSBaseSDNode *N,
+BaseIndexOffset BaseIndexOffset::match(const LSBaseSDNode *N,
const SelectionDAG &DAG) {
SDValue Ptr = N->getBasePtr();
More information about the llvm-commits
mailing list