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;
std::unique_ptr< llvm::MemoryBuffer > Buffer
PTHLexer * CreateLexer(FileID FID)
CreateLexer - Return a PTHLexer that "lexes" the cached tokens for the specified file.
static PTHManager * Create(StringRef file, DiagnosticsEngine &Diags)
Create - This method creates PTHManager objects.
One of these records is kept for each identifier that is lexed.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
Concrete class used by the front-end to report problems and issues.
std::unique_ptr< FileSystemStatCache > createStatCache()
createStatCache - Returns a FileSystemStatCache object for use with FileManager objects.
const char * getOriginalSourceFile() const
getOriginalSourceFile - Return the full path to the original header file name that was used to genera...
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.