clang: lib/CodeGen/MacroPPCallbacks.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_CLANG_LIB_CODEGEN_MACROPPCALLBACKS_H

14#define LLVM_CLANG_LIB_CODEGEN_MACROPPCALLBACKS_H

15

17

18namespace llvm {

19class DIMacroFile;

20}

25

27

29

30

32

33

35

36

37

38 int EnteredCommandLineIncludeFiles = 0;

39

40 enum FileScopeStatus {

41 NoScope = 0,

42 InitializedScope,

43 BuiltinScope,

44 CommandLineIncludeScope,

45 MainFileScope

46 };

47 FileScopeStatus Status;

48

49

50

52

53

54

55 llvm::DIMacroFile *getCurrentScope();

56

57

58

59

60

62

63

64

65

66

67

68

69

70

71

72 static void writeMacroDefinition(const IdentifierInfo &II,

74 raw_ostream &Name, raw_ostream &Value);

75

76

77 void updateStatusToNextScope();

78

79

80

81

83

84

85

86

88

89public:

91

92

93

94

95

99

100

102 StringRef FileName, bool IsAngled,

105 StringRef RelativePath, const Module *SuggestedModule,

106 bool ModuleImported,

108

109

112

113

114

115

118};

119

120}

121

122#endif

llvm::MachO::FileType FileType

Defines the PPCallbacks interface.

Represents a character-granular source range.

The primary public interface to the Clang code generator.

An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...

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

A description of the current definition of a macro.

Encapsulates changes to the "macros namespace" (the location where the macro name became active,...

Encapsulates the data about a macro definition (e.g.

void MacroUndefined(const Token &MacroNameTok, const MacroDefinition &MD, const MacroDirective *Undef) override

Hook called whenever a macro #undef is seen.

void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File, StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule, bool ModuleImported, SrcMgr::CharacteristicKind FileType) override

Callback invoked whenever a directive (xxx) is processed.

void MacroDefined(const Token &MacroNameTok, const MacroDirective *MD) override

Hook called whenever a macro definition is seen.

void FileChanged(SourceLocation Loc, FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID=FileID()) override

Callback invoked whenever a source file is entered or exited.

MacroPPCallbacks(CodeGenerator *Gen, Preprocessor &PP)

Describes a module or submodule.

This interface provides a way to observe the actions of the preprocessor as it does its thing.

Engages in a tight little dance with the lexer to efficiently preprocess tokens.

Encodes a location in the source.

Token - This structure provides full information about a lexed token.

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.

CustomizableOptional< FileEntryRef > OptionalFileEntryRef

Diagnostic wrappers for TextAPI types for error reporting.