diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-10-20 10:41:29 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-10-20 10:41:29 +0000 |
commit | 34b45cdb95338b245abd20a3b0eeca923ef651eb (patch) | |
tree | a9a25425003350aeac8878a6bec8981aa9e67b20 | |
parent | d413989edb520cd2a026338fe41a91dc69dcb3a5 (diff) | |
download | llvm-34b45cdb95338b245abd20a3b0eeca923ef651eb.tar.gz |
Switch the default DataLayout to be little endian, and make the variable
be BigEndian so the default can continue to be zero-initialized.
This is one of the prerequisites to making DataLayout a constant and
always available part of every module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220193 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/IR/DataLayout.h | 8 | ||||
-rw-r--r-- | lib/IR/DataLayout.cpp | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/include/llvm/IR/DataLayout.h b/include/llvm/IR/DataLayout.h index ff5f0b55427e..4580a4f56a07 100644 --- a/include/llvm/IR/DataLayout.h +++ b/include/llvm/IR/DataLayout.h @@ -99,7 +99,7 @@ struct PointerAlignElem { class DataLayout { private: /// Defaults to false. - bool LittleEndian; + bool BigEndian; unsigned StackNaturalAlign; @@ -180,7 +180,7 @@ public: DataLayout &operator=(const DataLayout &DL) { clear(); - LittleEndian = DL.isLittleEndian(); + BigEndian = DL.isBigEndian(); StackNaturalAlign = DL.StackNaturalAlign; ManglingMode = DL.ManglingMode; LegalIntWidths = DL.LegalIntWidths; @@ -198,8 +198,8 @@ public: void reset(StringRef LayoutDescription); /// Layout endianness... - bool isLittleEndian() const { return LittleEndian; } - bool isBigEndian() const { return !LittleEndian; } + bool isLittleEndian() const { return !BigEndian; } + bool isBigEndian() const { return BigEndian; } /// \brief Returns the string representation of the DataLayout. /// diff --git a/lib/IR/DataLayout.cpp b/lib/IR/DataLayout.cpp index eb13a95954f6..8a057f552a53 100644 --- a/lib/IR/DataLayout.cpp +++ b/lib/IR/DataLayout.cpp @@ -179,7 +179,7 @@ void DataLayout::reset(StringRef Desc) { clear(); LayoutMap = nullptr; - LittleEndian = false; + BigEndian = false; StackNaturalAlign = 0; ManglingMode = MM_None; @@ -239,10 +239,10 @@ void DataLayout::parseSpecifier(StringRef Desc) { // FIXME: remove this on LLVM 4.0. break; case 'E': - LittleEndian = false; + BigEndian = true; break; case 'e': - LittleEndian = true; + BigEndian = false; break; case 'p': { // Address space. @@ -357,7 +357,7 @@ void DataLayout::init(const Module *M) { } bool DataLayout::operator==(const DataLayout &Other) const { - bool Ret = LittleEndian == Other.LittleEndian && + bool Ret = BigEndian == Other.BigEndian && StackNaturalAlign == Other.StackNaturalAlign && ManglingMode == Other.ManglingMode && LegalIntWidths == Other.LegalIntWidths && @@ -526,7 +526,7 @@ std::string DataLayout::getStringRepresentation() const { std::string Result; raw_string_ostream OS(Result); - OS << (LittleEndian ? "e" : "E"); + OS << (BigEndian ? "E" : "e"); switch (ManglingMode) { case MM_None: |