diff options
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r-- | lib/MC/MCStreamer.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 96d6d691d2..51ef415542 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -21,10 +21,9 @@ #include <cstdlib> using namespace llvm; -MCStreamer::MCStreamer(MCContext &Ctx) - : Context(Ctx), EmitEHFrame(true), EmitDebugFrame(false), - CurrentW64UnwindInfo(0), LastSymbol(0), - AutoInitSections(false) { +MCStreamer::MCStreamer(StreamerKind Kind, MCContext &Ctx) + : Kind(Kind), Context(Ctx), EmitEHFrame(true), EmitDebugFrame(false), + CurrentW64UnwindInfo(0), LastSymbol(0), AutoInitSections(false) { const MCSection *section = NULL; SectionStack.push_back(std::make_pair(section, section)); } @@ -34,6 +33,18 @@ MCStreamer::~MCStreamer() { delete W64UnwindInfos[i]; } +void MCStreamer::reset() { + for (unsigned i = 0; i < getNumW64UnwindInfos(); ++i) + delete W64UnwindInfos[i]; + EmitEHFrame = true; + EmitDebugFrame = false; + CurrentW64UnwindInfo = 0; + LastSymbol = 0; + const MCSection *section = NULL; + SectionStack.clear(); + SectionStack.push_back(std::make_pair(section, section)); +} + const MCExpr *MCStreamer::BuildSymbolDiff(MCContext &Context, const MCSymbol *A, const MCSymbol *B) { @@ -92,8 +103,8 @@ void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size, /// EmitULEB128Value - Special case of EmitULEB128Value that avoids the /// client having to pass in a MCExpr for constant integers. -void MCStreamer::EmitULEB128IntValue(uint64_t Value, unsigned AddrSpace, - unsigned Padding) { +void MCStreamer::EmitULEB128IntValue(uint64_t Value, unsigned Padding, + unsigned AddrSpace) { SmallString<128> Tmp; raw_svector_ostream OSE(Tmp); encodeULEB128(Value, OSE, Padding); @@ -146,8 +157,8 @@ void MCStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue, bool MCStreamer::EmitDwarfFileDirective(unsigned FileNo, StringRef Directory, - StringRef Filename) { - return getContext().GetDwarfFile(Directory, Filename, FileNo) == 0; + StringRef Filename, unsigned CUID) { + return getContext().GetDwarfFile(Directory, Filename, FileNo, CUID) == 0; } void MCStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line, @@ -182,6 +193,13 @@ void MCStreamer::EmitLabel(MCSymbol *Symbol) { LastSymbol = Symbol; } +void MCStreamer::EmitDebugLabel(MCSymbol *Symbol) { + assert(!Symbol->isVariable() && "Cannot emit a variable symbol!"); + assert(getCurrentSection() && "Cannot emit before setting section!"); + Symbol->setSection(*getCurrentSection()); + LastSymbol = Symbol; +} + void MCStreamer::EmitCompactUnwindEncoding(uint32_t CompactUnwindEncoding) { EnsureValidFrame(); MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo(); @@ -602,3 +620,8 @@ void MCStreamer::Finish() { FinishImpl(); } + +MCSymbolData &MCStreamer::getOrCreateSymbolData(MCSymbol *Symbol) { + report_fatal_error("Not supported!"); + return *(static_cast<MCSymbolData*> (NULL)); +} |