This patch adds more fine grained information in ObjFile about PDB type server dependencies and precomp OBJ dependencies.
Dependencies are required to be loaded & merged first, before any dependent OBJ that relies on it.
Before, dependencies were discovered and loaded along the way, when the type stream for a given OBJ was being merged (in PDB.cpp).
This patch is part of ground work towards parallelizing the type merging. The objective is to split PDBLinker::addObjFile into several smaller parallelizable pieces. See D59226 for the overall intention.
I'm starting to feel like mergeDebugT should really be behind a virtual interface, something like this:
The class names I came up with are kind of crummy, though.
I feel like 4 public, optional members of ObjFile leaks a lot of PDB details into the rest of the linker. Instead, we could have a pointer to some interface. Do you think this, or something like it, is worth doing now, ever, or later?
The "regular" or .debug$T based type merger could just be some stateless global variable that all the regular objs point to, since we pass the object file in through the interface, and that's all the info it needs. Every file using a type server would point to the same TypeServerTPISource. I'm not sure how the PCH stuff would work, since I'm less familiar.