From 437b0d588703adbfb01e7c77ec8f40d85ddd573b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 31 Jul 2014 03:12:45 +0000 Subject: Use std::unique_ptr to make the ownership explicit. llvm-svn: 214377 --- llvm/lib/Object/Binary.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Object/Binary.cpp') 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 object::createBinary(std::unique_ptr Buffer, - LLVMContext *Context) { +ErrorOr> +object::createBinary(std::unique_ptr Buffer, + LLVMContext *Context) { sys::fs::file_magic Type = sys::fs::identify_magic(Buffer->getBuffer()); switch (Type) { @@ -74,7 +75,7 @@ ErrorOr object::createBinary(std::unique_ptr Buffer, llvm_unreachable("Unexpected Binary File Type"); } -ErrorOr object::createBinary(StringRef Path) { +ErrorOr> object::createBinary(StringRef Path) { ErrorOr> FileOrErr = MemoryBuffer::getFileOrSTDIN(Path); if (std::error_code EC = FileOrErr.getError()) -- cgit v1.2.3