Replace 4-line function with 10-line version per review comment.
authorDale Johannesen <dalej@apple.com>
Mon, 6 Aug 2007 22:10:35 +0000 (22:10 +0000)
committerDale Johannesen <dalej@apple.com>
Mon, 6 Aug 2007 22:10:35 +0000 (22:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40881 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86Subtarget.h

index 772f1431c920a1ac1c131e9d49760df81d59444c..49af986c4b1d2f7fcb4108e2dd47ce5867fda904 100644 (file)
@@ -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; }