mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Make createObjectFile's signature a bit less error prone.
This will be better with c++11, but right now file_magic converts to bool, which makes the api really easy to misuse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200357 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -378,9 +378,13 @@ public:
|
||||
/// return true.
|
||||
/// @brief Create ObjectFile from path.
|
||||
static ErrorOr<ObjectFile *> createObjectFile(StringRef ObjectPath);
|
||||
static ErrorOr<ObjectFile *>
|
||||
createObjectFile(MemoryBuffer *Object, bool BufferOwned = true,
|
||||
sys::fs::file_magic Type = sys::fs::file_magic::unknown);
|
||||
static ErrorOr<ObjectFile *> createObjectFile(MemoryBuffer *Object,
|
||||
bool BufferOwned,
|
||||
sys::fs::file_magic Type);
|
||||
static ErrorOr<ObjectFile *> createObjectFile(MemoryBuffer *Object) {
|
||||
return createObjectFile(Object, true, sys::fs::file_magic::unknown);
|
||||
}
|
||||
|
||||
|
||||
static inline bool classof(const Binary *v) {
|
||||
return v->isObject();
|
||||
|
Reference in New Issue
Block a user