21 #include "llvm/Bitcode/BitstreamWriter.h"
24 using namespace clang;
29 std::shared_ptr<PCHBuffer>
Buffer,
31 bool AllowASTWithErrors,
bool IncludeTimestamps)
32 : PP(PP), OutputFile(OutputFile), Module(Module), isysroot(isysroot.str()),
33 SemaPtr(nullptr), Buffer(Buffer), Stream(Buffer->Data),
34 Writer(Stream, Extensions, IncludeTimestamps),
35 AllowASTWithErrors(AllowASTWithErrors) {
36 Buffer->IsComplete =
false;
48 if (hasErrors && !AllowASTWithErrors)
52 assert(SemaPtr &&
"No Sema?");
59 Buffer->IsComplete =
true;
Defines the clang::ASTContext interface.
Defines the clang::FileManager interface and associated types.
bool hasErrorOccurred() const
std::unique_ptr< llvm::MemoryBuffer > Buffer
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
void HandleTranslationUnit(ASTContext &Ctx) override
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been par...
Describes a module or submodule.
PCHGenerator(const Preprocessor &PP, StringRef OutputFile, clang::Module *Module, StringRef isysroot, std::shared_ptr< PCHBuffer > Buffer, ArrayRef< llvm::IntrusiveRefCntPtr< ModuleFileExtension >> Extensions, bool AllowASTWithErrors=false, bool IncludeTimestamps=true)
ASTDeserializationListener * GetASTDeserializationListener() override
If the consumer is interested in entities being deserialized from AST files, it should return a point...
Defines the clang::Preprocessor interface.
ModuleLoader & getModuleLoader() const
Retrieve the module loader associated with this preprocessor.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
DiagnosticsEngine & getDiagnostics() const
ASTMutationListener * GetASTMutationListener() override
If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here.
uint64_t WriteAST(Sema &SemaRef, const std::string &OutputFile, Module *WritingModule, StringRef isysroot, bool hasErrors=false)
Write a precompiled header for the given semantic analysis.
bool hasUncompilableErrorOccurred() const
Errors that actually prevent compilation, not those that are upgraded from a warning by -Werror...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.