- Add a comment to the callback indicating that it's *extremely* not a good
authorBill Wendling <isanbard@gmail.com>
Mon, 18 Jan 2010 19:36:27 +0000 (19:36 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 18 Jan 2010 19:36:27 +0000 (19:36 +0000)
  idea, but unfortunately necessary.
- Default to using 4-bytes for the LSDA pointer encoding to agree with the
  encoded value in the CIE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93753 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetMachine.h
lib/CodeGen/AsmPrinter/DwarfException.cpp
lib/Target/X86/X86TargetMachine.cpp

index 74dd11fd035b991803ff49498efbdfbc4827952e..15f4e6c35c07e3f7daf58a5cf93af9c05fd14066 100644 (file)
@@ -202,6 +202,9 @@ public:
 
   /// getLSDAEncoding - Returns the LSDA pointer encoding. The choices are
   /// 4-byte, 8-byte, and target default.
+  /// 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.
   virtual DwarfLSDAEncoding::Encoding getLSDAEncoding() const {
     return DwarfLSDAEncoding::Default;
   }
index 8de9bd65cac5ff9a22cf3c05e0cfa28334efb0d1..01c32647740fdb11980eb491b8a741e39ca2bf03 100644 (file)
@@ -283,7 +283,7 @@ void DwarfException::EmitFDE(const FunctionEHFrameInfo &EHFrameInfo) {
     if (MMI->getPersonalities()[0] != NULL) {
       bool is4Byte = TD->getPointerSize() == sizeof(int32_t);
 
-      if (Asm->TM.getLSDAEncoding() == DwarfLSDAEncoding::FourByte) {
+      if (Asm->TM.getLSDAEncoding() != DwarfLSDAEncoding::EightByte) {
         Asm->EmitULEB128Bytes(4);
         Asm->EOL("Augmentation size");
 
index ea21676c3b22043179608d55d7429ac1273ac8e5..b778fc2f2c8fb7dfce71b7cb1420fe8e3795bb69 100644 (file)
@@ -251,8 +251,8 @@ void X86TargetMachine::setCodeModelForJIT() {
 }
 
 DwarfLSDAEncoding::Encoding X86TargetMachine::getLSDAEncoding() const {
-  if (Subtarget.isTargetDarwin() && Subtarget.getDarwinVers() > 10)
+  if (Subtarget.isTargetDarwin() && Subtarget.getDarwinVers() != 10)
     return DwarfLSDAEncoding::FourByte;
 
-  return DwarfLSDAEncoding::Default;
+  return DwarfLSDAEncoding::EightByte;
 }