LLVM 19.0.0git
Classes | Namespaces | Macros | Typedefs | Functions
InstrProfReader.cpp File Reference
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/ProfileSummary.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/ProfileData/MemProf.h"
#include "llvm/ProfileData/ProfileCommon.h"
#include "llvm/ProfileData/SymbolRemappingReader.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Support/VirtualFileSystem.h"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <memory>
#include <system_error>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  llvm::InstrProfReaderItaniumRemapper< HashTableImpl >
 A remapper that applies remappings based on a symbol remapping file. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define CHECK_LINE_END(Line)
 
#define READ_NUM(Str, Dst)
 
#define VP_READ_ADVANCE(Val)
 

Typedefs

using data_type = InstrProfLookupTrait::data_type
 
using offset_type = InstrProfLookupTrait::offset_type
 

Functions

static InstrProfKind getProfileKindFromVersion (uint64_t Version)
 
static Expected< std::unique_ptr< MemoryBuffer > > setupMemoryBuffer (const Twine &Filename, vfs::FileSystem &FS)
 
static Error initializeReader (InstrProfReader &Reader)
 
static Error readBinaryIdsInternal (const MemoryBuffer &DataBuffer, const uint64_t BinaryIdsSize, const uint8_t *BinaryIdsStart, std::vector< llvm::object::BuildID > &BinaryIds, const llvm::endianness Endian)
 Read a list of binary ids from a profile that consist of a.
 
static void printBinaryIdsInternal (raw_ostream &OS, std::vector< llvm::object::BuildID > &BinaryIds)
 

Macro Definition Documentation

◆ CHECK_LINE_END

#define CHECK_LINE_END (   Line)
Value:
if (Line.is_at_end()) \
return error(instrprof_error::truncated);
#define error(X)

◆ READ_NUM

#define READ_NUM (   Str,
  Dst 
)
Value:
if ((Str).getAsInteger(10, (Dst))) \
return error(instrprof_error::malformed);

◆ VP_READ_ADVANCE

#define VP_READ_ADVANCE (   Val)
Value:
CHECK_LINE_END(Line); \
uint32_t Val; \
READ_NUM((*Line), (Val)); \
Line++;
#define CHECK_LINE_END(Line)

Typedef Documentation

◆ data_type

Definition at line 871 of file InstrProfReader.cpp.

◆ offset_type

Definition at line 872 of file InstrProfReader.cpp.

Function Documentation

◆ getProfileKindFromVersion()

static InstrProfKind getProfileKindFromVersion ( uint64_t  Version)
static

◆ initializeReader()

static Error initializeReader ( InstrProfReader Reader)
static

◆ printBinaryIdsInternal()

static void printBinaryIdsInternal ( raw_ostream OS,
std::vector< llvm::object::BuildID > &  BinaryIds 
)
static

◆ readBinaryIdsInternal()

static Error readBinaryIdsInternal ( const MemoryBuffer DataBuffer,
const uint64_t  BinaryIdsSize,
const uint8_t *  BinaryIdsStart,
std::vector< llvm::object::BuildID > &  BinaryIds,
const llvm::endianness  Endian 
)
static

Read a list of binary ids from a profile that consist of a.

uint64_t binary id length b. uint8_t binary id data c. uint8_t padding (if necessary) This function is shared between raw and indexed profiles. Raw profiles are in host-endian format, and indexed profiles are in little-endian format. So, this function takes an argument indicating the associated endian format to read the binary ids correctly.

Definition at line 91 of file InstrProfReader.cpp.

References llvm::alignToPowerOf2(), End, Endian, llvm::MemoryBuffer::getBufferEnd(), llvm::little, and llvm::Error::success().

Referenced by llvm::IndexedInstrProfReader::readBinaryIds().

◆ setupMemoryBuffer()

static Expected< std::unique_ptr< MemoryBuffer > > setupMemoryBuffer ( const Twine Filename,
vfs::FileSystem FS 
)
static