r219838 - Set ABI and DescriptionString first to reduce OS specific logic.
Joerg Sonnenberger
joerg at bec.de
Wed Oct 15 12:47:15 PDT 2014
Author: joerg
Date: Wed Oct 15 14:47:15 2014
New Revision: 219838
URL: http://llvm.org/viewvc/llvm-project?rev=219838&view=rev
Log:
Set ABI and DescriptionString first to reduce OS specific logic.
Use switch for FreeBSD check to allow easier extension.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=219838&r1=219837&r2=219838&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Oct 15 14:47:15 2014
@@ -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.
More information about the cfe-commits
mailing list