summaryrefslogtreecommitdiff
path: root/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-10-24 22:43:10 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-10-24 22:43:10 +0000
commit5759c3a02902026a27a0d1bc24a5bad85f52bd71 (patch)
tree9f9b828ebafa2a8e5a7cbf718149fce0f7d10946 /lib/MC/MCStreamer.cpp
parent07d5aef3057b2e403b20d683e7477c93fde67d99 (diff)
downloadllvm-5759c3a02902026a27a0d1bc24a5bad85f52bd71.tar.gz
llvm-5759c3a02902026a27a0d1bc24a5bad85f52bd71.tar.bz2
llvm-5759c3a02902026a27a0d1bc24a5bad85f52bd71.tar.xz
MCStreamer: Reimplement the virtual EmitRawText as a protected member, EmitRawTextImpl, to avoid string literal ambiguities
Also improve the implementation of EmitRawText(Twine) so it doesn't bother using the SmallString buffer if the Twine is a simple StringRef anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r--lib/MC/MCStreamer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 04e36bedc0..2be89e95e7 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -571,7 +571,7 @@ void MCStreamer::EmitCOFFSecRel32(MCSymbol const *Symbol) {
/// EmitRawText - If this file is backed by an 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) {
+void MCStreamer::EmitRawTextImpl(StringRef String) {
errs() << "EmitRawText called on an MCStreamer that doesn't support it, "
" something must not be fully mc'ized\n";
abort();
@@ -579,8 +579,7 @@ void MCStreamer::EmitRawText(StringRef String) {
void MCStreamer::EmitRawText(const Twine &T) {
SmallString<128> Str;
- T.toVector(Str);
- EmitRawText(Str.str());
+ EmitRawTextImpl(T.toStringRef(Str));
}
void MCStreamer::EmitFrames(MCAsmBackend *MAB, bool usingCFI) {