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/slangdata.py b/slangdata.py
index 2486ff4..a23b26c 100755
--- a/slangdata.py
+++ b/slangdata.py
@@ -61,9 +61,9 @@
sys.stdout.write(", ")
else:
sys.stdout.write(",")
- # always ends with 0x0 (can fix assembler warnings)
+ # always ends with 0x0
+ sys.stdout.write("0x00")
if col != 0:
- sys.stdout.write("0x00")
sys.stdout.write("\n")
# encode file size