[llvm-branch-commits] [llvm-branch] r81701 - /llvm/branches/release_26/lib/CodeGen/AsmPrinter/DwarfException.cpp

Tanya Lattner tonic at nondot.org
Sun Sep 13 12:12:07 PDT 2009


Author: tbrethou
Date: Sun Sep 13 14:12:07 2009
New Revision: 81701

URL: http://llvm.org/viewvc/llvm-project?rev=81701&view=rev
Log:
Merge 80414 from mainline.
Make the augmentation size and next set of bytes agree on size,
and make the reference pointer size as it should be.

Fixes an abort on a testcase derived from libunwind's personality
test in 64-bit.

Modified:
    llvm/branches/release_26/lib/CodeGen/AsmPrinter/DwarfException.cpp

Modified: llvm/branches/release_26/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=81701&r1=81700&r2=81701&view=diff

==============================================================================
--- llvm/branches/release_26/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/branches/release_26/lib/CodeGen/AsmPrinter/DwarfException.cpp Sun Sep 13 14:12:07 2009
@@ -203,13 +203,19 @@
     // If there is a personality and landing pads then point to the language
     // specific data area in the exception table.
     if (EHFrameInfo.PersonalityIndex) {
-      Asm->EmitULEB128Bytes(4);
+      bool is4Byte = TD->getPointerSize() == sizeof(int32_t);
+
+      Asm->EmitULEB128Bytes(is4Byte ? 4 : 8);
       Asm->EOL("Augmentation size");
 
       if (EHFrameInfo.hasLandingPads)
-        EmitReference("exception", EHFrameInfo.Number, true, true);
-      else
-        Asm->EmitInt32((int)0);
+        EmitReference("exception", EHFrameInfo.Number, true, false);
+      else {
+	if (is4Byte)
+	  Asm->EmitInt32((int)0);
+	else
+	  Asm->EmitInt64((int)0);
+      }
       Asm->EOL("Language Specific Data Area");
     } else {
       Asm->EmitULEB128Bytes(0);





More information about the llvm-branch-commits mailing list