[llvm] r210574 - Revert "Patch by Ray Donnelly to print register names instead of numbers."

Reid Kleckner reid at kleckner.net
Tue Jun 10 13:16:36 PDT 2014


Author: rnk
Date: Tue Jun 10 15:16:36 2014
New Revision: 210574

URL: http://llvm.org/viewvc/llvm-project?rev=210574&view=rev
Log:
Revert "Patch by Ray Donnelly to print register names instead of numbers."

This reverts commit r206683.

The code was confusing SEH register numbers with DWARF register numbers.
The test case it was committed with was obviously incorrect.  The
disassembler was roundtripping '.seh_pushreg %rsi' as '.seh_pushreg
%rbp', and other exciting things.

Noticed by Vadim Chugunov.

Modified:
    llvm/trunk/lib/MC/MCAsmStreamer.cpp
    llvm/trunk/test/MC/AsmParser/directive_seh.s

Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=210574&r1=210573&r2=210574&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Tue Jun 10 15:16:36 2014
@@ -1134,17 +1134,14 @@ void MCAsmStreamer::EmitWin64EHHandlerDa
 void MCAsmStreamer::EmitWin64EHPushReg(unsigned Register) {
   MCStreamer::EmitWin64EHPushReg(Register);
 
-  OS << "\t.seh_pushreg ";
-  EmitRegisterName(Register);
+  OS << "\t.seh_pushreg " << Register;
   EmitEOL();
 }
 
 void MCAsmStreamer::EmitWin64EHSetFrame(unsigned Register, unsigned Offset) {
   MCStreamer::EmitWin64EHSetFrame(Register, Offset);
 
-  OS << "\t.seh_setframe ";
-  EmitRegisterName(Register);
-  OS << ", " << Offset;
+  OS << "\t.seh_setframe " << Register << ", " << Offset;
   EmitEOL();
 }
 
@@ -1158,18 +1155,14 @@ void MCAsmStreamer::EmitWin64EHAllocStac
 void MCAsmStreamer::EmitWin64EHSaveReg(unsigned Register, unsigned Offset) {
   MCStreamer::EmitWin64EHSaveReg(Register, Offset);
 
-  OS << "\t.seh_savereg ";
-  EmitRegisterName(Register);
-  OS << ", " << Offset;
+  OS << "\t.seh_savereg " << Register << ", " << Offset;
   EmitEOL();
 }
 
 void MCAsmStreamer::EmitWin64EHSaveXMM(unsigned Register, unsigned Offset) {
   MCStreamer::EmitWin64EHSaveXMM(Register, Offset);
 
-  OS << "\t.seh_savexmm ";
-  EmitRegisterName(Register);
-  OS << ", " << Offset;
+  OS << "\t.seh_savexmm " << Register << ", " << Offset;
   EmitEOL();
 }
 

Modified: llvm/trunk/test/MC/AsmParser/directive_seh.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_seh.s?rev=210574&r1=210573&r2=210574&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_seh.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_seh.s Tue Jun 10 15:16:36 2014
@@ -3,10 +3,10 @@
 # CHECK: .seh_proc func
 # CHECK: .seh_pushframe @code
 # CHECK: .seh_stackalloc 24
-# CHECK: .seh_savereg %rbp, 16
-# CHECK: .seh_savexmm %r8, 0
-# CHECK: .seh_pushreg %rbx
-# CHECK: .seh_setframe %rbx, 0
+# CHECK: .seh_savereg 6, 16
+# CHECK: .seh_savexmm 8, 0
+# CHECK: .seh_pushreg 3
+# CHECK: .seh_setframe 3, 0
 # CHECK: .seh_endprologue
 # CHECK: .seh_handler __C_specific_handler, @except
 # CHECK-NOT: .section{{.*}}.xdata





More information about the llvm-commits mailing list