diff options
Diffstat (limited to 'include/clang/Serialization/ASTWriter.h')
-rw-r--r-- | include/clang/Serialization/ASTWriter.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index 11af30ac83..3e287d9657 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -1,9 +1,8 @@ //===- ASTWriter.h - AST File Writer ----------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -75,8 +74,8 @@ class IdentifierResolver; class LangOptions; class MacroDefinitionRecord; class MacroInfo; -class MemoryBufferCache; class Module; +class InMemoryModuleCache; class ModuleFileExtension; class ModuleFileExtensionWriter; class NamedDecl; @@ -133,7 +132,7 @@ private: const SmallVectorImpl<char> &Buffer; /// The PCM manager which manages memory buffers for pcm files. - MemoryBufferCache &PCMCache; + InMemoryModuleCache &ModuleCache; /// The ASTContext we're writing. ASTContext *Context = nullptr; @@ -543,7 +542,7 @@ public: /// Create a new precompiled header writer that outputs to /// the given bitstream. ASTWriter(llvm::BitstreamWriter &Stream, SmallVectorImpl<char> &Buffer, - MemoryBufferCache &PCMCache, + InMemoryModuleCache &ModuleCache, ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions, bool IncludeTimestamps = true); ~ASTWriter() override; @@ -571,7 +570,8 @@ public: /// the module but currently is merely a random 32-bit number. ASTFileSignature WriteAST(Sema &SemaRef, const std::string &OutputFile, Module *WritingModule, StringRef isysroot, - bool hasErrors = false); + bool hasErrors = false, + bool ShouldCacheASTInMemory = false); /// Emit a token. void AddToken(const Token &Tok, RecordDataImpl &Record); @@ -738,6 +738,7 @@ private: void DeclarationMarkedOpenMPThreadPrivate(const Decl *D) override; void DeclarationMarkedOpenMPDeclareTarget(const Decl *D, const Attr *Attr) override; + void DeclarationMarkedOpenMPAllocate(const Decl *D, const Attr *A) override; void RedefinedHiddenDefinition(const NamedDecl *D, Module *M) override; void AddedAttributeToRecord(const Attr *Attr, const RecordDecl *Record) override; @@ -974,6 +975,7 @@ class PCHGenerator : public SemaConsumer { llvm::BitstreamWriter Stream; ASTWriter Writer; bool AllowASTWithErrors; + bool ShouldCacheASTInMemory; protected: ASTWriter &getWriter() { return Writer; } @@ -981,10 +983,12 @@ protected: SmallVectorImpl<char> &getPCH() const { return Buffer->Data; } public: - PCHGenerator(const Preprocessor &PP, StringRef OutputFile, StringRef isysroot, + 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 AllowASTWithErrors = false, bool IncludeTimestamps = true, + bool ShouldCacheASTInMemory = false); ~PCHGenerator() override; void InitializeSema(Sema &S) override { SemaPtr = &S; } |