WORK IN PROGRESS
This change is mostly for discussion, it is messy and likely wrong as I am new to the lldb codebase.
The goal of this exercise is to support expressions containing template instantiations, e.g. foo<int>::x.
The idea here is to collect all template types in the dwarf index. Later, when asked to find a name X, we import all the instantiations of X and pass the template declaration with the instantiations to Clang. In addition to my poor abstraction skills, the major problem with this is that we need to import all the instantiations even when only one is used. I tried to only import forward declarations, but if the instantiations were already previously completed, the AST importer still imports everything. This leads to massive evaluation times (tens of seconds) on templates with many instantiations (std::vector and the likes).
I am planning to pursue a different avenue, where I would introduce another hook into clang (perhaps in Sema::CheckTemplateIdType), but I am not sure how viable that path is.