1 //===-- CodeGen/ObjectFilePCHContainerOperations.h - ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_CODEGEN_OBJECT_FILE_PCH_CONTAINER_OPERATIONS_H
11 #define LLVM_CLANG_CODEGEN_OBJECT_FILE_PCH_CONTAINER_OPERATIONS_H
13 #include "clang/Frontend/PCHContainerOperations.h"
17 /// A PCHContainerWriter implementation that uses LLVM to
18 /// wraps Clang modules inside a COFF, ELF, or Mach-O container.
19 class ObjectFilePCHContainerWriter : public PCHContainerWriter {
20 StringRef getFormat() const override { return "obj"; }
22 /// Return an ASTConsumer that can be chained with a
23 /// PCHGenerator that produces a wrapper file format
24 /// that also contains full debug info for the module.
25 std::unique_ptr<ASTConsumer>
26 CreatePCHContainerGenerator(CompilerInstance &CI,
27 const std::string &MainFileName,
28 const std::string &OutputFileName,
29 std::unique_ptr<llvm::raw_pwrite_stream> OS,
30 std::shared_ptr<PCHBuffer> Buffer) const override;
33 /// A PCHContainerReader implementation that uses LLVM to
34 /// wraps Clang modules inside a COFF, ELF, or Mach-O container.
35 class ObjectFilePCHContainerReader : public PCHContainerReader {
36 StringRef getFormat() const override { return "obj"; }
38 /// Initialize an llvm::BitstreamReader with the serialized
39 /// AST inside the PCH container Buffer.
40 void ExtractPCH(llvm::MemoryBufferRef Buffer,
41 llvm::BitstreamReader &StreamFile) const override;