- When we evaluating an expression multiple times and the searching scope is translation unit, ParseDeclsForContext iterates the type info and symbol info multiple times, though only the debug info is parsed once. Using llvm::call_once to make it only iterating and parsing once.
- When evaluating an expression with identifier whose parent scope is a namespace, ParseDeclsForContext needs to search the entire type info to complete those records whose name is prefixed with the namespace's name and the entire symbol info to to parse functions and non-local variables. Caching parsed namespaces to avoid unnecessary searching.
I have a feeling this is still doing more work than it would be necessary. I haven't checked, but I'd expect that here it should be sufficient to parse only the top level namespace names (not their contents), and create forward declarations for the classes in the global namespace. I suspect this is doing much more than that.
(Of course, if PDB makes it hard to parse just this information, then it might actually be better to parse everything -- I just don't know)