LLVM API Documentation
00001 //===- MCWinCOFFStreamer.h - COFF Object File Interface ---------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef LLVM_MC_MCWINCOFFSTREAMER_H 00011 #define LLVM_MC_MCWINCOFFSTREAMER_H 00012 00013 #include "llvm/MC/MCDirectives.h" 00014 #include "llvm/MC/MCObjectStreamer.h" 00015 00016 namespace llvm { 00017 class MCAsmBackend; 00018 class MCContext; 00019 class MCCodeEmitter; 00020 class MCExpr; 00021 class MCInst; 00022 class MCSection; 00023 class MCSubtargetInfo; 00024 class MCSymbol; 00025 class StringRef; 00026 class raw_ostream; 00027 00028 class MCWinCOFFStreamer : public MCObjectStreamer { 00029 public: 00030 MCWinCOFFStreamer(MCContext &Context, MCAsmBackend &MAB, MCCodeEmitter &CE, 00031 raw_ostream &OS); 00032 00033 /// state management 00034 void reset() override { 00035 CurSymbol = nullptr; 00036 MCObjectStreamer::reset(); 00037 } 00038 00039 /// \name MCStreamer interface 00040 /// \{ 00041 00042 void InitSections() override; 00043 void EmitLabel(MCSymbol *Symbol) override; 00044 void EmitAssemblerFlag(MCAssemblerFlag Flag) override; 00045 void EmitThumbFunc(MCSymbol *Func) override; 00046 bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override; 00047 void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override; 00048 void BeginCOFFSymbolDef(MCSymbol const *Symbol) override; 00049 void EmitCOFFSymbolStorageClass(int StorageClass) override; 00050 void EmitCOFFSymbolType(int Type) override; 00051 void EndCOFFSymbolDef() override; 00052 void EmitCOFFSectionIndex(MCSymbol const *Symbol) override; 00053 void EmitCOFFSecRel32(MCSymbol const *Symbol) override; 00054 void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override; 00055 void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, 00056 unsigned ByteAlignment) override; 00057 void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, 00058 unsigned ByteAlignment) override; 00059 void EmitZerofill(const MCSection *Section, MCSymbol *Symbol, uint64_t Size, 00060 unsigned ByteAlignment) override; 00061 void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol, uint64_t Size, 00062 unsigned ByteAlignment) override; 00063 void EmitFileDirective(StringRef Filename) override; 00064 void EmitIdent(StringRef IdentString) override; 00065 void EmitWinEHHandlerData() override; 00066 void FinishImpl() override; 00067 00068 /// \} 00069 00070 protected: 00071 const MCSymbol *CurSymbol; 00072 void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override; 00073 00074 private: 00075 LLVM_ATTRIBUTE_NORETURN void FatalError(const Twine &Msg) const; 00076 }; 00077 } 00078 00079 #endif 00080