LLVM  14.0.0git
Macros | Functions
COFFObjectFile.cpp File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include <algorithm>
#include <cassert>
#include <cinttypes>
#include <cstddef>
#include <cstring>
#include <limits>
#include <memory>
#include <system_error>
Include dependency graph for COFFObjectFile.cpp:

Go to the source code of this file.

Macros

#define LLVM_COFF_SWITCH_RELOC_TYPE_NAME(reloc_type)
 
#define RETURN_IF_ERROR(Expr)
 

Functions

static bool checkSize (MemoryBufferRef M, std::error_code &EC, uint64_t Size)
 
template<typename T >
static Error getObject (const T *&Obj, MemoryBufferRef M, const void *Ptr, const uint64_t Size=sizeof(T))
 
static bool decodeBase64StringEntry (StringRef Str, uint32_t &Result)
 
static uint32_t getNumberOfRelocations (const coff_section *Sec, MemoryBufferRef M, const uint8_t *base)
 
static const coff_relocation * getFirstReloc (const coff_section *Sec, MemoryBufferRef M, const uint8_t *Base)
 
static imported_symbol_iterator makeImportedSymbolIterator (const COFFObjectFile *Object, uintptr_t Ptr, int Index)
 
static imported_symbol_iterator importedSymbolBegin (uint32_t RVA, const COFFObjectFile *Object)
 
static imported_symbol_iterator importedSymbolEnd (uint32_t RVA, const COFFObjectFile *Object)
 

Macro Definition Documentation

◆ LLVM_COFF_SWITCH_RELOC_TYPE_NAME

#define LLVM_COFF_SWITCH_RELOC_TYPE_NAME (   reloc_type)
Value:
case COFF::reloc_type: \
return #reloc_type;

Definition at line 1210 of file COFFObjectFile.cpp.

◆ RETURN_IF_ERROR

#define RETURN_IF_ERROR (   Expr)
Value:
do { \
Error E = (Expr); \
if (E) \
return std::move(E); \
} while (0)

Definition at line 1693 of file COFFObjectFile.cpp.

Function Documentation

◆ checkSize()

static bool checkSize ( MemoryBufferRef  M,
std::error_code &  EC,
uint64_t  Size 
)
static

Definition at line 47 of file COFFObjectFile.cpp.

References M, llvm::Check::Size, and llvm::object::unexpected_eof.

◆ decodeBase64StringEntry()

static bool decodeBase64StringEntry ( StringRef  Str,
uint32_t Result 
)
static

Definition at line 69 of file COFFObjectFile.cpp.

References assert(), and llvm::max().

Referenced by llvm::object::COFFObjectFile::getSectionName().

◆ getFirstReloc()

static const coff_relocation* getFirstReloc ( const coff_section *  Sec,
MemoryBufferRef  M,
const uint8_t *  Base 
)
static

◆ getNumberOfRelocations()

static uint32_t getNumberOfRelocations ( const coff_section *  Sec,
MemoryBufferRef  M,
const uint8_t *  base 
)
static

◆ getObject()

template<typename T >
static Error getObject ( const T *&  Obj,
MemoryBufferRef  M,
const void *  Ptr,
const uint64_t  Size = sizeof(T) 
)
static

◆ importedSymbolBegin()

static imported_symbol_iterator importedSymbolBegin ( uint32_t  RVA,
const COFFObjectFile *  Object 
)
static

◆ importedSymbolEnd()

static imported_symbol_iterator importedSymbolEnd ( uint32_t  RVA,
const COFFObjectFile *  Object 
)
static

◆ makeImportedSymbolIterator()

static imported_symbol_iterator makeImportedSymbolIterator ( const COFFObjectFile *  Object,
uintptr_t  Ptr,
int  Index 
)
static

Definition at line 1346 of file COFFObjectFile.cpp.

References Index, llvm::Object, and P.

Referenced by importedSymbolBegin().

E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
move
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
Definition: README.txt:546