mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Another improvement to the implementation of .incbin directive by avoiding a
buffer copy. Suggestion by Chris Lattner! llvm-svn: 146614
This commit is contained in:
parent
e9bd145105
commit
c65cec89e5
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user