[PATCH] D88213: [llvm-objcopy][NFC] refactor error handling. part 2.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 25 01:52:45 PDT 2020
grimar added inline comments.
================
Comment at: llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp:57
support::endian::write32le(Data.data() + CRCPos, CRC32);
- return Data;
+ return std::move(Data);
}
----------------
You don't need this move I believe. Move constructor of `Expected<>` will be called anyways.
================
Comment at: llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp:282
+ return createFileError(Config.InputFilename, O.takeError());
+ Object *Obj = O->get();
assert(Obj && "Unable to deserialize COFF object");
----------------
mstorsjo wrote:
> This bit seems like unrelated renamings?
And `ObjOrErr` was probably a better name. It is common to name `Expected` variables as "<something>OrErr".
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88213/new/
https://reviews.llvm.org/D88213
More information about the llvm-commits
mailing list