[lldb] Make TypeSystemClang::GetFullyUnqualifiedType work for constant arrays

Unqualify (constant) arrays recursively, just like we do for pointers.
This allows for better pretty printer matching.

Differential Revision: https://reviews.llvm.org/D112708
This commit is contained in:
Pavel Labath
2021-10-28 13:24:46 +02:00
parent c78640ee6a
commit 3abd063fc7
4 changed files with 38 additions and 3 deletions

View File

@@ -4238,7 +4238,13 @@ static clang::QualType GetFullyUnqualifiedType_Impl(clang::ASTContext *ast,
if (qual_type->isPointerType())
qual_type = ast->getPointerType(
GetFullyUnqualifiedType_Impl(ast, qual_type->getPointeeType()));
else
else if (const ConstantArrayType *arr =
ast->getAsConstantArrayType(qual_type)) {
qual_type = ast->getConstantArrayType(
GetFullyUnqualifiedType_Impl(ast, arr->getElementType()),
arr->getSize(), arr->getSizeExpr(), arr->getSizeModifier(),
arr->getIndexTypeQualifiers().getAsOpaqueValue());
} else
qual_type = qual_type.getUnqualifiedType();
qual_type.removeLocalConst();
qual_type.removeLocalRestrict();