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)
commit4b9ae52ac1b936cefa2a9ec4b9b7db6a103182ca
tree5d8f0dd9bc326a94134766f94b8789629448578a
parentdc01ca18966e91793d8e7ca14be6dfc12a662f38
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.

llvm-svn: 213557
llvm/include/llvm/Object/Binary.h
llvm/lib/Object/Archive.cpp
llvm/lib/Object/Binary.cpp
llvm/tools/llvm-nm/llvm-nm.cpp