[mips] Slightly simplify MipsTargetInfo::setDataLayout(). NFC.

Summary:

Reviewers: atanasyan

Subscribers: atanasyan, cfe-commits

Differential Revision: http://reviews.llvm.org/D20680

llvm-svn: 271647
This commit is contained in:
Daniel Sanders 2016-06-03 10:11:01 +00:00
parent 205f65f62f
commit 55e4069702
1 changed files with 15 additions and 19 deletions

View File

@ -7009,25 +7009,21 @@ public:
class MipsTargetInfo : public TargetInfo {
void setDataLayout() {
if (BigEndian) {
if (ABI == "o32")
resetDataLayout("E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64");
else if (ABI == "n32")
resetDataLayout("E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128");
else if (ABI == "n64")
resetDataLayout("E-m:m-i8:8:32-i16:16:32-i64:64-n32:64-S128");
else
llvm_unreachable("Invalid ABI");
} else {
if (ABI == "o32")
resetDataLayout("e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64");
else if (ABI == "n32")
resetDataLayout("e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128");
else if (ABI == "n64")
resetDataLayout("e-m:m-i8:8:32-i16:16:32-i64:64-n32:64-S128");
else
llvm_unreachable("Invalid ABI");
}
StringRef Layout;
if (ABI == "o32")
Layout = "m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64";
else if (ABI == "n32")
Layout = "m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128";
else if (ABI == "n64")
Layout = "m:m-i8:8:32-i16:16:32-i64:64-n32:64-S128";
else
llvm_unreachable("Invalid ABI");
if (BigEndian)
resetDataLayout(("E-" + Layout).str());
else
resetDataLayout(("e-" + Layout).str());
}