[Lldb-commits] [lldb] [LLDB] Add type casting to DIL. (PR #159500)
Ilia Kuklin via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 19 10:29:23 PDT 2025
https://github.com/kuilpd commented:
I think we need to get rid of everything that references C++ keywords directly. I don't think we need to parse the builtin type manually, so we can just remove `IsSimpleTypeSpecifierKeyword`, `HandleSimpleTypeSpecifier`, and `TypeDeclaration` class altogether. Instead, parse a sequence of identifiers as a single string and call `TypeSystem::GetBuiltinTypeByName` to check if such a builtin type exists, it already has pretty much all variations of builtin types in `TypeSystemClang`. This way other languages can specify their own builtin types as well.
The algorithm of `ParseTypeId` would be something like this:
1. `ParseTypeSpecifierSeq`, that returns a string that is either a builtin type (`"unsigned long long"`) or a user defined type (`"ns::myint"`)
2. Call `ResolveTypeByName` on the string, which first attempts a `GetBuiltinTypeByName` and immediately returns a `CompilerType` if found, then searches in modules for user types
3. Handle * and & like before
I did a quick test with this logic, seems to be working.
https://github.com/llvm/llvm-project/pull/159500
More information about the lldb-commits
mailing list