[llvm] r185793 - Revert: Fix wrong code offset for unwind code SET_FPREG.

Kai Nacke kai.nacke at redstar.de
Sun Jul 7 21:48:35 PDT 2013


Author: redstar
Date: Sun Jul  7 23:48:34 2013
New Revision: 185793

URL: http://llvm.org/viewvc/llvm-project?rev=185793&view=rev
Log:
Revert: Fix wrong code offset for unwind code SET_FPREG.

Modified:
    llvm/trunk/lib/MC/MCStreamer.cpp
    llvm/trunk/lib/MC/MCWin64EH.cpp
    llvm/trunk/test/MC/COFF/seh.s
    llvm/trunk/test/tools/llvm-objdump/win64-unwind-data.s

Modified: llvm/trunk/lib/MC/MCStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCStreamer.cpp?rev=185793&r1=185792&r2=185793&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCStreamer.cpp Sun Jul  7 23:48:34 2013
@@ -470,9 +470,7 @@ void MCStreamer::EmitWin64EHSetFrame(uns
     report_fatal_error("Frame register and offset already specified!");
   if (Offset & 0x0F)
     report_fatal_error("Misaligned frame pointer offset!");
-  MCSymbol *Label = getContext().CreateTempSymbol();
-  MCWin64EHInstruction Inst(Win64EH::UOP_SetFPReg, Label, Register, Offset);
-  EmitLabel(Label);
+  MCWin64EHInstruction Inst(Win64EH::UOP_SetFPReg, 0, Register, Offset);
   CurFrame->LastFrameInst = CurFrame->Instructions.size();
   CurFrame->Instructions.push_back(Inst);
 }

Modified: llvm/trunk/lib/MC/MCWin64EH.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCWin64EH.cpp?rev=185793&r1=185792&r2=185793&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCWin64EH.cpp (original)
+++ llvm/trunk/lib/MC/MCWin64EH.cpp Sun Jul  7 23:48:34 2013
@@ -64,7 +64,7 @@ static void EmitAbsDifference(MCStreamer
 
 static void EmitUnwindCode(MCStreamer &streamer, MCSymbol *begin,
                            MCWin64EHInstruction &inst) {
-  uint8_t b2;
+  uint8_t b1, b2;
   uint16_t w;
   b2 = (inst.getOperation() & 0x0F);
   switch (inst.getOperation()) {
@@ -93,7 +93,8 @@ static void EmitUnwindCode(MCStreamer &s
     streamer.EmitIntValue(b2, 1);
     break;
   case Win64EH::UOP_SetFPReg:
-    EmitAbsDifference(streamer, inst.getLabel(), begin);
+    b1 = inst.getOffset() & 0xF0;
+    streamer.EmitIntValue(b1, 1);
     streamer.EmitIntValue(b2, 1);
     break;
   case Win64EH::UOP_SaveNonVol:

Modified: llvm/trunk/test/MC/COFF/seh.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/seh.s?rev=185793&r1=185792&r2=185793&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/seh.s (original)
+++ llvm/trunk/test/MC/COFF/seh.s Sun Jul  7 23:48:34 2013
@@ -1,5 +1,7 @@
 // This test checks that the SEH directives emit the correct unwind data.
 
+// TODO: Expected fail because SET_FPREG has a wrong offset.
+// XFAIL: *
 // RUN: llvm-mc -triple x86_64-pc-win32 -filetype=obj %s | llvm-readobj -s -u | FileCheck %s
 
 // CHECK:      Sections [

Modified: llvm/trunk/test/tools/llvm-objdump/win64-unwind-data.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/win64-unwind-data.s?rev=185793&r1=185792&r2=185793&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/win64-unwind-data.s (original)
+++ llvm/trunk/test/tools/llvm-objdump/win64-unwind-data.s Sun Jul  7 23:48:34 2013
@@ -13,7 +13,7 @@
 // CHECK-NEXT: Frame register: RBX
 // CHECK-NEXT: Frame offset: 0
 // CHECK-NEXT: Unwind Codes:
-// CHECK-NEXT: 0x12: UOP_SetFPReg
+// CHECK-NEXT: 0x00: UOP_SetFPReg
 // CHECK-NEXT: 0x0f: UOP_PushNonVol RBX
 // CHECK-NEXT: 0x0e: UOP_SaveXMM128 XMM8 [0x0000]
 // CHECK-NEXT: 0x09: UOP_SaveNonVol RSI [0x0010]





More information about the llvm-commits mailing list