From: Dale Johannesen Date: Mon, 6 Aug 2007 22:10:35 +0000 (+0000) Subject: Replace 4-line function with 10-line version per review comment. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9989a65693c357809e8e131b0a4ff1285b5e968a;p=oota-llvm.git Replace 4-line function with 10-line version per review comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40881 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86Subtarget.h b/lib/Target/X86/X86Subtarget.h index 772f1431c92..49af986c4b1 100644 --- a/lib/Target/X86/X86Subtarget.h +++ b/lib/Target/X86/X86Subtarget.h @@ -143,10 +143,16 @@ public: TargetType == isCygwin); } bool isTargetCygwin() const { return TargetType == isCygwin; } - std::string getDataLayout() const { return - is64Bit() ? std::string("e-p:64:64-f64:32:64-i64:32:64-f80:128:128") : - isTargetDarwin() ? std::string("e-p:32:32-f64:32:64-i64:32:64-f80:128:128") : - std::string("e-p:32:32-f64:32:64-i64:32:64-f80:32:32"); } + std::string getDataLayout() const { + const char *p; + if (is64Bit()) + p = "e-p:64:64-f64:32:64-i64:32:64-f80:128:128"; + else if (isTargetDarwin()) + p = "e-p:32:32-f64:32:64-i64:32:64-f80:128:128"; + else + p = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32"; + return std::string(p); + } bool isPICStyleSet() const { return PICStyle != PICStyle::None; } bool isPICStyleGOT() const { return PICStyle == PICStyle::GOT; }