diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-04-06 15:52:58 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-04-06 15:52:58 +0000 |
commit | 5f970ec96e421f64db6b1c6509a902ea73d98cc7 (patch) | |
tree | 0dd020f28a4846707f8d60717d9b2921ea187bd8 /lib/MC/MCStreamer.cpp | |
parent | 62cc576dca6a6aa62c0424f0a1e93a0a679d4c8a (diff) | |
download | FreeBSD-src-5f970ec96e421f64db6b1c6509a902ea73d98cc7.zip FreeBSD-src-5f970ec96e421f64db6b1c6509a902ea73d98cc7.tar.gz |
Update LLVM to r100520.
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r-- | lib/MC/MCStreamer.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 703acc4..4f484a2 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -10,6 +10,9 @@ #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCExpr.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/ADT/Twine.h" +#include <cstdlib> using namespace llvm; MCStreamer::MCStreamer(MCContext &_Context) : Context(_Context), CurSection(0) { @@ -44,3 +47,18 @@ void MCStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue, for (uint64_t i = 0, e = NumBytes; i != e; ++i) EmitValue(E, 1, AddrSpace); } + +/// EmitRawText - If this file is backed by a assembly streamer, this dumps +/// the specified string in the output .s file. This capability is +/// indicated by the hasRawTextSupport() predicate. +void MCStreamer::EmitRawText(StringRef String) { + errs() << "EmitRawText called on an MCStreamer that doesn't support it, " + " something must not be fully mc'ized\n"; + abort(); +} + +void MCStreamer::EmitRawText(const Twine &T) { + SmallString<128> Str; + T.toVector(Str); + EmitRawText(Str.str()); +} |