clang: include/clang/Lex/HeaderMap.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_LEX_HEADERMAP_H
14#define LLVM_CLANG_LEX_HEADERMAP_H
15
19#include "llvm/ADT/StringMap.h"
20#include "llvm/Support/Compiler.h"
21#include "llvm/Support/MemoryBuffer.h"
22#include
23#include
24
26
27struct HMapBucket;
28struct HMapHeader;
29
30
32 std::unique_ptr FileBuffer;
33 bool NeedsBSwap;
34 mutable llvm::StringMap ReverseMap;
35
36public:
37 HeaderMapImpl(std::unique_ptr File, bool NeedsBSwap)
38 : FileBuffer(std::move(File)), NeedsBSwap(NeedsBSwap) {}
39
40
41 static bool checkHeader(const llvm::MemoryBuffer &File, bool &NeedsByteSwap);
42
43
44 template void forEachKey(Func Callback) const {
46 unsigned NumBuckets = getEndianAdjustedWord(Hdr.NumBuckets);
47
48 for (unsigned Bucket = 0; Bucket < NumBuckets; ++Bucket) {
51 if (std::optional Key = getString(B.Key))
52 Callback(*Key);
53 }
54 }
55
56
57
60
61
63
64
65 void dump() const;
66
67
69
70private:
71 unsigned getEndianAdjustedWord(unsigned X) const;
73 HMapBucket getBucket(unsigned BucketNo) const;
74
75
76
77 std::optional getString(unsigned StrTabIdx) const;
78};
79
80
81
82
83
85 HeaderMap(std::unique_ptr File, bool BSwap)
87
88public:
89
90
92
98};
99
100}
101
102#endif
Defines the clang::FileManager interface and associated types.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
Implements support for file system lookup, file system caching, and directory search management.
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...