[Lldb-commits] [lldb] [LLDB] Add type casting to DIL. (PR #159500)
Ilia Kuklin via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 26 10:45:19 PDT 2025
kuilpd wrote:
> The biggest problem is in your step 2. We can't make GetBuiltinTypeByName the first thing in ResolveTypeByName. Doing that would prevent users from every being able to redefine types with the same names as the builtins, which is something I've been told is allowed in Swift, e.g.
Ah, I see, I didn't realize that this logic might not work for other languages. Mainly I suggested to change the way we parse the basic types, using `GetBuiltinTypeByName` instead of doing it manually. But this manual implementation comes from lldb-eval, which handled only C++, so it prioritizes the basic types the same way: if it finds something that looks like a basic type, it just returns the according CompilerType without looking for user types any further.
In any case, Swift, if I understand correctly, doesn't really have builtin types, all the types like `Int` or `Float` are effectively user types defined in the standard library. The important distinction is that C++ builtin types may not be found by `ResolveTypeByName` that searches types in modules, so we need explicitly check if something is a builtin type, while for Swift we don't need to. So from my understanding `GetBuiltinTypeByName` in `TypeSystemSwift` can just always return nothing, and the code can move on to searching user types.
Need some Swift insight here :) @jimingham @adrian-prantl
https://github.com/llvm/llvm-project/pull/159500
More information about the lldb-commits
mailing list