diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-20 15:21:32 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-20 15:21:32 +0000 |
| commit | e23b87746a0e45bdbaf4a6052e0d0315103b9336 (patch) | |
| tree | a37d6f3a5474ad0c6089e375900d80d4101668ad /llvm/lib/IR | |
| parent | 21a697b8b1815f40b069c220f518154ca7e12254 (diff) | |
| download | bcm5719-llvm-e23b87746a0e45bdbaf4a6052e0d0315103b9336.tar.gz bcm5719-llvm-e23b87746a0e45bdbaf4a6052e0d0315103b9336.zip | |
Make this array const.
llvm-svn: 197814
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/DataLayout.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index f23f79c9bba..a22588628f7 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -152,7 +152,7 @@ DataLayout::InvalidPointerElem = { 0U, 0U, 0U, ~0U }; // DataLayout Class Implementation //===----------------------------------------------------------------------===// -static LayoutAlignElem DefaultAlignments[] = { +static const LayoutAlignElem DefaultAlignments[] = { { INTEGER_ALIGN, 1, 1, 1 }, // i1 { INTEGER_ALIGN, 8, 1, 1 }, // i8 { INTEGER_ALIGN, 16, 2, 2 }, // i16 @@ -176,7 +176,7 @@ void DataLayout::init(StringRef Desc) { // Default alignments 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, E.TypeBitWidth); } @@ -507,8 +507,8 @@ std::string DataLayout::getStringRepresentation() const { OS << ':' << PI.PrefAlign*8; } - LayoutAlignElem *DefaultStart = DefaultAlignments; - LayoutAlignElem *DefaultEnd = + const LayoutAlignElem *DefaultStart = DefaultAlignments; + const LayoutAlignElem *DefaultEnd = DefaultStart + array_lengthof(DefaultAlignments); for (unsigned i = 0, e = Alignments.size(); i != e; ++i) { const LayoutAlignElem &AI = Alignments[i]; |

