Go to the documentation of this file.
19 #include "llvm/Bitstream/BitstreamWriter.h"
21 using namespace clang;
25 StringRef OutputFile, StringRef isysroot, std::shared_ptr<PCHBuffer> Buffer,
26 ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions,
27 bool AllowASTWithErrors,
bool IncludeTimestamps,
28 bool ShouldCacheASTInMemory)
29 : PP(PP), OutputFile(OutputFile), isysroot(isysroot.str()),
30 SemaPtr(nullptr), Buffer(
std::move(Buffer)), Stream(this->Buffer->Data),
31 Writer(Stream, this->Buffer->Data, ModuleCache, Extensions,
33 AllowASTWithErrors(AllowASTWithErrors),
34 ShouldCacheASTInMemory(ShouldCacheASTInMemory) {
35 this->Buffer->IsComplete =
false;
47 if (hasErrors && !AllowASTWithErrors)
55 assert(hasErrors &&
"emitting module but current module doesn't exist");
62 if (AllowASTWithErrors)
66 assert(SemaPtr &&
"No Sema?");
72 ShouldCacheASTInMemory);
74 Buffer->IsComplete =
true;
std::string CurrentModule
The name of the current module, of which the main source file is a part.
bool isCompilingModule() const
Are we compiling a module interface (.cppm or module map)?
bool hasUncompilableErrorOccurred() const
Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror.
const LangOptions & getLangOpts() const
Describes a module or submodule.
PCHGenerator(const Preprocessor &PP, InMemoryModuleCache &ModuleCache, StringRef OutputFile, StringRef isysroot, std::shared_ptr< PCHBuffer > Buffer, ArrayRef< std::shared_ptr< ModuleFileExtension >> Extensions, bool AllowASTWithErrors=false, bool IncludeTimestamps=true, bool ShouldCacheASTInMemory=false)
bool hasErrorOccurred() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
DiagnosticConsumer * getClient()
ASTMutationListener * GetASTMutationListener() override
If the consumer is interested in entities getting modified after their initial creation,...
void HandleTranslationUnit(ASTContext &Ctx) override
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been par...
ASTDeserializationListener * GetASTDeserializationListener() override
If the consumer is interested in entities being deserialized from AST files, it should return a point...
ASTFileSignature WriteAST(Sema &SemaRef, const std::string &OutputFile, Module *WritingModule, StringRef isysroot, bool hasErrors=false, bool ShouldCacheASTInMemory=false)
Write a precompiled header for the given semantic analysis.
ModuleLoader & getModuleLoader() const
Retrieve the module loader associated with this preprocessor.
Dataflow Directional Tag Classes.
DiagnosticsEngine & getDiagnostics() const
In-memory cache for modules.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
HeaderSearch & getHeaderSearchInfo() const