14 #ifndef LLVM_CLANG_LEX_PTHMANAGER_H
15 #define LLVM_CLANG_LEX_PTHMANAGER_H
19 #include "llvm/ADT/STLExtras.h"
20 #include "llvm/Support/Allocator.h"
21 #include "llvm/Support/OnDiskHashTable.h"
32 class DiagnosticsEngine;
33 class FileSystemStatCache;
46 std::unique_ptr<const llvm::MemoryBuffer> Buf;
49 llvm::BumpPtrAllocator Alloc;
53 std::unique_ptr<IdentifierInfo *[], llvm::FreeDeleter> PerIDCache;
57 std::unique_ptr<PTHFileLookup> FileLookup;
62 const unsigned char*
const IdDataTable;
66 std::unique_ptr<PTHStringIdLookup> StringIdLookup;
69 const unsigned NumIds;
77 const unsigned char*
const SpellingBase;
81 const char* OriginalSourceFile;
85 PTHManager(std::unique_ptr<const llvm::MemoryBuffer> buf,
86 std::unique_ptr<PTHFileLookup> fileLookup,
87 const unsigned char *idDataTable,
89 std::unique_ptr<PTHStringIdLookup> stringIdLookup,
unsigned numIds,
90 const unsigned char *spellingBase,
const char *originalSourceFile);
97 unsigned getSpellingAtPTHOffset(
unsigned PTHOffset,
const char*&
Buffer);
105 return LazilyCreateIdentifierInfo(PersistentID);
107 IdentifierInfo* LazilyCreateIdentifierInfo(
unsigned PersistentID);
118 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.
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::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 clang::SourceLocation class and associated facilities.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.