14#ifndef LLVM_CLANG_BASIC_SOURCEMANAGERINTERNALS_H
15#define LLVM_CLANG_BASIC_SOURCEMANAGERINTERNALS_H
19#include "llvm/ADT/StringMap.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/Allocator.h"
72 return E.FileOffset < Offset;
76 return Offset <
E.FileOffset;
87 llvm::StringMap<unsigned, llvm::BumpPtrAllocator> FilenameIDs;
88 std::vector<llvm::StringMapEntry<unsigned>*> FilenamesByID;
92 std::map<FileID, std::vector<LineEntry>> LineEntries;
97 FilenamesByID.clear();
104 assert(
ID < FilenamesByID.size() &&
"Invalid FilenameID");
105 return FilenamesByID[
ID]->getKey();
111 unsigned LineNo,
int FilenameID,
Defines the clang::SourceLocation class and associated facilities.
Defines the SourceManager interface.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Used to hold and unique data used to represent #line information.
StringRef getFilename(unsigned ID) const
const LineEntry * FindNearestLineEntry(FileID FID, unsigned Offset)
Find the line entry nearest to FID that is before it.
std::map< FileID, std::vector< LineEntry > >::iterator iterator
unsigned getLineTableFilenameID(StringRef Str)
void AddEntry(FileID FID, const std::vector< LineEntry > &Entries)
Add a new line entry that has already been encoded into the internal representation of the line table...
unsigned getNumFilenames() const
void AddLineNote(FileID FID, unsigned Offset, unsigned LineNo, int FilenameID, unsigned EntryExit, SrcMgr::CharacteristicKind FileKind)
Add a line note to the line table that indicates that there is a #line or GNU line marker at the spec...
CharacteristicKind
Indicates whether a file or directory holds normal user code, system code, or system code which is im...
The JSON file list parser is used to communicate input to InstallAPI.
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
int FilenameID
The ID of the filename identified by this line entry: #line 4 "foo.c".
SrcMgr::CharacteristicKind FileKind
Set the 0 if no flags, 1 if a system header,.
unsigned FileOffset
The offset in this file that the line entry occurs at.
unsigned IncludeOffset
The offset of the virtual include stack location, which is manipulated by GNU linemarker directives.
unsigned LineNo
The presumed line number of this line entry: #line 4.
static LineEntry get(unsigned Offs, unsigned Line, int Filename, SrcMgr::CharacteristicKind FileKind, unsigned IncludeOffset)