Skip to content

Commit f9ef3a6

Browse files
committed
[SelectionDAG] Make isConstantIntBuildVectorOrConstantInt and isConstantFPBuildVectorOrConstantFP methods const.
1 parent edde2eb commit f9ef3a6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,14 +1959,14 @@ class SelectionDAG {
19591959
}
19601960

19611961
/// Test whether the given value is a constant int or similar node.
1962-
SDNode *isConstantIntBuildVectorOrConstantInt(SDValue N);
1962+
SDNode *isConstantIntBuildVectorOrConstantInt(SDValue N) const;
19631963

19641964
/// Test whether the given value is a constant FP or similar node.
1965-
SDNode *isConstantFPBuildVectorOrConstantFP(SDValue N);
1965+
SDNode *isConstantFPBuildVectorOrConstantFP(SDValue N) const ;
19661966

19671967
/// \returns true if \p N is any kind of constant or build_vector of
19681968
/// constants, int or float. If a vector, it may not necessarily be a splat.
1969-
inline bool isConstantValueOfAnyType(SDValue N) {
1969+
inline bool isConstantValueOfAnyType(SDValue N) const {
19701970
return isConstantIntBuildVectorOrConstantInt(N) ||
19711971
isConstantFPBuildVectorOrConstantFP(N);
19721972
}

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10068,7 +10068,7 @@ bool ShuffleVectorSDNode::isSplatMask(const int *Mask, EVT VT) {
1006810068

1006910069
// Returns the SDNode if it is a constant integer BuildVector
1007010070
// or constant integer.
10071-
SDNode *SelectionDAG::isConstantIntBuildVectorOrConstantInt(SDValue N) {
10071+
SDNode *SelectionDAG::isConstantIntBuildVectorOrConstantInt(SDValue N) const {
1007210072
if (isa<ConstantSDNode>(N))
1007310073
return N.getNode();
1007410074
if (ISD::isBuildVectorOfConstantSDNodes(N.getNode()))
@@ -10085,7 +10085,7 @@ SDNode *SelectionDAG::isConstantIntBuildVectorOrConstantInt(SDValue N) {
1008510085
return nullptr;
1008610086
}
1008710087

10088-
SDNode *SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) {
10088+
SDNode *SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) const {
1008910089
if (isa<ConstantFPSDNode>(N))
1009010090
return N.getNode();
1009110091

0 commit comments

Comments
 (0)