Go to the documentation of this file.
17 #if !defined(_MSC_VER) && !defined(__MINGW32__)
36 switch ((
unsigned char)
Magic[0]) {
42 if (
Magic.size() < MinSize)
95 bool Data2MSB =
Magic[5] == 2;
96 unsigned high = Data2MSB ? 16 : 17;
97 unsigned low = Data2MSB ? 17 : 16;
98 if (
Magic[high] == 0) {
138 if (
Magic[3] ==
char(0xCE))
142 if (
Magic.size() >= MinSize)
148 if (
Magic[0] ==
char(0xCE))
152 if (
Magic.size() >= MinSize)
194 if (
Magic[1] == 0x01)
200 if (
Magic[1] == 0x02)
209 if (
Magic.substr(off).startswith(
213 if (
Magic.startswith(
"Microsoft C/C++ MSF 7.00\r\n"))
244 return FileOrError.getError();
246 std::unique_ptr<MemoryBuffer> FileBuffer =
std::move(*FileOrError);
249 return std::error_code();
@ unknown
Unrecognized file.
This is an optimization pass for GlobalISel generic memory operations.
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...
@ cuda_fatbinary
CUDA Fatbinary object file.
@ elf_core
ELF core image.
@ pdb
Windows PDB debug info file.
#define offsetof(TYPE, MEMBER)
@ macho_dynamic_linker
The Mach-O dynamic linker.
@ elf_shared_object
ELF dynamically linked shared lib.
Merge contiguous icmps into a memcmp
@ goff_object
GOFF object file.
static bool startswith(StringRef Magic, const char(&S)[N])
@ minidump
Windows minidump file.
Note that only the low bits of effective_addr2 are used On bit we don t eliminate the computation of the top half of effective_addr2 because we don t have whole function selection dags On x86
static const char PEMagic[]
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
@ xcoff_object_64
64-bit XCOFF object file
@ macho_preload_executable
Mach-O Preloaded Executable.
@ macho_bundle
Mach-O Bundle file.
@ macho_core
Mach-O Core File.
@ macho_dsym_companion
Mach-O dSYM companion file.
@ dxcontainer_object
DirectX container file.
static const char WinResMagic[]
@ elf_relocatable
ELF Relocatable object file.
@ coff_import_library
COFF import library.
@ pecoff_executable
PECOFF executable file.
@ macho_universal_binary
Mach-O universal binary.
@ macho_dynamically_linked_shared_lib
Mach-O dynlinked shared lib.
@ macho_dynamically_linked_shared_lib_stub
Mach-O Shared lib stub.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
@ coff_object
COFF object file.
std::pair< llvm::MachO::Target, std::string > UUID
static const char BigObjMagic[]
StringRef - Represent a constant reference to a string, i.e.
static const char Magic[]
@ macho_kext_bundle
Mach-O kext bundle file.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
@ macho_fixed_virtual_memory_shared_lib
Mach-O Shared Lib, FVM.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
@ archive
ar style archive file
@ elf_executable
ELF Executable image.
uint32_t read32le(const void *P)
static const char ClGlObjMagic[]
@ wasm_object
WebAssembly Object file.
@ coff_cl_gl_object
Microsoft cl.exe's intermediate code file.
@ macho_executable
Mach-O Executable.
@ tapi_file
Text-based Dynamic Library Stub file.
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
@ windows_resource
Windows compiled resource file (.res)
@ macho_object
Mach-O Object file.
@ xcoff_object_32
32-bit XCOFF object file