[llvm] r197283 - Pointer sizes are stored in Bytes. Fix variables names to say so.
Rafael Espindola
rafael.espindola at gmail.com
Fri Dec 13 15:15:20 PST 2013
Author: rafael
Date: Fri Dec 13 17:15:20 2013
New Revision: 197283
URL: http://llvm.org/viewvc/llvm-project?rev=197283&view=rev
Log:
Pointer sizes are stored in Bytes. Fix variables names to say so.
Also update for the current naming style.
Modified:
llvm/trunk/include/llvm/IR/DataLayout.h
llvm/trunk/lib/IR/DataLayout.cpp
Modified: llvm/trunk/include/llvm/IR/DataLayout.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DataLayout.h?rev=197283&r1=197282&r2=197283&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DataLayout.h (original)
+++ llvm/trunk/include/llvm/IR/DataLayout.h Fri Dec 13 17:15:20 2013
@@ -78,12 +78,12 @@ struct LayoutAlignElem {
struct PointerAlignElem {
unsigned ABIAlign; ///< ABI 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
/// Initializer
- static PointerAlignElem get(uint32_t addr_space, unsigned abi_align,
- unsigned pref_align, uint32_t bit_width);
+ static PointerAlignElem get(uint32_t AddressSpace, unsigned ABIAlign,
+ unsigned PrefAlign, uint32_t TypeByteWidth);
/// Equality predicate
bool operator==(const PointerAlignElem &rhs) const;
};
@@ -129,8 +129,8 @@ private:
bool ABIAlign, Type *Ty) const;
//! Set/initialize pointer alignments
- void setPointerAlignment(uint32_t addr_space, unsigned abi_align,
- unsigned pref_align, uint32_t bit_width);
+ void setPointerAlignment(uint32_t AddrSpace, unsigned ABIAlign,
+ unsigned PrefAlign, uint32_t TypeByteWidth);
//! Internal helper method that returns requested alignment for type.
unsigned getAlignment(Type *Ty, bool abi_or_pref) const;
@@ -263,7 +263,7 @@ public:
if (val == Pointers.end()) {
val = Pointers.find(0);
}
- return val->second.TypeBitWidth;
+ return val->second.TypeByteWidth;
}
/// Layout pointer size, in bits
/// FIXME: The defaults need to be removed once all of
Modified: llvm/trunk/lib/IR/DataLayout.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DataLayout.cpp?rev=197283&r1=197282&r2=197283&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DataLayout.cpp (original)
+++ llvm/trunk/lib/IR/DataLayout.cpp Fri Dec 13 17:15:20 2013
@@ -125,14 +125,14 @@ DataLayout::InvalidAlignmentElem = { INV
//===----------------------------------------------------------------------===//
PointerAlignElem
-PointerAlignElem::get(uint32_t addr_space, unsigned abi_align,
- unsigned pref_align, uint32_t bit_width) {
- assert(abi_align <= pref_align && "Preferred alignment worse than ABI!");
+PointerAlignElem::get(uint32_t AddressSpace, unsigned ABIAlign,
+ unsigned PrefAlign, uint32_t TypeByteWidth) {
+ assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!");
PointerAlignElem retval;
- retval.AddressSpace = addr_space;
- retval.ABIAlign = abi_align;
- retval.PrefAlign = pref_align;
- retval.TypeBitWidth = bit_width;
+ retval.AddressSpace = AddressSpace;
+ retval.ABIAlign = ABIAlign;
+ retval.PrefAlign = PrefAlign;
+ retval.TypeByteWidth = TypeByteWidth;
return retval;
}
@@ -141,7 +141,7 @@ PointerAlignElem::operator==(const Point
return (ABIAlign == rhs.ABIAlign
&& AddressSpace == rhs.AddressSpace
&& PrefAlign == rhs.PrefAlign
- && TypeBitWidth == rhs.TypeBitWidth);
+ && TypeByteWidth == rhs.TypeByteWidth);
}
const PointerAlignElem
@@ -335,18 +335,18 @@ DataLayout::setAlignment(AlignTypeEnum a
pref_align, bit_width));
}
-void
-DataLayout::setPointerAlignment(uint32_t addr_space, unsigned abi_align,
- unsigned pref_align, uint32_t bit_width) {
- assert(abi_align <= pref_align && "Preferred alignment worse than ABI!");
- DenseMap<unsigned,PointerAlignElem>::iterator val = Pointers.find(addr_space);
+void DataLayout::setPointerAlignment(uint32_t AddrSpace, unsigned ABIAlign,
+ unsigned PrefAlign,
+ uint32_t TypeByteWidth) {
+ assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!");
+ DenseMap<unsigned,PointerAlignElem>::iterator val = Pointers.find(AddrSpace);
if (val == Pointers.end()) {
- Pointers[addr_space] = PointerAlignElem::get(addr_space,
- abi_align, pref_align, bit_width);
+ Pointers[AddrSpace] =
+ PointerAlignElem::get(AddrSpace, ABIAlign, PrefAlign, TypeByteWidth);
} else {
- val->second.ABIAlign = abi_align;
- val->second.PrefAlign = pref_align;
- val->second.TypeBitWidth = bit_width;
+ val->second.ABIAlign = ABIAlign;
+ val->second.PrefAlign = PrefAlign;
+ val->second.TypeByteWidth = TypeByteWidth;
}
}
@@ -487,7 +487,7 @@ std::string DataLayout::getStringReprese
if (PI.AddressSpace) {
OS << PI.AddressSpace;
}
- OS << ":" << PI.TypeBitWidth*8 << ':' << PI.ABIAlign*8
+ OS << ":" << PI.TypeByteWidth*8 << ':' << PI.ABIAlign*8
<< ':' << PI.PrefAlign*8;
}
OS << "-S" << StackNaturalAlign*8;
More information about the llvm-commits
mailing list