Skip to content

[SystemZ][z/OS] Mark text files as text in ClangScanDeps #127514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions clang/tools/clang-scan-deps/ClangScanDeps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,14 @@ class ResourceDirectoryCache {
};
if (llvm::sys::ExecuteAndWait(ClangBinaryPath, PrintResourceDirArgs, {},
Redirects)) {
auto ErrorBuf = llvm::MemoryBuffer::getFile(ErrorFile.c_str());
auto ErrorBuf =
llvm::MemoryBuffer::getFile(ErrorFile.c_str(), /*IsText=*/true);
llvm::errs() << ErrorBuf.get()->getBuffer();
return "";
}

auto OutputBuf = llvm::MemoryBuffer::getFile(OutputFile.c_str());
auto OutputBuf =
llvm::MemoryBuffer::getFile(OutputFile.c_str(), /*IsText=*/true);
if (!OutputBuf)
return "";
StringRef Output = OutputBuf.get()->getBuffer().rtrim('\n');
Expand Down Expand Up @@ -1032,7 +1034,8 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) {
std::unique_ptr<llvm::MemoryBuffer> TU;
std::optional<llvm::MemoryBufferRef> TUBuffer;
if (!TranslationUnitFile.empty()) {
auto MaybeTU = llvm::MemoryBuffer::getFile(TranslationUnitFile);
auto MaybeTU =
llvm::MemoryBuffer::getFile(TranslationUnitFile, /*IsText=*/true);
if (!MaybeTU) {
llvm::errs() << "cannot open input translation unit: "
<< MaybeTU.getError().message() << "\n";
Expand Down