forked from OSchip/llvm-project
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. llvm-svn: 171611
This commit is contained in:
parent
800a916f99
commit
c91006f741
|
@ -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;
|
||||
|
|
|
@ -426,6 +426,8 @@ uint64_t AttributeImpl::getBitMask() const {
|
|||
uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
|
||||
switch (Val) {
|
||||
case Attribute::EndAttrKinds: break;
|
||||
case Attribute::EmptyKey: break;
|
||||
case Attribute::TombstoneKey: break;
|
||||
case Attribute::None: return 0;
|
||||
case Attribute::ZExt: return 1 << 0;
|
||||
case Attribute::SExt: return 1 << 1;
|
||||
|
|
Loading…
Reference in New Issue