15#include "llvm/Support/raw_ostream.h"
26class RawPCHContainerGenerator :
public ASTConsumer {
27 std::shared_ptr<PCHBuffer> Buffer;
28 std::unique_ptr<raw_pwrite_stream> OS;
31 RawPCHContainerGenerator(std::unique_ptr<llvm::raw_pwrite_stream> OS,
32 std::shared_ptr<PCHBuffer> Buffer)
33 : Buffer(
std::move(Buffer)), OS(
std::move(OS)) {}
35 ~RawPCHContainerGenerator()
override =
default;
37 void HandleTranslationUnit(
ASTContext &Ctx)
override {
38 if (Buffer->IsComplete) {
45 Buffer->Data = std::move(
Empty);
51std::unique_ptr<ASTConsumer> RawPCHContainerWriter::CreatePCHContainerGenerator(
53 const std::string &OutputFileName, std::unique_ptr<llvm::raw_pwrite_stream> OS,
54 std::shared_ptr<PCHBuffer> Buffer)
const {
55 return std::make_unique<RawPCHContainerGenerator>(std::move(OS), Buffer);
59 static StringRef Raw(
"raw");
64RawPCHContainerReader::ExtractPCH(llvm::MemoryBufferRef Buffer)
const {
65 return Buffer.getBuffer();
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
void registerReader(std::unique_ptr< PCHContainerReader > Reader)
PCHContainerOperations()
Automatically registers a RawPCHContainerWriter and RawPCHContainerReader.
void registerWriter(std::unique_ptr< PCHContainerWriter > Writer)
virtual ~PCHContainerReader()=0
virtual ~PCHContainerWriter()=0
The JSON file list parser is used to communicate input to InstallAPI.