1//===- llvm/BinaryFormat/Magic.h - File magic identification ----*- C++ -*-===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 9#ifndef LLVM_BINARYFORMAT_MAGIC_H 10#define LLVM_BINARYFORMAT_MAGIC_H 12#include <system_error> 18/// file_magic - An "enum class" enumeration of file types based on magic (the 19/// first N bytes of the file). 26elf,
///< ELF Unknown type 54pdb,
///< Windows PDB debug info file 68operatorImpl()
const{
return V; }
74/// Identify the type of a binary file based on how magical it is. 77/// Get and identify \a path's type based on its content. 79/// @param path Input path. 80/// @param result Set to the type of file, or file_magic::unknown. 81/// @returns errc::success if result has been successfully set, otherwise a 82/// platform-specific error_code. 83std::error_code
identify_magic(
const Twine &path, file_magic &result);
This is an optimization pass for GlobalISel generic memory operations.
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...
@ coff_import_library
COFF import library.
@ pdb
Windows PDB debug info file.
@ spirv_object
A binary SPIR-V file.
@ elf_relocatable
ELF Relocatable object file.
@ archive
ar style archive file
@ elf_shared_object
ELF dynamically linked shared lib.
@ goff_object
GOFF object file.
@ minidump
Windows minidump file.
@ macho_dynamically_linked_shared_lib
Mach-O dynlinked shared lib.
@ xcoff_object_64
64-bit XCOFF object file
@ elf_executable
ELF Executable image.
@ macho_dynamically_linked_shared_lib_stub
Mach-O Shared lib stub.
@ macho_preload_executable
Mach-O Preloaded Executable.
@ offload_bundle
Clang offload bundle file.
@ offload_bundle_compressed
Compressed clang offload bundle file.
@ macho_file_set
Mach-O file set binary.
@ dxcontainer_object
DirectX container file.
@ macho_kext_bundle
Mach-O kext bundle file.
@ pecoff_executable
PECOFF executable file.
@ offload_binary
LLVM offload object file.
@ macho_universal_binary
Mach-O universal binary.
@ macho_core
Mach-O Core File.
@ wasm_object
WebAssembly Object file.
@ xcoff_object_32
32-bit XCOFF object file
@ windows_resource
Windows compiled resource file (.res)
@ clang_ast
Clang PCH or PCM.
@ elf_core
ELF core image.
@ macho_object
Mach-O Object file.
@ coff_object
COFF object file.
@ macho_bundle
Mach-O Bundle file.
@ coff_cl_gl_object
Microsoft cl.exe's intermediate code file.
@ cuda_fatbinary
CUDA Fatbinary object file.
@ macho_executable
Mach-O Executable.
@ macho_dsym_companion
Mach-O dSYM companion file.
@ unknown
Unrecognized file.
@ macho_fixed_virtual_memory_shared_lib
Mach-O Shared Lib, FVM.
@ macho_dynamic_linker
The Mach-O dynamic linker.
@ tapi_file
Text-based Dynamic Library Stub file.