14 #ifndef LLVM_CLANG_LEX_PTHMANAGER_H
15 #define LLVM_CLANG_LEX_PTHMANAGER_H
21 #include "llvm/ADT/DenseMap.h"
22 #include "llvm/ADT/STLExtras.h"
23 #include "llvm/Support/Allocator.h"
24 #include "llvm/Support/OnDiskHashTable.h"
35 class DiagnosticsEngine;
36 class FileSystemStatCache;
49 std::unique_ptr<const llvm::MemoryBuffer> Buf;
52 llvm::BumpPtrAllocator Alloc;
56 std::unique_ptr<IdentifierInfo *[], llvm::FreeDeleter> PerIDCache;
60 std::unique_ptr<PTHFileLookup> FileLookup;
65 const unsigned char*
const IdDataTable;
69 std::unique_ptr<PTHStringIdLookup> StringIdLookup;
72 const unsigned NumIds;
80 const unsigned char*
const SpellingBase;
84 const char* OriginalSourceFile;
88 PTHManager(std::unique_ptr<const llvm::MemoryBuffer> buf,
89 std::unique_ptr<PTHFileLookup> fileLookup,
90 const unsigned char *idDataTable,
92 std::unique_ptr<PTHStringIdLookup> stringIdLookup,
unsigned numIds,
93 const unsigned char *spellingBase,
const char *originalSourceFile);
100 unsigned getSpellingAtPTHOffset(
unsigned PTHOffset,
const char*& Buffer);
108 return LazilyCreateIdentifierInfo(PersistentID);
110 IdentifierInfo* LazilyCreateIdentifierInfo(
unsigned PersistentID);
121 return OriginalSourceFile;
PTHLexer * CreateLexer(FileID FID)
static PTHManager * Create(StringRef file, DiagnosticsEngine &Diags)
Concrete class used by the front-end to report problems and issues.
std::unique_ptr< FileSystemStatCache > createStatCache()
const char * getOriginalSourceFile() const
Provides lookups to, and iteration over, IdentiferInfo objects.
Defines the clang::LangOptions interface.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
void setPreprocessor(Preprocessor *pp)
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Defines the Diagnostic-related interfaces.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.