mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-11 21:38:46 +00:00
Pointer sizes are stored in Bytes. Fix variables names to say so.
Also update for the current naming style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197283 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
303a00ec48
commit
5e7d241791
@ -78,12 +78,12 @@ struct LayoutAlignElem {
|
|||||||
struct PointerAlignElem {
|
struct PointerAlignElem {
|
||||||
unsigned ABIAlign; ///< ABI alignment for this type/bitw
|
unsigned ABIAlign; ///< ABI alignment for this type/bitw
|
||||||
unsigned PrefAlign; ///< Pref. alignment for this type/bitw
|
unsigned PrefAlign; ///< Pref. alignment for this type/bitw
|
||||||
uint32_t TypeBitWidth; ///< Type bit width
|
uint32_t TypeByteWidth; ///< Type byte width
|
||||||
uint32_t AddressSpace; ///< Address space for the pointer type
|
uint32_t AddressSpace; ///< Address space for the pointer type
|
||||||
|
|
||||||
/// Initializer
|
/// Initializer
|
||||||
static PointerAlignElem get(uint32_t addr_space, unsigned abi_align,
|
static PointerAlignElem get(uint32_t AddressSpace, unsigned ABIAlign,
|
||||||
unsigned pref_align, uint32_t bit_width);
|
unsigned PrefAlign, uint32_t TypeByteWidth);
|
||||||
/// Equality predicate
|
/// Equality predicate
|
||||||
bool operator==(const PointerAlignElem &rhs) const;
|
bool operator==(const PointerAlignElem &rhs) const;
|
||||||
};
|
};
|
||||||
@ -129,8 +129,8 @@ private:
|
|||||||
bool ABIAlign, Type *Ty) const;
|
bool ABIAlign, Type *Ty) const;
|
||||||
|
|
||||||
//! Set/initialize pointer alignments
|
//! Set/initialize pointer alignments
|
||||||
void setPointerAlignment(uint32_t addr_space, unsigned abi_align,
|
void setPointerAlignment(uint32_t AddrSpace, unsigned ABIAlign,
|
||||||
unsigned pref_align, uint32_t bit_width);
|
unsigned PrefAlign, uint32_t TypeByteWidth);
|
||||||
|
|
||||||
//! Internal helper method that returns requested alignment for type.
|
//! Internal helper method that returns requested alignment for type.
|
||||||
unsigned getAlignment(Type *Ty, bool abi_or_pref) const;
|
unsigned getAlignment(Type *Ty, bool abi_or_pref) const;
|
||||||
@ -263,7 +263,7 @@ public:
|
|||||||
if (val == Pointers.end()) {
|
if (val == Pointers.end()) {
|
||||||
val = Pointers.find(0);
|
val = Pointers.find(0);
|
||||||
}
|
}
|
||||||
return val->second.TypeBitWidth;
|
return val->second.TypeByteWidth;
|
||||||
}
|
}
|
||||||
/// Layout pointer size, in bits
|
/// Layout pointer size, in bits
|
||||||
/// FIXME: The defaults need to be removed once all of
|
/// FIXME: The defaults need to be removed once all of
|
||||||
|
@ -125,14 +125,14 @@ DataLayout::InvalidAlignmentElem = { INVALID_ALIGN, 0, 0, 0 };
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
PointerAlignElem
|
PointerAlignElem
|
||||||
PointerAlignElem::get(uint32_t addr_space, unsigned abi_align,
|
PointerAlignElem::get(uint32_t AddressSpace, unsigned ABIAlign,
|
||||||
unsigned pref_align, uint32_t bit_width) {
|
unsigned PrefAlign, uint32_t TypeByteWidth) {
|
||||||
assert(abi_align <= pref_align && "Preferred alignment worse than ABI!");
|
assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!");
|
||||||
PointerAlignElem retval;
|
PointerAlignElem retval;
|
||||||
retval.AddressSpace = addr_space;
|
retval.AddressSpace = AddressSpace;
|
||||||
retval.ABIAlign = abi_align;
|
retval.ABIAlign = ABIAlign;
|
||||||
retval.PrefAlign = pref_align;
|
retval.PrefAlign = PrefAlign;
|
||||||
retval.TypeBitWidth = bit_width;
|
retval.TypeByteWidth = TypeByteWidth;
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ PointerAlignElem::operator==(const PointerAlignElem &rhs) const {
|
|||||||
return (ABIAlign == rhs.ABIAlign
|
return (ABIAlign == rhs.ABIAlign
|
||||||
&& AddressSpace == rhs.AddressSpace
|
&& AddressSpace == rhs.AddressSpace
|
||||||
&& PrefAlign == rhs.PrefAlign
|
&& PrefAlign == rhs.PrefAlign
|
||||||
&& TypeBitWidth == rhs.TypeBitWidth);
|
&& TypeByteWidth == rhs.TypeByteWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
const PointerAlignElem
|
const PointerAlignElem
|
||||||
@ -335,18 +335,18 @@ DataLayout::setAlignment(AlignTypeEnum align_type, unsigned abi_align,
|
|||||||
pref_align, bit_width));
|
pref_align, bit_width));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void DataLayout::setPointerAlignment(uint32_t AddrSpace, unsigned ABIAlign,
|
||||||
DataLayout::setPointerAlignment(uint32_t addr_space, unsigned abi_align,
|
unsigned PrefAlign,
|
||||||
unsigned pref_align, uint32_t bit_width) {
|
uint32_t TypeByteWidth) {
|
||||||
assert(abi_align <= pref_align && "Preferred alignment worse than ABI!");
|
assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!");
|
||||||
DenseMap<unsigned,PointerAlignElem>::iterator val = Pointers.find(addr_space);
|
DenseMap<unsigned,PointerAlignElem>::iterator val = Pointers.find(AddrSpace);
|
||||||
if (val == Pointers.end()) {
|
if (val == Pointers.end()) {
|
||||||
Pointers[addr_space] = PointerAlignElem::get(addr_space,
|
Pointers[AddrSpace] =
|
||||||
abi_align, pref_align, bit_width);
|
PointerAlignElem::get(AddrSpace, ABIAlign, PrefAlign, TypeByteWidth);
|
||||||
} else {
|
} else {
|
||||||
val->second.ABIAlign = abi_align;
|
val->second.ABIAlign = ABIAlign;
|
||||||
val->second.PrefAlign = pref_align;
|
val->second.PrefAlign = PrefAlign;
|
||||||
val->second.TypeBitWidth = bit_width;
|
val->second.TypeByteWidth = TypeByteWidth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ std::string DataLayout::getStringRepresentation() const {
|
|||||||
if (PI.AddressSpace) {
|
if (PI.AddressSpace) {
|
||||||
OS << PI.AddressSpace;
|
OS << PI.AddressSpace;
|
||||||
}
|
}
|
||||||
OS << ":" << PI.TypeBitWidth*8 << ':' << PI.ABIAlign*8
|
OS << ":" << PI.TypeByteWidth*8 << ':' << PI.ABIAlign*8
|
||||||
<< ':' << PI.PrefAlign*8;
|
<< ':' << PI.PrefAlign*8;
|
||||||
}
|
}
|
||||||
OS << "-S" << StackNaturalAlign*8;
|
OS << "-S" << StackNaturalAlign*8;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user