struct SourceMgr::SrcBuffer

Declaration

struct SourceMgr::SrcBuffer { /* full declaration omitted */ };

Declared at: llvm/include/llvm/Support/SourceMgr.h:56

Member Variables

public std::unique_ptr<MemoryBuffer> Buffer
The memory buffer for the file.
public llvm::SourceMgr::SrcBuffer::VariableSizeOffsets OffsetCache
Vector of offsets into Buffer at which there are line-endings (lazily populated). Once populated, the '\n' that marks the end of line number N from [1..] is at Buffer[OffsetCache[N-1]]. Since these offsets are in sorted (ascending) order, they can be binary-searched for the first one after any given offset (eg. an offset corresponding to a particular SMLoc).
public llvm::SMLoc IncludeLoc
This is the location of the parent include, or null if at the top level.

Method Overview

Methods

SrcBuffer()

Declared at: llvm/include/llvm/Support/SourceMgr.h:87

SrcBuffer(llvm::SourceMgr::SrcBuffer&&)

Declared at: llvm/include/llvm/Support/SourceMgr.h:88

Parameters

llvm::SourceMgr::SrcBuffer&&

SrcBuffer(const llvm::SourceMgr::SrcBuffer&)

Declared at: llvm/include/llvm/Support/SourceMgr.h:89

Parameters

const llvm::SourceMgr::SrcBuffer&

template <typename T>
unsigned int getLineNumber(const char* Ptr) const

Description

Populate \c OffsetCache and look up a given \p Ptr in it, assuming it points somewhere into \c Buffer. The static type parameter \p T must be an unsigned integer type from uint{8,16,32,64}_t large enough to store offsets inside \c Buffer.

Declared at: llvm/include/llvm/Support/SourceMgr.h:82

Templates

T

Parameters

const char* Ptr

~SrcBuffer()

Declared at: llvm/include/llvm/Support/SourceMgr.h:91