add support for .zerofill, patch by Kevin Enderby!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75301 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index b7f1982..9640fd9 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -44,6 +44,9 @@
virtual void EmitCommonSymbol(MCSymbol *Symbol, unsigned Size,
unsigned Pow2Alignment, bool IsLocal);
+ virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = NULL,
+ unsigned Size = 0, unsigned Pow2Alignment = 0);
+
virtual void EmitBytes(const char *Data, unsigned Length);
virtual void EmitValue(const MCValue &Value, unsigned Size);
@@ -157,6 +160,21 @@
OS << '\n';
}
+void MCAsmStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,
+ unsigned Size, unsigned Pow2Alignment) {
+ // Note: a .zerofill directive does not switch sections
+ // FIXME: Really we would like the segment and section names as well as the
+ // section type to be separate values instead of embedded in the name. Not
+ // all assemblers understand all this stuff though.
+ OS << ".zerofill " << Section->getName();
+ if (Symbol != NULL) {
+ OS << ',' << Symbol->getName() << ',' << Size;
+ if (Pow2Alignment != 0)
+ OS << ',' << Pow2Alignment;
+ }
+ OS << '\n';
+}
+
void MCAsmStreamer::EmitBytes(const char *Data, unsigned Length) {
assert(CurSection && "Cannot emit contents before setting section!");
for (unsigned i = 0; i != Length; ++i)