ruiu added a comment. Do you need multiple scans? I wonder if you can keep type records that were not resolved in the first pass in a map or something and backfill them once we visit all type records. https://reviews.llvm.org/D31629