/// Initialize target data from properties stored in the module.
explicit DataLayout(const Module *M);
- DataLayout(const DataLayout &TD) :
+ DataLayout(const DataLayout &DL) :
ImmutablePass(ID),
- LittleEndian(TD.isLittleEndian()),
- StackNaturalAlign(TD.StackNaturalAlign),
- LegalIntWidths(TD.LegalIntWidths),
- Alignments(TD.Alignments),
- Pointers(TD.Pointers),
+ LittleEndian(DL.isLittleEndian()),
+ StackNaturalAlign(DL.StackNaturalAlign),
+ LegalIntWidths(DL.LegalIntWidths),
+ Alignments(DL.Alignments),
+ Pointers(DL.Pointers),
LayoutMap(0)
{ }
private:
friend class DataLayout; // Only DataLayout can create this class
- StructLayout(StructType *ST, const DataLayout &TD);
+ StructLayout(StructType *ST, const DataLayout &DL);
};
// 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");
StructAlignment = 0;
StructSize = 0;
// Loop over each of the elements, placing them in memory.
for (unsigned i = 0, e = NumElements; i != e; ++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.
if ((StructSize & (TyAlign-1)) != 0)
StructAlignment = std::max(TyAlign, StructAlignment);
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.