virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
unsigned Size = 0, unsigned ByteAlignment = 0);
- virtual void EmitBytes(const StringRef &Data);
+ virtual void EmitBytes(StringRef Data);
virtual void EmitValue(const MCExpr *Value, unsigned Size);
assert((Symbol->isUndefined() || Symbol->isAbsolute()) &&
"Cannot define a symbol twice!");
- llvm_unreachable("FIXME: Not yet implemented!");
+ // FIXME: Lift context changes into super class.
+ // FIXME: Set associated section.
+ Symbol->setValue(Value);
}
void MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
SectData.setAlignment(ByteAlignment);
}
-void MCMachOStreamer::EmitBytes(const StringRef &Data) {
+void MCMachOStreamer::EmitBytes(StringRef Data) {
MCDataFragment *DF = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
if (!DF)
DF = new MCDataFragment(CurSectionData);
}
void MCMachOStreamer::EmitValue(const MCExpr *Value, unsigned Size) {
- MCValue RelocValue;
-
- if (!AddValueSymbols(Value)->EvaluateAsRelocatable(getContext(), RelocValue))
- return llvm_report_error("expected relocatable expression");
-
- new MCFillFragment(RelocValue, Size, 1, CurSectionData);
+ new MCFillFragment(*AddValueSymbols(Value), Size, 1, CurSectionData);
}
void MCMachOStreamer::EmitValueToAlignment(unsigned ByteAlignment,
void MCMachOStreamer::EmitValueToOffset(const MCExpr *Offset,
unsigned char Value) {
- MCValue RelocOffset;
-
- if (!AddValueSymbols(Offset)->EvaluateAsRelocatable(getContext(),
- RelocOffset))
- return llvm_report_error("expected relocatable expression");
-
- new MCOrgFragment(RelocOffset, Value, CurSectionData);
+ new MCOrgFragment(*Offset, Value, CurSectionData);
}
void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {