In order to have all inputs loaded & available upfront when starting to merge types, we need to open PDB type server files early in the process.
PDB type servers are created when using MSVC /Zi. In that case, the debug info for a given project is stored in a single PDB type server file. All OBJ files in that project will refer to their corresponding PDB through a TypeServer2Record.
This patch also fixes a tiny issue where the PDB "Age" wasn't validated against the OBJ's TypeServer2Record.Age. The age is a concept used by MSVC for incremental compilation: the PDB's Age is incremented by MSVC on each incremental build, but the GUID remains the same.
This patch is step 2. in "Proposed commit strategy" in D59226
If a constructor can fail, one pattern to handle that is to make the constructor private and instead provide static ErrorOr<TypeServerSource> getInstance() function. In that function, you can load a PDB and then instantiate TypeServerSouce only when the file loading succeeded. If failed, you can return an error.