versioner: fix LLVM assertion failure.
MemoryBuffer::getOpenFileSlice asserts that the map size passed in
isn't -1 (presumably because the offset can be nonzero). Switch to
getOpenFile, which results in an identical call to the implementation
function without the assert.
Bug: http://b/37002637
Test: export FORCE_BUILD_LLVM_COMPONENTS=true
export FORCE_BUILD_LLVM_DEBUG=true
export FORCE_BUILD_LLVM_DISABLE_NDEBUG=true
mma -j && versioner
Change-Id: Ib610db9e07429aa3f64128eaef6ef555c4d1868e
diff --git a/tools/versioner/src/VFS.cpp b/tools/versioner/src/VFS.cpp
index cdf232f..8f9de88 100644
--- a/tools/versioner/src/VFS.cpp
+++ b/tools/versioner/src/VFS.cpp
@@ -54,7 +54,7 @@
err(1, "failed to open header '%s'", file_path);
}
- auto buffer_opt = llvm::MemoryBuffer::getOpenFileSlice(fd, file_path, -1, 0);
+ auto buffer_opt = llvm::MemoryBuffer::getOpenFile(fd, file_path, -1, false, false);
if (!buffer_opt) {
errx(1, "failed to map header '%s'", file_path);
}