Correct the ownership passing semantics of object::createBinary and make them explici...
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 21 Jul 2014 16:26:24 +0000 (16:26 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 21 Jul 2014 16:26:24 +0000 (16:26 +0000)
commit95689f0845b0b6344d78746522a14790358e49f4
tree8edbb147d91ef24e3ce7916ded627d34ce01616d
parentd8fa9295c853695900eaede718ce75125c9baf68
Correct the ownership passing semantics of object::createBinary and make them explicit in the type system.

createBinary documented that it destroyed the parameter in error cases,
though by observation it does not. By passing the unique_ptr by value
rather than lvalue reference, callers are now explicit about passing
ownership and the function implements the documented contract. Remove
the explicit documentation, since now the behavior cannot be anything
other than what was documented, so it's redundant.

Also drops a unique_ptr::release in llvm-nm that was always run on a
null unique_ptr anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213557 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/Binary.h
lib/Object/Archive.cpp
lib/Object/Binary.cpp
tools/llvm-nm/llvm-nm.cpp