https://github.com/sedymrak updated https://github.com/llvm/llvm-project/pull/162278
From 04fea010905c6a24dd5b51e3cb7ff96c4b33d40d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ko=C5=A1=C3=ADk?= <[email protected]> Date: Tue, 7 Oct 2025 12:18:43 +0200 Subject: [PATCH 1/4] [lldb] Fix the TypeSystemClang::GetBasicTypeEnumeration wrt. 128-bit integer types --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 4 ++-- lldb/unittests/Symbol/TestTypeSystemClang.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index 21c265ede0bc5..1a574c97d9e46 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -849,8 +849,8 @@ lldb::BasicType TypeSystemClang::GetBasicTypeEnumeration(llvm::StringRef name) { {"unsigned long long int", eBasicTypeUnsignedLongLong}, // "int128" - {"__int128_t", eBasicTypeInt128}, - {"__uint128_t", eBasicTypeUnsignedInt128}, + {"__int128", eBasicTypeInt128}, + {"unsigned __int128", eBasicTypeUnsignedInt128}, // "bool" {"bool", eBasicTypeBool}, diff --git a/lldb/unittests/Symbol/TestTypeSystemClang.cpp b/lldb/unittests/Symbol/TestTypeSystemClang.cpp index f673cceae00dd..814e6578766bd 100644 --- a/lldb/unittests/Symbol/TestTypeSystemClang.cpp +++ b/lldb/unittests/Symbol/TestTypeSystemClang.cpp @@ -159,9 +159,9 @@ TEST_F(TestTypeSystemClang, TestGetBasicTypeFromName) { GetBasicQualType("unsigned long long")); EXPECT_EQ(GetBasicQualType(eBasicTypeUnsignedLongLong), GetBasicQualType("unsigned long long int")); - EXPECT_EQ(GetBasicQualType(eBasicTypeInt128), GetBasicQualType("__int128_t")); + EXPECT_EQ(GetBasicQualType(eBasicTypeInt128), GetBasicQualType("__int128")); EXPECT_EQ(GetBasicQualType(eBasicTypeUnsignedInt128), - GetBasicQualType("__uint128_t")); + GetBasicQualType("unsigned __int128")); EXPECT_EQ(GetBasicQualType(eBasicTypeVoid), GetBasicQualType("void")); EXPECT_EQ(GetBasicQualType(eBasicTypeBool), GetBasicQualType("bool")); EXPECT_EQ(GetBasicQualType(eBasicTypeFloat), GetBasicQualType("float")); From 7092c65a45d35a4e570000488d3d3472946f9217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ko=C5=A1=C3=ADk?= <[email protected]> Date: Fri, 10 Oct 2025 01:42:16 +0200 Subject: [PATCH 2/4] [lldb] reverting some of the previous changes that break backward-compatibility --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index 1a574c97d9e46..21691c4a6cc87 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -849,6 +849,8 @@ lldb::BasicType TypeSystemClang::GetBasicTypeEnumeration(llvm::StringRef name) { {"unsigned long long int", eBasicTypeUnsignedLongLong}, // "int128" + {"__int128_t", eBasicTypeInt128}, + {"__uint128_t", eBasicTypeUnsignedInt128}, {"__int128", eBasicTypeInt128}, {"unsigned __int128", eBasicTypeUnsignedInt128}, From 89f03065d934da984193b8aa41218e7603923ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ko=C5=A1=C3=ADk?= <[email protected]> Date: Fri, 10 Oct 2025 01:53:39 +0200 Subject: [PATCH 3/4] [lldb] reverting some of the previous changes that break backward-compatibility --- lldb/unittests/Symbol/TestTypeSystemClang.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lldb/unittests/Symbol/TestTypeSystemClang.cpp b/lldb/unittests/Symbol/TestTypeSystemClang.cpp index 814e6578766bd..1981e912fa4fa 100644 --- a/lldb/unittests/Symbol/TestTypeSystemClang.cpp +++ b/lldb/unittests/Symbol/TestTypeSystemClang.cpp @@ -159,6 +159,9 @@ TEST_F(TestTypeSystemClang, TestGetBasicTypeFromName) { GetBasicQualType("unsigned long long")); EXPECT_EQ(GetBasicQualType(eBasicTypeUnsignedLongLong), GetBasicQualType("unsigned long long int")); + EXPECT_EQ(GetBasicQualType(eBasicTypeInt128), GetBasicQualType("__int128_t")); + EXPECT_EQ(GetBasicQualType(eBasicTypeUnsignedInt128), + GetBasicQualType("__uint128_t")); EXPECT_EQ(GetBasicQualType(eBasicTypeInt128), GetBasicQualType("__int128")); EXPECT_EQ(GetBasicQualType(eBasicTypeUnsignedInt128), GetBasicQualType("unsigned __int128")); From 02885e1a17d187b6c7c526f61184837b2a40adee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ko=C5=A1=C3=ADk?= <[email protected]> Date: Fri, 10 Oct 2025 10:12:05 +0200 Subject: [PATCH 4/4] [lldb] add comments concerning the 128-bit integer types --- .../Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index 21691c4a6cc87..12cabff7c36e4 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -849,8 +849,18 @@ lldb::BasicType TypeSystemClang::GetBasicTypeEnumeration(llvm::StringRef name) { {"unsigned long long int", eBasicTypeUnsignedLongLong}, // "int128" + // + // The following two lines are here only + // for the sake of backward-compatibility. + // Neither "__int128_t", nor "__uint128_t" are basic-types. + // They are typedefs. {"__int128_t", eBasicTypeInt128}, {"__uint128_t", eBasicTypeUnsignedInt128}, + // In order to be consistent with: + // - gcc's C programming language extension related to 128-bit integers + // https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html + // - the "BuiltinType::getName" method in LLVM + // the following two lines must be present: {"__int128", eBasicTypeInt128}, {"unsigned __int128", eBasicTypeUnsignedInt128}, _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
