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

56 E.FileOffset = Offs;

61 return E;

62 }

63};

64

65

67

69}

70

72 return E.FileOffset < Offset;

73}

74

76 return Offset < E.FileOffset;

77}

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.

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)