diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -342,7 +342,7 @@ return Diags.Report(diag::err_target_unknown_triple) << Opts.Triple; ErrorOr> Buffer = - MemoryBuffer::getFileOrSTDIN(Opts.InputFile); + MemoryBuffer::getFileOrSTDIN(Opts.InputFile, /*IsText=*/true); if (std::error_code EC = Buffer.getError()) { Error = EC.message(); diff --git a/llvm/lib/AsmParser/Parser.cpp b/llvm/lib/AsmParser/Parser.cpp --- a/llvm/lib/AsmParser/Parser.cpp +++ b/llvm/lib/AsmParser/Parser.cpp @@ -104,7 +104,7 @@ bool UpgradeDebugInfo, DataLayoutCallbackTy DataLayoutCallback) { ErrorOr> FileOrErr = - MemoryBuffer::getFileOrSTDIN(Filename); + MemoryBuffer::getFileOrSTDIN(Filename, /*IsText=*/true); if (std::error_code EC = FileOrErr.getError()) { Err = SMDiagnostic(Filename, SourceMgr::DK_Error, "Could not open input file: " + EC.message()); diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -984,7 +984,7 @@ std::unique_ptr llvm::createMIRParserFromFile( StringRef Filename, SMDiagnostic &Error, LLVMContext &Context, std::function ProcessIRFunction) { - auto FileOrErr = MemoryBuffer::getFileOrSTDIN(Filename); + auto FileOrErr = MemoryBuffer::getFileOrSTDIN(Filename, /*IsText=*/true); if (std::error_code EC = FileOrErr.getError()) { Error = SMDiagnostic(Filename, SourceMgr::DK_Error, "Could not open input file: " + EC.message()); diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp --- a/llvm/lib/ProfileData/InstrProfReader.cpp +++ b/llvm/lib/ProfileData/InstrProfReader.cpp @@ -41,7 +41,7 @@ static Expected> setupMemoryBuffer(const Twine &Path) { ErrorOr> BufferOrErr = - MemoryBuffer::getFileOrSTDIN(Path); + MemoryBuffer::getFileOrSTDIN(Path, /*IsText=*/true); if (std::error_code EC = BufferOrErr.getError()) return errorCodeToError(EC); return std::move(BufferOrErr.get()); diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -1575,7 +1575,7 @@ /// \returns an error code indicating the status of the buffer. static ErrorOr> setupMemoryBuffer(const Twine &Filename) { - auto BufferOrErr = MemoryBuffer::getFileOrSTDIN(Filename); + auto BufferOrErr = MemoryBuffer::getFileOrSTDIN(Filename, /*IsText=*/true); if (std::error_code EC = BufferOrErr.getError()) return EC; auto Buffer = std::move(BufferOrErr.get()); diff --git a/llvm/lib/Testing/Support/SupportHelpers.cpp b/llvm/lib/Testing/Support/SupportHelpers.cpp --- a/llvm/lib/Testing/Support/SupportHelpers.cpp +++ b/llvm/lib/Testing/Support/SupportHelpers.cpp @@ -40,7 +40,7 @@ EXPECT_TRUE(Found) << "Unit test source directory file does not exist."; - auto File = MemoryBuffer::getFile(InputFilePath); + auto File = MemoryBuffer::getFile(InputFilePath, /*IsText=*/true); EXPECT_TRUE(static_cast(File)) << "Could not open unit test source directory file."; diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp --- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp @@ -334,7 +334,7 @@ Expected InstructionBenchmark::readYaml(const LLVMState &State, StringRef Filename) { if (auto ExpectedMemoryBuffer = - errorOrToExpected(MemoryBuffer::getFile(Filename))) { + errorOrToExpected(MemoryBuffer::getFile(Filename, /*IsText=*/true))) { yaml::Input Yin(*ExpectedMemoryBuffer.get()); YamlContext Context(State); InstructionBenchmark Benchmark; @@ -351,7 +351,7 @@ Expected> InstructionBenchmark::readYamls(const LLVMState &State, StringRef Filename) { if (auto ExpectedMemoryBuffer = - errorOrToExpected(MemoryBuffer::getFile(Filename))) { + errorOrToExpected(MemoryBuffer::getFile(Filename, /*IsText=*/true))) { yaml::Input Yin(*ExpectedMemoryBuffer.get()); YamlContext Context(State); std::vector Benchmarks; diff --git a/llvm/tools/llvm-ifs/llvm-ifs.cpp b/llvm/tools/llvm-ifs/llvm-ifs.cpp --- a/llvm/tools/llvm-ifs/llvm-ifs.cpp +++ b/llvm/tools/llvm-ifs/llvm-ifs.cpp @@ -182,7 +182,7 @@ static Expected> readInputFile(StringRef FilePath) { // Read in file. ErrorOr> BufOrError = - MemoryBuffer::getFileOrSTDIN(FilePath); + MemoryBuffer::getFileOrSTDIN(FilePath, /*IsText=*/true); if (!BufOrError) return createStringError(BufOrError.getError(), "Could not open `%s`", FilePath.data()); diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -343,7 +343,7 @@ Triple TheTriple(TripleName); ErrorOr> BufferPtr = - MemoryBuffer::getFileOrSTDIN(InputFilename); + MemoryBuffer::getFileOrSTDIN(InputFilename, /*IsText=*/true); if (std::error_code EC = BufferPtr.getError()) { WithColor::error(errs(), ProgName) << InputFilename << ": " << EC.message() << '\n';