[llvm] [llvm-objcopy] fix llvm-objcopy replaced faiiled when the file is modified inplace (PR #121564)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 04:06:39 PST 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 f0909e3a991c7b6515cafe2ce0a069a856fe675f 6f875b85070a41c48af0cf8bf83abb55a0aa5d26 --extensions h,cpp -- llvm/include/llvm/ObjCopy/ObjCopy.h llvm/lib/ObjCopy/Archive.cpp llvm/tools/llvm-objcopy/llvm-objcopy.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/ObjCopy/Archive.cpp b/llvm/lib/ObjCopy/Archive.cpp
index 0512b0ddfb9..85db7df140e 100644
--- a/llvm/lib/ObjCopy/Archive.cpp
+++ b/llvm/lib/ObjCopy/Archive.cpp
@@ -69,9 +69,8 @@ static Error deepWriteArchive(StringRef ArcName,
       NewMembers.front().detectKindFromObject() == object::Archive::K_DARWIN)
     Kind = object::Archive::K_DARWIN;
 
-  if (Error E =
-          writeArchive(ArcName, NewMembers, WriteSymtab, Kind, Deterministic,
-                       Thin, std::move(Buffer)))
+  if (Error E = writeArchive(ArcName, NewMembers, WriteSymtab, Kind,
+                             Deterministic, Thin, std::move(Buffer)))
     return createFileError(ArcName, std::move(E));
 
   if (!Thin)

``````````

</details>


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


More information about the llvm-commits mailing list