10 #ifndef LLVM_CLANG_PCH_CONTAINER_OPERATIONS_H 11 #define LLVM_CLANG_PCH_CONTAINER_OPERATIONS_H 14 #include "llvm/ADT/SmallVector.h" 15 #include "llvm/ADT/StringMap.h" 16 #include "llvm/Support/MemoryBuffer.h" 20 class raw_pwrite_stream;
23 using llvm::StringRef;
29 class DiagnosticsEngine;
30 class CompilerInstance;
44 virtual StringRef getFormat()
const = 0;
49 virtual std::unique_ptr<ASTConsumer>
51 const std::string &MainFileName,
52 const std::string &OutputFileName,
53 std::unique_ptr<llvm::raw_pwrite_stream> OS,
54 std::shared_ptr<PCHBuffer> Buffer)
const = 0;
64 virtual StringRef getFormat()
const = 0;
67 virtual StringRef ExtractPCH(llvm::MemoryBufferRef Buffer)
const = 0;
72 StringRef getFormat()
const override {
return "raw"; }
76 std::unique_ptr<ASTConsumer>
78 const std::string &MainFileName,
79 const std::string &OutputFileName,
80 std::unique_ptr<llvm::raw_pwrite_stream> OS,
81 std::shared_ptr<PCHBuffer> Buffer)
const override;
86 StringRef getFormat()
const override {
return "raw"; }
89 StringRef ExtractPCH(llvm::MemoryBufferRef Buffer)
const override;
94 llvm::StringMap<std::unique_ptr<PCHContainerWriter>> Writers;
95 llvm::StringMap<std::unique_ptr<PCHContainerReader>> Readers;
101 Writers[Writer->getFormat()] = std::move(Writer);
104 Readers[Reader->getFormat()] = std::move(Reader);
107 return Writers[Format].get();
110 return Readers[Format].get();
113 return *getReaderOrNull(
"raw");
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
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 ...
const PCHContainerWriter * getWriterOrNull(StringRef Format)
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 PCHContainerReader * getReaderOrNull(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.