[llvm-commits] [llvm] r78817 - in /llvm/trunk/lib: CodeGen/AsmPrinter/DwarfException.cpp Target/ARM/ARMISelLowering.cpp

Jim Grosbach grosbach at apple.com
Wed Aug 12 10:38:44 PDT 2009


Author: grosbach
Date: Wed Aug 12 12:38:44 2009
New Revision: 78817

URL: http://llvm.org/viewvc/llvm-project?rev=78817&view=rev
Log:
Add catch block handling to SjLj exception handling.


Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=78817&r1=78816&r2=78817&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Wed Aug 12 12:38:44 2009
@@ -531,6 +531,11 @@
   const unsigned SiteLengthSize = sizeof(int32_t); // DW_EH_PE_udata4
   const unsigned LandingPadSize = sizeof(int32_t); // DW_EH_PE_udata4
   unsigned SizeSites;
+
+  bool HaveTTData = (TAI->getExceptionHandlingType() == ExceptionHandling::SjLj)
+    ? (!TypeInfos.empty() || !FilterIds.empty()) : true;
+
+
   if (TAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
     SizeSites = (MF->getMaxCallSiteIndex() - CallSites.size()) *
       TargetAsmInfo::getULEB128Size(0) * 2;
@@ -553,7 +558,8 @@
 
   unsigned TotalSize = sizeof(int8_t) + // LPStart format
                        sizeof(int8_t) + // TType format
-           TargetAsmInfo::getULEB128Size(TypeOffset) + // TType base offset
+       (HaveTTData ?
+          TargetAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset
                        TypeOffset;
 
   unsigned SizeAlign = (4 - TotalSize) & 3;
@@ -624,11 +630,10 @@
     Asm->EOL("TType base offset");
   }
 #else
-  // For SjLj exceptions, is there is no TypeInfo, then we just explicitly
+  // For SjLj exceptions, if there is no TypeInfo, then we just explicitly
   // say that we're omitting that bit.
   // FIXME: does this apply to Dwarf also? The above #if 0 implies yes?
-  if (TAI->getExceptionHandlingType() == ExceptionHandling::SjLj
-      && (TypeInfos.empty() || FilterIds.empty())) {
+  if (!HaveTTData) {
     Asm->EmitInt8(dwarf::DW_EH_PE_omit);
     Asm->EOL("TType format (DW_EH_PE_omit)");
   } else {

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=78817&r1=78816&r2=78817&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Aug 12 12:38:44 2009
@@ -312,6 +312,10 @@
   setOperationAction(ISD::VAEND,              MVT::Other, Expand);
   setOperationAction(ISD::STACKSAVE,          MVT::Other, Expand);
   setOperationAction(ISD::STACKRESTORE,       MVT::Other, Expand);
+  setOperationAction(ISD::EHSELECTION,        MVT::i32,   Expand);
+  // FIXME: Shouldn't need this, since no register is used, but the legalizer
+  // doesn't yet know how to not do that for SjLj.
+  setExceptionSelectorRegister(ARM::R0);
   if (Subtarget->isThumb())
     setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Custom);
   else





More information about the llvm-commits mailing list