[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 12 08:23:47 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 9e261c5bee4c5618723c243986c4b39236713378 539af083a22ccdeaa64ccc85d6ffc08b48c9432f --extensions cpp,h -- clang/include/clang/Basic/FileEntry.h clang/lib/Basic/SourceManager.cpp llvm/include/llvm/Support/AutoConvert.h llvm/lib/Support/AutoConvert.cpp llvm/lib/Support/MemoryBuffer.cpp llvm/lib/Support/VirtualFileSystem.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/Basic/FileEntry.h b/clang/include/clang/Basic/FileEntry.h
index 56684cc882..1fe6c36175 100644
--- a/clang/include/clang/Basic/FileEntry.h
+++ b/clang/include/clang/Basic/FileEntry.h
@@ -71,9 +71,9 @@ public:
return *getBaseMapEntry().second->V.get<FileEntry *>();
}
#ifdef __MVS__
- FileEntry &getFileEntry() {
- return *getBaseMapEntry().second->V.get<FileEntry *>();
- }
+ FileEntry &getFileEntry() {
+ return *getBaseMapEntry().second->V.get<FileEntry *>();
+ }
#endif
DirectoryEntryRef getDir() const { return ME->second->Dir; }
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 1b6197e4fa..6fc9902fb4 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -631,8 +631,8 @@ FileID SourceManager::createFileIDImpl(ContentCache &File, StringRef Filename,
// Buffer size may increase due to potential z/OS EBCDIC to UTF-8
// conversion.
if (std::optional<llvm::MemoryBufferRef> Buffer =
- File.getBufferOrNone(Diag, getFileManager())) {
- unsigned BufSize = Buffer->getBufferSize();
+ File.getBufferOrNone(Diag, getFileManager())) {
+ unsigned BufSize = Buffer->getBufferSize();
if (BufSize > FileSize) {
if (File.ContentsEntry.has_value())
File.ContentsEntry->getFileEntry().setSize(BufSize);
``````````
</details>
https://github.com/llvm/llvm-project/pull/98652
More information about the llvm-commits
mailing list