Always output zero-terminator in slangdata.py.
Output one more byte '\0' can be useful when the input data file is
a bitcode file. With the existence of '\0', we can use
llvm::MemoryBuffer::getMemBuffer()
instead of
llvm::MemoryBuffer::getMemBufferCopy()
to prepare buffer for llvm::ParseBitcodeFile(llvm::MemoryBuffer, ...).
diff --git a/llvm-rs-link.cpp b/llvm-rs-link.cpp
index 20d3669..32ea36d 100644
--- a/llvm-rs-link.cpp
+++ b/llvm-rs-link.cpp
@@ -145,8 +145,8 @@
if (!NoStdLib) {
// rslib.bc
- MB = MemoryBuffer::getMemBufferCopy(StringRef(rslib_bc, rslib_bc_size),
- "rslib.bc");
+ MB = MemoryBuffer::getMemBuffer(StringRef(rslib_bc, rslib_bc_size),
+ "rslib.bc");
if (MB == NULL) {
errs() << "Failed to load (in-memory) `rslib.bc'!\n";
return false;