summaryrefslogtreecommitdiff
path: root/lib/MC
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-19 18:45:47 +0000
committerChris Lattner <sabre@nondot.org>2010-01-19 18:45:47 +0000
commitddf6bdde44287b5b559bc403a02ff971e15e8303 (patch)
treebc3558e6741c70092f9a71a601123180bfa0cba5 /lib/MC
parentf03ffd13f8f31fb8ead74b94eb2ef71b80ac7739 (diff)
downloadllvm-ddf6bdde44287b5b559bc403a02ff971e15e8303.tar.gz
llvm-ddf6bdde44287b5b559bc403a02ff971e15e8303.tar.bz2
llvm-ddf6bdde44287b5b559bc403a02ff971e15e8303.tar.xz
add a "MCStreamer::EmitFill" method, and move the default implementation
(which just iteratively emits bytes) to MCStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCStreamer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 8a6dcdae7a..e43d941309 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCStreamer.h"
+#include "llvm/MC/MCExpr.h"
using namespace llvm;
@@ -16,3 +17,11 @@ MCStreamer::MCStreamer(MCContext &_Context) : Context(_Context), CurSection(0) {
MCStreamer::~MCStreamer() {
}
+
+/// EmitFill - Emit NumBytes bytes worth of the value specified by
+/// FillValue. This implements directives such as '.space'.
+void MCStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue) {
+ const MCExpr *E = MCConstantExpr::Create(FillValue, getContext());
+ for (uint64_t i = 0, e = NumBytes; i != e; ++i)
+ EmitValue(E, 1);
+}