[llvm] [pdb] Provide a better error message when overflowing the public/global symbol record stream (PR #140884)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 21 05:06:30 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
index 0289a7543..526a369e7 100644
--- a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
@@ -322,9 +322,11 @@ Error GSIStreamBuilder::finalizeMsfLayout() {
 
   uint64_t RecordBytes = PSH->RecordByteSize + GSH->RecordByteSize;
   if (RecordBytes > UINT32_MAX)
-    return make_error<StringError>(formatv("the public ({0} bytes) and global "
-          "({1} bytes) symbols are too large to fit in a PDB file.",
-          PSH->RecordByteSize, GSH->RecordByteSize), inconvertibleErrorCode());
+    return make_error<StringError>(
+        formatv("the public ({0} bytes) and global "
+                "({1} bytes) symbols are too large to fit in a PDB file.",
+                PSH->RecordByteSize, GSH->RecordByteSize),
+        inconvertibleErrorCode());
 
   Idx = Msf.addStream(RecordBytes);
   if (!Idx)

``````````

</details>


https://github.com/llvm/llvm-project/pull/140884


More information about the llvm-commits mailing list