mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Revert "Simplify the attributes '<' comparison function."
This reverts commit 82c101153fe7b35bce48781fab038e1b8f31a7bd. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175250 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -332,23 +332,25 @@ StringRef AttributeImpl::getValueAsString() const {
|
|||||||
bool AttributeImpl::operator<(const AttributeImpl &AI) const {
|
bool AttributeImpl::operator<(const AttributeImpl &AI) const {
|
||||||
// This sorts the attributes with Attribute::AttrKinds coming first (sorted
|
// This sorts the attributes with Attribute::AttrKinds coming first (sorted
|
||||||
// relative to their enum value) and then strings.
|
// relative to their enum value) and then strings.
|
||||||
if (isEnumAttribute()) {
|
if (isEnumAttribute())
|
||||||
if (AI.isEnumAttribute()) return getKindAsEnum() < AI.getKindAsEnum();
|
if (AI.isAlignAttribute() || AI.isEnumAttribute())
|
||||||
if (AI.isAlignAttribute()) return true;
|
return getKindAsEnum() < AI.getKindAsEnum();
|
||||||
if (AI.isStringAttribute()) return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isAlignAttribute()) {
|
if (isAlignAttribute()) {
|
||||||
if (AI.isEnumAttribute()) return false;
|
if (!AI.isStringAttribute() && getKindAsEnum() < AI.getKindAsEnum())
|
||||||
if (AI.isAlignAttribute()) return getValueAsInt() < AI.getValueAsInt();
|
return true;
|
||||||
if (AI.isStringAttribute()) return true;
|
if (AI.isAlignAttribute())
|
||||||
|
return getValueAsInt() < AI.getValueAsInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AI.isEnumAttribute()) return false;
|
if (isStringAttribute()) {
|
||||||
if (AI.isAlignAttribute()) return false;
|
if (!AI.isStringAttribute()) return false;
|
||||||
if (getKindAsString() == AI.getKindAsString())
|
if (getKindAsString() < AI.getKindAsString()) return true;
|
||||||
return getValueAsString() < AI.getValueAsString();
|
if (getKindAsString() == AI.getKindAsString())
|
||||||
return getKindAsString() < AI.getKindAsString();
|
return getValueAsString() < AI.getValueAsString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
|
uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
|
||||||
|
Reference in New Issue
Block a user