diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-01 14:31:55 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-01 14:31:55 +0000 |
commit | 9aa0b5e11e4827c21883e2054600968db8d6a54d (patch) | |
tree | ecc45b4420ca070db57cf17dd2bce935c37b9ad9 /tools/llvm-size/llvm-size.cpp | |
parent | a36429f26d0b7a8eccdb27c649baa58926881cd8 (diff) |
Remove some calls to std::move.
Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get
a reference to it.
Thanks to David Blaikie for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-size/llvm-size.cpp')
-rw-r--r-- | tools/llvm-size/llvm-size.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/llvm-size/llvm-size.cpp b/tools/llvm-size/llvm-size.cpp index 0664d535b8b..24c9cd862fe 100644 --- a/tools/llvm-size/llvm-size.cpp +++ b/tools/llvm-size/llvm-size.cpp @@ -458,9 +458,9 @@ static void PrintFileSectionSizes(StringRef file) { errs() << ToolName << ": " << file << ": " << EC.message() << ".\n"; return; } - std::unique_ptr<Binary> binary = std::move(BinaryOrErr.get()); + Binary &Bin = *BinaryOrErr.get(); - if (Archive *a = dyn_cast<Archive>(binary.get())) { + if (Archive *a = dyn_cast<Archive>(&Bin)) { // This is an archive. Iterate over each member and display its sizes. for (object::Archive::child_iterator i = a->child_begin(), e = a->child_end(); @@ -488,7 +488,7 @@ static void PrintFileSectionSizes(StringRef file) { } } } else if (MachOUniversalBinary *UB = - dyn_cast<MachOUniversalBinary>(binary.get())) { + dyn_cast<MachOUniversalBinary>(&Bin)) { // If we have a list of architecture flags specified dump only those. if (!ArchAll && ArchFlags.size() != 0) { // Look for a slice in the universal binary that matches each ArchFlag. @@ -692,7 +692,7 @@ static void PrintFileSectionSizes(StringRef file) { } } } - } else if (ObjectFile *o = dyn_cast<ObjectFile>(binary.get())) { + } else if (ObjectFile *o = dyn_cast<ObjectFile>(&Bin)) { if (!checkMachOAndArchFlags(o, file)) return; if (OutputFormat == sysv) |