diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
| commit | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (patch) | |
| tree | a764184c2fc9486979b074250b013a0937ee64e5 /include/clang/Serialization/ASTWriter.h | |
| parent | 798321d8eb5630cd4a8f490a4f25e32ef195fb07 (diff) | |
Notes
Diffstat (limited to 'include/clang/Serialization/ASTWriter.h')
| -rw-r--r-- | include/clang/Serialization/ASTWriter.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index 297ee22dfa68..decd07a00ed5 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -17,6 +17,7 @@ #include "clang/AST/ASTMutationListener.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclarationName.h" +#include "clang/Frontend/PCHContainerOperations.h" #include "clang/AST/TemplateBase.h" #include "clang/Sema/SemaConsumer.h" #include "clang/Serialization/ASTBitCodes.h" @@ -868,30 +869,28 @@ class PCHGenerator : public SemaConsumer { std::string OutputFile; clang::Module *Module; std::string isysroot; - raw_ostream *Out; Sema *SemaPtr; - SmallVector<char, 128> Buffer; + std::shared_ptr<PCHBuffer> Buffer; llvm::BitstreamWriter Stream; ASTWriter Writer; bool AllowASTWithErrors; - bool HasEmittedPCH; protected: ASTWriter &getWriter() { return Writer; } const ASTWriter &getWriter() const { return Writer; } + SmallVectorImpl<char> &getPCH() const { return Buffer->Data; } public: PCHGenerator(const Preprocessor &PP, StringRef OutputFile, - clang::Module *Module, - StringRef isysroot, raw_ostream *Out, + clang::Module *Module, StringRef isysroot, + std::shared_ptr<PCHBuffer> Buffer, bool AllowASTWithErrors = false); ~PCHGenerator() override; void InitializeSema(Sema &S) override { SemaPtr = &S; } void HandleTranslationUnit(ASTContext &Ctx) override; ASTMutationListener *GetASTMutationListener() override; ASTDeserializationListener *GetASTDeserializationListener() override; - - bool hasEmittedPCH() const { return HasEmittedPCH; } + bool hasEmittedPCH() const { return Buffer->IsComplete; } }; } // end namespace clang |
