diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:50:49 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:50:49 +0000 |
commit | 2298981669bf3bd63335a4be179bc0f96823a8f4 (patch) | |
tree | 1cbe2eb27f030d2d70b80ee5ca3c86bee7326a9f /include/clang/Serialization | |
parent | 9a83721404652cea39e9f02ae3e3b5c964602a5c (diff) |
Notes
Diffstat (limited to 'include/clang/Serialization')
-rw-r--r-- | include/clang/Serialization/ASTBitCodes.h | 33 | ||||
-rw-r--r-- | include/clang/Serialization/ASTDeserializationListener.h | 7 | ||||
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 44 | ||||
-rw-r--r-- | include/clang/Serialization/ASTWriter.h | 29 | ||||
-rw-r--r-- | include/clang/Serialization/ContinuousRangeMap.h | 11 | ||||
-rw-r--r-- | include/clang/Serialization/GlobalModuleIndex.h | 31 | ||||
-rw-r--r-- | include/clang/Serialization/InMemoryModuleCache.h | 107 | ||||
-rw-r--r-- | include/clang/Serialization/Module.h | 11 | ||||
-rw-r--r-- | include/clang/Serialization/ModuleFileExtension.h | 7 | ||||
-rw-r--r-- | include/clang/Serialization/ModuleManager.h | 15 | ||||
-rw-r--r-- | include/clang/Serialization/PCHContainerOperations.h | 7 | ||||
-rw-r--r-- | include/clang/Serialization/SerializationDiagnostic.h | 7 |
12 files changed, 216 insertions, 93 deletions
diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h index ec752fb7c796e..0e1b9e0af9e6d 100644 --- a/include/clang/Serialization/ASTBitCodes.h +++ b/include/clang/Serialization/ASTBitCodes.h @@ -1,9 +1,8 @@ //===- ASTBitCodes.h - Enum values for the PCH bitcode format ---*- 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 // //===----------------------------------------------------------------------===// // @@ -24,7 +23,7 @@ #include "clang/Basic/OperatorKinds.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/DenseMapInfo.h" -#include "llvm/Bitcode/BitCodes.h" +#include "llvm/Bitstream/BitCodes.h" #include <cassert> #include <cstdint> @@ -1174,7 +1173,10 @@ namespace serialization { TYPE_DEPENDENT_ADDRESS_SPACE = 47, /// A dependentSizedVectorType record. - TYPE_DEPENDENT_SIZED_VECTOR = 48 + TYPE_DEPENDENT_SIZED_VECTOR = 48, + + /// A type defined in a macro. + TYPE_MACRO_QUALIFIED = 49 }; /// The type IDs for special types constructed by semantic @@ -1439,9 +1441,6 @@ namespace serialization { /// A CXXConstructorDecl record. DECL_CXX_CONSTRUCTOR, - /// A CXXConstructorDecl record for an inherited constructor. - DECL_CXX_INHERITED_CONSTRUCTOR, - /// A CXXDestructorDecl record. DECL_CXX_DESTRUCTOR, @@ -1490,7 +1489,10 @@ namespace serialization { /// A TypeAliasTemplateDecl record. DECL_TYPE_ALIAS_TEMPLATE, - /// A StaticAssertDecl record. + /// \brief A ConceptDecl record. + DECL_CONCEPT, + + /// \brief A StaticAssertDecl record. DECL_STATIC_ASSERT, /// A record containing CXXBaseSpecifiers. @@ -1522,7 +1524,10 @@ namespace serialization { /// An OMPRequiresDecl record. DECL_OMP_REQUIRES, - + + /// An OMPAllocateDcl record. + DECL_OMP_ALLOCATE, + /// An EmptyDecl record. DECL_EMPTY, @@ -1538,6 +1543,9 @@ namespace serialization { /// A PragmaDetectMismatchDecl record. DECL_PRAGMA_DETECT_MISMATCH, + /// An OMPDeclareMapperDecl record. + DECL_OMP_DECLARE_MAPPER, + /// An OMPDeclareReductionDecl record. DECL_OMP_DECLARE_REDUCTION, @@ -1727,6 +1735,9 @@ namespace serialization { /// A GNUNullExpr record. EXPR_GNU_NULL, + /// A SourceLocExpr record. + EXPR_SOURCE_LOC, + /// A ShuffleVectorExpr record. EXPR_SHUFFLE_VECTOR, diff --git a/include/clang/Serialization/ASTDeserializationListener.h b/include/clang/Serialization/ASTDeserializationListener.h index c462a90dde549..f3a01a4b97315 100644 --- a/include/clang/Serialization/ASTDeserializationListener.h +++ b/include/clang/Serialization/ASTDeserializationListener.h @@ -1,9 +1,8 @@ //===- ASTDeserializationListener.h - Decl/Type PCH Read Events -*- 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 // //===----------------------------------------------------------------------===// // diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index f97f545852f48..37bea48d88465 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -1,9 +1,8 @@ //===- ASTReader.h - AST File Reader ----------------------------*- 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 // //===----------------------------------------------------------------------===// // @@ -57,7 +56,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" -#include "llvm/Bitcode/BitstreamReader.h" +#include "llvm/Bitstream/BitstreamReader.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Endian.h" #include "llvm/Support/MemoryBuffer.h" @@ -98,7 +97,7 @@ class HeaderSearchOptions; class LangOptions; class LazyASTUnresolvedSet; class MacroInfo; -class MemoryBufferCache; +class InMemoryModuleCache; class NamedDecl; class NamespaceDecl; class ObjCCategoryDecl; @@ -441,9 +440,6 @@ private: /// The module manager which manages modules and their dependencies ModuleManager ModuleMgr; - /// The cache that manages memory buffers for PCM files. - MemoryBufferCache &PCMCache; - /// A dummy identifier resolver used to merge TU-scope declarations in /// C, for the cases where we don't have a Sema object to provide a real /// identifier resolver. @@ -1441,6 +1437,7 @@ private: void Error(StringRef Msg) const; void Error(unsigned DiagID, StringRef Arg1 = StringRef(), StringRef Arg2 = StringRef()) const; + void Error(llvm::Error &&Err) const; public: /// Load the AST file and validate its contents against the given @@ -1482,8 +1479,8 @@ public: /// /// \param ReadTimer If non-null, a timer used to track the time spent /// deserializing. - ASTReader(Preprocessor &PP, ASTContext *Context, - const PCHContainerReader &PCHContainerRdr, + ASTReader(Preprocessor &PP, InMemoryModuleCache &ModuleCache, + ASTContext *Context, const PCHContainerReader &PCHContainerRdr, ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions, StringRef isysroot = "", bool DisableValidation = false, bool AllowASTWithCompilerErrors = false, @@ -2224,6 +2221,9 @@ public: llvm::APFloat ReadAPFloat(const RecordData &Record, const llvm::fltSemantics &Sem, unsigned &Idx); + /// Read an APValue + APValue ReadAPValue(const RecordData &Record, unsigned &Idx); + // Read a string static std::string ReadString(const RecordData &Record, unsigned &Idx); @@ -2235,6 +2235,10 @@ public: // Read a path std::string ReadPath(ModuleFile &F, const RecordData &Record, unsigned &Idx); + // Read a path + std::string ReadPath(StringRef BaseDirectory, const RecordData &Record, + unsigned &Idx); + // Skip a path static void SkipPath(const RecordData &Record, unsigned &Idx) { SkipString(Record, Idx); @@ -2376,7 +2380,8 @@ public: /// Reads a record with id AbbrevID from Cursor, resetting the /// internal state. - unsigned readRecord(llvm::BitstreamCursor &Cursor, unsigned AbbrevID); + Expected<unsigned> readRecord(llvm::BitstreamCursor &Cursor, + unsigned AbbrevID); /// Is this a module file for a module (rather than a PCH or similar). bool isModule() const { return F->isModule(); } @@ -2430,6 +2435,14 @@ public: ID); } + ExplicitSpecifier readExplicitSpec() { + uint64_t Kind = readInt(); + bool HasExpr = Kind & 0x1; + Kind = Kind >> 1; + return ExplicitSpecifier(HasExpr ? readExpr() : nullptr, + static_cast<ExplicitSpecKind>(Kind)); + } + void readExceptionSpec(SmallVectorImpl<QualType> &ExceptionStorage, FunctionProtoType::ExceptionSpecInfo &ESI) { return Reader->readExceptionSpec(*F, ExceptionStorage, ESI, Record, Idx); @@ -2604,6 +2617,8 @@ public: return Reader->ReadSourceRange(*F, Record, Idx); } + APValue readAPValue() { return Reader->ReadAPValue(Record, Idx); } + /// Read an integral value, advancing Idx. llvm::APInt readAPInt() { return Reader->ReadAPInt(Record, Idx); @@ -2666,7 +2681,10 @@ struct SavedStreamPosition { : Cursor(Cursor), Offset(Cursor.GetCurrentBitNo()) {} ~SavedStreamPosition() { - Cursor.JumpToBit(Offset); + if (llvm::Error Err = Cursor.JumpToBit(Offset)) + llvm::report_fatal_error( + "Cursor should always be able to go back, failed: " + + toString(std::move(Err))); } private: diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index 11af30ac8373e..76bd874fb0128 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 // //===----------------------------------------------------------------------===// // @@ -37,7 +36,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" -#include "llvm/Bitcode/BitstreamWriter.h" +#include "llvm/Bitstream/BitstreamWriter.h" #include <cassert> #include <cstddef> #include <cstdint> @@ -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; @@ -862,6 +863,9 @@ public: /// Emit a floating-point value. void AddAPFloat(const llvm::APFloat &Value); + /// Emit an APvalue. + void AddAPValue(const APValue &Value); + /// Emit a reference to an identifier. void AddIdentifierRef(const IdentifierInfo *II) { return Writer->AddIdentifierRef(II, *Record); @@ -974,6 +978,7 @@ class PCHGenerator : public SemaConsumer { llvm::BitstreamWriter Stream; ASTWriter Writer; bool AllowASTWithErrors; + bool ShouldCacheASTInMemory; protected: ASTWriter &getWriter() { return Writer; } @@ -981,10 +986,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; } diff --git a/include/clang/Serialization/ContinuousRangeMap.h b/include/clang/Serialization/ContinuousRangeMap.h index ad827e37db2d7..0c05537dd1080 100644 --- a/include/clang/Serialization/ContinuousRangeMap.h +++ b/include/clang/Serialization/ContinuousRangeMap.h @@ -1,9 +1,8 @@ //===- ContinuousRangeMap.h - Map with int range as key ---------*- 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 // //===----------------------------------------------------------------------===// // @@ -74,7 +73,7 @@ public: } void insertOrReplace(const value_type &Val) { - iterator I = std::lower_bound(Rep.begin(), Rep.end(), Val, Compare()); + iterator I = llvm::lower_bound(Rep, Val, Compare()); if (I != Rep.end() && I->first == Val.first) { I->second = Val.second; return; @@ -92,7 +91,7 @@ public: const_iterator end() const { return Rep.end(); } iterator find(Int K) { - iterator I = std::upper_bound(Rep.begin(), Rep.end(), K, Compare()); + iterator I = llvm::upper_bound(Rep, K, Compare()); // I points to the first entry with a key > K, which is the range that // follows the one containing K. if (I == Rep.begin()) diff --git a/include/clang/Serialization/GlobalModuleIndex.h b/include/clang/Serialization/GlobalModuleIndex.h index 5791fc024a329..5f48126262247 100644 --- a/include/clang/Serialization/GlobalModuleIndex.h +++ b/include/clang/Serialization/GlobalModuleIndex.h @@ -1,9 +1,8 @@ //===--- GlobalModuleIndex.h - Global Module Index --------------*- 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 // //===----------------------------------------------------------------------===// // @@ -21,6 +20,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/Error.h" #include <memory> #include <utility> @@ -123,27 +123,14 @@ class GlobalModuleIndex { public: ~GlobalModuleIndex(); - /// An error code returned when trying to read an index. - enum ErrorCode { - /// No error occurred. - EC_None, - /// No index was found. - EC_NotFound, - /// Some other process is currently building the index; it is not - /// available yet. - EC_Building, - /// There was an unspecified I/O error reading or writing the index. - EC_IOError - }; - /// Read a global index file for the given directory. /// /// \param Path The path to the specific module cache where the module files /// for the intended configuration reside. /// /// \returns A pair containing the global module index (if it exists) and - /// the error code. - static std::pair<GlobalModuleIndex *, ErrorCode> + /// the error. + static std::pair<GlobalModuleIndex *, llvm::Error> readIndex(llvm::StringRef Path); /// Returns an iterator for identifiers stored in the index table. @@ -195,9 +182,9 @@ public: /// creating modules. /// \param Path The path to the directory containing module files, into /// which the global index will be written. - static ErrorCode writeIndex(FileManager &FileMgr, - const PCHContainerReader &PCHContainerRdr, - llvm::StringRef Path); + static llvm::Error writeIndex(FileManager &FileMgr, + const PCHContainerReader &PCHContainerRdr, + llvm::StringRef Path); }; } diff --git a/include/clang/Serialization/InMemoryModuleCache.h b/include/clang/Serialization/InMemoryModuleCache.h new file mode 100644 index 0000000000000..7b5b5c1cf1be9 --- /dev/null +++ b/include/clang/Serialization/InMemoryModuleCache.h @@ -0,0 +1,107 @@ +//===- InMemoryModuleCache.h - In-memory cache for modules ------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H +#define LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H + +#include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/Optional.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/Support/MemoryBuffer.h" +#include <memory> + +namespace clang { + +/// In-memory cache for modules. +/// +/// This is a cache for modules for use across a compilation, sharing state +/// between the CompilerInstances in an implicit modules build. It must be +/// shared by each CompilerInstance, ASTReader, ASTWriter, and ModuleManager +/// that are coordinating. +/// +/// Critically, it ensures that a single process has a consistent view of each +/// PCM. This is used by \a CompilerInstance when building PCMs to ensure that +/// each \a ModuleManager sees the same files. +class InMemoryModuleCache : public llvm::RefCountedBase<InMemoryModuleCache> { + struct PCM { + std::unique_ptr<llvm::MemoryBuffer> Buffer; + + /// Track whether this PCM is known to be good (either built or + /// successfully imported by a CompilerInstance/ASTReader using this + /// cache). + bool IsFinal = false; + + PCM() = default; + PCM(std::unique_ptr<llvm::MemoryBuffer> Buffer) + : Buffer(std::move(Buffer)) {} + }; + + /// Cache of buffers. + llvm::StringMap<PCM> PCMs; + +public: + /// There are four states for a PCM. It must monotonically increase. + /// + /// 1. Unknown: the PCM has neither been read from disk nor built. + /// 2. Tentative: the PCM has been read from disk but not yet imported or + /// built. It might work. + /// 3. ToBuild: the PCM read from disk did not work but a new one has not + /// been built yet. + /// 4. Final: indicating that the current PCM was either built in this + /// process or has been successfully imported. + enum State { Unknown, Tentative, ToBuild, Final }; + + /// Get the state of the PCM. + State getPCMState(llvm::StringRef Filename) const; + + /// Store the PCM under the Filename. + /// + /// \pre state is Unknown + /// \post state is Tentative + /// \return a reference to the buffer as a convenience. + llvm::MemoryBuffer &addPCM(llvm::StringRef Filename, + std::unique_ptr<llvm::MemoryBuffer> Buffer); + + /// Store a just-built PCM under the Filename. + /// + /// \pre state is Unknown or ToBuild. + /// \pre state is not Tentative. + /// \return a reference to the buffer as a convenience. + llvm::MemoryBuffer &addBuiltPCM(llvm::StringRef Filename, + std::unique_ptr<llvm::MemoryBuffer> Buffer); + + /// Try to remove a buffer from the cache. No effect if state is Final. + /// + /// \pre state is Tentative/Final. + /// \post Tentative => ToBuild or Final => Final. + /// \return false on success, i.e. if Tentative => ToBuild. + bool tryToDropPCM(llvm::StringRef Filename); + + /// Mark a PCM as final. + /// + /// \pre state is Tentative or Final. + /// \post state is Final. + void finalizePCM(llvm::StringRef Filename); + + /// Get a pointer to the pCM if it exists; else nullptr. + llvm::MemoryBuffer *lookupPCM(llvm::StringRef Filename) const; + + /// Check whether the PCM is final and has been shown to work. + /// + /// \return true iff state is Final. + bool isPCMFinal(llvm::StringRef Filename) const; + + /// Check whether the PCM is waiting to be built. + /// + /// \return true iff state is ToBuild. + bool shouldBuildPCM(llvm::StringRef Filename) const; +}; + +} // end namespace clang + +#endif // LLVM_CLANG_SERIALIZATION_INMEMORYMODULECACHE_H diff --git a/include/clang/Serialization/Module.h b/include/clang/Serialization/Module.h index d6e78e693109e..1979c53a7133c 100644 --- a/include/clang/Serialization/Module.h +++ b/include/clang/Serialization/Module.h @@ -1,9 +1,8 @@ //===- Module.h - Module description ----------------------------*- 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 // //===----------------------------------------------------------------------===// // @@ -25,7 +24,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" -#include "llvm/Bitcode/BitstreamReader.h" +#include "llvm/Bitstream/BitstreamReader.h" #include "llvm/Support/Endian.h" #include <cassert> #include <cstdint> @@ -175,7 +174,7 @@ public: unsigned Generation; /// The memory buffer that stores the data associated with - /// this AST file, owned by the PCMCache in the ModuleManager. + /// this AST file, owned by the InMemoryModuleCache. llvm::MemoryBuffer *Buffer; /// The size of this file, in bits. diff --git a/include/clang/Serialization/ModuleFileExtension.h b/include/clang/Serialization/ModuleFileExtension.h index f70218e329af1..63562c0d6bd2b 100644 --- a/include/clang/Serialization/ModuleFileExtension.h +++ b/include/clang/Serialization/ModuleFileExtension.h @@ -1,9 +1,8 @@ //===-- ModuleFileExtension.h - Module File Extensions ----------*- 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 // //===----------------------------------------------------------------------===// diff --git a/include/clang/Serialization/ModuleManager.h b/include/clang/Serialization/ModuleManager.h index cfc9a2ef112c2..5b3b22be759c7 100644 --- a/include/clang/Serialization/ModuleManager.h +++ b/include/clang/Serialization/ModuleManager.h @@ -1,9 +1,8 @@ //===- ModuleManager.cpp - Module Manager -----------------------*- 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 // //===----------------------------------------------------------------------===// // @@ -39,7 +38,7 @@ class FileEntry; class FileManager; class GlobalModuleIndex; class HeaderSearch; -class MemoryBufferCache; +class InMemoryModuleCache; class ModuleMap; class PCHContainerReader; @@ -68,7 +67,7 @@ class ModuleManager { FileManager &FileMgr; /// Cache of PCM files. - IntrusiveRefCntPtr<MemoryBufferCache> PCMCache; + IntrusiveRefCntPtr<InMemoryModuleCache> ModuleCache; /// Knows how to unwrap module containers. const PCHContainerReader &PCHContainerRdr; @@ -140,7 +139,7 @@ public: SmallVectorImpl<std::unique_ptr<ModuleFile>>::reverse_iterator>; using ModuleOffset = std::pair<uint32_t, StringRef>; - explicit ModuleManager(FileManager &FileMgr, MemoryBufferCache &PCMCache, + explicit ModuleManager(FileManager &FileMgr, InMemoryModuleCache &ModuleCache, const PCHContainerReader &PCHContainerRdr, const HeaderSearch &HeaderSearchInfo); ~ModuleManager(); @@ -318,7 +317,7 @@ public: /// View the graphviz representation of the module graph. void viewGraph(); - MemoryBufferCache &getPCMCache() const { return *PCMCache; } + InMemoryModuleCache &getModuleCache() const { return *ModuleCache; } }; } // namespace serialization diff --git a/include/clang/Serialization/PCHContainerOperations.h b/include/clang/Serialization/PCHContainerOperations.h index 2a91d9830af3c..33fc4a0a24e07 100644 --- a/include/clang/Serialization/PCHContainerOperations.h +++ b/include/clang/Serialization/PCHContainerOperations.h @@ -1,9 +1,8 @@ //===--- Serialization/PCHContainerOperations.h - PCH Containers --*- 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 // //===----------------------------------------------------------------------===// diff --git a/include/clang/Serialization/SerializationDiagnostic.h b/include/clang/Serialization/SerializationDiagnostic.h index 2decd1c2f67be..7fc93c11932f7 100644 --- a/include/clang/Serialization/SerializationDiagnostic.h +++ b/include/clang/Serialization/SerializationDiagnostic.h @@ -1,9 +1,8 @@ //===--- SerializationDiagnostic.h - Serialization Diagnostics -*- 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 // //===----------------------------------------------------------------------===// |