summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-01-05 07:55:47 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-01-05 07:55:47 +0000
commit3a4779a9211281a1d0c27c97037342329035a185 (patch)
tree1222d13ea928337dca3f898770b81803a2bf1939 /include
parent00ece1b846536cb2ba4efefa6e6194c7030e4c63 (diff)
downloadllvm-3a4779a9211281a1d0c27c97037342329035a185.tar.gz
llvm-3a4779a9211281a1d0c27c97037342329035a185.tar.bz2
llvm-3a4779a9211281a1d0c27c97037342329035a185.tar.xz
IR/Attributes: Provide EmptyKey and TombstoneKey in part of enum, as workaround for gcc-4.4 take #2.
I will investigate, later, what was wrong. I am too tired for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/IR/Attributes.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h
index 28ec9db62e..1932ffd3cb 100644
--- a/include/llvm/IR/Attributes.h
+++ b/include/llvm/IR/Attributes.h
@@ -93,7 +93,11 @@ public:
UWTable, ///< Function must be in a unwind table
ZExt, ///< Zero extended before/after call
- EndAttrKinds ///< Sentinal value useful for loops
+ EndAttrKinds, ///< Sentinal value useful for loops
+
+ // Values for DenseMapInfo
+ EmptyKey = 0x7FFFFFFF,
+ TombstoneKey = -0x7FFFFFFF - 1
};
private:
AttributeImpl *pImpl;
@@ -165,10 +169,10 @@ public:
/// AttrBuilder.
template<> struct DenseMapInfo<Attribute::AttrKind> {
static inline Attribute::AttrKind getEmptyKey() {
- return Attribute::AttrKind(~0U);
+ return Attribute::EmptyKey;
}
static inline Attribute::AttrKind getTombstoneKey() {
- return Attribute::AttrKind(~0U - 1);
+ return Attribute::TombstoneKey;
}
static unsigned getHashValue(const Attribute::AttrKind &Val) {
return Val * 37U;