diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-07-31 03:12:45 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-07-31 03:12:45 +0000 |
commit | 437b0d588703adbfb01e7c77ec8f40d85ddd573b (patch) | |
tree | f7e01d94b89564ba63da611328bf9fd32f0465a8 /llvm/lib/Object/Binary.cpp | |
parent | db9552f4a4ca7cd8edf786037b2db948dfac1b1e (diff) | |
download | bcm5719-llvm-437b0d588703adbfb01e7c77ec8f40d85ddd573b.tar.gz bcm5719-llvm-437b0d588703adbfb01e7c77ec8f40d85ddd573b.zip |
Use std::unique_ptr to make the ownership explicit.
llvm-svn: 214377
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r-- | llvm/lib/Object/Binary.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp index 552d5db89c5..89e9d732ce9 100644 --- a/llvm/lib/Object/Binary.cpp +++ b/llvm/lib/Object/Binary.cpp @@ -38,8 +38,9 @@ StringRef Binary::getFileName() const { return Data->getBufferIdentifier(); } -ErrorOr<Binary *> object::createBinary(std::unique_ptr<MemoryBuffer> Buffer, - LLVMContext *Context) { +ErrorOr<std::unique_ptr<Binary>> +object::createBinary(std::unique_ptr<MemoryBuffer> Buffer, + LLVMContext *Context) { sys::fs::file_magic Type = sys::fs::identify_magic(Buffer->getBuffer()); switch (Type) { @@ -74,7 +75,7 @@ ErrorOr<Binary *> object::createBinary(std::unique_ptr<MemoryBuffer> Buffer, llvm_unreachable("Unexpected Binary File Type"); } -ErrorOr<Binary *> object::createBinary(StringRef Path) { +ErrorOr<std::unique_ptr<Binary>> object::createBinary(StringRef Path) { ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr = MemoryBuffer::getFileOrSTDIN(Path); if (std::error_code EC = FileOrErr.getError()) |