Index: lib/MC/MCAsmStreamer.cpp =================================================================== --- lib/MC/MCAsmStreamer.cpp +++ lib/MC/MCAsmStreamer.cpp @@ -1257,7 +1257,8 @@ void MCAsmStreamer::EmitWin64EHPushReg(unsigned Register) { MCStreamer::EmitWin64EHPushReg(Register); - OS << "\t.seh_pushreg " << Register; + OS << "\t.seh_pushreg "; + EmitRegisterName(Register); EmitEOL(); } @@ -1264,7 +1265,9 @@ void MCAsmStreamer::EmitWin64EHSetFrame(unsigned Register, unsigned Offset) { MCStreamer::EmitWin64EHSetFrame(Register, Offset); - OS << "\t.seh_setframe " << Register << ", " << Offset; + OS << "\t.seh_setframe "; + EmitRegisterName(Register); + OS << ", " << Offset; EmitEOL(); } @@ -1278,7 +1281,9 @@ void MCAsmStreamer::EmitWin64EHSaveReg(unsigned Register, unsigned Offset) { MCStreamer::EmitWin64EHSaveReg(Register, Offset); - OS << "\t.seh_savereg " << Register << ", " << Offset; + OS << "\t.seh_savereg "; + EmitRegisterName(Register); + OS << ", " << Offset; EmitEOL(); } @@ -1285,7 +1290,9 @@ void MCAsmStreamer::EmitWin64EHSaveXMM(unsigned Register, unsigned Offset) { MCStreamer::EmitWin64EHSaveXMM(Register, Offset); - OS << "\t.seh_savexmm " << Register << ", " << Offset; + OS << "\t.seh_savexmm "; + EmitRegisterName(Register); + OS << ", " << Offset; EmitEOL(); } Index: test/MC/AsmParser/directive_seh.s =================================================================== --- test/MC/AsmParser/directive_seh.s +++ 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 6, 16 -# CHECK: .seh_savexmm 8, 0 -# CHECK: .seh_pushreg 3 -# CHECK: .seh_setframe 3, 0 +# CHECK: .seh_savereg %rbp, 16 +# CHECK: .seh_savexmm %r8, 0 +# CHECK: .seh_pushreg %rbx +# CHECK: .seh_setframe %rbx, 0 # CHECK: .seh_endprologue # CHECK: .seh_handler __C_specific_handler, @except # CHECK-NOT: .section{{.*}}.xdata