1 //===- DebugTypes.h ---------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLD_COFF_DEBUGTYPES_H
10 #define LLD_COFF_DEBUGTYPES_H
12 #include "llvm/Support/Error.h"
13 #include "llvm/Support/MemoryBuffer.h"
18 class TypeServer2Record;
19 } // namespace codeview
32 enum TpiKind { Regular, PCH, UsingPCH, PDB, UsingPDB };
34 TpiSource(TpiKind k, const ObjFile *f);
35 virtual ~TpiSource() {}
41 TpiSource *makeTpiSource(const ObjFile *f);
42 TpiSource *makeUseTypeServerSource(const ObjFile *f,
43 const llvm::codeview::TypeServer2Record *ts);
44 TpiSource *makePrecompSource(const ObjFile *f);
45 TpiSource *makeUsePrecompSource(const ObjFile *f,
46 const llvm::codeview::PrecompRecord *precomp);
48 void loadTypeServerSource(llvm::MemoryBufferRef m);
50 // Temporary interface to get the dependency
51 template <typename T> const T &retrieveDependencyInfo(const TpiSource *source);
53 // Temporary interface until we move PDBLinker::maybeMergeTypeServerPDB here
54 llvm::Expected<llvm::pdb::NativeSession *>
55 findTypeServerSource(const ObjFile *f);