aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-rc/ResourceFileWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-rc/ResourceFileWriter.cpp')
-rw-r--r--llvm/tools/llvm-rc/ResourceFileWriter.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/tools/llvm-rc/ResourceFileWriter.cpp b/llvm/tools/llvm-rc/ResourceFileWriter.cpp
index 553bb75..2856fa8 100644
--- a/llvm/tools/llvm-rc/ResourceFileWriter.cpp
+++ b/llvm/tools/llvm-rc/ResourceFileWriter.cpp
@@ -1524,14 +1524,16 @@ ResourceFileWriter::loadFile(StringRef File) const {
// properly though, so if using that to append paths below, this early
// exception case could be removed.)
if (sys::path::has_root_directory(File))
- return errorOrToExpected(MemoryBuffer::getFile(File, -1, false));
+ return errorOrToExpected(MemoryBuffer::getFile(
+ File, /*IsText=*/false, /*RequiresNullTerminator=*/false));
// 1. The current working directory.
sys::fs::current_path(Cwd);
Path.assign(Cwd.begin(), Cwd.end());
sys::path::append(Path, File);
if (sys::fs::exists(Path))
- return errorOrToExpected(MemoryBuffer::getFile(Path, -1, false));
+ return errorOrToExpected(MemoryBuffer::getFile(
+ Path, /*IsText=*/false, /*RequiresNullTerminator=*/false));
// 2. The directory of the input resource file, if it is different from the
// current working directory.
@@ -1539,19 +1541,22 @@ ResourceFileWriter::loadFile(StringRef File) const {
Path.assign(InputFileDir.begin(), InputFileDir.end());
sys::path::append(Path, File);
if (sys::fs::exists(Path))
- return errorOrToExpected(MemoryBuffer::getFile(Path, -1, false));
+ return errorOrToExpected(MemoryBuffer::getFile(
+ Path, /*IsText=*/false, /*RequiresNullTerminator=*/false));
// 3. All of the include directories specified on the command line.
for (StringRef ForceInclude : Params.Include) {
Path.assign(ForceInclude.begin(), ForceInclude.end());
sys::path::append(Path, File);
if (sys::fs::exists(Path))
- return errorOrToExpected(MemoryBuffer::getFile(Path, -1, false));
+ return errorOrToExpected(MemoryBuffer::getFile(
+ Path, /*IsText=*/false, /*RequiresNullTerminator=*/false));
}
if (auto Result =
llvm::sys::Process::FindInEnvPath("INCLUDE", File, Params.NoInclude))
- return errorOrToExpected(MemoryBuffer::getFile(*Result, -1, false));
+ return errorOrToExpected(MemoryBuffer::getFile(
+ *Result, /*IsText=*/false, /*RequiresNullTerminator=*/false));
return make_error<StringError>("error : file not found : " + Twine(File),
inconvertibleErrorCode());