clang: include/clang/Basic/SourceManagerInternals.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_CLANG_BASIC_SOURCEMANAGERINTERNALS_H

15#define LLVM_CLANG_BASIC_SOURCEMANAGERINTERNALS_H

16

19#include "llvm/ADT/StringMap.h"

20#include "llvm/ADT/StringRef.h"

21#include "llvm/Support/Allocator.h"

22#include

23#include

24#include

25

27

28

29

30

31

33

35

36

38

39

40

42

43

45

46

47

48

49

51

63};

64

65

70

74

78

79

81

82

83

84

85

86

87 llvm::StringMap<unsigned, llvm::BumpPtrAllocator> FilenameIDs;

88 std::vector<llvm::StringMapEntry*> FilenamesByID;

89

90

91

92 std::map<FileID, std::vector> LineEntries;

93

94public:

96 FilenameIDs.clear();

97 FilenamesByID.clear();

98 LineEntries.clear();

99 }

100

102

104 assert(ID < FilenamesByID.size() && "Invalid FilenameID");

105 return FilenamesByID[ID]->getKey();

106 }

107

109

111 unsigned LineNo, int FilenameID,

113

114

115

116

117

119

120

122

125

126

127

128 void AddEntry(FileID FID, const std::vector &Entries);

129};

130

131}

132

133#endif

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.

Definition SourceManagerInternals.h:80

StringRef getFilename(unsigned ID) const

Definition SourceManagerInternals.h:103

const LineEntry * FindNearestLineEntry(FileID FID, unsigned Offset)

Find the line entry nearest to FID that is before it.

void clear()

Definition SourceManagerInternals.h:95

unsigned getLineTableFilenameID(StringRef Str)

iterator end()

Definition SourceManagerInternals.h:124

std::map< FileID, std::vector< LineEntry > >::iterator iterator

Definition SourceManagerInternals.h:121

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

Definition SourceManagerInternals.h:108

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...

iterator begin()

Definition SourceManagerInternals.h:123

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.

Definition SourceManagerInternals.h:32

int FilenameID

The ID of the filename identified by this line entry: #line 4 "foo.c".

Definition SourceManagerInternals.h:41

SrcMgr::CharacteristicKind FileKind

Set the 0 if no flags, 1 if a system header,.

Definition SourceManagerInternals.h:44

unsigned FileOffset

The offset in this file that the line entry occurs at.

Definition SourceManagerInternals.h:34

unsigned IncludeOffset

The offset of the virtual include stack location, which is manipulated by GNU linemarker directives.

Definition SourceManagerInternals.h:50

unsigned LineNo

The presumed line number of this line entry: #line 4.

Definition SourceManagerInternals.h:37

static LineEntry get(unsigned Offs, unsigned Line, int Filename, SrcMgr::CharacteristicKind FileKind, unsigned IncludeOffset)

Definition SourceManagerInternals.h:52