[libcxx-commits] [libcxxabi] f5f4c5b - [clang][NFC] Follow up to ArraySizeModifier refactoring

Vlad Serebrennikov via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 31 08:21:51 PDT 2023


Author: Vlad Serebrennikov
Date: 2023-10-31T18:21:36+03:00
New Revision: f5f4c5b313fc809b9b1b9d600d0ec3cec0d12941

URL: https://github.com/llvm/llvm-project/commit/f5f4c5b313fc809b9b1b9d600d0ec3cec0d12941
DIFF: https://github.com/llvm/llvm-project/commit/f5f4c5b313fc809b9b1b9d600d0ec3cec0d12941.diff

LOG: [clang][NFC] Follow up to ArraySizeModifier refactoring

This addresses issues found by https://lab.llvm.org/buildbot/#/builders/68/builds/62599 introduced in d71ac4b05bcf2804368ec7217a13c2c47fce7479

Added: 
    

Modified: 
    clang-tools-extra/clangd/Hover.cpp
    libcxxabi/test/test_demangle.pass.cpp
    lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/Hover.cpp b/clang-tools-extra/clangd/Hover.cpp
index 933c69294b40926..7f7b5513dff6fee 100644
--- a/clang-tools-extra/clangd/Hover.cpp
+++ b/clang-tools-extra/clangd/Hover.cpp
@@ -686,9 +686,9 @@ getPredefinedExprHoverContents(const PredefinedExpr &PE, ASTContext &Ctx,
     HI.Type = printType(Name->getType(), Ctx, PP);
   } else {
     // Inside templates, the approximate type `const char[]` is still useful.
-    QualType StringType = Ctx.getIncompleteArrayType(
-        Ctx.CharTy.withConst(), ArrayType::ArraySizeModifier::Normal,
-        /*IndexTypeQuals=*/0);
+    QualType StringType = Ctx.getIncompleteArrayType(Ctx.CharTy.withConst(),
+                                                     ArraySizeModifier::Normal,
+                                                     /*IndexTypeQuals=*/0);
     HI.Type = printType(StringType, Ctx, PP);
   }
   return HI;

diff  --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp
index 77741a952850ab9..3bfdc04ced50b36 100644
--- a/libcxxabi/test/test_demangle.pass.cpp
+++ b/libcxxabi/test/test_demangle.pass.cpp
@@ -5989,7 +5989,7 @@ const char* cases[][2] =
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_129CurrentInstantiationRebuilderEE13TransformTypeERNS_14TypeLocBuilderENS_7TypeLocE", "clang::TreeTransform<(anonymous namespace)::CurrentInstantiationRebuilder>::TransformType(clang::TypeLocBuilder&, clang::TypeLoc)"},
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_129CurrentInstantiationRebuilderEE27TransformFunctionTypeParamsENS_14SourceLocationEPPNS_11ParmVarDeclEjPKNS_8QualTypeERN4llvm15SmallVectorImplIS8_EEPNSC_IS6_EE", "clang::TreeTransform<(anonymous namespace)::CurrentInstantiationRebuilder>::TransformFunctionTypeParams(clang::SourceLocation, clang::ParmVarDecl**, unsigned int, clang::QualType const*, llvm::SmallVectorImpl<clang::QualType>&, llvm::SmallVectorImpl<clang::ParmVarDecl*>*)"},
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_129CurrentInstantiationRebuilderEE26TransformFunctionTypeParamEPNS_11ParmVarDeclEN4llvm8OptionalIjEE", "clang::TreeTransform<(anonymous namespace)::CurrentInstantiationRebuilder>::TransformFunctionTypeParam(clang::ParmVarDecl*, llvm::Optional<unsigned int>)"},
-    {"_ZN5clang13TreeTransformIN12_GLOBAL__N_129CurrentInstantiationRebuilderEE16RebuildArrayTypeENS_8QualTypeENS_9ArrayType17ArraySizeModifierEPKN4llvm5APIntEPNS_4ExprEjNS_11SourceRangeE", "clang::TreeTransform<(anonymous namespace)::CurrentInstantiationRebuilder>::RebuildArrayType(clang::QualType, clang::ArrayType::ArraySizeModifier, llvm::APInt const*, clang::Expr*, unsigned int, clang::SourceRange)"},
+    {"_ZN5clang13TreeTransformIN12_GLOBAL__N_129CurrentInstantiationRebuilderEE16RebuildArrayTypeENS_8QualTypeENS_9ArrayType17ArraySizeModifierEPKN4llvm5APIntEPNS_4ExprEjNS_11SourceRangeE", "clang::TreeTransform<(anonymous namespace)::CurrentInstantiationRebuilder>::RebuildArrayType(clang::QualType, clang::ArraySizeModifier, llvm::APInt const*, clang::Expr*, unsigned int, clang::SourceRange)"},
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_129CurrentInstantiationRebuilderEE22TransformReferenceTypeERNS_14TypeLocBuilderENS_16ReferenceTypeLocE", "clang::TreeTransform<(anonymous namespace)::CurrentInstantiationRebuilder>::TransformReferenceType(clang::TypeLocBuilder&, clang::ReferenceTypeLoc)"},
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_129CurrentInstantiationRebuilderEE26TransformTemplateArgumentsINS_33TemplateArgumentLocInventIteratorIS2_PKNS_16TemplateArgumentEEEEEbT_SA_RNS_24TemplateArgumentListInfoE", "bool clang::TreeTransform<(anonymous namespace)::CurrentInstantiationRebuilder>::TransformTemplateArguments<clang::TemplateArgumentLocInventIterator<(anonymous namespace)::CurrentInstantiationRebuilder, clang::TemplateArgument const*>>(clang::TemplateArgumentLocInventIterator<(anonymous namespace)::CurrentInstantiationRebuilder, clang::TemplateArgument const*>, clang::TemplateArgumentLocInventIterator<(anonymous namespace)::CurrentInstantiationRebuilder, clang::TemplateArgument const*>, clang::TemplateArgumentListInfo&)"},
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_129CurrentInstantiationRebuilderEE25TransformTemplateArgumentERKNS_19TemplateArgumentLocERS4_", "clang::TreeTransform<(anonymous namespace)::CurrentInstantiationRebuilder>::TransformTemplateArgument(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&)"},
@@ -6152,7 +6152,7 @@ const char* cases[][2] =
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_120TemplateInstantiatorEE17TransformCallExprEPNS_8CallExprE", "clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*)"},
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_120TemplateInstantiatorEE21TransformCXXCatchStmtEPNS_12CXXCatchStmtE", "clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformCXXCatchStmt(clang::CXXCatchStmt*)"},
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_120TemplateInstantiatorEE26TransformFunctionProtoTypeERNS_14TypeLocBuilderENS_20FunctionProtoTypeLocE", "clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformFunctionProtoType(clang::TypeLocBuilder&, clang::FunctionProtoTypeLoc)"},
-    {"_ZN5clang13TreeTransformIN12_GLOBAL__N_120TemplateInstantiatorEE16RebuildArrayTypeENS_8QualTypeENS_9ArrayType17ArraySizeModifierEPKN4llvm5APIntEPNS_4ExprEjNS_11SourceRangeE", "clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::RebuildArrayType(clang::QualType, clang::ArrayType::ArraySizeModifier, llvm::APInt const*, clang::Expr*, unsigned int, clang::SourceRange)"},
+    {"_ZN5clang13TreeTransformIN12_GLOBAL__N_120TemplateInstantiatorEE16RebuildArrayTypeENS_8QualTypeENS_9ArrayType17ArraySizeModifierEPKN4llvm5APIntEPNS_4ExprEjNS_11SourceRangeE", "clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::RebuildArrayType(clang::QualType, clang::ArraySizeModifier, llvm::APInt const*, clang::Expr*, unsigned int, clang::SourceRange)"},
     {"_ZN5clang13TreeTransformIN12_GLOBAL__N_120TemplateInstantiatorEE22TransformReferenceTypeERNS_14TypeLocBuilderENS_16ReferenceTypeLocE", "clang::TreeTransform<(anonymous namespace)::TemplateInstantiator>::TransformReferenceType(clang::TypeLocBuilder&, clang::ReferenceTypeLoc)"},
     {"_ZN5clang14TypeLocBuilder12pushFullCopyENS_7TypeLocE", "clang::TypeLocBuilder::pushFullCopy(clang::TypeLoc)"},
     {"_ZN5clang11DeclVisitorINS_24TemplateDeclInstantiatorEPNS_4DeclEE5VisitES3_", "clang::DeclVisitor<clang::TemplateDeclInstantiator, clang::Decl*>::Visit(clang::Decl*)"},
@@ -6262,7 +6262,7 @@ const char* cases[][2] =
     {"_ZN5clang4Sema14BuildParenTypeENS_8QualTypeE", "clang::Sema::BuildParenType(clang::QualType)"},
     {"_ZN5clang4Sema16BuildPointerTypeENS_8QualTypeENS_14SourceLocationENS_15DeclarationNameE", "clang::Sema::BuildPointerType(clang::QualType, clang::SourceLocation, clang::DeclarationName)"},
     {"_ZN5clang4Sema18BuildReferenceTypeENS_8QualTypeEbNS_14SourceLocationENS_15DeclarationNameE", "clang::Sema::BuildReferenceType(clang::QualType, bool, clang::SourceLocation, clang::DeclarationName)"},
-    {"_ZN5clang4Sema14BuildArrayTypeENS_8QualTypeENS_9ArrayType17ArraySizeModifierEPNS_4ExprEjNS_11SourceRangeENS_15DeclarationNameE", "clang::Sema::BuildArrayType(clang::QualType, clang::ArrayType::ArraySizeModifier, clang::Expr*, unsigned int, clang::SourceRange, clang::DeclarationName)"},
+    {"_ZN5clang4Sema14BuildArrayTypeENS_8QualTypeENS_9ArrayType17ArraySizeModifierEPNS_4ExprEjNS_11SourceRangeENS_15DeclarationNameE", "clang::Sema::BuildArrayType(clang::QualType, clang::ArraySizeModifier, clang::Expr*, unsigned int, clang::SourceRange, clang::DeclarationName)"},
     {"_ZN5clang4Sema19RequireCompleteTypeENS_14SourceLocationENS_8QualTypeEj", "clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, unsigned int)"},
     {"_ZN5clang4Sema18BuildExtVectorTypeENS_8QualTypeEPNS_4ExprENS_14SourceLocationE", "clang::Sema::BuildExtVectorType(clang::QualType, clang::Expr*, clang::SourceLocation)"},
     {"_ZN5clang4Sema17BuildFunctionTypeENS_8QualTypeEPS1_jbjNS_16RefQualifierKindENS_14SourceLocationENS_15DeclarationNameENS_12FunctionType7ExtInfoE", "clang::Sema::BuildFunctionType(clang::QualType, clang::QualType*, unsigned int, bool, unsigned int, clang::RefQualifierKind, clang::SourceLocation, clang::DeclarationName, clang::FunctionType::ExtInfo)"},
@@ -8880,11 +8880,11 @@ const char* cases[][2] =
     {"_ZNK5clang10ASTContext22getLValueReferenceTypeENS_8QualTypeEb", "clang::ASTContext::getLValueReferenceType(clang::QualType, bool) const"},
     {"_ZNK5clang10ASTContext22getRValueReferenceTypeENS_8QualTypeE", "clang::ASTContext::getRValueReferenceType(clang::QualType) const"},
     {"_ZNK5clang10ASTContext20getMemberPointerTypeENS_8QualTypeEPKNS_4TypeE", "clang::ASTContext::getMemberPointerType(clang::QualType, clang::Type const*) const"},
-    {"_ZNK5clang10ASTContext20getConstantArrayTypeENS_8QualTypeERKN4llvm5APIntENS_9ArrayType17ArraySizeModifierEj", "clang::ASTContext::getConstantArrayType(clang::QualType, llvm::APInt const&, clang::ArrayType::ArraySizeModifier, unsigned int) const"},
+    {"_ZNK5clang10ASTContext20getConstantArrayTypeENS_8QualTypeERKN4llvm5APIntENS_9ArrayType17ArraySizeModifierEj", "clang::ASTContext::getConstantArrayType(clang::QualType, llvm::APInt const&, clang::ArraySizeModifier, unsigned int) const"},
     {"_ZNK5clang10ASTContext27getVariableArrayDecayedTypeENS_8QualTypeE", "clang::ASTContext::getVariableArrayDecayedType(clang::QualType) const"},
-    {"_ZNK5clang10ASTContext26getDependentSizedArrayTypeENS_8QualTypeEPNS_4ExprENS_9ArrayType17ArraySizeModifierEjNS_11SourceRangeE", "clang::ASTContext::getDependentSizedArrayType(clang::QualType, clang::Expr*, clang::ArrayType::ArraySizeModifier, unsigned int, clang::SourceRange) const"},
-    {"_ZNK5clang10ASTContext20getVariableArrayTypeENS_8QualTypeEPNS_4ExprENS_9ArrayType17ArraySizeModifierEjNS_11SourceRangeE", "clang::ASTContext::getVariableArrayType(clang::QualType, clang::Expr*, clang::ArrayType::ArraySizeModifier, unsigned int, clang::SourceRange) const"},
-    {"_ZNK5clang10ASTContext22getIncompleteArrayTypeENS_8QualTypeENS_9ArrayType17ArraySizeModifierEj", "clang::ASTContext::getIncompleteArrayType(clang::QualType, clang::ArrayType::ArraySizeModifier, unsigned int) const"},
+    {"_ZNK5clang10ASTContext26getDependentSizedArrayTypeENS_8QualTypeEPNS_4ExprENS_9ArrayType17ArraySizeModifierEjNS_11SourceRangeE", "clang::ASTContext::getDependentSizedArrayType(clang::QualType, clang::Expr*, clang::ArraySizeModifier, unsigned int, clang::SourceRange) const"},
+    {"_ZNK5clang10ASTContext20getVariableArrayTypeENS_8QualTypeEPNS_4ExprENS_9ArrayType17ArraySizeModifierEjNS_11SourceRangeE", "clang::ASTContext::getVariableArrayType(clang::QualType, clang::Expr*, clang::ArraySizeModifier, unsigned int, clang::SourceRange) const"},
+    {"_ZNK5clang10ASTContext22getIncompleteArrayTypeENS_8QualTypeENS_9ArrayType17ArraySizeModifierEj", "clang::ASTContext::getIncompleteArrayType(clang::QualType, clang::ArraySizeModifier, unsigned int) const"},
     {"_ZNK5clang10ASTContext13getVectorTypeENS_8QualTypeEjNS_10VectorType10VectorKindE", "clang::ASTContext::getVectorType(clang::QualType, unsigned int, clang::VectorType::VectorKind) const"},
     {"_ZNK5clang10ASTContext16getExtVectorTypeENS_8QualTypeEj", "clang::ASTContext::getExtVectorType(clang::QualType, unsigned int) const"},
     {"_ZNK5clang10ASTContext30getDependentSizedExtVectorTypeENS_8QualTypeEPNS_4ExprENS_14SourceLocationE", "clang::ASTContext::getDependentSizedExtVectorType(clang::QualType, clang::Expr*, clang::SourceLocation) const"},
@@ -10865,9 +10865,9 @@ const char* cases[][2] =
     {"_ZN5clang8QualType10isConstantES0_RNS_10ASTContextE", "clang::QualType::isConstant(clang::QualType, clang::ASTContext&)"},
     {"_ZN5clang17ConstantArrayType20getNumAddressingBitsERNS_10ASTContextENS_8QualTypeERKN4llvm5APIntE", "clang::ConstantArrayType::getNumAddressingBits(clang::ASTContext&, clang::QualType, llvm::APInt const&)"},
     {"_ZN5clang17ConstantArrayType14getMaxSizeBitsERNS_10ASTContextE", "clang::ConstantArrayType::getMaxSizeBits(clang::ASTContext&)"},
-    {"_ZN5clang23DependentSizedArrayTypeC1ERKNS_10ASTContextENS_8QualTypeES4_PNS_4ExprENS_9ArrayType17ArraySizeModifierEjNS_11SourceRangeE", "clang::DependentSizedArrayType::DependentSizedArrayType(clang::ASTContext const&, clang::QualType, clang::QualType, clang::Expr*, clang::ArrayType::ArraySizeModifier, unsigned int, clang::SourceRange)"},
-    {"_ZN5clang23DependentSizedArrayTypeC2ERKNS_10ASTContextENS_8QualTypeES4_PNS_4ExprENS_9ArrayType17ArraySizeModifierEjNS_11SourceRangeE", "clang::DependentSizedArrayType::DependentSizedArrayType(clang::ASTContext const&, clang::QualType, clang::QualType, clang::Expr*, clang::ArrayType::ArraySizeModifier, unsigned int, clang::SourceRange)"},
-    {"_ZN5clang23DependentSizedArrayType7ProfileERN4llvm16FoldingSetNodeIDERKNS_10ASTContextENS_8QualTypeENS_9ArrayType17ArraySizeModifierEjPNS_4ExprE", "clang::DependentSizedArrayType::Profile(llvm::FoldingSetNodeID&, clang::ASTContext const&, clang::QualType, clang::ArrayType::ArraySizeModifier, unsigned int, clang::Expr*)"},
+    {"_ZN5clang23DependentSizedArrayTypeC1ERKNS_10ASTContextENS_8QualTypeES4_PNS_4ExprENS_9ArrayType17ArraySizeModifierEjNS_11SourceRangeE", "clang::DependentSizedArrayType::DependentSizedArrayType(clang::ASTContext const&, clang::QualType, clang::QualType, clang::Expr*, clang::ArraySizeModifier, unsigned int, clang::SourceRange)"},
+    {"_ZN5clang23DependentSizedArrayTypeC2ERKNS_10ASTContextENS_8QualTypeES4_PNS_4ExprENS_9ArrayType17ArraySizeModifierEjNS_11SourceRangeE", "clang::DependentSizedArrayType::DependentSizedArrayType(clang::ASTContext const&, clang::QualType, clang::QualType, clang::Expr*, clang::ArraySizeModifier, unsigned int, clang::SourceRange)"},
+    {"_ZN5clang23DependentSizedArrayType7ProfileERN4llvm16FoldingSetNodeIDERKNS_10ASTContextENS_8QualTypeENS_9ArrayType17ArraySizeModifierEjPNS_4ExprE", "clang::DependentSizedArrayType::Profile(llvm::FoldingSetNodeID&, clang::ASTContext const&, clang::QualType, clang::ArraySizeModifier, unsigned int, clang::Expr*)"},
     {"_ZN5clang27DependentSizedExtVectorTypeC1ERKNS_10ASTContextENS_8QualTypeES4_PNS_4ExprENS_14SourceLocationE", "clang::DependentSizedExtVectorType::DependentSizedExtVectorType(clang::ASTContext const&, clang::QualType, clang::QualType, clang::Expr*, clang::SourceLocation)"},
     {"_ZN5clang27DependentSizedExtVectorTypeC2ERKNS_10ASTContextENS_8QualTypeES4_PNS_4ExprENS_14SourceLocationE", "clang::DependentSizedExtVectorType::DependentSizedExtVectorType(clang::ASTContext const&, clang::QualType, clang::QualType, clang::Expr*, clang::SourceLocation)"},
     {"_ZN5clang27DependentSizedExtVectorType7ProfileERN4llvm16FoldingSetNodeIDERKNS_10ASTContextENS_8QualTypeEPNS_4ExprE", "clang::DependentSizedExtVectorType::Profile(llvm::FoldingSetNodeID&, clang::ASTContext const&, clang::QualType, clang::Expr*)"},

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index f037708efc38007..b2a5cb4eb99f4be 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -2294,12 +2294,13 @@ CompilerType TypeSystemClang::CreateArrayType(const CompilerType &element_type,
 
       llvm::APInt ap_element_count(64, element_count);
       if (element_count == 0) {
-        return GetType(ast.getIncompleteArrayType(
-            ClangUtil::GetQualType(element_type), clang::ArrayType::Normal, 0));
+        return GetType(
+            ast.getIncompleteArrayType(ClangUtil::GetQualType(element_type),
+                                       clang::ArraySizeModifier::Normal, 0));
       } else {
         return GetType(ast.getConstantArrayType(
             ClangUtil::GetQualType(element_type), ap_element_count, nullptr,
-            clang::ArrayType::Normal, 0));
+            clang::ArraySizeModifier::Normal, 0));
       }
     }
   }
@@ -4308,10 +4309,10 @@ CompilerType TypeSystemClang::GetArrayType(lldb::opaque_compiler_type_t type,
     if (size != 0)
       return GetType(ast_ctx.getConstantArrayType(
           qual_type, llvm::APInt(64, size), nullptr,
-          clang::ArrayType::ArraySizeModifier::Normal, 0));
+          clang::ArraySizeModifier::Normal, 0));
     else
       return GetType(ast_ctx.getIncompleteArrayType(
-          qual_type, clang::ArrayType::ArraySizeModifier::Normal, 0));
+          qual_type, clang::ArraySizeModifier::Normal, 0));
   }
 
   return CompilerType();


        


More information about the libcxx-commits mailing list