void MCTargetStreamer::emitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
MCStreamer::MCStreamer(MCContext &Ctx)
- : Context(Ctx), EmitEHFrame(true), EmitDebugFrame(false),
- CurrentW64UnwindInfo(0), LastSymbol(0) {
+ : Context(Ctx), CurrentW64UnwindInfo(nullptr), LastSymbol(nullptr) {
SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
}
for (unsigned i = 0; i < getNumW64UnwindInfos(); ++i)
delete W64UnwindInfos[i];
W64UnwindInfos.clear();
- EmitEHFrame = true;
- EmitDebugFrame = false;
- CurrentW64UnwindInfo = 0;
- LastSymbol = 0;
+ CurrentW64UnwindInfo = nullptr;
+ LastSymbol = nullptr;
SectionStack.clear();
SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
}
}
-void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size) {
- EmitValueImpl(Value, Size);
+void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size,
+ const SMLoc &Loc) {
+ EmitValueImpl(Value, Size, Loc);
}
void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size) {
MCDwarfFrameInfo *MCStreamer::getCurrentFrameInfo() {
if (FrameInfos.empty())
- return 0;
+ return nullptr;
return &FrameInfos.back();
}
void MCStreamer::EmitCFISections(bool EH, bool Debug) {
assert(EH || Debug);
- EmitEHFrame = EH;
- EmitDebugFrame = Debug;
}
void MCStreamer::EmitCFIStartProc(bool IsSimple) {
}
void MCStreamer::RecordProcStart(MCDwarfFrameInfo &Frame) {
+ // Report an error if we haven't seen a symbol yet where we'd bind
+ // .cfi_startproc.
+ if (!LastSymbol)
+ report_fatal_error("No symbol to start a frame");
Frame.Function = LastSymbol;
// We need to create a local symbol to avoid relocations.
Frame.Begin = getContext().CreateTempSymbol();
EmitRawTextImpl(T.toStringRef(Str));
}
-void MCStreamer::EmitFrames(MCAsmBackend *MAB, bool usingCFI) {
- if (!getNumFrameInfos())
- return;
-
- if (EmitEHFrame)
- MCDwarfFrameEmitter::Emit(*this, MAB, usingCFI, true);
-
- if (EmitDebugFrame)
- MCDwarfFrameEmitter::Emit(*this, MAB, usingCFI, false);
-}
-
void MCStreamer::EmitW64Tables() {
if (!getNumW64UnwindInfos())
return;
FinishImpl();
}
-MCSymbolData &MCStreamer::getOrCreateSymbolData(const MCSymbol *Symbol) {
- report_fatal_error("Not supported!");
- return *(static_cast<MCSymbolData*>(0));
-}
-
void MCStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
Symbol->setVariableValue(Value);