From b01961c2c12f7305b3b957f3992e2cb7f7aeaad6 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 10 Jun 2014 20:16:36 +0000 Subject: [PATCH] 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. llvm-svn: 210574 --- llvm/lib/MC/MCAsmStreamer.cpp | 15 ++++----------- llvm/test/MC/AsmParser/directive_seh.s | 8 ++++---- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index 7f8ae54949e0..bccf5b9cd287 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -1134,17 +1134,14 @@ void MCAsmStreamer::EmitWin64EHHandlerData() { 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::EmitWin64EHAllocStack(unsigned Size) { 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(); } diff --git a/llvm/test/MC/AsmParser/directive_seh.s b/llvm/test/MC/AsmParser/directive_seh.s index f6eb9705caa8..98fc6061f9dc 100644 --- a/llvm/test/MC/AsmParser/directive_seh.s +++ b/llvm/test/MC/AsmParser/directive_seh.s @@ -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