forked from OSchip/llvm-project
Add an explicit bool operator to SDValue to make it easier to test for
a non-null node. In particular, this makes it easier to use condition variables with SDValues, etc. llvm-svn: 212323
This commit is contained in:
parent
7c163a44aa
commit
872d592326
|
@ -142,6 +142,9 @@ public:
|
||||||
bool operator<(const SDValue &O) const {
|
bool operator<(const SDValue &O) const {
|
||||||
return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
|
return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
|
||||||
}
|
}
|
||||||
|
LLVM_EXPLICIT operator bool() const {
|
||||||
|
return Node != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
SDValue getValue(unsigned R) const {
|
SDValue getValue(unsigned R) const {
|
||||||
return SDValue(Node, R);
|
return SDValue(Node, R);
|
||||||
|
|
Loading…
Reference in New Issue