class LineTableInfo

Declaration

class LineTableInfo { /* full declaration omitted */ };

Description

Used to hold and unique data used to represent # line information.

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:80

Member Variables

private llvm::StringMap<unsigned int, llvm::BumpPtrAllocator> FilenameIDs
This allows us to unique the filenames that frequently reoccur and reference them with indices. FilenameIDs holds the mapping from string -> ID, and FilenamesByID holds the mapping of ID to string.
private std::vector<llvm::StringMapEntry<unsigned int>*> FilenamesByID
private std::map<FileID, std::vector<LineEntry>> LineEntries
Map from FileIDs to a list of line entries (sorted by the offset at which they occur in the file).

Method Overview

  • public void AddEntry(clang::FileID FID, const std::vector<LineEntry> & Entries)
  • public void AddLineNote(clang::FileID FID, unsigned int Offset, unsigned int LineNo, int FilenameID, unsigned int EntryExit, SrcMgr::CharacteristicKind FileKind)
  • public const clang::LineEntry * FindNearestLineEntry(clang::FileID FID, unsigned int Offset)
  • public clang::LineTableInfo::iterator begin()
  • public void clear()
  • public clang::LineTableInfo::iterator end()
  • public llvm::StringRef getFilename(unsigned int ID) const
  • public unsigned int getLineTableFilenameID(llvm::StringRef Str)
  • public unsigned int getNumFilenames() const

Methods

void AddEntry(
    clang::FileID FID,
    const std::vector<LineEntry>& Entries)

Description

Add a new line entry that has already been encoded into the internal representation of the line table.

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:128

Parameters

clang::FileID FID
const std::vector<LineEntry>& Entries

void AddLineNote(
    clang::FileID FID,
    unsigned int Offset,
    unsigned int LineNo,
    int FilenameID,
    unsigned int EntryExit,
    SrcMgr::CharacteristicKind FileKind)

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:110

Parameters

clang::FileID FID
unsigned int Offset
unsigned int LineNo
int FilenameID
unsigned int EntryExit
SrcMgr::CharacteristicKind FileKind

const clang::LineEntry* FindNearestLineEntry(
    clang::FileID FID,
    unsigned int Offset)

Description

Find the line entry nearest to FID that is before it. If there is no line entry before \p Offset in \p FID, returns null.

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:118

Parameters

clang::FileID FID
unsigned int Offset

clang::LineTableInfo::iterator begin()

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:123

void clear()

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:95

clang::LineTableInfo::iterator end()

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:124

llvm::StringRef getFilename(unsigned int ID) const

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:103

Parameters

unsigned int ID

unsigned int getLineTableFilenameID(
    llvm::StringRef Str)

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:101

Parameters

llvm::StringRef Str

unsigned int getNumFilenames() const

Declared at: clang/include/clang/Basic/SourceManagerInternals.h:108