Skip to content

Commit

Permalink
Revert "Patch by Ray Donnelly to print register names instead of numb…
Browse files Browse the repository at this point in the history
…ers."

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210574 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rnk committed Jun 10, 2014
1 parent 258e822 commit e21498e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
15 changes: 4 additions & 11 deletions lib/MC/MCAsmStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand Down
8 changes: 4 additions & 4 deletions test/MC/AsmParser/directive_seh.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e21498e

Please sign in to comment.