[llvm-commits] [llvm] r40878 - in /llvm/trunk/lib/Target/X86: X86Subtarget.h X86TargetMachine.cpp

Chris Lattner clattner at apple.com
Mon Aug 6 15:04:53 PDT 2007


On Aug 6, 2007, at 3:05 PM, Dale Johannesen wrote:

>
> 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.

The main reason for doing this is that it makes it easy to add these  
comments:

// x86-64 uses the same data layout conventions for all subtargets

// darwin-x86-32 has special feature XYZ

// linux, freebsd and others on x86-32 use ABC

-Chris



More information about the llvm-commits mailing list