mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Use the Attributes::Builder to build the attributes in the parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165458 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -33,6 +33,8 @@ Attributes::Attributes(Attribute::AttrConst Val) : Attrs(Val.v) {}
|
||||
|
||||
Attributes::Attributes(AttributesImpl *A) : Attrs(A->Bits) {}
|
||||
|
||||
Attributes::Attributes(const Attributes &A) : Attrs(A.Attrs) {}
|
||||
|
||||
// FIXME: This is temporary until we have implemented the uniquified version of
|
||||
// AttributesImpl.
|
||||
Attributes Attributes::get(Attributes::Builder &B) {
|
||||
@@ -451,6 +453,26 @@ void Attributes::Builder::removeZExtAttr() {
|
||||
Bits &= ~Attribute::ZExt_i;
|
||||
}
|
||||
|
||||
void Attributes::Builder::removeAlignmentAttr() {
|
||||
Bits &= ~Attribute::Alignment_i;
|
||||
}
|
||||
void Attributes::Builder::removeStackAlignmentAttr() {
|
||||
Bits &= ~Attribute::StackAlignment_i;
|
||||
}
|
||||
|
||||
bool Attributes::Builder::hasAttributes() const {
|
||||
return Bits != 0;
|
||||
}
|
||||
bool Attributes::Builder::hasAlignmentAttr() const {
|
||||
return Bits & Attribute::Alignment_i;
|
||||
}
|
||||
|
||||
uint64_t Attributes::Builder::getAlignment() const {
|
||||
if (!hasAlignmentAttr())
|
||||
return 0;
|
||||
return 1U << (((Bits & Attribute::Alignment_i) >> 16) - 1);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// AttributeImpl Definition
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user