Make this array const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197814 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2013-12-20 15:21:32 +00:00
parent 23c9710636
commit 2c6e51ffed

View File

@ -152,7 +152,7 @@ DataLayout::InvalidPointerElem = { 0U, 0U, 0U, ~0U };
// DataLayout Class Implementation // DataLayout Class Implementation
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
static LayoutAlignElem DefaultAlignments[] = { static const LayoutAlignElem DefaultAlignments[] = {
{ INTEGER_ALIGN, 1, 1, 1 }, // i1 { INTEGER_ALIGN, 1, 1, 1 }, // i1
{ INTEGER_ALIGN, 8, 1, 1 }, // i8 { INTEGER_ALIGN, 8, 1, 1 }, // i8
{ INTEGER_ALIGN, 16, 2, 2 }, // i16 { INTEGER_ALIGN, 16, 2, 2 }, // i16
@ -176,7 +176,7 @@ void DataLayout::init(StringRef Desc) {
// Default alignments // Default alignments
for (int I = 0, N = array_lengthof(DefaultAlignments); I < N; ++I) { for (int I = 0, N = array_lengthof(DefaultAlignments); I < N; ++I) {
LayoutAlignElem &E = DefaultAlignments[I]; const LayoutAlignElem &E = DefaultAlignments[I];
setAlignment((AlignTypeEnum)E.AlignType, E.ABIAlign, E.PrefAlign, setAlignment((AlignTypeEnum)E.AlignType, E.ABIAlign, E.PrefAlign,
E.TypeBitWidth); E.TypeBitWidth);
} }
@ -507,8 +507,8 @@ std::string DataLayout::getStringRepresentation() const {
OS << ':' << PI.PrefAlign*8; OS << ':' << PI.PrefAlign*8;
} }
LayoutAlignElem *DefaultStart = DefaultAlignments; const LayoutAlignElem *DefaultStart = DefaultAlignments;
LayoutAlignElem *DefaultEnd = const LayoutAlignElem *DefaultEnd =
DefaultStart + array_lengthof(DefaultAlignments); DefaultStart + array_lengthof(DefaultAlignments);
for (unsigned i = 0, e = Alignments.size(); i != e; ++i) { for (unsigned i = 0, e = Alignments.size(); i != e; ++i) {
const LayoutAlignElem &AI = Alignments[i]; const LayoutAlignElem &AI = Alignments[i];