aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCParser
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2011-12-15 00:00:27 +0000
committerKevin Enderby <enderby@apple.com>2011-12-15 00:00:27 +0000
commitdac2953e3b5e5de73290c25740983a64a3e9920b (patch)
treeda0e29214f63a64a7bb24d3a3486091ed1bfe175 /lib/MC/MCParser
parent10e412ec6b761952b95710203e6d2d89f4fee53a (diff)
downloadexternal_llvm-dac2953e3b5e5de73290c25740983a64a3e9920b.zip
external_llvm-dac2953e3b5e5de73290c25740983a64a3e9920b.tar.gz
external_llvm-dac2953e3b5e5de73290c25740983a64a3e9920b.tar.bz2
Another improvement to the implementation of .incbin directive by avoiding a
buffer copy. Suggestion by Chris Lattner! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 4ab60c1..aac020d 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -443,11 +443,8 @@ bool AsmParser::ProcessIncbinFile(const std::string &Filename) {
return true;
// Pick up the bytes from the file and emit them.
- const char *BufferStart = SrcMgr.getMemoryBuffer(NewBuf)->getBufferStart();
- size_t BufferSize = SrcMgr.getMemoryBuffer(NewBuf)->getBufferSize();
- std::string Data(BufferStart, BufferSize);
- getStreamer().EmitBytes(Data, DEFAULT_ADDRSPACE);
-
+ getStreamer().EmitBytes(SrcMgr.getMemoryBuffer(NewBuf)->getBuffer(),
+ DEFAULT_ADDRSPACE);
return false;
}