Skip to content

Commit 65afc38

Browse files
authored
Merge pull request #3002 from augusto2112/next-tss-typeref-typeaslias-skip-special
[lldb] Skip validation on TypeSystemSwiftTypeRef::IsTypedefedType and GetTyp edefType when dealing with special types which diverge from SwiftASTContext. (swift/next)
2 parents 0dbfe7f + 426d34e commit 65afc38

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,6 +3167,15 @@ bool TypeSystemSwiftTypeRef::IsTypedefType(opaque_compiler_type_t type) {
31673167
NodePointer node = GetDemangledType(dem, AsMangledName(type));
31683168
if (node && node->getKind() == Node::Kind::BuiltinTypeName)
31693169
return impl();
3170+
3171+
// This is a discrepancy with `SwiftASTContext`. `impl` correctly
3172+
// returns true, but `VALIDATE_AND_RETURN` will assert. This hardcoded
3173+
// handling of `__C.NSNotificationName` and `__C.NSDecimal` can be removed
3174+
// when the `VALIDATE_AND_RETURN` is removed.
3175+
auto mangled_name = GetMangledTypeName(type);
3176+
if (mangled_name == "$sSo18NSNotificationNameaD" ||
3177+
mangled_name == "$sSo9NSDecimalaD")
3178+
return impl();
31703179
#endif
31713180
VALIDATE_AND_RETURN(impl, IsTypedefType, type, (ReconstructType(type)),
31723181
(ReconstructType(type)));
@@ -3199,6 +3208,15 @@ TypeSystemSwiftTypeRef::GetTypedefedType(opaque_compiler_type_t type) {
31993208
NodePointer node = GetDemangledType(dem, AsMangledName(type));
32003209
if (node && node->getKind() == Node::Kind::BuiltinTypeName)
32013210
return impl();
3211+
3212+
// This is a discrepancy with `SwiftASTContext`. `impl` correctly
3213+
// returns true, but `VALIDATE_AND_RETURN` will assert. This hardcoded
3214+
// handling of `__C.NSNotificationName` and `__C.NSDecimal` can be removed
3215+
// when the `VALIDATE_AND_RETURN` is removed.
3216+
auto mangled_name = GetMangledTypeName(type);
3217+
if (mangled_name == "$sSo18NSNotificationNameaD" ||
3218+
mangled_name == "$sSo9NSDecimalaD")
3219+
return impl();
32023220
#endif
32033221
VALIDATE_AND_RETURN(impl, GetTypedefedType, type, (ReconstructType(type)),
32043222
(ReconstructType(type)));

0 commit comments

Comments
 (0)