diff options
| author | Gabor Greif <ggreif@gmail.com> | 2008-08-26 22:36:50 +0000 |
|---|---|---|
| committer | Gabor Greif <ggreif@gmail.com> | 2008-08-26 22:36:50 +0000 |
| commit | 46bf54702f3d06e26fcc6520ad347540696f263d (patch) | |
| tree | 6bb72e831f77e338e8be827a61363847b91723b5 /include/llvm/CodeGen/SelectionDAGNodes.h | |
| parent | 30eba3f242c82aac1d939288be0b1d81b3629692 (diff) | |
| download | external_llvm-46bf54702f3d06e26fcc6520ad347540696f263d.zip external_llvm-46bf54702f3d06e26fcc6520ad347540696f263d.tar.gz external_llvm-46bf54702f3d06e26fcc6520ad347540696f263d.tar.bz2 | |
disallow direct access to SDValue::ResNo, provide a getter instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
| -rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 5fe9647..b509667 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -811,11 +811,15 @@ namespace ISD { class SDValue { public: SDNode *Val; // The node defining the value we are using. +private: unsigned ResNo; // Which return value of the node we are using. - +public: SDValue() : Val(0), ResNo(0) {} SDValue(SDNode *val, unsigned resno) : Val(val), ResNo(resno) {} + /// get the index which selects a specific result in the SDNode + unsigned getResNo() const { return ResNo; } + bool operator==(const SDValue &O) const { return Val == O.Val && ResNo == O.ResNo; } @@ -882,7 +886,7 @@ template<> struct DenseMapInfo<SDValue> { } static unsigned getHashValue(const SDValue &Val) { return ((unsigned)((uintptr_t)Val.Val >> 4) ^ - (unsigned)((uintptr_t)Val.Val >> 9)) + Val.ResNo; + (unsigned)((uintptr_t)Val.Val >> 9)) + Val.getResNo(); } static bool isEqual(const SDValue &LHS, const SDValue &RHS) { return LHS == RHS; |
