summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-21 18:29:01 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-21 18:29:01 +0000
commit4ef7fb95309bc6356f055f6d053e8e78f78de5fc (patch)
treed3afcaabd1710ccdfd62e5e9cc252ee33c133955 /llvm/lib/MC/MCMachOStreamer.cpp
parentc0b967dfb4aa2420613a65322d8d76c042637d61 (diff)
downloadbcm5719-llvm-4ef7fb95309bc6356f055f6d053e8e78f78de5fc.tar.gz
bcm5719-llvm-4ef7fb95309bc6356f055f6d053e8e78f78de5fc.zip
llvm-mc/Mach-O: Support byte and fill value emission.
llvm-svn: 79652
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index f34fcd9a61f..0ad03273cf0 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud