clang: include/clang/Lex/ExternalPreprocessorSource.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_LEX_EXTERNALPREPROCESSORSOURCE_H
14#define LLVM_CLANG_LEX_EXTERNALPREPROCESSORSOURCE_H
15
16#include
17#include
18
20
21class IdentifierInfo;
23
24
25
26
27
28
30public:
32
33
35
36
38
39
40
41
43
44
46};
47
48
49
51
52
53 mutable uint64_t Ptr = 0;
54
55public:
57
59 : Ptr(reinterpret_cast<uint64_t>(Ptr)) {}
60
62 assert((ID << 1 >> 1) == ID && "ID must require < 63 bits");
63 if (ID == 0)
64 Ptr = 0;
65 }
66
68 this->Ptr = reinterpret_cast<uint64_t>(Ptr);
69 return *this;
70 }
71
73 assert((ID << 1 >> 1) == ID && "IDs must require < 63 bits");
74 if (ID == 0)
75 Ptr = 0;
76 else
77 Ptr = (ID << 1) | 0x01;
78
79 return *this;
80 }
81
82
83
84
85 bool isValid() const { return Ptr != 0; }
86
87
88 bool isID() const { return Ptr & 0x01; }
89
91 assert(());
93 }
94
96 assert(isID());
97 return Ptr >> 1;
98 }
99};
100}
101
102#endif
Abstract interface for external sources of preprocessor information.
virtual ~ExternalPreprocessorSource()
virtual void updateOutOfDateIdentifier(const IdentifierInfo &II)=0
Update an out-of-date identifier.
virtual IdentifierInfo * GetIdentifier(uint64_t ID)=0
Return the identifier associated with the given ID number.
virtual void ReadDefinedMacros()=0
Read the set of macros defined by this external macro source.
virtual Module * getModule(unsigned ModuleID)=0
Map a module ID to a module.
One of these records is kept for each identifier that is lexed.
LazyIdentifierInfoPtr & operator=(uint64_t ID)
bool isValid() const
Whether this pointer is non-NULL.
IdentifierInfo * getPtr() const
LazyIdentifierInfoPtr & operator=(const IdentifierInfo *Ptr)
LazyIdentifierInfoPtr(uint64_t ID)
LazyIdentifierInfoPtr()=default
bool isID() const
Whether this pointer is currently stored as ID.
LazyIdentifierInfoPtr(const IdentifierInfo *Ptr)
Describes a module or submodule.
The JSON file list parser is used to communicate input to InstallAPI.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...