[llvm-commits] [llvm] r97196 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp

Bill Wendling isanbard at gmail.com
Thu Feb 25 16:43:54 PST 2010


Author: void
Date: Thu Feb 25 18:43:54 2010
New Revision: 97196

URL: http://llvm.org/viewvc/llvm-project?rev=97196&view=rev
Log:
Add another (and hopefully the last) exception case, where once we recalculate
the alignment requirement, if it no longer makes the TType base offset overflow
into extra bytes, then we need to pad to those bytes ourselves.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=97196&r1=97195&r2=97196&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Thu Feb 25 18:43:54 2010
@@ -762,9 +762,16 @@
       SizeAlign -= TTypeBaseOverflow;
     }
 
-    if (!TTypeBaseOverflow || SizeAlign != 0)
-      EmitULEB128(Offset, "@TType base offset");
-    else
+    if (!TTypeBaseOverflow) {
+      EmitULEB128(TTypeBaseOffset + SizeAlign, "@TType base offset");
+    } else if (SizeAlign != 0) {
+      // If the new "offset + alignment" size doesn't require extra the same
+      // extra padding that the original one did, then we need to insert that
+      // padding ourselves.
+      EmitULEB128(TTypeBaseOffset + SizeAlign, "@TType base offset",
+                  MCAsmInfo::getULEB128Size(TTypeBaseOffset + SizeAlign) !=
+                  OffsetSize ? TTypeBaseOverflow : 0);
+    } else {
       // If adding the extra padding to this offset causes it to buffer to the
       // size of the padding needed, then we should perform the padding here and
       // not at the call site table below. E.g. if we have this:
@@ -790,6 +797,7 @@
       //
       // and not with padding on the "Call site table length" entry.
       EmitULEB128(TTypeBaseOffset, "@TType base offset", TTypeBaseOverflow);
+    }
   }
 
   // SjLj Exception handling





More information about the llvm-commits mailing list