Since commit 846b676 SmallVectorBase<uint32_t> has been explicitly instantiated, which means that clang.exe must export it for a plugin to be able to link against it, but the constructor is not exported as currently no template constructors or destructors are exported.
We can't just export all constructors and destructors, as that puts us over the symbol limit on Windows, so instead rewrite how we decide which templates need to be exported to be more precise. Currently we assume that templates instantiated many times have no explicit instantiations, but this isn't necessarily true and results also in exporting implicit template instantiations that we don't need to. Instead check for references to template members, as this indicates that the template must be explicitly instantiated (as if it weren't the template would just be implicitly instantiated on use).
Doing this reduces the number of symbols exported from clang from 66011 to 53993 (in the build configuration that I've been testing). It also lets us get rid of the special-case handling of Type::getAs, as its explicit instantiations are now being detected as such.
would it be worth changing this to use parse_microsoft_mangling?