llvm.org GIT mirror llvm / cf89e1c
NFC: Rename MCSafeSEHFragment to MCSymbolIdFragment Summary: This fragment emits a symbol ID and will be useful for more than just Safe SEH tables (e.g., I plan to re-use it for Control Flow Guard tables). This is simply a rename refactor. Reviewers: rnk Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D39770 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317703 91177308-0d34-0410-b5e6-96231b3b80d8 Adrian McCarthy 2 years ago
4 changed file(s) with 15 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
4141 FT_DwarfFrame,
4242 FT_LEB,
4343 FT_Padding,
44 FT_SafeSEH,
44 FT_SymbolId,
4545 FT_CVInlineLines,
4646 FT_CVDefRange,
4747 FT_Dummy
561561 }
562562 };
563563
564 class MCSafeSEHFragment : public MCFragment {
564 /// Represents a symbol table index fragment.
565 class MCSymbolIdFragment : public MCFragment {
565566 const MCSymbol *Sym;
566567
567568 public:
568 MCSafeSEHFragment(const MCSymbol *Sym, MCSection *Sec = nullptr)
569 : MCFragment(FT_SafeSEH, false, 0, Sec), Sym(Sym) {}
569 MCSymbolIdFragment(const MCSymbol *Sym, MCSection *Sec = nullptr)
570 : MCFragment(FT_SymbolId, false, 0, Sec), Sym(Sym) {}
570571
571572 /// \name Accessors
572573 /// @{
577578 /// @}
578579
579580 static bool classof(const MCFragment *F) {
580 return F->getKind() == MCFragment::FT_SafeSEH;
581 return F->getKind() == MCFragment::FT_SymbolId;
581582 }
582583 };
583584
289289 case MCFragment::FT_Padding:
290290 return cast(F).getSize();
291291
292 case MCFragment::FT_SafeSEH:
292 case MCFragment::FT_SymbolId:
293293 return 4;
294294
295295 case MCFragment::FT_Align: {
562562 break;
563563 }
564564
565 case MCFragment::FT_SafeSEH: {
566 const MCSafeSEHFragment &SF = cast(F);
565 case MCFragment::FT_SymbolId: {
566 const MCSymbolIdFragment &SF = cast(F);
567567 OW->write32(SF.getSymbol()->getIndex());
568568 break;
569569 }
280280 case FT_Padding:
281281 delete cast(this);
282282 return;
283 case FT_SafeSEH:
284 delete cast(this);
283 case FT_SymbolId:
284 delete cast(this);
285285 return;
286286 case FT_CVInlineLines:
287287 delete cast(this);
325325 case MCFragment::FT_DwarfFrame: OS << "MCDwarfCallFrameFragment"; break;
326326 case MCFragment::FT_LEB: OS << "MCLEBFragment"; break;
327327 case MCFragment::FT_Padding: OS << "MCPaddingFragment"; break;
328 case MCFragment::FT_SafeSEH: OS << "MCSafeSEHFragment"; break;
328 case MCFragment::FT_SymbolId: OS << "MCSymbolIdFragment"; break;
329329 case MCFragment::FT_CVInlineLines: OS << "MCCVInlineLineTableFragment"; break;
330330 case MCFragment::FT_CVDefRange: OS << "MCCVDefRangeTableFragment"; break;
331331 case MCFragment::FT_Dummy: OS << "MCDummyFragment"; break;
435435 OS << "\n ";
436436 break;
437437 }
438 case MCFragment::FT_SafeSEH: {
439 const MCSafeSEHFragment *F = cast(this);
438 case MCFragment::FT_SymbolId: {
439 const MCSymbolIdFragment *F = cast(this);
440440 OS << "\n ";
441441 OS << " Sym:" << F->getSymbol();
442442 break;
181181 if (SXData->getAlignment() < 4)
182182 SXData->setAlignment(4);
183183
184 new MCSafeSEHFragment(Symbol, SXData);
184 new MCSymbolIdFragment(Symbol, SXData);
185185
186186 getAssembler().registerSymbol(*Symbol);
187187 CSymbol->setIsSafeSEH();