diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-21 18:29:01 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-21 18:29:01 +0000 |
commit | 0705fbf52fcaade0c6b9d5d33bec163ee4c2daf4 (patch) | |
tree | 6a94c62766d730622c20c3a2ab24da931415e57e /lib/MC/MCMachOStreamer.cpp | |
parent | 7178010a168a378df5d9be95956093a3e5f963fd (diff) |
llvm-mc/Mach-O: Support byte and fill value emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79652 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCMachOStreamer.cpp')
-rw-r--r-- | lib/MC/MCMachOStreamer.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp index f34fcd9a61..0ad03273cf 100644 --- a/lib/MC/MCMachOStreamer.cpp +++ b/lib/MC/MCMachOStreamer.cpp @@ -139,22 +139,28 @@ void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol, } void MCMachOStreamer::EmitBytes(const StringRef &Data) { - llvm_unreachable("FIXME: Not yet implemented!"); + MCDataFragment *DF = new MCDataFragment(CurSectionData); + DF->getContents().append(Data.begin(), Data.end()); } void MCMachOStreamer::EmitValue(const MCValue &Value, unsigned Size) { - llvm_unreachable("FIXME: Not yet implemented!"); + new MCFillFragment(Value, Size, 1, CurSectionData); } void MCMachOStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value, unsigned ValueSize, unsigned MaxBytesToEmit) { - llvm_unreachable("FIXME: Not yet implemented!"); + new MCAlignFragment(ByteAlignment, Value, ValueSize, MaxBytesToEmit, + CurSectionData); + + // Update the maximum alignment on the current section if necessary + if (ByteAlignment > CurSectionData->getAlignment()) + CurSectionData->setAlignment(ByteAlignment); } void MCMachOStreamer::EmitValueToOffset(const MCValue &Offset, unsigned char Value) { - llvm_unreachable("FIXME: Not yet implemented!"); + new MCOrgFragment(Offset, Value, 1, CurSectionData); } void MCMachOStreamer::EmitInstruction(const MCInst &Inst) { |