Pass the computed magic to createBinary and createObjectFile if available.
[oota-llvm.git] / include / llvm / Object / ObjectFile.h
index 4aa1e06676360fa53cae34d1817e798941c6e1c2..77833cbf94071a2da619e4455e423f5ab70515d8 100644 (file)
@@ -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();