On Mon, 2007-08-06 at 22:10 +0000, Dale Johannesen wrote: > 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.
You could make it 8 lines by not using the variable p and returning the strings directly. return "..." will auto-convert to std::string > > 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; } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits