[llvm-commits] [llvm] r40878 - in /llvm/trunk/lib/Target/X86: X86Subtarget.h X86TargetMachine.cpp
Dale Johannesen
dalej at apple.com
Mon Aug 6 15:05:04 PDT 2007
On Aug 6, 2007, at 2:57 PM, Chris Lattner wrote:
>> Move lengthy conditional down 1 level per review comment.
>
> Thanks!
>
>>
>> + 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"); }
>
> Can you make this use if/then/else for clarity? :)
I think it is clearer this way, but OK.
> -Chris
>
>> bool isPICStyleSet() const { return PICStyle != PICStyle::None; }
>> bool isPICStyleGOT() const { return PICStyle == PICStyle::GOT; }
>> bool isPICStyleStub() const { return PICStyle == PICStyle::Stub; }
>>
>> Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/
>> X86TargetMachine.cpp?rev=40878&r1=40877&r2=40878&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Mon Aug 6
>> 16:48:35 2007
>> @@ -114,11 +114,7 @@
>> X86TargetMachine::X86TargetMachine(const Module &M, const
>> std::string &FS,
>> bool is64Bit)
>> : Subtarget(M, FS, is64Bit),
>> - DataLayout(Subtarget.is64Bit() ?
>> - std::string("e-p:64:64-f64:32:64-i64:32:64-
>> f80:128:128") :
>> - Subtarget.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")),
>> + DataLayout(Subtarget.getDataLayout()),
>> FrameInfo(TargetFrameInfo::StackGrowsDown,
>> Subtarget.getStackAlignment(), Subtarget.is64Bit() ?
>> -8 : -4),
>> InstrInfo(*this), JITInfo(*this), TLInfo(*this) {
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list