10 #ifndef LLVM_CLANG_SERIALIZATION_PCHCONTAINEROPERATIONS_H 11 #define LLVM_CLANG_SERIALIZATION_PCHCONTAINEROPERATIONS_H 14 #include "llvm/ADT/SmallVector.h" 15 #include "llvm/ADT/StringMap.h" 16 #include "llvm/Support/MemoryBuffer.h" 20 class raw_pwrite_stream;
27 class DiagnosticsEngine;
28 class CompilerInstance;
42 virtual llvm::StringRef getFormat()
const = 0;
47 virtual std::unique_ptr<ASTConsumer>
49 const std::string &MainFileName,
50 const std::string &OutputFileName,
51 std::unique_ptr<llvm::raw_pwrite_stream> OS,
52 std::shared_ptr<PCHBuffer> Buffer)
const = 0;
62 virtual llvm::StringRef getFormat()
const = 0;
65 virtual llvm::StringRef ExtractPCH(llvm::MemoryBufferRef Buffer)
const = 0;
70 llvm::StringRef getFormat()
const override {
return "raw"; }
74 std::unique_ptr<ASTConsumer>
76 const std::string &MainFileName,
77 const std::string &OutputFileName,
78 std::unique_ptr<llvm::raw_pwrite_stream> OS,
79 std::shared_ptr<PCHBuffer> Buffer)
const override;
84 llvm::StringRef getFormat()
const override {
return "raw"; }
87 llvm::StringRef ExtractPCH(llvm::MemoryBufferRef Buffer)
const override;
92 llvm::StringMap<std::unique_ptr<PCHContainerWriter>> Writers;
93 llvm::StringMap<std::unique_ptr<PCHContainerReader>> Readers;
99 Writers[Writer->getFormat()] = std::move(Writer);
102 Readers[Reader->getFormat()] = std::move(Reader);
105 return Writers[Format].get();
108 return Readers[Format].get();
111 return *getReaderOrNull(
"raw");
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
const PCHContainerReader * getReaderOrNull(llvm::StringRef Format)
Defines the clang::Module class, which describes a module in the source code.
A registry of PCHContainerWriter and -Reader objects for different formats.
The signature of a module, which is a hash of the AST content.
This abstract interface provides operations for creating containers for serialized ASTs (precompiled ...
This abstract interface provides operations for unwrapping containers for serialized ASTs (precompile...
void registerReader(std::unique_ptr< PCHContainerReader > Reader)
const PCHContainerReader & getRawReader()
ASTFileSignature Signature
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
const PCHContainerWriter * getWriterOrNull(llvm::StringRef Format)
Dataflow Directional Tag Classes.
Implements read operations for a raw pass-through PCH container.
llvm::SmallVector< char, 0 > Data
void registerWriter(std::unique_ptr< PCHContainerWriter > Writer)
Implements write operations for a raw pass-through PCH container.