[llvm] Add llvm-extract-bundle-entry to extend llvm-objcopy (PR #169386)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 12 00:50:11 PST 2026


================
@@ -219,24 +219,38 @@ Error object::extractOffloadBundleFatBinary(
   return Error::success();
 }
 
-Error object::extractCodeObject(const ObjectFile &Source, int64_t Offset,
-                                int64_t Size, StringRef OutputFileName) {
+Error object::extractCodeObject(const ObjectFile &Source, size_t Offset,
+                                size_t Size, StringRef OutputFileName) {
   Expected<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
       FileOutputBuffer::create(OutputFileName, Size);
 
-  if (!BufferOrErr)
-    return BufferOrErr.takeError();
+  if (Error Err = BufferOrErr.takeError())
+    return Err;
----------------
jh7370 wrote:

Sorry, I should have seen this earlier: why have you changed this line? The original is more idiomatic, if you're not wrapping the error in something else (like you do a few lines later).

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


More information about the llvm-commits mailing list