[llvm] r323494 - Reland "[llvm-objcopy] Refactor llvm-objcopy to use reader and writer objects"
Jake Ehrlich via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 25 18:01:38 PST 2018
Author: jakehehrlich
Date: Thu Jan 25 18:01:37 2018
New Revision: 323494
URL: http://llvm.org/viewvc/llvm-project?rev=323494&view=rev
Log:
Reland "[llvm-objcopy] Refactor llvm-objcopy to use reader and writer objects"
Somehow I reverted changes I made in a previous Reland. This change re-relands
unconfusing a varible name with a type name.
Modified:
llvm/trunk/tools/llvm-objcopy/Object.cpp
llvm/trunk/tools/llvm-objcopy/Object.h
Modified: llvm/trunk/tools/llvm-objcopy/Object.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/Object.cpp?rev=323494&r1=323493&r2=323494&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/Object.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/Object.cpp Thu Jan 25 18:01:37 2018
@@ -693,37 +693,37 @@ ELFReader::ELFReader(StringRef File) {
auto BinaryOrErr = createBinary(File);
if (!BinaryOrErr)
reportError(File, BinaryOrErr.takeError());
- auto Bin = std::move(BinaryOrErr.get());
- std::tie(Binary, Data) = Bin.takeBinary();
+ auto OwnedBin = std::move(BinaryOrErr.get());
+ std::tie(Bin, Data) = OwnedBin.takeBinary();
}
ElfType ELFReader::getElfType() const {
- if (isa<ELFObjectFile<ELF32LE>>(Binary.get()))
+ if (isa<ELFObjectFile<ELF32LE>>(Bin.get()))
return ELFT_ELF32LE;
- if (isa<ELFObjectFile<ELF64LE>>(Binary.get()))
+ if (isa<ELFObjectFile<ELF64LE>>(Bin.get()))
return ELFT_ELF64LE;
- if (isa<ELFObjectFile<ELF32BE>>(Binary.get()))
+ if (isa<ELFObjectFile<ELF32BE>>(Bin.get()))
return ELFT_ELF32BE;
- if (isa<ELFObjectFile<ELF64BE>>(Binary.get()))
+ if (isa<ELFObjectFile<ELF64BE>>(Bin.get()))
return ELFT_ELF64BE;
llvm_unreachable("Invalid ELFType");
}
std::unique_ptr<Object> ELFReader::create() const {
auto Obj = llvm::make_unique<Object>(Data);
- if (auto *o = dyn_cast<ELFObjectFile<ELF32LE>>(Binary.get())) {
+ if (auto *o = dyn_cast<ELFObjectFile<ELF32LE>>(Bin.get())) {
ELFBuilder<ELF32LE> Builder(*o, *Obj);
Builder.build();
return Obj;
- } else if (auto *o = dyn_cast<ELFObjectFile<ELF64LE>>(Binary.get())) {
+ } else if (auto *o = dyn_cast<ELFObjectFile<ELF64LE>>(Bin.get())) {
ELFBuilder<ELF64LE> Builder(*o, *Obj);
Builder.build();
return Obj;
- } else if (auto *o = dyn_cast<ELFObjectFile<ELF32BE>>(Binary.get())) {
+ } else if (auto *o = dyn_cast<ELFObjectFile<ELF32BE>>(Bin.get())) {
ELFBuilder<ELF32BE> Builder(*o, *Obj);
Builder.build();
return Obj;
- } else if (auto *o = dyn_cast<ELFObjectFile<ELF64BE>>(Binary.get())) {
+ } else if (auto *o = dyn_cast<ELFObjectFile<ELF64BE>>(Bin.get())) {
ELFBuilder<ELF64BE> Builder(*o, *Obj);
Builder.build();
return Obj;
Modified: llvm/trunk/tools/llvm-objcopy/Object.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/Object.h?rev=323494&r1=323493&r2=323494&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/Object.h (original)
+++ llvm/trunk/tools/llvm-objcopy/Object.h Thu Jan 25 18:01:37 2018
@@ -530,7 +530,7 @@ public:
class ELFReader : public Reader {
private:
- std::unique_ptr<Binary> Binary;
+ std::unique_ptr<Binary> Bin;
std::shared_ptr<MemoryBuffer> Data;
public:
More information about the llvm-commits
mailing list