git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175235
91177308-0d34-0410-b5e6-
96231b3b80d8
bool AttributeImpl::operator<(const AttributeImpl &AI) const {
// This sorts the attributes with Attribute::AttrKinds coming first (sorted
// relative to their enum value) and then strings.
bool AttributeImpl::operator<(const AttributeImpl &AI) const {
// This sorts the attributes with Attribute::AttrKinds coming first (sorted
// relative to their enum value) and then strings.
- if (isEnumAttribute())
- if (AI.isAlignAttribute() || AI.isEnumAttribute())
- return getKindAsEnum() < AI.getKindAsEnum();
-
- if (isAlignAttribute()) {
- if (!AI.isStringAttribute() && getKindAsEnum() < AI.getKindAsEnum())
- return true;
- if (AI.isAlignAttribute())
- return getValueAsInt() < AI.getValueAsInt();
+ if (isEnumAttribute()) {
+ if (AI.isEnumAttribute()) return getKindAsEnum() < AI.getKindAsEnum();
+ if (AI.isAlignAttribute()) return true;
+ if (AI.isStringAttribute()) return true;
- if (isStringAttribute()) {
- if (!AI.isStringAttribute()) return false;
- if (getKindAsString() < AI.getKindAsString()) return true;
- if (getKindAsString() == AI.getKindAsString())
- return getValueAsString() < AI.getValueAsString();
+ if (isAlignAttribute()) {
+ if (AI.isEnumAttribute()) return false;
+ if (AI.isAlignAttribute()) return getValueAsInt() < AI.getValueAsInt();
+ if (AI.isStringAttribute()) return true;
+ if (AI.isEnumAttribute()) return false;
+ if (AI.isAlignAttribute()) return false;
+ if (getKindAsString() == AI.getKindAsString())
+ return getValueAsString() < AI.getValueAsString();
+ return getKindAsString() < AI.getKindAsString();
}
uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
}
uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {