summaryrefslogtreecommitdiff
path: root/lld/COFF/DebugTypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/DebugTypes.h')
-rw-r--r--lld/COFF/DebugTypes.h56
1 files changed, 38 insertions, 18 deletions
diff --git a/lld/COFF/DebugTypes.h b/lld/COFF/DebugTypes.h
index e37c727232d0..24d79d83e4c6 100644
--- a/lld/COFF/DebugTypes.h
+++ b/lld/COFF/DebugTypes.h
@@ -26,35 +26,55 @@ namespace lld {
namespace coff {
class ObjFile;
+class PDBInputFile;
+struct CVIndexMap;
+class TypeMerger;
class TpiSource {
public:
enum TpiKind { Regular, PCH, UsingPCH, PDB, UsingPDB };
- TpiSource(TpiKind k, const ObjFile *f);
- virtual ~TpiSource() {}
+ TpiSource(TpiKind k, ObjFile *f);
+ virtual ~TpiSource();
- const TpiKind kind;
- const ObjFile *file;
-};
+ /// Produce a mapping from the type and item indices used in the object
+ /// file to those in the destination PDB.
+ ///
+ /// If the object file uses a type server PDB (compiled with /Zi), merge TPI
+ /// and IPI from the type server PDB and return a map for it. Each unique type
+ /// server PDB is merged at most once, so this may return an existing index
+ /// mapping.
+ ///
+ /// If the object does not use a type server PDB (compiled with /Z7), we merge
+ /// all the type and item records from the .debug$S stream and fill in the
+ /// caller-provided ObjectIndexMap.
+ virtual llvm::Expected<const CVIndexMap *> mergeDebugT(TypeMerger *m,
+ CVIndexMap *indexMap);
+ /// Is this a dependent file that needs to be processed first, before other
+ /// OBJs?
+ virtual bool isDependency() const { return false; }
+
+ static void forEachSource(llvm::function_ref<void(TpiSource *)> fn);
-TpiSource *makeTpiSource(const ObjFile *f);
-TpiSource *makeUseTypeServerSource(const ObjFile *f,
- const llvm::codeview::TypeServer2Record *ts);
-TpiSource *makePrecompSource(const ObjFile *f);
-TpiSource *makeUsePrecompSource(const ObjFile *f,
- const llvm::codeview::PrecompRecord *precomp);
+ static uint32_t countTypeServerPDBs();
+ static uint32_t countPrecompObjs();
-void loadTypeServerSource(llvm::MemoryBufferRef m);
+ /// Clear global data structures for TpiSources.
+ static void clear();
-// Temporary interface to get the dependency
-template <typename T> const T &retrieveDependencyInfo(const TpiSource *source);
+ const TpiKind kind;
+ ObjFile *file;
+};
-// Temporary interface until we move PDBLinker::maybeMergeTypeServerPDB here
-llvm::Expected<llvm::pdb::NativeSession *>
-findTypeServerSource(const ObjFile *f);
+TpiSource *makeTpiSource(ObjFile *file);
+TpiSource *makeTypeServerSource(PDBInputFile *pdbInputFile);
+TpiSource *makeUseTypeServerSource(ObjFile *file,
+ llvm::codeview::TypeServer2Record ts);
+TpiSource *makePrecompSource(ObjFile *file);
+TpiSource *makeUsePrecompSource(ObjFile *file,
+ llvm::codeview::PrecompRecord ts);
} // namespace coff
} // namespace lld
-#endif \ No newline at end of file
+#endif