[Lldb-commits] [PATCH] D64042: [Symbol] Improve Variable::GetLanguage

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 8 14:54:18 PDT 2019

xiaobai added a comment.

In D64042#1574438 <https://reviews.llvm.org/D64042#1574438>, @jingham wrote:

> Why did you make this a function of Variable, rather than SymbolContextScope?

After thinking about it more, I realized that the implementation inside of SymbolContextScope would be identical or near identical to the implementation in SymbolContext. I thought that because `IsRuntimeSupportValue` requires that you have a Variable, that it would make sense to ask the Variable for its language. An alternative could be to ask the SymbolContext for its language instead, which I think will be effectively equivalent here.

I also noticed that there's a lot of repetitive code around asking for languages. Everybody always guesses from the mangled name and asks the compilation unit at some point during the process. Adding another implementation inside of SymbolContextScope would kind of add to the cruft a bit here I think.



More information about the lldb-commits mailing list