mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Return an ErrorOr<Binary *> from createBinary.
I did write a version returning ErrorOr<OwningPtr<Binary> >, but it is too cumbersome to use without std::move. I will keep the patch locally and submit when we switch to c++11. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199326 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
#ifndef LLVM_OBJECT_BINARY_H
|
||||
#define LLVM_OBJECT_BINARY_H
|
||||
|
||||
#include "llvm/ADT/OwningPtr.h"
|
||||
#include "llvm/Object/Error.h"
|
||||
#include "llvm/Support/ErrorOr.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -113,13 +113,11 @@ public:
|
||||
/// @brief Create a Binary from Source, autodetecting the file type.
|
||||
///
|
||||
/// @param Source The data to create the Binary from. Ownership is transferred
|
||||
/// to Result if successful. If an error is returned, Source is destroyed
|
||||
/// by createBinary before returning.
|
||||
/// @param Result A pointer to the resulting Binary if no error occured.
|
||||
error_code createBinary(MemoryBuffer *Source, OwningPtr<Binary> &Result);
|
||||
|
||||
error_code createBinary(StringRef Path, OwningPtr<Binary> &Result);
|
||||
/// to the Binary if successful. If an error is returned,
|
||||
/// Source is destroyed by createBinary before returning.
|
||||
ErrorOr<Binary *> createBinary(MemoryBuffer *Source);
|
||||
|
||||
ErrorOr<Binary *> createBinary(StringRef Path);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user