DebugTypes.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //===- DebugTypes.h ---------------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLD_COFF_DEBUGTYPES_H
  9. #define LLD_COFF_DEBUGTYPES_H
  10. #include "llvm/Support/Error.h"
  11. #include "llvm/Support/MemoryBuffer.h"
  12. namespace llvm {
  13. namespace codeview {
  14. class PrecompRecord;
  15. class TypeServer2Record;
  16. } // namespace codeview
  17. namespace pdb {
  18. class NativeSession;
  19. }
  20. } // namespace llvm
  21. namespace lld {
  22. namespace coff {
  23. class ObjFile;
  24. class TpiSource {
  25. public:
  26. enum TpiKind { Regular, PCH, UsingPCH, PDB, UsingPDB };
  27. TpiSource(TpiKind k, const ObjFile *f);
  28. virtual ~TpiSource() {}
  29. const TpiKind kind;
  30. const ObjFile *file;
  31. };
  32. TpiSource *makeTpiSource(const ObjFile *f);
  33. TpiSource *makeUseTypeServerSource(const ObjFile *f,
  34. const llvm::codeview::TypeServer2Record *ts);
  35. TpiSource *makePrecompSource(const ObjFile *f);
  36. TpiSource *makeUsePrecompSource(const ObjFile *f,
  37. const llvm::codeview::PrecompRecord *precomp);
  38. void loadTypeServerSource(llvm::MemoryBufferRef m);
  39. // Temporary interface to get the dependency
  40. template <typename T> const T &retrieveDependencyInfo(const TpiSource *source);
  41. // Temporary interface until we move PDBLinker::maybeMergeTypeServerPDB here
  42. llvm::Expected<llvm::pdb::NativeSession *>
  43. findTypeServerSource(const ObjFile *f);
  44. } // namespace coff
  45. } // namespace lld
  46. #endif