mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-06 09:44:39 +00:00
Convert the AttrBuilder into a list of Attributes instead of one Attribute object that holds all of its attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173742 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b8d2c92ac4
commit
8fbc0c296e
@ -445,8 +445,21 @@ AttributeSet AttributeSet::get(LLVMContext &C,
|
||||
AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx, AttrBuilder &B) {
|
||||
if (!B.hasAttributes())
|
||||
return AttributeSet();
|
||||
return get(C, ArrayRef<std::pair<unsigned, Attribute> >(
|
||||
std::make_pair(Idx, Attribute::get(C, B))));
|
||||
|
||||
SmallVector<std::pair<unsigned, Attribute>, 8> Attrs;
|
||||
for (AttrBuilder::iterator I = B.begin(), E = B.end(); I != E; ++I) {
|
||||
Attribute::AttrKind Kind = *I;
|
||||
if (Kind == Attribute::Alignment)
|
||||
Attrs.push_back(std::make_pair(Idx, Attribute::
|
||||
getWithAlignment(C, B.getAlignment())));
|
||||
else if (Kind == Attribute::StackAlignment)
|
||||
Attrs.push_back(std::make_pair(Idx, Attribute::
|
||||
getWithStackAlignment(C, B.getStackAlignment())));
|
||||
else
|
||||
Attrs.push_back(std::make_pair(Idx, Attribute::get(C, Kind)));
|
||||
}
|
||||
|
||||
return get(C, Attrs);
|
||||
}
|
||||
|
||||
AttributeSet AttributeSet::get(LLVMContext &C, unsigned Idx,
|
||||
|
Loading…
x
Reference in New Issue
Block a user