clang: include/clang/Lex/ModuleLoader.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_CLANG_LEX_MODULELOADER_H

15#define LLVM_CLANG_LEX_MODULELOADER_H

16

21#include "llvm/ADT/ArrayRef.h"

22#include "llvm/ADT/PointerIntPair.h"

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

24#include

25

27

30

31

32

34

35

37public:

39

41

42

43

44

46

47

49 };

50 llvm::PointerIntPair<Module *, 2, LoadResultKind> Storage;

51

56

57 operator bool() const {

59 }

60

61 operator Module *() const { return Storage.getPointer(); }

62

63

64

66

67

68

69

70

72

73

74

76};

77

78

79

80

81

82

84

85 bool BuildingModule;

86

87public:

89 : BuildingModule(BuildingModule) {}

90

92

93

95 return BuildingModule;

96 }

97

98

100 BuildingModule = BuildingModuleFlag;

101 }

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

126 bool IsInclusionDirective) = 0;

127

128

129

130

131

132

133

134

136 StringRef Source) = 0;

137

138

142

143

144

145

146

147

148

149

150

151

152

155

156

157

158

159

162

164};

165

166

168public:

171 bool IsInclusionDirective) override {

172 return {};

173 }

174

176 StringRef Source) override {}

177

180

182 return nullptr;

183 }

184

189};

190

191}

192

193#endif

Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.

Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.

Defines the clang::Module class, which describes a module in the source code.

Defines the clang::SourceLocation class and associated facilities.

A global index for a set of module files, providing information about the identifiers within those mo...

One of these records is kept for each identifier that is lexed.

Describes the result of attempting to load a module.

Definition ModuleLoader.h:36

bool isNormal() const

Determines whether this is a normal return, whether or not loading the module was successful.

Definition ModuleLoader.h:65

ModuleLoadResult(Module *M)

Definition ModuleLoader.h:53

ModuleLoadResult(LoadResultKind Kind)

Definition ModuleLoader.h:54

bool isMissingExpected() const

Determines whether the module, which failed to load, was actually a submodule that we expected to see...

Definition ModuleLoader.h:71

llvm::PointerIntPair< Module *, 2, LoadResultKind > Storage

Definition ModuleLoader.h:50

bool isConfigMismatch() const

Determines whether the module failed to load due to a configuration mismatch with an explicitly-named...

Definition ModuleLoader.h:75

ModuleLoadResult()=default

LoadResultKind

Definition ModuleLoader.h:38

@ ConfigMismatch

Definition ModuleLoader.h:48

@ MissingExpected

Definition ModuleLoader.h:45

@ Normal

Definition ModuleLoader.h:40

ModuleLoadResult(Module *M, LoadResultKind Kind)

Definition ModuleLoader.h:55

bool buildingModule() const

Returns true if this instance is building a module.

Definition ModuleLoader.h:94

bool HadFatalFailure

Definition ModuleLoader.h:163

virtual GlobalModuleIndex * loadGlobalModuleIndex(SourceLocation TriggerLoc)=0

Load, create, or return global module.

virtual ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective)=0

Attempt to load the given module.

virtual bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc)=0

Check global module index for missing imports.

virtual void createModuleFromSource(SourceLocation Loc, StringRef ModuleName, StringRef Source)=0

Attempt to create the given module from the specified source buffer.

virtual void makeModuleVisible(Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc)=0

Make the given module visible.

void setBuildingModule(bool BuildingModuleFlag)

Flag indicating whether this instance is building a module.

Definition ModuleLoader.h:99

ModuleLoader(bool BuildingModule=false)

Definition ModuleLoader.h:88

Describes a module or submodule.

NameVisibilityKind

Describes the visibility of the various names within a particular module.

Encodes a location in the source.

A module loader that doesn't know how to create or load modules.

Definition ModuleLoader.h:167

ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective) override

Attempt to load the given module.

Definition ModuleLoader.h:169

bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc) override

Check global module index for missing imports.

Definition ModuleLoader.h:185

GlobalModuleIndex * loadGlobalModuleIndex(SourceLocation TriggerLoc) override

Load, create, or return global module.

Definition ModuleLoader.h:181

void makeModuleVisible(Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc) override

Make the given module visible.

Definition ModuleLoader.h:178

void createModuleFromSource(SourceLocation ImportLoc, StringRef ModuleName, StringRef Source) override

Attempt to create the given module from the specified source buffer.

Definition ModuleLoader.h:175

The JSON file list parser is used to communicate input to InstallAPI.

ArrayRef< IdentifierLoc > ModuleIdPath

A sequence of identifier/location pairs used to describe a particular module or submodule,...

Definition ModuleLoader.h:33

nullptr

This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...

Visibility

Describes the different kinds of visibility that a declaration may have.