summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit0c65fd49022849e1ba5d94459ea0128d7ab6c45f (patch)
tree563c89c56cb12062253494e6bf875711b44dde33 /llvm/lib
parent6d77a961119fcdf30e627259a7d1e73b841caf1c (diff)
downloadbcm5719-llvm-0c65fd49022849e1ba5d94459ea0128d7ab6c45f.tar.gz
bcm5719-llvm-0c65fd49022849e1ba5d94459ea0128d7ab6c45f.zip
add a "MCStreamer::EmitFill" method, and move the default implementation
(which just iteratively emits bytes) to MCStreamer. llvm-svn: 93888
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index 8a6dcdae7a4..e43d9413093 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/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);
+}
OpenPOWER on IntegriCloud