-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[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
[SystemZ][z/OS] Mark text files as text in ClangScanDeps #127514
Conversation
@llvm/pr-subscribers-clang Author: Abhina Sree (abhina-sree) ChangesThis patch continues the work that was started here https://reviews.llvm.org/D99426 to correctly open text files in text mode. Full diff: https://github.com/llvm/llvm-project/pull/127514.diff 1 Files Affected:
diff --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
index 9cdb1eae56187..0849782a7354b 100644
--- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp
+++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -298,12 +298,12 @@ 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');
@@ -1032,7 +1032,7 @@ 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";
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/88/builds/8183 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/12944 Here is the relevant piece of the build log for the reference
|
This patch continues the work that was started here https://reviews.llvm.org/D99426 to correctly open text files in text mode.
This patch continues the work that was started here https://reviews.llvm.org/D99426 to correctly open text files in text mode.