[llvm-commits] [llvm] r40881 - /llvm/trunk/lib/Target/X86/X86Subtarget.h
Dale Johannesen
dalej at apple.com
Mon Aug 6 15:10:36 PDT 2007
Author: johannes
Date: Mon Aug 6 17:10:35 2007
New Revision: 40881
URL: http://llvm.org/viewvc/llvm-project?rev=40881&view=rev
Log:
Replace 4-line function with 10-line version per review comment.
Modified:
llvm/trunk/lib/Target/X86/X86Subtarget.h
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=40881&r1=40880&r2=40881&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Mon Aug 6 17:10:35 2007
@@ -143,10 +143,16 @@
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; }
More information about the llvm-commits
mailing list