@@ -77,13 +77,6 @@ llvm::createARMWinCOFFStreamer(MCContext &Context,
7777
7878namespace {
7979class ARMTargetWinCOFFStreamer : public llvm ::ARMTargetStreamer {
80- private:
81- // True if we are processing SEH directives in an epilogue.
82- bool InEpilogCFI = false ;
83-
84- // Symbol of the current epilog for which we are processing SEH directives.
85- MCSymbol *CurrentEpilog = nullptr ;
86-
8780public:
8881 ARMTargetWinCOFFStreamer (llvm::MCStreamer &S) : ARMTargetStreamer(S) {}
8982
@@ -114,8 +107,8 @@ void ARMTargetWinCOFFStreamer::emitARMWinUnwindCode(unsigned UnwindCode,
114107 return ;
115108 MCSymbol *Label = S.emitCFILabel ();
116109 auto Inst = WinEH::Instruction (UnwindCode, Label, Reg, Offset);
117- if (InEpilogCFI )
118- CurFrame->EpilogMap [CurrentEpilog ].Instructions .push_back (Inst);
110+ if (S. isInEpilogCFI () )
111+ CurFrame->EpilogMap [S. getCurrentEpilog () ].Instructions .push_back (Inst);
119112 else
120113 CurFrame->Instructions .push_back (Inst);
121114}
@@ -224,9 +217,8 @@ void ARMTargetWinCOFFStreamer::emitARMWinCFIEpilogStart(unsigned Condition) {
224217 if (!CurFrame)
225218 return ;
226219
227- InEpilogCFI = true ;
228- CurrentEpilog = S.emitCFILabel ();
229- CurFrame->EpilogMap [CurrentEpilog].Condition = Condition;
220+ S.emitWinCFIBeginEpilogue ();
221+ CurFrame->EpilogMap [S.getCurrentEpilog ()].Condition = Condition;
230222}
231223
232224void ARMTargetWinCOFFStreamer::emitARMWinCFIEpilogEnd () {
@@ -235,14 +227,14 @@ void ARMTargetWinCOFFStreamer::emitARMWinCFIEpilogEnd() {
235227 if (!CurFrame)
236228 return ;
237229
238- if (!CurrentEpilog ) {
230+ if (!S. getCurrentEpilog () ) {
239231 S.getContext ().reportError (SMLoc (), " Stray .seh_endepilogue in " +
240232 CurFrame->Function ->getName ());
241233 return ;
242234 }
243235
244236 std::vector<WinEH::Instruction> &Epilog =
245- CurFrame->EpilogMap [CurrentEpilog ].Instructions ;
237+ CurFrame->EpilogMap [S. getCurrentEpilog () ].Instructions ;
246238
247239 unsigned UnwindCode = Win64EH::UOP_End;
248240 if (!Epilog.empty ()) {
@@ -256,12 +248,9 @@ void ARMTargetWinCOFFStreamer::emitARMWinCFIEpilogEnd() {
256248 }
257249 }
258250
259- InEpilogCFI = false ;
260251 WinEH::Instruction Inst = WinEH::Instruction (UnwindCode, nullptr , -1 , 0 );
261- CurFrame->EpilogMap [CurrentEpilog].Instructions .push_back (Inst);
262- MCSymbol *Label = S.emitCFILabel ();
263- CurFrame->EpilogMap [CurrentEpilog].End = Label;
264- CurrentEpilog = nullptr ;
252+ CurFrame->EpilogMap [S.getCurrentEpilog ()].Instructions .push_back (Inst);
253+ S.emitWinCFIEndEpilogue ();
265254}
266255
267256void ARMTargetWinCOFFStreamer::emitARMWinCFICustom (unsigned Opcode) {
0 commit comments