Set ABI and DescriptionString first to reduce OS specific logic.

Use switch for FreeBSD check to allow easier extension.

llvm-svn: 219838
This commit is contained in:
Joerg Sonnenberger 2014-10-15 19:47:15 +00:00
parent 2ceaeb6baf
commit 3f1a935548
1 changed files with 13 additions and 10 deletions

View File

@ -1288,18 +1288,21 @@ public:
IntMaxType = SignedLong;
Int64Type = SignedLong;
if (getTriple().getOS() == llvm::Triple::FreeBSD) {
if ((Triple.getArch() == llvm::Triple::ppc64le)) {
DescriptionString = "e-m:e-i64:64-n32:64";
ABI = "elfv2";
} else {
DescriptionString = "E-m:e-i64:64-n32:64";
ABI = "elfv1";
}
switch (getTriple().getOS()) {
case llvm::Triple::FreeBSD:
LongDoubleWidth = LongDoubleAlign = 64;
LongDoubleFormat = &llvm::APFloat::IEEEdouble;
DescriptionString = "E-m:e-i64:64-n32:64";
} else {
if ((Triple.getArch() == llvm::Triple::ppc64le)) {
DescriptionString = "e-m:e-i64:64-n32:64";
ABI = "elfv2";
} else {
DescriptionString = "E-m:e-i64:64-n32:64";
ABI = "elfv1";
}
break;
default:
break;
}
// PPC64 supports atomics up to 8 bytes.