#ifndef LLVM_BINARYFORMAT_MAGIC_H
#define LLVM_BINARYFORMAT_MAGIC_H
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include <system_error>
namespace llvm {
struct file_magic {
enum Impl {
unknown = 0, bitcode, archive, elf, elf_relocatable, elf_executable, elf_shared_object, elf_core, macho_object, macho_executable, macho_fixed_virtual_memory_shared_lib, macho_core, macho_preload_executable, macho_dynamically_linked_shared_lib, macho_dynamic_linker, macho_bundle, macho_dynamically_linked_shared_lib_stub, macho_dsym_companion, macho_kext_bundle, macho_universal_binary, minidump, coff_cl_gl_object, coff_object, coff_import_library, pecoff_executable, windows_resource, xcoff_object_32, xcoff_object_64, wasm_object, pdb, tapi_file, };
bool is_object() const { return V != unknown; }
file_magic() = default;
file_magic(Impl V) : V(V) {}
operator Impl() const { return V; }
private:
Impl V = unknown;
};
file_magic identify_magic(StringRef magic);
std::error_code identify_magic(const Twine &path, file_magic &result);
}
#endif