ObjectFilePCHContainerOperations.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- CodeGen/ObjectFilePCHContainerOperations.h - ------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_CODEGEN_OBJECTFILEPCHCONTAINEROPERATIONS_H
  14. #define LLVM_CLANG_CODEGEN_OBJECTFILEPCHCONTAINEROPERATIONS_H
  15. #include "clang/Frontend/PCHContainerOperations.h"
  16. namespace clang {
  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"; }
  21. /// Return an ASTConsumer that can be chained with a
  22. /// PCHGenerator that produces a wrapper file format
  23. /// that also contains full debug info for the module.
  24. std::unique_ptr<ASTConsumer>
  25. CreatePCHContainerGenerator(CompilerInstance &CI,
  26. const std::string &MainFileName,
  27. const std::string &OutputFileName,
  28. std::unique_ptr<llvm::raw_pwrite_stream> OS,
  29. std::shared_ptr<PCHBuffer> Buffer) const override;
  30. };
  31. /// A PCHContainerReader implementation that uses LLVM to
  32. /// wraps Clang modules inside a COFF, ELF, or Mach-O container.
  33. class ObjectFilePCHContainerReader : public PCHContainerReader {
  34. StringRef getFormat() const override { return "obj"; }
  35. /// Returns the serialized AST inside the PCH container Buffer.
  36. StringRef ExtractPCH(llvm::MemoryBufferRef Buffer) const override;
  37. };
  38. }
  39. #endif
  40. #ifdef __GNUC__
  41. #pragma GCC diagnostic pop
  42. #endif