X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FTargetData.cpp;h=63b3eaafe1be92361f24e7e388048b3876aef069;hb=2625f9b2e4388a957286063f6c7fe5406fd0ca7a;hp=d543f24d986d1f8945f32e59aa530045abee6b37;hpb=ceb4d1aecb9deffe59b3dcdc9a783ffde8477be9;p=oota-llvm.git diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index d543f24d986..63b3eaafe1b 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -302,14 +302,14 @@ unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType, BestMatchIdx = LargestInt; } else { assert(AlignType == VECTOR_ALIGN && "Unknown alignment type!"); - + // If we didn't find a vector size that is smaller or equal to this type, // then we will end up scalarizing this to its element type. Just return // the alignment of the element. return getAlignment(cast(Ty)->getElementType(), ABIInfo); - } + } } - + // Since we got a "best match" index, just return it. return ABIInfo ? Alignments[BestMatchIdx].ABIAlign : Alignments[BestMatchIdx].PrefAlign; @@ -475,12 +475,12 @@ unsigned char TargetData::getAlignment(const Type *Ty, bool abi_or_pref) const { : getPointerPrefAlignment()); case Type::ArrayTyID: return getAlignment(cast(Ty)->getElementType(), abi_or_pref); - + case Type::StructTyID: { // Packed structure types always have an ABI alignment of one. if (cast(Ty)->isPacked() && abi_or_pref) return 1; - + // Get the layout annotation... which is lazily created on demand. const StructLayout *Layout = getStructLayout(cast(Ty)); unsigned Align = getAlignmentInfo(AGGREGATE_ALIGN, 0, abi_or_pref, Ty);