mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Cleanup naming: DataLayout s/TD/DL/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179601 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -171,13 +171,13 @@ public:
|
|||||||
/// Initialize target data from properties stored in the module.
|
/// Initialize target data from properties stored in the module.
|
||||||
explicit DataLayout(const Module *M);
|
explicit DataLayout(const Module *M);
|
||||||
|
|
||||||
DataLayout(const DataLayout &TD) :
|
DataLayout(const DataLayout &DL) :
|
||||||
ImmutablePass(ID),
|
ImmutablePass(ID),
|
||||||
LittleEndian(TD.isLittleEndian()),
|
LittleEndian(DL.isLittleEndian()),
|
||||||
StackNaturalAlign(TD.StackNaturalAlign),
|
StackNaturalAlign(DL.StackNaturalAlign),
|
||||||
LegalIntWidths(TD.LegalIntWidths),
|
LegalIntWidths(DL.LegalIntWidths),
|
||||||
Alignments(TD.Alignments),
|
Alignments(DL.Alignments),
|
||||||
Pointers(TD.Pointers),
|
Pointers(DL.Pointers),
|
||||||
LayoutMap(0)
|
LayoutMap(0)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -426,7 +426,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend class DataLayout; // Only DataLayout can create this class
|
friend class DataLayout; // Only DataLayout can create this class
|
||||||
StructLayout(StructType *ST, const DataLayout &TD);
|
StructLayout(StructType *ST, const DataLayout &DL);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ char DataLayout::ID = 0;
|
|||||||
// Support for StructLayout
|
// Support for StructLayout
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
StructLayout::StructLayout(StructType *ST, const DataLayout &TD) {
|
StructLayout::StructLayout(StructType *ST, const DataLayout &DL) {
|
||||||
assert(!ST->isOpaque() && "Cannot get layout of opaque structs");
|
assert(!ST->isOpaque() && "Cannot get layout of opaque structs");
|
||||||
StructAlignment = 0;
|
StructAlignment = 0;
|
||||||
StructSize = 0;
|
StructSize = 0;
|
||||||
@ -50,7 +50,7 @@ StructLayout::StructLayout(StructType *ST, const DataLayout &TD) {
|
|||||||
// Loop over each of the elements, placing them in memory.
|
// Loop over each of the elements, placing them in memory.
|
||||||
for (unsigned i = 0, e = NumElements; i != e; ++i) {
|
for (unsigned i = 0, e = NumElements; i != e; ++i) {
|
||||||
Type *Ty = ST->getElementType(i);
|
Type *Ty = ST->getElementType(i);
|
||||||
unsigned TyAlign = ST->isPacked() ? 1 : TD.getABITypeAlignment(Ty);
|
unsigned TyAlign = ST->isPacked() ? 1 : DL.getABITypeAlignment(Ty);
|
||||||
|
|
||||||
// Add padding if necessary to align the data element properly.
|
// Add padding if necessary to align the data element properly.
|
||||||
if ((StructSize & (TyAlign-1)) != 0)
|
if ((StructSize & (TyAlign-1)) != 0)
|
||||||
@ -60,7 +60,7 @@ StructLayout::StructLayout(StructType *ST, const DataLayout &TD) {
|
|||||||
StructAlignment = std::max(TyAlign, StructAlignment);
|
StructAlignment = std::max(TyAlign, StructAlignment);
|
||||||
|
|
||||||
MemberOffsets[i] = StructSize;
|
MemberOffsets[i] = StructSize;
|
||||||
StructSize += TD.getTypeAllocSize(Ty); // Consume space for this data item
|
StructSize += DL.getTypeAllocSize(Ty); // Consume space for this data item
|
||||||
}
|
}
|
||||||
|
|
||||||
// Empty structures have alignment of 1 byte.
|
// Empty structures have alignment of 1 byte.
|
||||||
|
Reference in New Issue
Block a user