mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Support string attributes in the AttrBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4930e7266b
commit
74fe825ca5
@ -938,14 +938,22 @@ AttrBuilder &AttrBuilder::removeAttributes(AttributeSet A, uint64_t Index) {
|
|||||||
assert(Idx != ~0U && "Couldn't find index in AttributeSet!");
|
assert(Idx != ~0U && "Couldn't find index in AttributeSet!");
|
||||||
|
|
||||||
for (AttributeSet::iterator I = A.begin(Idx), E = A.end(Idx); I != E; ++I) {
|
for (AttributeSet::iterator I = A.begin(Idx), E = A.end(Idx); I != E; ++I) {
|
||||||
// FIXME: Support string attributes.
|
Attribute Attr = *I;
|
||||||
Attribute::AttrKind Kind = I->getKindAsEnum();
|
if (Attr.isEnumAttribute() || Attr.isAlignAttribute()) {
|
||||||
Attrs.erase(Kind);
|
Attribute::AttrKind Kind = I->getKindAsEnum();
|
||||||
|
Attrs.erase(Kind);
|
||||||
|
|
||||||
if (Kind == Attribute::Alignment)
|
if (Kind == Attribute::Alignment)
|
||||||
Alignment = 0;
|
Alignment = 0;
|
||||||
else if (Kind == Attribute::StackAlignment)
|
else if (Kind == Attribute::StackAlignment)
|
||||||
StackAlignment = 0;
|
StackAlignment = 0;
|
||||||
|
} else {
|
||||||
|
assert(Attr.isStringAttribute() && "Invalid attribute type!");
|
||||||
|
std::map<std::string, std::string>::iterator
|
||||||
|
Iter = TargetDepAttrs.find(Attr.getKindAsString());
|
||||||
|
if (Iter != TargetDepAttrs.end())
|
||||||
|
TargetDepAttrs.erase(Iter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
@ -1021,10 +1029,16 @@ bool AttrBuilder::hasAttributes(AttributeSet A, uint64_t Index) const {
|
|||||||
assert(Idx != ~0U && "Couldn't find the index!");
|
assert(Idx != ~0U && "Couldn't find the index!");
|
||||||
|
|
||||||
for (AttributeSet::iterator I = A.begin(Idx), E = A.end(Idx);
|
for (AttributeSet::iterator I = A.begin(Idx), E = A.end(Idx);
|
||||||
I != E; ++I)
|
I != E; ++I) {
|
||||||
// FIXME: Support string attributes.
|
Attribute Attr = *I;
|
||||||
if (Attrs.count(I->getKindAsEnum()))
|
if (Attr.isEnumAttribute() || Attr.isAlignAttribute()) {
|
||||||
return true;
|
if (Attrs.count(I->getKindAsEnum()))
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
assert(Attr.isStringAttribute() && "Invalid attribute kind!");
|
||||||
|
return TargetDepAttrs.find(Attr.getKindAsString())!=TargetDepAttrs.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user