[Lldb-commits] [lldb] Draft: [LLDB] Add scalar literal node (PR #147064)

Augusto Noronha via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 8 12:51:50 PDT 2025


augusto2112 wrote:

> Here is the problem with types: initial scalar literal type, all the type promotions and conversions are done using `lldb::BasicType` enumeration types, and later converted to `CompilerType` using the `TypeSystem`. In C++, this works perfectly well, because in [`TypeSystemClang.cpp:5468`](https://github.com/llvm/llvm-project/blob/740da004af5ed402b6ddb0d71759f978bc814f7f/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp#L5468C1-L5468C41) it is implemented, but in [`TypeSystemSwift:304`](https://github.com/swiftlang/llvm-project/blob/4cbdeee819f3f2ce36d67af493fdd91c708612f4/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h#L304) it is not.
> 
> Do we assume that this was just never needed before, so it can now be implemented and used? Or is there some sort of inherent incompatibility between LLDB's basic type system and Swift type system (talking about primitive types) that this cannot be implemented correctly? If so, what would be an alternative way to abstract the type promotion/conversion from the specific compiler type and type system?

I don't think there's any inherent reason why the Swift type systems can't implement `GetBasicTypeEnumeration` and `GetBasicTypeFromAST`, it's most likely something that just wasn't needed before.

https://github.com/llvm/llvm-project/pull/147064


More information about the lldb-commits mailing list