- Add getLSDAEncoding to the PowerPC backend.
authorBill Wendling <isanbard@gmail.com>
Mon, 18 Jan 2010 22:36:35 +0000 (22:36 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 18 Jan 2010 22:36:35 +0000 (22:36 +0000)
- Greatly improve the comments to the getLSDAEncoding method.

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

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

index 15f4e6c35c07e3f7daf58a5cf93af9c05fd14066..b0ed6b3aa79da59a1cf67523aba65d40207191ea 100644 (file)
@@ -201,7 +201,12 @@ public:
   static void setAsmVerbosityDefault(bool);
 
   /// getLSDAEncoding - Returns the LSDA pointer encoding. The choices are
-  /// 4-byte, 8-byte, and target default.
+  /// 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.
index 8079c6e9cc605a418d0fb2f1443feaa4f02f1109..c80a530c885a56431cb005a89d8a43fd2fe3a688 100644 (file)
@@ -194,4 +194,19 @@ bool PPCTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM,
   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;
+}
index 3399ac89188fa66a6386364991247a6c0f5e033e..4afcb23415c6954110f4461e0287b423397cbc9f 100644 (file)
@@ -62,6 +62,18 @@ public:
     return &MachOWriterInfo;
   }
 
+  /// 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.
+  virtual DwarfLSDAEncoding::Encoding getLSDAEncoding() const;
+
   // Pass Pipeline Configuration
   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
   virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
index 547fa8eeebc2ffe809ddf6e13ac3bb1c147bfd6a..684e1fc573d45b5d023bbb4ab095e5dec5aa19ae 100644 (file)
@@ -250,12 +250,19 @@ void X86TargetMachine::setCodeModelForJIT() {
     setCodeModel(CodeModel::Small);
 }
 
+/// 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 X86TargetMachine::getLSDAEncoding() const {
   if (Subtarget.isTargetDarwin() && Subtarget.getDarwinVers() != 10)
-    return DwarfLSDAEncoding::FourByte;
+    return DwarfLSDAEncoding::Default;
 
   return DwarfLSDAEncoding::EightByte;
 }
index c42aa89ff9bde69a68f4c63aeb034ebef29134ca..d05bebd0712aa5b2f139ed1a7840212bbc2bb445 100644 (file)
@@ -62,6 +62,16 @@ public:
     return Subtarget.isTargetELF() ? &ELFWriterInfo : 0;
   }
 
+  /// 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.
   virtual DwarfLSDAEncoding::Encoding getLSDAEncoding() const;
 
   // Set up the pass pipeline.