summaryrefslogtreecommitdiff
path: root/lib/MC/MCAsmStreamer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-10 22:20:30 +0000
committerChris Lattner <sabre@nondot.org>2009-07-10 22:20:30 +0000
commit9be3fee2bdc3126fb87e4e1b31935905f4bcc4d0 (patch)
treeb51bd12c9229acf7e8630ea1ff8db5cdc44da66e /lib/MC/MCAsmStreamer.cpp
parentdd9f8bbc20c3941efb4923e5f3a462c73a80713a (diff)
downloadllvm-9be3fee2bdc3126fb87e4e1b31935905f4bcc4d0.tar.gz
llvm-9be3fee2bdc3126fb87e4e1b31935905f4bcc4d0.tar.bz2
llvm-9be3fee2bdc3126fb87e4e1b31935905f4bcc4d0.tar.xz
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
Diffstat (limited to 'lib/MC/MCAsmStreamer.cpp')
-rw-r--r--lib/MC/MCAsmStreamer.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index b7f198232f..9640fd9121 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -44,6 +44,9 @@ namespace {
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 @@ void MCAsmStreamer::EmitCommonSymbol(MCSymbol *Symbol, unsigned Size,
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)