mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
Add a new Attribute::getAlignmentFromAttrs method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
67b9a2abc4
commit
033ff38411
@ -88,6 +88,16 @@ inline Attributes constructAlignmentFromInt(unsigned i) {
|
|||||||
return (Log2_32(i)+1) << 16;
|
return (Log2_32(i)+1) << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// This returns the alignment field of an attribute as a byte alignment value.
|
||||||
|
inline unsigned getAlignmentFromAttrs(Attributes A) {
|
||||||
|
Attributes Align = A & Attribute::Alignment;
|
||||||
|
if (Align == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1U << ((Align >> 16) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// The set of Attributes set in Attributes is converted to a
|
/// The set of Attributes set in Attributes is converted to a
|
||||||
/// string of equivalent mnemonics. This is, presumably, for writing out
|
/// string of equivalent mnemonics. This is, presumably, for writing out
|
||||||
/// the mnemonics for the assembly writer.
|
/// the mnemonics for the assembly writer.
|
||||||
@ -184,11 +194,7 @@ public:
|
|||||||
/// getParamAlignment - Return the alignment for the specified function
|
/// getParamAlignment - Return the alignment for the specified function
|
||||||
/// parameter.
|
/// parameter.
|
||||||
unsigned getParamAlignment(unsigned Idx) const {
|
unsigned getParamAlignment(unsigned Idx) const {
|
||||||
Attributes Align = getAttributes(Idx) & Attribute::Alignment;
|
return Attribute::getAlignmentFromAttrs(getAttributes(Idx));
|
||||||
if (Align == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return 1ull << ((Align >> 16) - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// hasAttrSomewhere - Return true if the specified attribute is set for at
|
/// hasAttrSomewhere - Return true if the specified attribute is set for at
|
||||||
|
Loading…
Reference in New Issue
Block a user