forked from OSchip/llvm-project
Constify SDNodeIterator an stop its only non-const user being cast stripped
of its constness. Found by gcc48 -Wcast-qual. llvm-svn: 163254
This commit is contained in:
parent
0e1adc6085
commit
665260222f
|
@ -1745,10 +1745,10 @@ public:
|
||||||
|
|
||||||
class SDNodeIterator : public std::iterator<std::forward_iterator_tag,
|
class SDNodeIterator : public std::iterator<std::forward_iterator_tag,
|
||||||
SDNode, ptrdiff_t> {
|
SDNode, ptrdiff_t> {
|
||||||
SDNode *Node;
|
const SDNode *Node;
|
||||||
unsigned Operand;
|
unsigned Operand;
|
||||||
|
|
||||||
SDNodeIterator(SDNode *N, unsigned Op) : Node(N), Operand(Op) {}
|
SDNodeIterator(const SDNode *N, unsigned Op) : Node(N), Operand(Op) {}
|
||||||
public:
|
public:
|
||||||
bool operator==(const SDNodeIterator& x) const {
|
bool operator==(const SDNodeIterator& x) const {
|
||||||
return Operand == x.Operand;
|
return Operand == x.Operand;
|
||||||
|
@ -1779,8 +1779,8 @@ public:
|
||||||
return Operand - Other.Operand;
|
return Operand - Other.Operand;
|
||||||
}
|
}
|
||||||
|
|
||||||
static SDNodeIterator begin(SDNode *N) { return SDNodeIterator(N, 0); }
|
static SDNodeIterator begin(const SDNode *N) { return SDNodeIterator(N, 0); }
|
||||||
static SDNodeIterator end (SDNode *N) {
|
static SDNodeIterator end (const SDNode *N) {
|
||||||
return SDNodeIterator(N, N->getNumOperands());
|
return SDNodeIterator(N, N->getNumOperands());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace llvm {
|
||||||
|
|
||||||
template<typename EdgeIter>
|
template<typename EdgeIter>
|
||||||
static std::string getEdgeSourceLabel(const void *Node, EdgeIter I) {
|
static std::string getEdgeSourceLabel(const void *Node, EdgeIter I) {
|
||||||
return itostr(I - SDNodeIterator::begin((SDNode *) Node));
|
return itostr(I - SDNodeIterator::begin((const SDNode *) Node));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// edgeTargetsEdgeSource - This method returns true if this outgoing edge
|
/// edgeTargetsEdgeSource - This method returns true if this outgoing edge
|
||||||
|
|
Loading…
Reference in New Issue