[llvm-commits] [llvm] r93796 - in /llvm/trunk: include/llvm/Target/TargetMachine.h lib/Target/PowerPC/PPCTargetMachine.cpp lib/Target/PowerPC/PPCTargetMachine.h lib/Target/X86/X86TargetMachine.cpp lib/Target/X86/X86TargetMachine.h

Bill Wendling isanbard at gmail.com
Mon Jan 18 18:34:43 PST 2010


On Jan 18, 2010, at 5:35 PM, Chris Lattner wrote:

> On Jan 18, 2010, at 5:33 PM, Chris Lattner wrote:
> 
>>> 
>>> +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Mon Jan 18 16:36:35 2010
>>> @@ -194,4 +194,19 @@
>>> return false;
>>> }
>>> 
>>> +/// getLSDAEncoding - Returns the LSDA pointer encoding. The choices are 4-byte,
>>> +/// 8-byte, and target default. The CIE is hard-coded to indicate that the LSDA
>>> +/// pointer in the FDE section is an "sdata4", and should be encoded as a 4-byte
>>> +/// pointer by default. However, some systems may require a different size due
>>> +/// to bugs or other conditions. We will default to a 4-byte encoding unless the
>>> +/// system tells us otherwise.
>>> +///
>>> +/// FIXME: This call-back isn't good! We should be using the correct encoding
>>> +/// regardless of the system. However, there are some systems which have bugs
>>> +/// that prevent this from occuring.
>>> +DwarfLSDAEncoding::Encoding PPCTargetMachine::getLSDAEncoding() const {
>>> +  if (Subtarget.isDarwin() && Subtarget.getDarwinVers() != 10)
>>> +    return DwarfLSDAEncoding::Default;
>>> 
>>> +  return DwarfLSDAEncoding::EightByte;
>>> +}
>> 
>> You now have a nice generic comment, please add a big specific comment explaining why PPC (and X86) need to implement this. What is it doing, why is it important?
> 
> A specific question: is this something that has to do with *macho*, a thing having to do with a specific linker version, something having to do with generic PPC architecture (I assume not since you're only doing it on darwin) etc.
> 
Using 4-byte LSDA pointer encodings on Snow Leopard causes the sample program in the radar I have to crash. Indeed, when I first did this patch, it broke the SL build bot. This is not a Mach-O bug, but a libunwind issue.

-bw





More information about the llvm-commits mailing list