projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1bd30dc
)
Add an explicit bool operator to SDValue to make it easier to test for
author
Chandler Carruth
<chandlerc@gmail.com>
Fri, 4 Jul 2014 08:11:38 +0000
(08:11 +0000)
committer
Chandler Carruth
<chandlerc@gmail.com>
Fri, 4 Jul 2014 08:11:38 +0000
(08:11 +0000)
a non-null node. In particular, this makes it easier to use condition
variables with SDValues, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212323
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/CodeGen/SelectionDAGNodes.h
patch
|
blob
|
history
diff --git
a/include/llvm/CodeGen/SelectionDAGNodes.h
b/include/llvm/CodeGen/SelectionDAGNodes.h
index 29c787485ee19b54d7d081e3469850a163dc8f75..5df40671b529f0994c81b8545df8fa542a3aeb78 100644
(file)
--- a/
include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/
include/llvm/CodeGen/SelectionDAGNodes.h
@@
-142,6
+142,9
@@
public:
bool operator<(const SDValue &O) const {
return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
}
+ LLVM_EXPLICIT operator bool() const {
+ return Node != nullptr;
+ }
SDValue getValue(unsigned R) const {
return SDValue(Node, R);