mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Pass the computed magic to createBinary and createObjectFile if available.
identify_magic is not free, so we should avoid calling it twice. The argument also makes it cheap for createBinary to just forward to createObjectFile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
#include "llvm/Object/Binary.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/FileSystem.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
@ -377,7 +378,9 @@ public:
|
||||
/// return true.
|
||||
/// @brief Create ObjectFile from path.
|
||||
static ErrorOr<ObjectFile *> createObjectFile(StringRef ObjectPath);
|
||||
static ErrorOr<ObjectFile *> createObjectFile(MemoryBuffer *Object);
|
||||
static ErrorOr<ObjectFile *>
|
||||
createObjectFile(MemoryBuffer *Object,
|
||||
sys::fs::file_magic Type = sys::fs::file_magic::unknown);
|
||||
|
||||
static inline bool classof(const Binary *v) {
|
||||
return v->isObject();
|
||||
|
Reference in New Issue
Block a user