From 9628219f6c7e91973ec54c61bd22a7741c69280f Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Wed, 11 Jun 2025 01:38:27 +0800 Subject: [PATCH 01/52] Enable __ptrdiff_t --- clang/include/clang/AST/ASTContext.h | 30 +++-- clang/lib/AST/ASTContext.cpp | 58 +++++++--- clang/lib/AST/FormatString.cpp | 108 ++++++++++++++---- clang/lib/AST/PrintfFormatString.cpp | 9 +- clang/lib/AST/ScanfFormatString.cpp | 19 +-- clang/lib/CodeGen/CGCall.cpp | 3 +- clang/lib/CodeGen/CGCoroutine.cpp | 4 +- clang/lib/CodeGen/CGObjCMac.cpp | 2 +- .../Checkers/VLASizeChecker.cpp | 2 +- clang/test/AST/ast-dump-expr-json.cpp | 4 +- clang/test/AST/ast-dump-expr.cpp | 2 +- clang/test/AST/ast-dump-stmt-json.cpp | 8 +- clang/test/AST/ast-dump-stmt.cpp | 4 +- .../test/FixIt/fixit-format-ios-nopedantic.m | 2 +- clang/test/FixIt/format.m | 6 +- .../test/Sema/format-strings-fixit-ssize_t.c | 2 +- clang/test/Sema/format-strings-int-typedefs.c | 6 +- clang/test/Sema/format-strings-scanf.c | 8 +- clang/test/Sema/format-strings-size_t.c | 11 +- clang/test/Sema/ptrauth-atomic-ops.c | 2 +- .../SemaObjC/format-size-spec-nsinteger.m | 17 +-- 21 files changed, 208 insertions(+), 99 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 8d24d393eab09..bd4600e479b1b 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -25,6 +25,7 @@ #include "clang/AST/RawCommentList.h" #include "clang/AST/SYCLKernelInfo.h" #include "clang/AST/TemplateName.h" +#include "clang/AST/Type.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/PartialDiagnostic.h" #include "clang/Basic/SourceLocation.h" @@ -1952,6 +1953,13 @@ class ASTContext : public RefCountedBase { bool IsDependent, QualType Canon) const; + // The core language uses these types as the result types of some expressions, + // which are typically standard integer types and consistent with it's + // typedefs (if any). These variables store the typedefs generated in the AST, + // not the typedefs provided in the header files. + mutable QualType SizeType; // __size_t + mutable QualType SignedSizeType; // __signed_size_t + mutable QualType PtrdiffType; // __ptrdiff_t public: /// Return the unique reference to the type for the specified TagDecl /// (struct/union/class/enum) decl. @@ -1961,11 +1969,20 @@ class ASTContext : public RefCountedBase { /// . /// /// The sizeof operator requires this (C99 6.5.3.4p4). - CanQualType getSizeType() const; + QualType getSizeType() const; /// Return the unique signed counterpart of /// the integer type corresponding to size_t. - CanQualType getSignedSizeType() const; + QualType getSignedSizeType() const; + + /// Return the unique type for "ptrdiff_t" (C99 7.17) defined in + /// . Pointer - pointer requires this (C99 6.5.6p9). + QualType getPointerDiffType() const; + + /// Return the unique unsigned counterpart of "ptrdiff_t" + /// integer type. The standard (C11 7.21.6.1p7) refers to this type + /// in the definition of %tu format specifier. + QualType getUnsignedPointerDiffType() const; /// Return the unique type for "intmax_t" (C99 7.18.1.5), defined in /// . @@ -2006,15 +2023,6 @@ class ASTContext : public RefCountedBase { /// as defined by the target. QualType getUIntPtrType() const; - /// Return the unique type for "ptrdiff_t" (C99 7.17) defined in - /// . Pointer - pointer requires this (C99 6.5.6p9). - QualType getPointerDiffType() const; - - /// Return the unique unsigned counterpart of "ptrdiff_t" - /// integer type. The standard (C11 7.21.6.1p7) refers to this type - /// in the definition of %tu format specifier. - QualType getUnsignedPointerDiffType() const; - /// Return the unique type for "pid_t" defined in /// . We need this to compute the correct type for vfork(). QualType getProcessIDType() const; diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 45f9602856840..156a1ea157668 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6729,14 +6729,55 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { /// getSizeType - Return the unique type for "size_t" (C99 7.17), the result /// of the sizeof operator (C99 6.5.3.4p4). The value is target dependent and /// needs to agree with the definition in . -CanQualType ASTContext::getSizeType() const { +QualType ASTContext::getSizeType() const { +#if 0 + if (SizeType.isNull()) { + SizeType = getTypedefType(buildImplicitTypedef( + getFromTargetType(Target->getSizeType()), "__size_t")); + } + return SizeType; +#else return getFromTargetType(Target->getSizeType()); +#endif } /// Return the unique signed counterpart of the integer type /// corresponding to size_t. -CanQualType ASTContext::getSignedSizeType() const { +QualType ASTContext::getSignedSizeType() const { +#if 0 + if (SignedSizeType.isNull()) { + SignedSizeType = getTypedefType(buildImplicitTypedef( + getFromTargetType(Target->getSignedSizeType()), "__signed_size_t")); + } + return SignedSizeType; +#else return getFromTargetType(Target->getSignedSizeType()); +#endif +} + +/// getPointerDiffType - Return the unique type for "ptrdiff_t" (C99 7.17) +/// defined in . Pointer - pointer requires this (C99 6.5.6p9). +QualType ASTContext::getPointerDiffType() const { +#if 1 + if (PtrdiffType.isNull()) { + if (getLangOpts().C99 || getLangOpts().CPlusPlus) + PtrdiffType = getTypedefType(buildImplicitTypedef( + getFromTargetType(Target->getPtrDiffType(LangAS::Default)), + "__ptrdiff_t")); + else + PtrdiffType = getFromTargetType(Target->getPtrDiffType(LangAS::Default)); + } + return PtrdiffType; +#else + return getFromTargetType(Target->getPtrDiffType(LangAS::Default)); +#endif +} + +/// Return the unique unsigned counterpart of "ptrdiff_t" +/// integer type. The standard (C11 7.21.6.1p7) refers to this type +/// in the definition of %tu format specifier. +QualType ASTContext::getUnsignedPointerDiffType() const { + return getFromTargetType(Target->getUnsignedPtrDiffType(LangAS::Default)); } /// getIntMaxType - Return the unique type for "intmax_t" (C99 7.18.1.5). @@ -6771,19 +6812,6 @@ QualType ASTContext::getUIntPtrType() const { return getCorrespondingUnsignedType(getIntPtrType()); } -/// getPointerDiffType - Return the unique type for "ptrdiff_t" (C99 7.17) -/// defined in . Pointer - pointer requires this (C99 6.5.6p9). -QualType ASTContext::getPointerDiffType() const { - return getFromTargetType(Target->getPtrDiffType(LangAS::Default)); -} - -/// Return the unique unsigned counterpart of "ptrdiff_t" -/// integer type. The standard (C11 7.21.6.1p7) refers to this type -/// in the definition of %tu format specifier. -QualType ASTContext::getUnsignedPointerDiffType() const { - return getFromTargetType(Target->getUnsignedPtrDiffType(LangAS::Default)); -} - /// Return the unique type for "pid_t" defined in /// . We need this to compute the correct type for vfork(). QualType ASTContext::getProcessIDType() const { diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index 5d3b56fc4e713..0c1fd33b56f25 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "clang/AST/FormatString.h" #include "FormatStringParsing.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetInfo.h" @@ -320,6 +321,69 @@ bool clang::analyze_format_string::ParseUTF8InvalidSpecifier( // Methods on ArgType. //===----------------------------------------------------------------------===// +static bool namedTypeToLengthModifierKind(QualType QT, + LengthModifier::Kind &K) { + for (/**/; const auto *TT = QT->getAs(); + QT = TT->getDecl()->getUnderlyingType()) { + StringRef Name = TT->getDecl()->getIdentifier()->getName(); + if (Name == "size_t" || Name == "__size_t") { + K = LengthModifier::AsSizeT; + return true; + } else if (Name == "__signed_size_t" || + Name == "ssize_t" /*Not C99, but common in Unix.*/) { + K = LengthModifier::AsSizeT; + return true; + } else if (Name == "ptrdiff_t" || Name == "__ptrdiff_t") { + K = LengthModifier::AsPtrDiff; + return true; + } else if (Name == "intmax_t") { + K = LengthModifier::AsIntMax; + return true; + } else if (Name == "uintmax_t") { + K = LengthModifier::AsIntMax; + return true; + } + } + return false; +} + +// Check whether T and E are compatible size_t/ptrdiff_t typedefs. E must be +// consistent with LE. +// T is the type of the actual expression in the code to be checked, and E is +// the expected type parsed from the format string. +static clang::analyze_format_string::ArgType::MatchKind +matchesSizeTPtrdiffT(ASTContext &C, QualType T, QualType E, + LengthModifier::Kind LE) { + using Kind = LengthModifier::Kind; + using MatchKind = clang::analyze_format_string::ArgType::MatchKind; + assert(LE == Kind::AsPtrDiff || LE == Kind::AsSizeT); + + if (!T->isIntegerType()) + return MatchKind::NoMatch; + + if (C.getCorrespondingSignedType(T.getCanonicalType()) != + C.getCorrespondingSignedType(E.getCanonicalType())) + return MatchKind::NoMatch; + + // signed size_t and unsigned ptrdiff_t does not have typedefs in C and C++. + if (LE == Kind::AsSizeT && E->isSignedIntegerType()) + return T->isSignedIntegerType() ? MatchKind::Match + : MatchKind::NoMatchSignedness; + + if (LE == LengthModifier::Kind::AsPtrDiff && E->isUnsignedIntegerType()) + return T->isUnsignedIntegerType() ? MatchKind::Match + : MatchKind::NoMatchSignedness; + + if (Kind Actual = Kind::None; namedTypeToLengthModifierKind(T, Actual)) { + if (Actual == LE) + return MatchKind::Match; + else if (Actual == Kind::AsPtrDiff || Actual == Kind::AsSizeT) + return MatchKind::NoMatchSignedness; + } + + return MatchKind::NoMatch; +} + clang::analyze_format_string::ArgType::MatchKind ArgType::matchesType(ASTContext &C, QualType argTy) const { // When using the format attribute in C++, you can receive a function or an @@ -394,6 +458,13 @@ ArgType::matchesType(ASTContext &C, QualType argTy) const { } case SpecificTy: { + if (TK != TypeKind::DontCare) { + return matchesSizeTPtrdiffT(C, argTy, T, + TK == TypeKind::SizeT + ? LengthModifier::Kind::AsSizeT + : LengthModifier::AsPtrDiff); + } + if (const EnumType *ETy = argTy->getAs()) { // If the enum is incomplete we know nothing about the underlying type. // Assume that it's 'int'. Do not use the underlying type for a scoped @@ -653,6 +724,18 @@ ArgType::matchesArgType(ASTContext &C, const ArgType &Other) const { if (Left.K == AK::SpecificTy) { if (Right.K == AK::SpecificTy) { + if (Left.TK != TypeKind::DontCare) { + return matchesSizeTPtrdiffT(C, Right.T, Left.T, + Left.TK == TypeKind::SizeT + ? LengthModifier::Kind::AsSizeT + : LengthModifier::AsPtrDiff); + } else if (Right.TK != TypeKind::DontCare) { + return matchesSizeTPtrdiffT(C, Left.T, Right.T, + Right.TK == TypeKind::SizeT + ? LengthModifier::Kind::AsSizeT + : LengthModifier::AsPtrDiff); + } + auto Canon1 = C.getCanonicalType(Left.T); auto Canon2 = C.getCanonicalType(Right.T); if (Canon1 == Canon2) @@ -1200,27 +1283,10 @@ FormatSpecifier::getCorrectedLengthModifier() const { bool FormatSpecifier::namedTypeToLengthModifier(QualType QT, LengthModifier &LM) { - for (/**/; const auto *TT = QT->getAs(); - QT = TT->getDecl()->getUnderlyingType()) { - const TypedefNameDecl *Typedef = TT->getDecl(); - const IdentifierInfo *Identifier = Typedef->getIdentifier(); - if (Identifier->getName() == "size_t") { - LM.setKind(LengthModifier::AsSizeT); - return true; - } else if (Identifier->getName() == "ssize_t") { - // Not C99, but common in Unix. - LM.setKind(LengthModifier::AsSizeT); - return true; - } else if (Identifier->getName() == "intmax_t") { - LM.setKind(LengthModifier::AsIntMax); - return true; - } else if (Identifier->getName() == "uintmax_t") { - LM.setKind(LengthModifier::AsIntMax); - return true; - } else if (Identifier->getName() == "ptrdiff_t") { - LM.setKind(LengthModifier::AsPtrDiff); - return true; - } + if (LengthModifier::Kind Out = LengthModifier::Kind::None; + namedTypeToLengthModifierKind(QT, Out)) { + LM.setKind(Out); + return true; } return false; } diff --git a/clang/lib/AST/PrintfFormatString.cpp b/clang/lib/AST/PrintfFormatString.cpp index 293164ddac8f8..397a1d4c1172f 100644 --- a/clang/lib/AST/PrintfFormatString.cpp +++ b/clang/lib/AST/PrintfFormatString.cpp @@ -543,7 +543,8 @@ ArgType PrintfSpecifier::getScalarArgType(ASTContext &Ctx, case LengthModifier::AsIntMax: return ArgType(Ctx.getIntMaxType(), "intmax_t"); case LengthModifier::AsSizeT: - return ArgType::makeSizeT(ArgType(Ctx.getSignedSizeType(), "ssize_t")); + return ArgType::makeSizeT( + ArgType(Ctx.getSignedSizeType(), "signed size_t")); case LengthModifier::AsInt3264: return Ctx.getTargetInfo().getTriple().isArch64Bit() ? ArgType(Ctx.LongLongTy, "__int64") @@ -626,9 +627,11 @@ ArgType PrintfSpecifier::getScalarArgType(ASTContext &Ctx, case LengthModifier::AsIntMax: return ArgType::PtrTo(ArgType(Ctx.getIntMaxType(), "intmax_t")); case LengthModifier::AsSizeT: - return ArgType::PtrTo(ArgType(Ctx.getSignedSizeType(), "ssize_t")); + return ArgType::PtrTo(ArgType::makeSizeT( + ArgType(Ctx.getSignedSizeType(), "signed size_t"))); case LengthModifier::AsPtrDiff: - return ArgType::PtrTo(ArgType(Ctx.getPointerDiffType(), "ptrdiff_t")); + return ArgType::PtrTo(ArgType::makePtrdiffT( + ArgType(Ctx.getPointerDiffType(), "ptrdiff_t"))); case LengthModifier::AsLongDouble: return ArgType(); // FIXME: Is this a known extension? case LengthModifier::AsAllocate: diff --git a/clang/lib/AST/ScanfFormatString.cpp b/clang/lib/AST/ScanfFormatString.cpp index 7ee21c8c61954..e3926185860db 100644 --- a/clang/lib/AST/ScanfFormatString.cpp +++ b/clang/lib/AST/ScanfFormatString.cpp @@ -251,9 +251,11 @@ ArgType ScanfSpecifier::getArgType(ASTContext &Ctx) const { case LengthModifier::AsIntMax: return ArgType::PtrTo(ArgType(Ctx.getIntMaxType(), "intmax_t")); case LengthModifier::AsSizeT: - return ArgType::PtrTo(ArgType(Ctx.getSignedSizeType(), "ssize_t")); + return ArgType::PtrTo(ArgType::makeSizeT( + ArgType(Ctx.getSignedSizeType(), "signed size_t"))); case LengthModifier::AsPtrDiff: - return ArgType::PtrTo(ArgType(Ctx.getPointerDiffType(), "ptrdiff_t")); + return ArgType::PtrTo(ArgType::makePtrdiffT( + ArgType(Ctx.getPointerDiffType(), "ptrdiff_t"))); case LengthModifier::AsLongDouble: // GNU extension. return ArgType::PtrTo(Ctx.LongLongTy); @@ -292,10 +294,11 @@ ArgType ScanfSpecifier::getArgType(ASTContext &Ctx) const { case LengthModifier::AsIntMax: return ArgType::PtrTo(ArgType(Ctx.getUIntMaxType(), "uintmax_t")); case LengthModifier::AsSizeT: - return ArgType::PtrTo(ArgType(Ctx.getSizeType(), "size_t")); - case LengthModifier::AsPtrDiff: return ArgType::PtrTo( - ArgType(Ctx.getUnsignedPointerDiffType(), "unsigned ptrdiff_t")); + ArgType::makeSizeT(ArgType(Ctx.getSizeType(), "size_t"))); + case LengthModifier::AsPtrDiff: + return ArgType::PtrTo(ArgType::makePtrdiffT( + ArgType(Ctx.getUnsignedPointerDiffType(), "unsigned ptrdiff_t"))); case LengthModifier::AsLongDouble: // GNU extension. return ArgType::PtrTo(Ctx.UnsignedLongLongTy); @@ -390,9 +393,11 @@ ArgType ScanfSpecifier::getArgType(ASTContext &Ctx) const { case LengthModifier::AsIntMax: return ArgType::PtrTo(ArgType(Ctx.getIntMaxType(), "intmax_t")); case LengthModifier::AsSizeT: - return ArgType::PtrTo(ArgType(Ctx.getSignedSizeType(), "ssize_t")); + return ArgType::PtrTo(ArgType::makeSizeT( + ArgType(Ctx.getSignedSizeType(), "signed size_t"))); case LengthModifier::AsPtrDiff: - return ArgType::PtrTo(ArgType(Ctx.getPointerDiffType(), "ptrdiff_t")); + return ArgType::PtrTo(ArgType::makePtrdiffT( + ArgType(Ctx.getPointerDiffType(), "ptrdiff_t"))); case LengthModifier::AsLongDouble: return ArgType(); // FIXME: Is this a known extension? case LengthModifier::AsAllocate: diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 46a5d64412275..3ff2597d65e54 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -223,7 +223,8 @@ static void appendParameterTypes( for (unsigned I = 0, E = FPT->getNumParams(); I != E; ++I) { prefix.push_back(FPT->getParamType(I)); if (ExtInfos[I].hasPassObjectSize()) - prefix.push_back(CGT.getContext().getSizeType()); + prefix.push_back( + CGT.getContext().getSizeType()->getCanonicalTypeUnqualified()); } addExtParameterInfosForCall(paramInfos, FPT.getTypePtr(), PrefixSize, diff --git a/clang/lib/CodeGen/CGCoroutine.cpp b/clang/lib/CodeGen/CGCoroutine.cpp index 0fc488e98aaf0..265dedf228e69 100644 --- a/clang/lib/CodeGen/CGCoroutine.cpp +++ b/clang/lib/CodeGen/CGCoroutine.cpp @@ -1002,14 +1002,14 @@ RValue CodeGenFunction::EmitCoroutineIntrinsic(const CallExpr *E, } case llvm::Intrinsic::coro_size: { auto &Context = getContext(); - CanQualType SizeTy = Context.getSizeType(); + CanQualType SizeTy = Context.getSizeType()->getCanonicalTypeUnqualified(); llvm::IntegerType *T = Builder.getIntNTy(Context.getTypeSize(SizeTy)); llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::coro_size, T); return RValue::get(Builder.CreateCall(F)); } case llvm::Intrinsic::coro_align: { auto &Context = getContext(); - CanQualType SizeTy = Context.getSizeType(); + CanQualType SizeTy = Context.getSizeType()->getCanonicalTypeUnqualified(); llvm::IntegerType *T = Builder.getIntNTy(Context.getTypeSize(SizeTy)); llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::coro_align, T); return RValue::get(Builder.CreateCall(F)); diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 1c23a8b4db918..5a0d2a2286bac 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -285,7 +285,7 @@ class ObjCCommonTypesHelper { SmallVector Params; Params.push_back(Ctx.VoidPtrTy); Params.push_back(Ctx.VoidPtrTy); - Params.push_back(Ctx.getSizeType()); + Params.push_back(Ctx.getSizeType()->getCanonicalTypeUnqualified()); Params.push_back(Ctx.BoolTy); Params.push_back(Ctx.BoolTy); llvm::FunctionType *FTy = Types.GetFunctionType( diff --git a/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp index 1042b43680fd2..c97341f072aba 100644 --- a/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp @@ -92,7 +92,7 @@ ProgramStateRef VLASizeChecker::checkVLA(CheckerContext &C, ASTContext &Ctx = C.getASTContext(); SValBuilder &SVB = C.getSValBuilder(); - CanQualType SizeTy = Ctx.getSizeType(); + QualType SizeTy = Ctx.getSizeType(); uint64_t SizeMax = SVB.getBasicValueFactory().getMaxValue(SizeTy)->getZExtValue(); diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp index 5a762acad7917..f77c263d28a0c 100644 --- a/clang/test/AST/ast-dump-expr-json.cpp +++ b/clang/test/AST/ast-dump-expr-json.cpp @@ -1587,7 +1587,9 @@ void TestNonADLCall3() { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "long" +// CHECK-NEXT: "desugaredQualType": "long", +// CHECK-NEXT: "qualType": "__ptrdiff_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "opcode": "-", diff --git a/clang/test/AST/ast-dump-expr.cpp b/clang/test/AST/ast-dump-expr.cpp index 2efd0b5e8ac21..0aab221701d8f 100644 --- a/clang/test/AST/ast-dump-expr.cpp +++ b/clang/test/AST/ast-dump-expr.cpp @@ -119,7 +119,7 @@ void UnaryExpressions(int *p) { noexcept(p - p); // CHECK: CXXNoexceptExpr 0x{{[^ ]*}} 'bool' - // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} 'long' '-' + // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} '__ptrdiff_t':'long' '-' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' // CHECK-NEXT: ImplicitCastExpr diff --git a/clang/test/AST/ast-dump-stmt-json.cpp b/clang/test/AST/ast-dump-stmt-json.cpp index a473d17da9424..2beea0519bbac 100644 --- a/clang/test/AST/ast-dump-stmt-json.cpp +++ b/clang/test/AST/ast-dump-stmt-json.cpp @@ -4980,7 +4980,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "long" +// CHECK-NEXT: "desugaredQualType": "long", +// CHECK-NEXT: "qualType": "__ptrdiff_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "value": "10" @@ -6503,7 +6505,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "long" +// CHECK-NEXT: "desugaredQualType": "long" +// CHECK-NEXT: "qualType": "__ptrdiff_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "value": "10" diff --git a/clang/test/AST/ast-dump-stmt.cpp b/clang/test/AST/ast-dump-stmt.cpp index 407584e5b82de..42c5f3b3498a4 100644 --- a/clang/test/AST/ast-dump-stmt.cpp +++ b/clang/test/AST/ast-dump-stmt.cpp @@ -206,7 +206,7 @@ void TestIteration() { // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} 'int *' '+' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int[10]' lvalue Var 0x{{[^ ]*}} '__range1' 'int (&)[10]' - // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'long' 10 + // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} '__ptrdiff_t':'long' 10 // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} 'bool' '!=' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue Var 0x{{[^ ]*}} '__begin1' 'int *' @@ -274,7 +274,7 @@ void TestIteration() { // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} 'int *' '+' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int[10]' lvalue Var 0x{{[^ ]*}} '__range1' 'int (&)[10]' - // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'long' 10 + // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} '__ptrdiff_t':'long' 10 // CHECK-NEXT: BinaryOperator 0x{{[^ ]*}} 'bool' '!=' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue Var 0x{{[^ ]*}} '__begin1' 'int *' diff --git a/clang/test/FixIt/fixit-format-ios-nopedantic.m b/clang/test/FixIt/fixit-format-ios-nopedantic.m index db9ac797c2472..836a4b5372f13 100644 --- a/clang/test/FixIt/fixit-format-ios-nopedantic.m +++ b/clang/test/FixIt/fixit-format-ios-nopedantic.m @@ -1,5 +1,5 @@ // RUN: cp %s %t -// RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -Wformat -Werror -fixit %t +// RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -Wformat -fixit %t int printf(const char *restrict, ...); typedef unsigned int NSUInteger; diff --git a/clang/test/FixIt/format.m b/clang/test/FixIt/format.m index 950765bad9339..e97ae10c974aa 100644 --- a/clang/test/FixIt/format.m +++ b/clang/test/FixIt/format.m @@ -237,14 +237,14 @@ void testSizeTypes(void) { printf("%zu", 0.f); // expected-warning-re{{format specifies type 'size_t' (aka '{{.+}}') but the argument has type 'float'}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:14}:"%f" - printf("%zd", 0.f); // expected-warning-re{{format specifies type 'ssize_t' (aka '{{.+}}') but the argument has type 'float'}} + printf("%zd", 0.f); // expected-warning-re{{format specifies type 'signed size_t' (aka '{{.+}}') but the argument has type 'float'}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:14}:"%f" short x; #if !defined(__ANDROID__) && !defined(__Fuchsia__) - printf("%zn", &x); // expected-warning-re{{format specifies type 'ssize_t *' (aka '{{.+}}') but the argument has type 'short *'}} + printf("%zn", &x); // expected-warning-re{{format specifies type 'signed size_t *' (aka '{{.+}}') but the argument has type 'short *'}} #else - printf("%zn", &x); // expected-warning-re{{format specifies type 'ssize_t *' (aka '{{.+}}') but the argument has type 'short *'}} + printf("%zn", &x); // expected-warning-re{{format specifies type 'signed size_t *' (aka '{{.+}}') but the argument has type 'short *'}} // expected-warning@-1 {{'%n' specifier not supported on this platform}} #endif // !defined(__ANDROID__) && !defined(__Fuchsia__) // PrintfSpecifier::fixType doesn't handle %n, so a fix-it is not emitted, diff --git a/clang/test/Sema/format-strings-fixit-ssize_t.c b/clang/test/Sema/format-strings-fixit-ssize_t.c index 2c83db0b66362..a7c5c9c509817 100644 --- a/clang/test/Sema/format-strings-fixit-ssize_t.c +++ b/clang/test/Sema/format-strings-fixit-ssize_t.c @@ -6,7 +6,7 @@ /* This is a test of the various code modification hints that are provided as part of warning or extension diagnostics. All of the warnings will be fixed by -fixit, and the resulting file should - compile cleanly with -Werror -pedantic. */ + compile cleanly with -pedantic. */ int printf(char const *, ...); int scanf(const char *, ...); diff --git a/clang/test/Sema/format-strings-int-typedefs.c b/clang/test/Sema/format-strings-int-typedefs.c index 341d49c500f43..685f89b452e45 100644 --- a/clang/test/Sema/format-strings-int-typedefs.c +++ b/clang/test/Sema/format-strings-int-typedefs.c @@ -7,7 +7,7 @@ void test(void) { printf("%jd", 42.0); // expected-warning {{format specifies type 'intmax_t' (aka 'long long')}} printf("%ju", 42.0); // expected-warning {{format specifies type 'uintmax_t' (aka 'unsigned long long')}} printf("%zu", 42.0); // expected-warning {{format specifies type 'size_t' (aka 'unsigned long')}} - printf("%td", 42.0); // expected-warning {{format specifies type 'ptrdiff_t' (aka 'int')}} + printf("%td", 42.0); // expected-warning {{format specifies type 'ptrdiff_t' (aka '__ptrdiff_t')}} printf("%lc", 42.0); // expected-warning {{format specifies type 'wint_t' (aka 'int')}} printf("%ls", 42.0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} printf("%S", 42.0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} @@ -16,7 +16,7 @@ void test(void) { scanf("%jd", 0); // expected-warning {{format specifies type 'intmax_t *' (aka 'long long *')}} scanf("%ju", 0); // expected-warning {{format specifies type 'uintmax_t *' (aka 'unsigned long long *')}} scanf("%zu", 0); // expected-warning {{format specifies type 'size_t *' (aka 'unsigned long *')}} - scanf("%td", 0); // expected-warning {{format specifies type 'ptrdiff_t *' (aka 'int *')}} + scanf("%td", 0); // expected-warning {{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *')}} scanf("%lc", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} scanf("%ls", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} scanf("%S", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} @@ -33,5 +33,5 @@ void test(void) { printf("%jd", (intmax_t)42); // expected-warning {{format specifies type 'intmax_t' (aka 'long long') but the argument has type 'intmax_t' (aka 'void *')}} printf("%ju", (uintmax_t)42); // expected-warning {{format specifies type 'uintmax_t' (aka 'unsigned long long') but the argument has type 'uintmax_t' (aka 'void *')}} printf("%zu", (size_t)42); // expected-warning {{format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'size_t' (aka 'void *')}} - printf("%td", (ptrdiff_t)42); // expected-warning {{format specifies type 'ptrdiff_t' (aka 'int') but the argument has type 'ptrdiff_t' (aka 'void *')}} + printf("%td", (ptrdiff_t)42); // expected-warning {{format specifies type 'ptrdiff_t' (aka '__ptrdiff_t') but the argument has type 'ptrdiff_t' (aka 'void *')}} } diff --git a/clang/test/Sema/format-strings-scanf.c b/clang/test/Sema/format-strings-scanf.c index eb5b8ec36bf7a..0e48a760e457a 100644 --- a/clang/test/Sema/format-strings-scanf.c +++ b/clang/test/Sema/format-strings-scanf.c @@ -210,13 +210,13 @@ void test_size_types(void) { scanf("%zd", &s); // No warning. double d2 = 0.; - scanf("%zd", &d2); // expected-warning-re{{format specifies type 'ssize_t *' (aka '{{.+}}') but the argument has type 'double *'}} + scanf("%zd", &d2); // expected-warning-re{{format specifies type 'signed size_t *' (aka '{{.+}}') but the argument has type 'double *'}} ssize_t sn = 0; scanf("%zn", &sn); // No warning. double d3 = 0.; - scanf("%zn", &d3); // expected-warning-re{{format specifies type 'ssize_t *' (aka '{{.+}}') but the argument has type 'double *'}} + scanf("%zn", &d3); // expected-warning-re{{format specifies type 'signed size_t *' (aka '{{.+}}') but the argument has type 'double *'}} } void test_ptrdiff_t_types(void) { @@ -231,13 +231,13 @@ void test_ptrdiff_t_types(void) { scanf("%td", &p2); // No warning. double d2 = 0.; - scanf("%td", &d2); // expected-warning-re{{format specifies type 'ptrdiff_t *' (aka '{{.+}}') but the argument has type 'double *'}} + scanf("%td", &d2); // expected-warning{{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *') but the argument has type 'double *'}} ptrdiff_t p3 = 0; scanf("%tn", &p3); // No warning. double d3 = 0.; - scanf("%tn", &d3); // expected-warning-re{{format specifies type 'ptrdiff_t *' (aka '{{.+}}') but the argument has type 'double *'}} + scanf("%tn", &d3); // expected-warning{{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *') but the argument has type 'double *'}} } void check_conditional_literal(char *s, int *i) { diff --git a/clang/test/Sema/format-strings-size_t.c b/clang/test/Sema/format-strings-size_t.c index 5058a762183d3..e20a0157443e5 100644 --- a/clang/test/Sema/format-strings-size_t.c +++ b/clang/test/Sema/format-strings-size_t.c @@ -11,7 +11,7 @@ void test(void) { printf("%ju", (double)42); // expected-warning {{format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'double'}} // ptrdiff_t - printf("%td", (double)42); // expected-warning {{format specifies type 'ptrdiff_t' (aka 'long') but the argument has type 'double'}} + printf("%td", (double)42); // expected-warning {{format specifies type 'ptrdiff_t' (aka '__ptrdiff_t') but the argument has type 'double'}} } void test_writeback(void) { @@ -19,10 +19,9 @@ void test_writeback(void) { printf("%jn", (unsigned long*)0); // no-warning printf("%jn", (int*)0); // expected-warning{{format specifies type 'intmax_t *' (aka 'long *') but the argument has type 'int *'}} - printf("%zn", (long*)0); // no-warning - // FIXME: Warn about %zn with non-ssize_t argument. + printf("%zn", (int*)0); // expected-warning{{format specifies type 'signed size_t *' (aka 'long *') but the argument has type 'int *'}} - printf("%tn", (long*)0); // no-warning - printf("%tn", (unsigned long*)0); // no-warning - printf("%tn", (int*)0); // expected-warning{{format specifies type 'ptrdiff_t *' (aka 'long *') but the argument has type 'int *'}} + printf("%tn", (long*)0); // expected-warning{{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *') but the argument has type 'long *'}} + printf("%tn", (unsigned long*)0); // expected-warning{{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *') but the argument has type 'unsigned long *'}} + printf("%tn", (int*)0); // expected-warning{{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *') but the argument has type 'int *'}} } diff --git a/clang/test/Sema/ptrauth-atomic-ops.c b/clang/test/Sema/ptrauth-atomic-ops.c index ccb9a1abcc14d..8872090d83b8d 100644 --- a/clang/test/Sema/ptrauth-atomic-ops.c +++ b/clang/test/Sema/ptrauth-atomic-ops.c @@ -54,7 +54,7 @@ void f() { __c11_atomic_exchange(ATOMIZE(j), ATOMIZE(non_addr_discriminatedauthenticated_ptr), memory_order_seq_cst); // expected-error@-1 {{incompatible pointer to integer conversion passing 'volatile __ptrauth(2,0,200) _Atomic(int *) *' to parameter of type 'typeof (j)' (aka 'int')}} __c11_atomic_fetch_add(ATOMIZE(non_addr_discriminatedauthenticated_ptr), ATOMIZE(j), memory_order_seq_cst); - // expected-error@-1 {{incompatible pointer to integer conversion passing 'volatile _Atomic(typeof (j)) *' to parameter of type 'long'}} + // expected-error@-1 {{incompatible pointer to integer conversion passing 'volatile _Atomic(typeof (j)) *' to parameter of type '__ptrdiff_t'}} __c11_atomic_fetch_and(ATOMIZE(j), ATOMIZE(non_addr_discriminatedauthenticated_ptr), memory_order_seq_cst); // expected-error@-1 {{incompatible pointer to integer conversion passing 'volatile __ptrauth(2,0,200) _Atomic(int *) *' to parameter of type 'typeof (j)' (aka 'int')}} diff --git a/clang/test/SemaObjC/format-size-spec-nsinteger.m b/clang/test/SemaObjC/format-size-spec-nsinteger.m index 8ecca6ec6a544..f25ce27f345db 100644 --- a/clang/test/SemaObjC/format-size-spec-nsinteger.m +++ b/clang/test/SemaObjC/format-size-spec-nsinteger.m @@ -3,10 +3,6 @@ // RUN: %clang_cc1 -triple thumbv7k-apple-watchos2.0.0 -fsyntax-only -fblocks -verify %s // RUN: %clang_cc1 -triple thumbv7k-apple-watchos2.0.0 -fsyntax-only -fblocks -verify -Wformat-pedantic -DPEDANTIC %s -#if !defined(PEDANTIC) -// expected-no-diagnostics -#endif - #if __LP64__ typedef unsigned long NSUInteger; typedef long NSInteger; @@ -30,12 +26,10 @@ void testSizeSpecifier(void) { NSInteger i = 0; NSUInteger j = 0; NSLog(@"max NSInteger = %zi", i); - NSLog(@"max NSUinteger = %zu", j); - #if defined(PEDANTIC) - // expected-warning@-4 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}} - // expected-warning@-4 {{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}} + // expected-warning@-2 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}} #endif + NSLog(@"max NSUinteger = %zu", j); // expected-warning {{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}} } void testPtrdiffSpecifier(ptrdiff_t x) { @@ -43,10 +37,9 @@ void testPtrdiffSpecifier(ptrdiff_t x) { NSUInteger j = 0; NSLog(@"ptrdiff_t NSUinteger: %tu", j); - NSLog(@"ptrdiff_t NSInteger: %td", i); - NSLog(@"ptrdiff_t %tu, %td", x, x); #if __is_target_os(watchos) && defined(PEDANTIC) - // expected-warning@-4 {{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}} - // expected-warning@-4 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}} + // expected-warning@-2 {{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}} #endif + NSLog(@"ptrdiff_t NSInteger: %td", i); // expected-warning {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}} + NSLog(@"ptrdiff_t %tu, %td", x, x); // no-warning } From 33f05ab37c4aa0f92f62fd586194ac711ecd5eb5 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Wed, 11 Jun 2025 11:56:35 +0800 Subject: [PATCH 02/52] Enable __size_t and __unsigned_size_t --- clang/lib/AST/ASTContext.cpp | 39 +++-- clang/lib/Sema/SemaChecking.cpp | 2 +- .../Checkers/StdLibraryFunctionsChecker.cpp | 80 +++++---- clang/test/AST/ast-dump-array.cpp | 2 +- clang/test/AST/ast-dump-expr-json.c | 12 +- clang/test/AST/ast-dump-expr-json.cpp | 24 ++- clang/test/AST/ast-dump-expr.c | 6 +- clang/test/AST/ast-dump-expr.cpp | 14 +- ...dump-openmp-distribute-parallel-for-simd.c | 20 +-- .../ast-dump-openmp-distribute-parallel-for.c | 20 +-- ...arget-teams-distribute-parallel-for-simd.c | 160 +++++++++--------- ...nmp-target-teams-distribute-parallel-for.c | 160 +++++++++--------- ...penmp-teams-distribute-parallel-for-simd.c | 160 +++++++++--------- ...ump-openmp-teams-distribute-parallel-for.c | 160 +++++++++--------- clang/test/AST/ast-dump-recovery.c | 2 +- clang/test/AST/ast-dump-stmt-json.cpp | 78 ++++++--- clang/test/AST/ast-dump-traits.cpp | 8 +- clang/test/AST/ast-dump-types-errors-json.cpp | 4 +- clang/test/Analysis/cfg.cpp | 2 +- clang/test/Analysis/explain-svals.cpp | 2 +- .../std-c-library-functions-arg-weakdeps.c | 2 +- .../Analysis/std-c-library-functions-lookup.c | 2 +- ...td-c-library-functions-vs-stream-checker.c | 4 +- clang/test/Analysis/std-c-library-functions.c | 4 +- clang/test/CXX/drs/cwg2xx.cpp | 2 +- clang/test/CXX/lex/lex.literal/lex.ext/p2.cpp | 10 +- clang/test/CXX/lex/lex.literal/lex.ext/p5.cpp | 6 +- clang/test/CXX/lex/lex.literal/lex.ext/p7.cpp | 2 +- clang/test/Sema/format-strings-int-typedefs.c | 6 +- clang/test/Sema/format-strings-size_t.c | 4 +- clang/test/Sema/matrix-type-builtins.c | 8 +- clang/test/Sema/ptrauth.c | 2 +- .../SemaCXX/cxx2c-trivially-relocatable.cpp | 2 +- clang/test/SemaCXX/enum-scoped.cpp | 4 +- clang/test/SemaCXX/new-delete.cpp | 2 +- clang/test/SemaCXX/static-assert-cxx26.cpp | 14 +- ...are-new-delete-basic-free-declarations.cpp | 2 +- .../unavailable_aligned_allocation.cpp | 24 +-- clang/test/SemaObjC/matrix-type-builtins.m | 2 +- .../SemaOpenCL/cl20-device-side-enqueue.cl | 6 +- clang/test/SemaTemplate/type_pack_element.cpp | 12 +- 41 files changed, 564 insertions(+), 511 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 156a1ea157668..00f8f87466273 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6726,41 +6726,49 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { return getTypeDeclType(const_cast(Decl)); } +// Inject __size_t, __signed_size_t, and __ptrdiff_t to provide portable hints +// and diagnostics. In C and C++, expressions of type size_t can be obtained via +// the sizeof operator, expressions of type ptrdiff_t via pointer subtraction, +// and expressions of type signed size_t via the z literal suffix (since C++23). +// However, no core language mechanism directly produces an expression of type +// unsigned ptrdiff_t. The unsigned ptrdiff_t type is solely required by format +// specifiers for printf and scanf. Consequently, no expression's type needs to +// be displayed as unsigned ptrdiff_t. Verification of whether a type is +// unsigned ptrdiff_t is also unnecessary, as no corresponding typedefs exist. +// Therefore, injecting a typedef for signed ptrdiff_t is not required. + /// getSizeType - Return the unique type for "size_t" (C99 7.17), the result /// of the sizeof operator (C99 6.5.3.4p4). The value is target dependent and /// needs to agree with the definition in . QualType ASTContext::getSizeType() const { -#if 0 if (SizeType.isNull()) { - SizeType = getTypedefType(buildImplicitTypedef( - getFromTargetType(Target->getSizeType()), "__size_t")); + if (auto const &LO = getLangOpts(); !LO.HLSL && (LO.C99 || LO.CPlusPlus)) + SizeType = getTypedefType(buildImplicitTypedef( + getFromTargetType(Target->getSizeType()), "__size_t")); + else + SizeType = getFromTargetType(Target->getSizeType()); } return SizeType; -#else - return getFromTargetType(Target->getSizeType()); -#endif } /// Return the unique signed counterpart of the integer type /// corresponding to size_t. QualType ASTContext::getSignedSizeType() const { -#if 0 if (SignedSizeType.isNull()) { - SignedSizeType = getTypedefType(buildImplicitTypedef( - getFromTargetType(Target->getSignedSizeType()), "__signed_size_t")); + if (auto const &LO = getLangOpts(); !LO.HLSL && (LO.C99 || LO.CPlusPlus)) + SignedSizeType = getTypedefType(buildImplicitTypedef( + getFromTargetType(Target->getSignedSizeType()), "__signed_size_t")); + else + SignedSizeType = getFromTargetType(Target->getSignedSizeType()); } return SignedSizeType; -#else - return getFromTargetType(Target->getSignedSizeType()); -#endif } /// getPointerDiffType - Return the unique type for "ptrdiff_t" (C99 7.17) /// defined in . Pointer - pointer requires this (C99 6.5.6p9). QualType ASTContext::getPointerDiffType() const { -#if 1 if (PtrdiffType.isNull()) { - if (getLangOpts().C99 || getLangOpts().CPlusPlus) + if (auto const &LO = getLangOpts(); !LO.HLSL && (LO.C99 || LO.CPlusPlus)) PtrdiffType = getTypedefType(buildImplicitTypedef( getFromTargetType(Target->getPtrDiffType(LangAS::Default)), "__ptrdiff_t")); @@ -6768,9 +6776,6 @@ QualType ASTContext::getPointerDiffType() const { PtrdiffType = getFromTargetType(Target->getPtrDiffType(LangAS::Default)); } return PtrdiffType; -#else - return getFromTargetType(Target->getPtrDiffType(LangAS::Default)); -#endif } /// Return the unique unsigned counterpart of "ptrdiff_t" diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 8f8e1ceb7197e..9a0d824a26ae6 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -5131,7 +5131,7 @@ bool Sema::BuiltinVAStartARMMicrosoft(CallExpr *Call) { << 3 /* parameter mismatch */ << 2 << Arg1->getType() << ConstCharPtrTy; - const QualType SizeTy = Context.getSizeType(); + const QualType SizeTy = Context.getSizeType()->getCanonicalTypeInternal(); if (Arg2Ty->getCanonicalTypeInternal().withoutLocalFastQualifiers() != SizeTy) Diag(Arg2->getBeginLoc(), diag::err_typecheck_convert_incompatible) << Arg2->getType() << SizeTy << 1 /* different class */ diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp index 1c748f9bc1828..4057d83fed22e 100644 --- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp @@ -1666,7 +1666,7 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( const QualType IntTy = ACtx.IntTy; const QualType UnsignedIntTy = ACtx.UnsignedIntTy; const QualType LongTy = ACtx.LongTy; - const QualType SizeTy = ACtx.getSizeType(); + const QualType SizeTyCanonTy = ACtx.getSizeType().getCanonicalType(); const QualType VoidPtrTy = getPointerTy(VoidTy); // void * const QualType IntPtrTy = getPointerTy(IntTy); // int * @@ -1684,14 +1684,14 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( const QualType ConstWchar_tPtrTy = getPointerTy(getConstTy(WCharTy)); // const wchar_t * const QualType ConstVoidPtrRestrictTy = getRestrictTy(ConstVoidPtrTy); - const QualType SizePtrTy = getPointerTy(SizeTy); + const QualType SizePtrTy = getPointerTy(SizeTyCanonTy); const QualType SizePtrRestrictTy = getRestrictTy(SizePtrTy); const RangeInt IntMax = BVF.getMaxValue(IntTy)->getLimitedValue(); const RangeInt UnsignedIntMax = BVF.getMaxValue(UnsignedIntTy)->getLimitedValue(); const RangeInt LongMax = BVF.getMaxValue(LongTy)->getLimitedValue(); - const RangeInt SizeMax = BVF.getMaxValue(SizeTy)->getLimitedValue(); + const RangeInt SizeMax = BVF.getMaxValue(SizeTyCanonTy)->getLimitedValue(); // Set UCharRangeMax to min of int or uchar maximum value. // The C standard states that the arguments of functions like isalpha must @@ -2057,18 +2057,19 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // size_t fread(void *restrict ptr, size_t size, size_t nitems, // FILE *restrict stream); - addToFunctionSummaryMap( - "fread", - Signature(ArgTypes{VoidPtrRestrictTy, SizeTy, SizeTy, FilePtrRestrictTy}, - RetType{SizeTy}), - FreadSummary); + addToFunctionSummaryMap("fread", + Signature(ArgTypes{VoidPtrRestrictTy, SizeTyCanonTy, + SizeTyCanonTy, FilePtrRestrictTy}, + RetType{SizeTyCanonTy}), + FreadSummary); // size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, // FILE *restrict stream); - addToFunctionSummaryMap("fwrite", - Signature(ArgTypes{ConstVoidPtrRestrictTy, SizeTy, - SizeTy, FilePtrRestrictTy}, - RetType{SizeTy}), - FreadSummary); + addToFunctionSummaryMap( + "fwrite", + Signature(ArgTypes{ConstVoidPtrRestrictTy, SizeTyCanonTy, SizeTyCanonTy, + FilePtrRestrictTy}, + RetType{SizeTyCanonTy}), + FreadSummary); std::optional Ssize_tTy = lookupTy("ssize_t"); std::optional Ssize_tMax = getMaxValue(Ssize_tTy); @@ -2083,12 +2084,14 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // should handle them together with the rest of the POSIX functions. // ssize_t read(int fildes, void *buf, size_t nbyte); addToFunctionSummaryMap( - "read", Signature(ArgTypes{IntTy, VoidPtrTy, SizeTy}, RetType{Ssize_tTy}), + "read", + Signature(ArgTypes{IntTy, VoidPtrTy, SizeTyCanonTy}, RetType{Ssize_tTy}), ReadSummary); // ssize_t write(int fildes, const void *buf, size_t nbyte); addToFunctionSummaryMap( "write", - Signature(ArgTypes{IntTy, ConstVoidPtrTy, SizeTy}, RetType{Ssize_tTy}), + Signature(ArgTypes{IntTy, ConstVoidPtrTy, SizeTyCanonTy}, + RetType{Ssize_tTy}), ReadSummary); auto GetLineSummary = @@ -2618,7 +2621,7 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // char *strndup(const char *s, size_t n); addToFunctionSummaryMap( "strndup", - Signature(ArgTypes{ConstCharPtrTy, SizeTy}, RetType{CharPtrTy}), + Signature(ArgTypes{ConstCharPtrTy, SizeTyCanonTy}, RetType{CharPtrTy}), Summary(NoEvalCall) .ArgConstraint(NotNull(ArgNo(0))) .ArgConstraint( @@ -2649,7 +2652,8 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // char *getcwd(char *buf, size_t size); addToFunctionSummaryMap( - "getcwd", Signature(ArgTypes{CharPtrTy, SizeTy}, RetType{CharPtrTy}), + "getcwd", + Signature(ArgTypes{CharPtrTy, SizeTyCanonTy}, RetType{CharPtrTy}), Summary(NoEvalCall) .Case({NotNull(0), ArgumentCondition(1, WithinRange, Range(1, SizeMax)), @@ -2957,8 +2961,9 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // FIXME: Improve for errno modeling. addToFunctionSummaryMap( "mmap", - Signature(ArgTypes{VoidPtrTy, SizeTy, IntTy, IntTy, IntTy, Off_tTy}, - RetType{VoidPtrTy}), + Signature( + ArgTypes{VoidPtrTy, SizeTyCanonTy, IntTy, IntTy, IntTy, Off_tTy}, + RetType{VoidPtrTy}), Summary(NoEvalCall) .ArgConstraint(ArgumentCondition(1, WithinRange, Range(1, SizeMax))) .ArgConstraint( @@ -2970,8 +2975,9 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // FIXME: Improve for errno modeling. addToFunctionSummaryMap( "mmap64", - Signature(ArgTypes{VoidPtrTy, SizeTy, IntTy, IntTy, IntTy, Off64_tTy}, - RetType{VoidPtrTy}), + Signature( + ArgTypes{VoidPtrTy, SizeTyCanonTy, IntTy, IntTy, IntTy, Off64_tTy}, + RetType{VoidPtrTy}), Summary(NoEvalCall) .ArgConstraint(ArgumentCondition(1, WithinRange, Range(1, SizeMax))) .ArgConstraint( @@ -3002,8 +3008,9 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // size_t bufsize); addToFunctionSummaryMap( "readlink", - Signature(ArgTypes{ConstCharPtrRestrictTy, CharPtrRestrictTy, SizeTy}, - RetType{Ssize_tTy}), + Signature( + ArgTypes{ConstCharPtrRestrictTy, CharPtrRestrictTy, SizeTyCanonTy}, + RetType{Ssize_tTy}), Summary(NoEvalCall) .Case({ArgumentCondition(2, WithinRange, Range(1, IntMax)), ReturnValueCondition(LessThanOrEq, ArgNo(2)), @@ -3025,9 +3032,9 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // char *restrict buf, size_t bufsize); addToFunctionSummaryMap( "readlinkat", - Signature( - ArgTypes{IntTy, ConstCharPtrRestrictTy, CharPtrRestrictTy, SizeTy}, - RetType{Ssize_tTy}), + Signature(ArgTypes{IntTy, ConstCharPtrRestrictTy, CharPtrRestrictTy, + SizeTyCanonTy}, + RetType{Ssize_tTy}), Summary(NoEvalCall) .Case({ArgumentCondition(3, WithinRange, Range(1, IntMax)), ReturnValueCondition(LessThanOrEq, ArgNo(3)), @@ -3268,14 +3275,14 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // size_t length, // int flags, struct sockaddr *restrict address, // socklen_t *restrict address_len); - Signature(ArgTypes{IntTy, VoidPtrRestrictTy, SizeTy, IntTy, + Signature(ArgTypes{IntTy, VoidPtrRestrictTy, SizeTyCanonTy, IntTy, StructSockaddrPtrRestrictTy, Socklen_tPtrRestrictTy}, RetType{Ssize_tTy}), Recvfrom)) addToFunctionSummaryMap( "recvfrom", - Signature(ArgTypes{IntTy, VoidPtrRestrictTy, SizeTy, IntTy, + Signature(ArgTypes{IntTy, VoidPtrRestrictTy, SizeTyCanonTy, IntTy, Irrelevant, Socklen_tPtrRestrictTy}, RetType{Ssize_tTy}), Recvfrom); @@ -3297,14 +3304,14 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // ssize_t sendto(int socket, const void *message, size_t length, // int flags, const struct sockaddr *dest_addr, // socklen_t dest_len); - Signature(ArgTypes{IntTy, ConstVoidPtrTy, SizeTy, IntTy, + Signature(ArgTypes{IntTy, ConstVoidPtrTy, SizeTyCanonTy, IntTy, ConstStructSockaddrPtrTy, Socklen_tTy}, RetType{Ssize_tTy}), Sendto)) addToFunctionSummaryMap( "sendto", - Signature(ArgTypes{IntTy, ConstVoidPtrTy, SizeTy, IntTy, Irrelevant, - Socklen_tTy}, + Signature(ArgTypes{IntTy, ConstVoidPtrTy, SizeTyCanonTy, IntTy, + Irrelevant, Socklen_tTy}, RetType{Ssize_tTy}), Sendto); @@ -3320,7 +3327,7 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // ssize_t recv(int sockfd, void *buf, size_t len, int flags); addToFunctionSummaryMap( "recv", - Signature(ArgTypes{IntTy, VoidPtrTy, SizeTy, IntTy}, + Signature(ArgTypes{IntTy, VoidPtrTy, SizeTyCanonTy, IntTy}, RetType{Ssize_tTy}), Summary(NoEvalCall) .Case({ReturnValueCondition(LessThanOrEq, ArgNo(2)), @@ -3395,7 +3402,7 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // ssize_t send(int sockfd, const void *buf, size_t len, int flags); addToFunctionSummaryMap( "send", - Signature(ArgTypes{IntTy, ConstVoidPtrTy, SizeTy, IntTy}, + Signature(ArgTypes{IntTy, ConstVoidPtrTy, SizeTyCanonTy, IntTy}, RetType{Ssize_tTy}), Summary(NoEvalCall) .Case({ReturnValueCondition(LessThanOrEq, ArgNo(2)), @@ -3683,7 +3690,7 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize); addToFunctionSummaryMap( {"pthread_attr_setstacksize", "pthread_attr_setguardsize"}, - Signature(ArgTypes{Pthread_attr_tPtrTy, SizeTy}, RetType{IntTy}), + Signature(ArgTypes{Pthread_attr_tPtrTy, SizeTyCanonTy}, RetType{IntTy}), Summary(NoEvalCall) .ArgConstraint(NotNull(ArgNo(0))) .ArgConstraint( @@ -3888,13 +3895,14 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( .ArgConstraint(NotNull(ArgNo(1)))); addToFunctionSummaryMap( "__buf_size_arg_constraint", - Signature(ArgTypes{ConstVoidPtrTy, SizeTy}, RetType{IntTy}), + Signature(ArgTypes{ConstVoidPtrTy, SizeTyCanonTy}, RetType{IntTy}), Summary(EvalCallAsPure) .ArgConstraint( BufferSize(/*Buffer=*/ArgNo(0), /*BufSize=*/ArgNo(1)))); addToFunctionSummaryMap( "__buf_size_arg_constraint_mul", - Signature(ArgTypes{ConstVoidPtrTy, SizeTy, SizeTy}, RetType{IntTy}), + Signature(ArgTypes{ConstVoidPtrTy, SizeTyCanonTy, SizeTyCanonTy}, + RetType{IntTy}), Summary(EvalCallAsPure) .ArgConstraint(BufferSize(/*Buffer=*/ArgNo(0), /*BufSize=*/ArgNo(1), /*BufSizeMultiplier=*/ArgNo(2)))); diff --git a/clang/test/AST/ast-dump-array.cpp b/clang/test/AST/ast-dump-array.cpp index 15771f227df8a..5a982d34683ff 100644 --- a/clang/test/AST/ast-dump-array.cpp +++ b/clang/test/AST/ast-dump-array.cpp @@ -14,7 +14,7 @@ void testArrayInitExpr() auto l = [a]{ }; // CHECK: |-ArrayInitLoopExpr 0x{{[^ ]*}} 'int[10]' - // CHECK: | `-ArrayInitIndexExpr 0x{{[^ ]*}} <> 'unsigned long' + // CHECK: | `-ArrayInitIndexExpr 0x{{[^ ]*}} <> '__size_t':'unsigned long' } template diff --git a/clang/test/AST/ast-dump-expr-json.c b/clang/test/AST/ast-dump-expr-json.c index e910864eeed65..e42b626a8eb16 100644 --- a/clang/test/AST/ast-dump-expr-json.c +++ b/clang/test/AST/ast-dump-expr-json.c @@ -3911,7 +3911,9 @@ void PrimaryExpressions(int a) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", @@ -3964,7 +3966,9 @@ void PrimaryExpressions(int a) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", @@ -3989,7 +3993,9 @@ void PrimaryExpressions(int a) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "alignof", diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp index f77c263d28a0c..51afd3f85c3c9 100644 --- a/clang/test/AST/ast-dump-expr-json.cpp +++ b/clang/test/AST/ast-dump-expr-json.cpp @@ -1545,7 +1545,9 @@ void TestNonADLCall3() { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "Ts" @@ -1728,7 +1730,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: }, @@ -1757,7 +1759,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: }, @@ -1787,7 +1789,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1862,7 +1864,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1882,7 +1884,9 @@ void TestNonADLCall3() { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", @@ -1939,7 +1943,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1959,7 +1963,9 @@ void TestNonADLCall3() { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", @@ -2335,7 +2341,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ diff --git a/clang/test/AST/ast-dump-expr.c b/clang/test/AST/ast-dump-expr.c index 959d61ec9794b..e7aba39be8f68 100644 --- a/clang/test/AST/ast-dump-expr.c +++ b/clang/test/AST/ast-dump-expr.c @@ -222,15 +222,15 @@ void UnaryOperators(int a, int *b) { // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int' lvalue ParmVar 0x{{[^ ]*}} 'a' 'int' sizeof a; - // CHECK: UnaryExprOrTypeTraitExpr 0x{{[^ ]*}} 'unsigned long' sizeof + // CHECK: UnaryExprOrTypeTraitExpr 0x{{[^ ]*}} '__size_t':'unsigned long' sizeof // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int' lvalue ParmVar 0x{{[^ ]*}} 'a' 'int' sizeof(int); - // CHECK: UnaryExprOrTypeTraitExpr 0x{{[^ ]*}} 'unsigned long' sizeof 'int' + // CHECK: UnaryExprOrTypeTraitExpr 0x{{[^ ]*}} '__size_t':'unsigned long' sizeof 'int' _Alignof(int); // FIXME: Uses C++ spelling for alignof in C mode. - // CHECK: UnaryExprOrTypeTraitExpr 0x{{[^ ]*}} 'unsigned long' alignof 'int' + // CHECK: UnaryExprOrTypeTraitExpr 0x{{[^ ]*}} '__size_t':'unsigned long' alignof 'int' } struct S { diff --git a/clang/test/AST/ast-dump-expr.cpp b/clang/test/AST/ast-dump-expr.cpp index 0aab221701d8f..92adb3d7a5c38 100644 --- a/clang/test/AST/ast-dump-expr.cpp +++ b/clang/test/AST/ast-dump-expr.cpp @@ -115,7 +115,7 @@ void Casting(const S *s) { template void UnaryExpressions(int *p) { sizeof...(Ts); - // CHECK: SizeOfPackExpr 0x{{[^ ]*}} 'unsigned long' 0x{{[^ ]*}} Ts + // CHECK: SizeOfPackExpr 0x{{[^ ]*}} '__size_t':'unsigned long' 0x{{[^ ]*}} Ts noexcept(p - p); // CHECK: CXXNoexceptExpr 0x{{[^ ]*}} 'bool' @@ -126,23 +126,23 @@ void UnaryExpressions(int *p) { // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' ::new int; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' global Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' global Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' new (int); - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' new int{12}; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} 'int' // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 12 new int[2]; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(__size_t)' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 2 new int[2]{1, 2}; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(__size_t)' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 2 // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} 'int[2]' @@ -164,7 +164,7 @@ void UnaryExpressions(int *p) { // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' ::delete p; - // CHECK: CXXDeleteExpr 0x{{[^ ]*}} 'void' global Function 0x{{[^ ]*}} 'operator delete' 'void (void *, unsigned long) noexcept' + // CHECK: CXXDeleteExpr 0x{{[^ ]*}} 'void' global Function 0x{{[^ ]*}} 'operator delete' 'void (void *, __size_t) noexcept' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' diff --git a/clang/test/AST/ast-dump-openmp-distribute-parallel-for-simd.c b/clang/test/AST/ast-dump-openmp-distribute-parallel-for-simd.c index 10f27e759b5b1..672607fa90670 100644 --- a/clang/test/AST/ast-dump-openmp-distribute-parallel-for-simd.c +++ b/clang/test/AST/ast-dump-openmp-distribute-parallel-for-simd.c @@ -57,8 +57,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 0 @@ -97,8 +97,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -144,8 +144,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -191,8 +191,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -251,8 +251,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | `-NullStmt {{.*}} // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 0 diff --git a/clang/test/AST/ast-dump-openmp-distribute-parallel-for.c b/clang/test/AST/ast-dump-openmp-distribute-parallel-for.c index 419ba57191039..8eedf8ac8bc58 100644 --- a/clang/test/AST/ast-dump-openmp-distribute-parallel-for.c +++ b/clang/test/AST/ast-dump-openmp-distribute-parallel-for.c @@ -57,8 +57,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 0 @@ -97,8 +97,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -144,8 +144,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -191,8 +191,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -251,8 +251,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | `-NullStmt {{.*}} // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 0 diff --git a/clang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for-simd.c b/clang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for-simd.c index c209a0456d7a0..64e19ce0a53bf 100644 --- a/clang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for-simd.c +++ b/clang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for-simd.c @@ -65,8 +65,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -94,8 +94,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -123,8 +123,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -152,8 +152,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -189,8 +189,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -218,8 +218,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -247,8 +247,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -276,8 +276,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:4:1) *const restrict' // CHECK-NEXT: | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 0 @@ -325,8 +325,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -371,8 +371,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -417,8 +417,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -463,8 +463,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -517,8 +517,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -563,8 +563,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -609,8 +609,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -655,8 +655,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:10:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -711,8 +711,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -757,8 +757,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -803,8 +803,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -849,8 +849,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -903,8 +903,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -949,8 +949,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -995,8 +995,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1041,8 +1041,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:17:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1097,8 +1097,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1143,8 +1143,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1189,8 +1189,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1235,8 +1235,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1289,8 +1289,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1335,8 +1335,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1381,8 +1381,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1427,8 +1427,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:24:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1497,8 +1497,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1560,8 +1560,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1623,8 +1623,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1686,8 +1686,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1757,8 +1757,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1820,8 +1820,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1883,8 +1883,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1946,8 +1946,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | `-NullStmt {{.*}} // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for-simd.c:31:1) *const restrict' // CHECK-NEXT: | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 0 diff --git a/clang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for.c b/clang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for.c index b13e096101e63..cf3f4bfcaf225 100644 --- a/clang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for.c +++ b/clang/test/AST/ast-dump-openmp-target-teams-distribute-parallel-for.c @@ -65,8 +65,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -94,8 +94,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -123,8 +123,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -152,8 +152,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -189,8 +189,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -218,8 +218,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -247,8 +247,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -276,8 +276,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:4:1) *const restrict' // CHECK-NEXT: | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 0 @@ -325,8 +325,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -371,8 +371,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -417,8 +417,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -463,8 +463,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -517,8 +517,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -563,8 +563,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -609,8 +609,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -655,8 +655,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:10:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -711,8 +711,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -757,8 +757,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -803,8 +803,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -849,8 +849,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -903,8 +903,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -949,8 +949,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -995,8 +995,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1041,8 +1041,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:17:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1097,8 +1097,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1143,8 +1143,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1189,8 +1189,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1235,8 +1235,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1289,8 +1289,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1335,8 +1335,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1381,8 +1381,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1427,8 +1427,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:24:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1497,8 +1497,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1560,8 +1560,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1623,8 +1623,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1686,8 +1686,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1757,8 +1757,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1820,8 +1820,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1883,8 +1883,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1946,8 +1946,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | `-NullStmt {{.*}} // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-target-teams-distribute-parallel-for.c:31:1) *const restrict' // CHECK-NEXT: | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | `-IntegerLiteral {{.*}} 'int' 0 diff --git a/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c b/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c index 14356882b599a..c8da8cd1a5efa 100644 --- a/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c +++ b/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for-simd.c @@ -71,8 +71,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:1) *const restrict' // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -99,8 +99,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -127,8 +127,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:1) *const restrict' // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -155,8 +155,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:1) *const restrict' // CHECK-NEXT: | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -211,8 +211,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -239,8 +239,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:1) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -267,8 +267,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:1) *const restrict' // CHECK-NEXT: | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -295,8 +295,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:5:1) *const restrict' // CHECK-NEXT: | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -363,8 +363,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -407,8 +407,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -451,8 +451,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -495,8 +495,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -568,8 +568,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -612,8 +612,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -656,8 +656,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -700,8 +700,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:12:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -775,8 +775,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -819,8 +819,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -863,8 +863,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -907,8 +907,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -984,8 +984,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1028,8 +1028,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1072,8 +1072,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1116,8 +1116,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:20:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1191,8 +1191,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1235,8 +1235,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1279,8 +1279,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1323,8 +1323,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1419,8 +1419,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1463,8 +1463,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1507,8 +1507,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1551,8 +1551,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:28:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1659,8 +1659,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1719,8 +1719,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1779,8 +1779,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1839,8 +1839,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1952,8 +1952,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -2012,8 +2012,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -2072,8 +2072,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -2132,8 +2132,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for-simd.c:36:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 diff --git a/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c b/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c index 0f983cfdff1dc..09b649cbb3660 100644 --- a/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c +++ b/clang/test/AST/ast-dump-openmp-teams-distribute-parallel-for.c @@ -71,8 +71,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:5:1) *const restrict' // CHECK-NEXT: | | | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -99,8 +99,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:5:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -127,8 +127,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:5:1) *const restrict' // CHECK-NEXT: | | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -155,8 +155,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:5:1) *const restrict' // CHECK-NEXT: | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -211,8 +211,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:5:1) *const restrict' // CHECK-NEXT: | | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -239,8 +239,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:5:1) *const restrict' // CHECK-NEXT: | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -267,8 +267,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:5:1) *const restrict' // CHECK-NEXT: | | | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -295,8 +295,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:5:1) *const restrict' // CHECK-NEXT: | | | `-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -363,8 +363,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:12:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -407,8 +407,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:12:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -451,8 +451,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:12:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -495,8 +495,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:12:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -568,8 +568,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:12:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -612,8 +612,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:12:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -656,8 +656,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:12:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -700,8 +700,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:12:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -775,8 +775,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:20:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -819,8 +819,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:20:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -863,8 +863,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:20:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -907,8 +907,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:20:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -984,8 +984,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:20:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1028,8 +1028,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:20:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1072,8 +1072,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:20:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1116,8 +1116,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:20:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1191,8 +1191,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:28:1) *const restrict' // CHECK-NEXT: | | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1235,8 +1235,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:28:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1279,8 +1279,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:28:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1323,8 +1323,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:28:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1419,8 +1419,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:28:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1463,8 +1463,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:28:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1507,8 +1507,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:28:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1551,8 +1551,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:28:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1659,8 +1659,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:36:1) *const restrict' // CHECK-NEXT: | | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1719,8 +1719,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:36:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1779,8 +1779,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:36:1) *const restrict' // CHECK-NEXT: | | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1839,8 +1839,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:36:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -1952,8 +1952,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:36:1) *const restrict' // CHECK-NEXT: | | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -2012,8 +2012,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:36:1) *const restrict' // CHECK-NEXT: | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -2072,8 +2072,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | | | `-NullStmt {{.*}} // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:36:1) *const restrict' // CHECK-NEXT: | | | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | | | `-IntegerLiteral {{.*}} 'int' 0 @@ -2132,8 +2132,8 @@ void test_five(int x, int y, int z) { // CHECK-NEXT: | | | `-NullStmt {{.*}} // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .global_tid. 'const int *const restrict' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit .bound_tid. 'const int *const restrict' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const unsigned long' -// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.lb. 'const __size_t':'const unsigned long' +// CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit used .previous.ub. 'const __size_t':'const unsigned long' // CHECK-NEXT: | | |-ImplicitParamDecl {{.*}} col:1 implicit __context 'struct (unnamed at {{.*}}ast-dump-openmp-teams-distribute-parallel-for.c:36:1) *const restrict' // CHECK-NEXT: | | |-VarDecl {{.*}} col:12 used i 'int' cinit // CHECK-NEXT: | | | `-IntegerLiteral {{.*}} 'int' 0 diff --git a/clang/test/AST/ast-dump-recovery.c b/clang/test/AST/ast-dump-recovery.c index 68d3f182dd9f6..3093d2998775c 100644 --- a/clang/test/AST/ast-dump-recovery.c +++ b/clang/test/AST/ast-dump-recovery.c @@ -120,7 +120,7 @@ void test5_GH62711() { void test6_GH50244() { double array[16]; - // CHECK: UnaryExprOrTypeTraitExpr {{.*}} 'unsigned long' contains-errors sizeof + // CHECK: UnaryExprOrTypeTraitExpr {{.*}} '__size_t':'unsigned long' contains-errors sizeof // CHECK-NEXT: `-CallExpr {{.*}} '' contains-errors // CHECK-NEXT: |-DeclRefExpr {{.*}} 'int ()' // CHECK-NEXT: `-RecoveryExpr {{.*}} '' diff --git a/clang/test/AST/ast-dump-stmt-json.cpp b/clang/test/AST/ast-dump-stmt-json.cpp index 2beea0519bbac..f34cd206fece0 100644 --- a/clang/test/AST/ast-dump-stmt-json.cpp +++ b/clang/test/AST/ast-dump-stmt-json.cpp @@ -963,7 +963,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } @@ -994,7 +994,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1126,7 +1126,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1146,7 +1146,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", @@ -1337,7 +1339,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } @@ -1369,7 +1371,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1444,7 +1446,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "mangledName": "_Znwm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1457,7 +1459,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1503,7 +1507,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "mangledName": "_ZnwmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long, std::align_val_t)" +// CHECK-NEXT: "qualType": "void *(__size_t, std::align_val_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1516,7 +1520,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1585,7 +1591,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "mangledName": "_Znam", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1598,7 +1604,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1644,7 +1652,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "mangledName": "_ZnamSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long, std::align_val_t)" +// CHECK-NEXT: "qualType": "void *(__size_t, std::align_val_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1657,7 +1665,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1821,7 +1831,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "mangledName": "_ZdlPvm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1847,7 +1857,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1874,7 +1886,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "mangledName": "_ZdlPvmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long, std::align_val_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t, std::align_val_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1900,7 +1912,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -2036,7 +2050,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete[]", // CHECK-NEXT: "mangledName": "_ZdaPvm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -2062,7 +2076,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -2089,7 +2105,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete[]", // CHECK-NEXT: "mangledName": "_ZdaPvmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long, std::align_val_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t, std::align_val_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -2115,7 +2131,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -3881,7 +3899,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", @@ -3955,7 +3975,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", @@ -4085,7 +4107,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", @@ -4159,7 +4183,9 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", diff --git a/clang/test/AST/ast-dump-traits.cpp b/clang/test/AST/ast-dump-traits.cpp index 3085e5883fd2e..72d2a2ae8603e 100644 --- a/clang/test/AST/ast-dump-traits.cpp +++ b/clang/test/AST/ast-dump-traits.cpp @@ -56,7 +56,7 @@ void test_unary_expr_or_type_trait() { // CHECK-NEXT: |-FunctionDecl {{.*}} line:20:6{{( imported)?}} test_array_type_trait 'void ()' // CHECK-NEXT: | `-CompoundStmt {{.*}} // CHECK-NEXT: | `-CStyleCastExpr {{.*}} 'void' -// CHECK-NEXT: | `-ArrayTypeTraitExpr {{.*}} 'unsigned long' __array_rank +// CHECK-NEXT: | `-ArrayTypeTraitExpr {{.*}} '__size_t':'unsigned long' __array_rank // CHECK-NEXT: |-FunctionDecl {{.*}} line:25:6{{( imported)?}} test_expression_trait 'void ()' // CHECK-NEXT: | `-CompoundStmt {{.*}} // CHECK-NEXT: | `-CStyleCastExpr {{.*}} 'void' @@ -64,8 +64,8 @@ void test_unary_expr_or_type_trait() { // CHECK-NEXT: `-FunctionDecl {{.*}} line:30:6{{( imported)?}} test_unary_expr_or_type_trait 'void ()' // CHECK-NEXT: `-CompoundStmt {{.*}} // CHECK-NEXT: |-CStyleCastExpr {{.*}} 'void' -// CHECK-NEXT: | `-UnaryExprOrTypeTraitExpr {{.*}} 'unsigned long' sizeof 'int' +// CHECK-NEXT: | `-UnaryExprOrTypeTraitExpr {{.*}} '__size_t':'unsigned long' sizeof 'int' // CHECK-NEXT: |-CStyleCastExpr {{.*}} 'void' -// CHECK-NEXT: | `-UnaryExprOrTypeTraitExpr {{.*}} 'unsigned long' alignof 'int' +// CHECK-NEXT: | `-UnaryExprOrTypeTraitExpr {{.*}} '__size_t':'unsigned long' alignof 'int' // CHECK-NEXT: `-CStyleCastExpr {{.*}} 'void' -// CHECK-NEXT: `-UnaryExprOrTypeTraitExpr {{.*}} 'unsigned long' __alignof 'int' +// CHECK-NEXT: `-UnaryExprOrTypeTraitExpr {{.*}} '__size_t':'unsigned long' __alignof 'int' diff --git a/clang/test/AST/ast-dump-types-errors-json.cpp b/clang/test/AST/ast-dump-types-errors-json.cpp index e15f8eeee20cc..78e4c7dfd2994 100644 --- a/clang/test/AST/ast-dump-types-errors-json.cpp +++ b/clang/test/AST/ast-dump-types-errors-json.cpp @@ -60,7 +60,9 @@ using TestContainsErrors = int[sizeof(undef())]; // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t", +// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", diff --git a/clang/test/Analysis/cfg.cpp b/clang/test/Analysis/cfg.cpp index 44a89df28e3b2..d6cef88dc18a6 100644 --- a/clang/test/Analysis/cfg.cpp +++ b/clang/test/Analysis/cfg.cpp @@ -70,7 +70,7 @@ void F(EmptyE e) { // CHECK-NEXT: Succs (1): B1 // CHECK: [B1] // CHECK-NEXT: 1: __builtin_object_size -// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, BuiltinFnToFnPtr, unsigned long (*)(const void *, int) noexcept) +// CHECK-NEXT: 2: [B1.1] (ImplicitCastExpr, BuiltinFnToFnPtr, __size_t (*)(const void *, int) noexcept) // CHECK-NEXT: 3: [B1.2](dummy(), 0) // CHECK-NEXT: 4: (void)[B1.3] (CStyleCastExpr, ToVoid, void) // CHECK-NEXT: Preds (1): B2 diff --git a/clang/test/Analysis/explain-svals.cpp b/clang/test/Analysis/explain-svals.cpp index 267980c3b20c8..dfc650223c9e7 100644 --- a/clang/test/Analysis/explain-svals.cpp +++ b/clang/test/Analysis/explain-svals.cpp @@ -46,7 +46,7 @@ void test_1(int param, void *ptr) { void test_2(char *ptr, int ext) { clang_analyzer_explain((void *) "asdf"); // expected-warning-re{{{{^pointer to element of type 'char' with index 0 of string literal "asdf"$}}}} - clang_analyzer_explain(strlen(ptr)); // expected-warning-re{{{{^metadata of type 'unsigned long' tied to pointee of argument 'ptr'$}}}} + clang_analyzer_explain(strlen(ptr)); // expected-warning-re{{{{^metadata of type '__size_t' tied to pointee of argument 'ptr'$}}}} clang_analyzer_explain(conjure()); // expected-warning-re{{{{^symbol of type 'int' conjured at CFG element 'conjure\(\)'$}}}} clang_analyzer_explain(glob); // expected-warning-re{{{{^value derived from \(symbol of type 'int' conjured at CFG element 'conjure\(\)'\) for global variable 'glob'$}}}} clang_analyzer_explain(glob_ptr); // expected-warning-re{{{{^value derived from \(symbol of type 'int' conjured at CFG element 'conjure\(\)'\) for global variable 'glob_ptr'$}}}} diff --git a/clang/test/Analysis/std-c-library-functions-arg-weakdeps.c b/clang/test/Analysis/std-c-library-functions-arg-weakdeps.c index 1f0d3627fae34..ba5bc57928b0c 100644 --- a/clang/test/Analysis/std-c-library-functions-arg-weakdeps.c +++ b/clang/test/Analysis/std-c-library-functions-arg-weakdeps.c @@ -20,7 +20,7 @@ // RUN: -triple x86_64-unknown-linux 2>&1 | FileCheck %s // CHECK: Loaded summary for: int isalnum(int) -// CHECK: Loaded summary for: unsigned long fread(void *restrict, size_t, size_t, FILE *restrict) __attribute__((nonnull(1))) +// CHECK: Loaded summary for: __size_t fread(void *restrict, size_t, size_t, FILE *restrict) __attribute__((nonnull(1))) // CHECK: Loaded summary for: int fileno(FILE *stream) void initializeSummaryMap(void); diff --git a/clang/test/Analysis/std-c-library-functions-lookup.c b/clang/test/Analysis/std-c-library-functions-lookup.c index e47d9bddda91b..8182e5a1f5fde 100644 --- a/clang/test/Analysis/std-c-library-functions-lookup.c +++ b/clang/test/Analysis/std-c-library-functions-lookup.c @@ -6,7 +6,7 @@ // RUN: -analyzer-config eagerly-assume=false \ // RUN: -triple i686-unknown-linux 2>&1 | FileCheck %s -// CHECK: Loaded summary for: unsigned int fread(void *restrict, size_t, size_t, FILE *restrict) +// CHECK: Loaded summary for: __size_t fread(void *restrict, size_t, size_t, FILE *restrict) typedef typeof(sizeof(int)) size_t; typedef struct FILE FILE; diff --git a/clang/test/Analysis/std-c-library-functions-vs-stream-checker.c b/clang/test/Analysis/std-c-library-functions-vs-stream-checker.c index b99cc30149c91..887817ba8551e 100644 --- a/clang/test/Analysis/std-c-library-functions-vs-stream-checker.c +++ b/clang/test/Analysis/std-c-library-functions-vs-stream-checker.c @@ -31,8 +31,8 @@ // Verify that the summaries are loaded when the StdLibraryFunctionsChecker is // enabled. // CHECK: Loaded summary for: int getchar(void) -// CHECK-NEXT: Loaded summary for: unsigned long fread(void *restrict, size_t, size_t, FILE *restrict) -// CHECK-NEXT: Loaded summary for: unsigned long fwrite(const void *restrict, size_t, size_t, FILE *restrict) +// CHECK-NEXT: Loaded summary for: __size_t fread(void *restrict, size_t, size_t, FILE *restrict) +// CHECK-NEXT: Loaded summary for: __size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict) #include "Inputs/system-header-simulator.h" diff --git a/clang/test/Analysis/std-c-library-functions.c b/clang/test/Analysis/std-c-library-functions.c index b03a1a5656517..b5f663493a676 100644 --- a/clang/test/Analysis/std-c-library-functions.c +++ b/clang/test/Analysis/std-c-library-functions.c @@ -59,8 +59,8 @@ // CHECK-NEXT: Loaded summary for: int tolower(int) // CHECK-NEXT: Loaded summary for: int toascii(int) // CHECK-NEXT: Loaded summary for: int getchar(void) -// CHECK-NEXT: Loaded summary for: unsigned int fread(void *restrict, size_t, size_t, FILE *restrict) -// CHECK-NEXT: Loaded summary for: unsigned int fwrite(const void *restrict, size_t, size_t, FILE *restrict) +// CHECK-NEXT: Loaded summary for: __size_t fread(void *restrict, size_t, size_t, FILE *restrict) +// CHECK-NEXT: Loaded summary for: __size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict) // CHECK-NEXT: Loaded summary for: ssize_t read(int, void *, size_t) // CHECK-NEXT: Loaded summary for: ssize_t write(int, const void *, size_t) // CHECK-NEXT: Loaded summary for: ssize_t getline(char **restrict, size_t *restrict, FILE *restrict) diff --git a/clang/test/CXX/drs/cwg2xx.cpp b/clang/test/CXX/drs/cwg2xx.cpp index a53a8d1ed64a8..9c2c46b8e4c0e 100644 --- a/clang/test/CXX/drs/cwg2xx.cpp +++ b/clang/test/CXX/drs/cwg2xx.cpp @@ -1429,7 +1429,7 @@ namespace cwg299 { // cwg299: 2.8 c++11 // cxx98-11-error@#cwg299-q {{ambiguous conversion of array size expression of type 'T' to an integral or enumeration type}} // cxx98-11-note@#cwg299-int {{conversion to integral type 'int' declared here}} // cxx98-11-note@#cwg299-ushort {{conversion to integral type 'unsigned short' declared here}} - // since-cxx14-error-re@#cwg299-q {{{{conversion from 'T' to 'unsigned (long long|long|int)' is ambiguous}}}} + // since-cxx14-error@#cwg299-q {{conversion from 'T' to '__size_t' (aka 'unsigned long') is ambiguous}} // since-cxx14-note@#cwg299-int {{candidate function}} // since-cxx14-note@#cwg299-ushort {{candidate function}} } // namespace cwg299 diff --git a/clang/test/CXX/lex/lex.literal/lex.ext/p2.cpp b/clang/test/CXX/lex/lex.literal/lex.ext/p2.cpp index 6942b68690c5d..d439f304b5101 100644 --- a/clang/test/CXX/lex/lex.literal/lex.ext/p2.cpp +++ b/clang/test/CXX/lex/lex.literal/lex.ext/p2.cpp @@ -5,11 +5,11 @@ typedef decltype(sizeof(int)) size_t; // FIXME: These diagnostics should say 'size_t' instead of 'unsigned long' int a = 123_x; // expected-error {{no matching literal operator for call to 'operator""_x' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template}} int b = 4.2_x; // expected-error {{no matching literal operator for call to 'operator""_x' with argument of type 'long double' or 'const char *', and no matching literal operator template}} -int c = "foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const char *' and 'unsigned}} -int d = L"foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const wchar_t *' and 'unsigned}} -int e = u8"foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const char *' and 'unsigned}} -int f = u"foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const char16_t *' and 'unsigned}} -int g = U"foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const char32_t *' and 'unsigned}} +int c = "foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const char *' and '__size_t' (aka 'unsigned}} +int d = L"foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const wchar_t *' and '__size_t' (aka 'unsigned}} +int e = u8"foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const char *' and '__size_t' (aka 'unsigned}} +int f = u"foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const char16_t *' and '__size_t' (aka 'unsigned}} +int g = U"foo"_x; // expected-error {{no matching literal operator for call to 'operator""_x' with arguments of types 'const char32_t *' and '__size_t' (aka 'unsigned}} int h = 'y'_x; // expected-error {{no matching literal operator for call to 'operator""_x' with argument of type 'char'}} int i = L'y'_x; // expected-error {{no matching literal operator for call to 'operator""_x' with argument of type 'wchar_t'}} int j = u'y'_x; // expected-error {{no matching literal operator for call to 'operator""_x' with argument of type 'char16_t'}} diff --git a/clang/test/CXX/lex/lex.literal/lex.ext/p5.cpp b/clang/test/CXX/lex/lex.literal/lex.ext/p5.cpp index afadba282e626..463d7854867a2 100644 --- a/clang/test/CXX/lex/lex.literal/lex.ext/p5.cpp +++ b/clang/test/CXX/lex/lex.literal/lex.ext/p5.cpp @@ -13,7 +13,7 @@ float &operator ""_x1 (const char8_t *, size_t); using char8 = double; #endif char8 &i2 = u8"foo"_x1; -double &i3 = L"foo"_x1; // expected-error {{no matching literal operator for call to 'operator""_x1' with arguments of types 'const wchar_t *' and 'unsigned long'}} +double &i3 = L"foo"_x1; // expected-error {{no matching literal operator for call to 'operator""_x1' with arguments of types 'const wchar_t *' and '__size_t' (aka 'unsigned long')}} char &operator ""_x1(const wchar_t *, size_t); char &i4 = L"foo"_x1; // ok @@ -46,8 +46,8 @@ template float &operator""_s(); void no_fallback() { "hello"_s; // FIXME: It'd be useful to explain what candidates were found and why they didn't work. - "xyzzy"_s; // expected-error {{no matching literal operator for call to 'operator""_s' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template}} - "yello"_s; // expected-error {{no matching literal operator for call to 'operator""_s' with arguments of types 'const char *' and 'unsigned long', and no matching literal operator template}} + "xyzzy"_s; // expected-error {{no matching literal operator for call to 'operator""_s' with arguments of types 'const char *' and '__size_t' (aka 'unsigned long'), and no matching literal operator template}} + "yello"_s; // expected-error {{no matching literal operator for call to 'operator""_s' with arguments of types 'const char *' and '__size_t' (aka 'unsigned long'), and no matching literal operator template}} } double &operator""_s(const char*, size_t); diff --git a/clang/test/CXX/lex/lex.literal/lex.ext/p7.cpp b/clang/test/CXX/lex/lex.literal/lex.ext/p7.cpp index d571fcb8697eb..17d9c83055a1c 100644 --- a/clang/test/CXX/lex/lex.literal/lex.ext/p7.cpp +++ b/clang/test/CXX/lex/lex.literal/lex.ext/p7.cpp @@ -17,7 +17,7 @@ int main() { auto v1 = 1.2_w; // calls operator""_w(1.2L) auto v2 = u"one"_w; // calls operator""_w(u"one", 3) auto v3 = 12_w; // calls operator""_w("12") - "two"_w; // expected-error {{no matching literal operator for call to 'operator""_w' with arguments of types 'const char *' and 'unsigned long'}} + "two"_w; // expected-error {{no matching literal operator for call to 'operator""_w' with arguments of types 'const char *' and '__size_t' (aka 'unsigned long')}} same_type test1; same_type test2; diff --git a/clang/test/Sema/format-strings-int-typedefs.c b/clang/test/Sema/format-strings-int-typedefs.c index 685f89b452e45..8f85e68b067df 100644 --- a/clang/test/Sema/format-strings-int-typedefs.c +++ b/clang/test/Sema/format-strings-int-typedefs.c @@ -6,7 +6,7 @@ int scanf(char const *, ...); void test(void) { printf("%jd", 42.0); // expected-warning {{format specifies type 'intmax_t' (aka 'long long')}} printf("%ju", 42.0); // expected-warning {{format specifies type 'uintmax_t' (aka 'unsigned long long')}} - printf("%zu", 42.0); // expected-warning {{format specifies type 'size_t' (aka 'unsigned long')}} + printf("%zu", 42.0); // expected-warning {{format specifies type 'size_t' (aka '__size_t')}} printf("%td", 42.0); // expected-warning {{format specifies type 'ptrdiff_t' (aka '__ptrdiff_t')}} printf("%lc", 42.0); // expected-warning {{format specifies type 'wint_t' (aka 'int')}} printf("%ls", 42.0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} @@ -15,7 +15,7 @@ void test(void) { scanf("%jd", 0); // expected-warning {{format specifies type 'intmax_t *' (aka 'long long *')}} scanf("%ju", 0); // expected-warning {{format specifies type 'uintmax_t *' (aka 'unsigned long long *')}} - scanf("%zu", 0); // expected-warning {{format specifies type 'size_t *' (aka 'unsigned long *')}} + scanf("%zu", 0); // expected-warning {{format specifies type 'size_t *' (aka '__size_t *')}} scanf("%td", 0); // expected-warning {{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *')}} scanf("%lc", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} scanf("%ls", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} @@ -32,6 +32,6 @@ void test(void) { // The warning still fires, because it checks the underlying type. printf("%jd", (intmax_t)42); // expected-warning {{format specifies type 'intmax_t' (aka 'long long') but the argument has type 'intmax_t' (aka 'void *')}} printf("%ju", (uintmax_t)42); // expected-warning {{format specifies type 'uintmax_t' (aka 'unsigned long long') but the argument has type 'uintmax_t' (aka 'void *')}} - printf("%zu", (size_t)42); // expected-warning {{format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'size_t' (aka 'void *')}} + printf("%zu", (size_t)42); // expected-warning {{format specifies type 'size_t' (aka '__size_t') but the argument has type 'size_t' (aka 'void *')}} printf("%td", (ptrdiff_t)42); // expected-warning {{format specifies type 'ptrdiff_t' (aka '__ptrdiff_t') but the argument has type 'ptrdiff_t' (aka 'void *')}} } diff --git a/clang/test/Sema/format-strings-size_t.c b/clang/test/Sema/format-strings-size_t.c index e20a0157443e5..08efc1fa25066 100644 --- a/clang/test/Sema/format-strings-size_t.c +++ b/clang/test/Sema/format-strings-size_t.c @@ -4,7 +4,7 @@ int printf(char const *, ...); void test(void) { // size_t - printf("%zu", (double)42); // expected-warning {{format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'double'}} + printf("%zu", (double)42); // expected-warning {{format specifies type 'size_t' (aka '__size_t') but the argument has type 'double'}} // intmax_t / uintmax_t printf("%jd", (double)42); // expected-warning {{format specifies type 'intmax_t' (aka 'long') but the argument has type 'double'}} @@ -19,7 +19,7 @@ void test_writeback(void) { printf("%jn", (unsigned long*)0); // no-warning printf("%jn", (int*)0); // expected-warning{{format specifies type 'intmax_t *' (aka 'long *') but the argument has type 'int *'}} - printf("%zn", (int*)0); // expected-warning{{format specifies type 'signed size_t *' (aka 'long *') but the argument has type 'int *'}} + printf("%zn", (int*)0); // expected-warning{{format specifies type 'signed size_t *' (aka '__signed_size_t *') but the argument has type 'int *'}} printf("%tn", (long*)0); // expected-warning{{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *') but the argument has type 'long *'}} printf("%tn", (unsigned long*)0); // expected-warning{{format specifies type 'ptrdiff_t *' (aka '__ptrdiff_t *') but the argument has type 'unsigned long *'}} diff --git a/clang/test/Sema/matrix-type-builtins.c b/clang/test/Sema/matrix-type-builtins.c index b5548831002e3..74e00736d64b3 100644 --- a/clang/test/Sema/matrix-type-builtins.c +++ b/clang/test/Sema/matrix-type-builtins.c @@ -73,13 +73,13 @@ void column_major_load(float *p1, int *p2, _Bool *p3, struct Foo *p4) { 10, // expected-error {{1st argument must be a pointer to a valid matrix element type}} 1ull << 21, // expected-error {{row dimension is outside the allowed range [1, 1048575]}} 1ull << 21, // expected-error {{column dimension is outside the allowed range [1, 1048575]}} - ""); // expected-error {{incompatible pointer to integer conversion casting 'char[1]' to type 'unsigned long'}} + ""); // expected-error {{incompatible pointer to integer conversion casting 'char[1]' to type '__size_t' (aka 'unsigned long')}} sx5x10_t a13 = __builtin_matrix_column_major_load( 10, // expected-error {{1st argument must be a pointer to a valid matrix element type}} - *p4, // expected-error {{casting 'struct Foo' to incompatible type 'unsigned long'}} + *p4, // expected-error {{casting 'struct Foo' to incompatible type '__size_t' (aka 'unsigned long')}} "", // expected-error {{column argument must be a constant unsigned integer expression}} - // expected-error@-1 {{incompatible pointer to integer conversion casting 'char[1]' to type 'unsigned long'}} + // expected-error@-1 {{incompatible pointer to integer conversion casting 'char[1]' to type '__size_t' (aka 'unsigned long')}} 10); } @@ -96,7 +96,7 @@ void column_major_store(sx5x10_t *m1, ix3x2_t *m2, float *p1, int *p2, struct Fo __builtin_matrix_column_major_store( "", // expected-error {{1st argument must be a matrix}} 10, // expected-error {{2nd argument must be a pointer to a valid matrix element type}} - *p3); // expected-error {{casting 'struct Foo' to incompatible type 'unsigned long'}} + *p3); // expected-error {{casting 'struct Foo' to incompatible type '__size_t' (aka 'unsigned long')}} __builtin_matrix_column_major_store( *m1, diff --git a/clang/test/Sema/ptrauth.c b/clang/test/Sema/ptrauth.c index e3932615c2962..b4e5214a7cb50 100644 --- a/clang/test/Sema/ptrauth.c +++ b/clang/test/Sema/ptrauth.c @@ -57,7 +57,7 @@ void test_string_discriminator(const char *str) { __builtin_ptrauth_string_discriminator(str); // expected-error {{argument must be a string literal}} __builtin_ptrauth_string_discriminator(L"wide test"); // expected-error {{argument must be a string literal}} expected-warning {{incompatible pointer types passing 'int[10]' to parameter of type 'const char *'}} - void *mismatch = __builtin_ptrauth_string_discriminator("test string"); // expected-error {{incompatible integer to pointer conversion initializing 'void *' with an expression of type 'unsigned long'}} + void *mismatch = __builtin_ptrauth_string_discriminator("test string"); // expected-error {{incompatible integer to pointer conversion initializing 'void *' with an expression of type '__size_t'}} } diff --git a/clang/test/SemaCXX/cxx2c-trivially-relocatable.cpp b/clang/test/SemaCXX/cxx2c-trivially-relocatable.cpp index 062becd4f5776..7d9c61b743afc 100644 --- a/clang/test/SemaCXX/cxx2c-trivially-relocatable.cpp +++ b/clang/test/SemaCXX/cxx2c-trivially-relocatable.cpp @@ -346,7 +346,7 @@ void test__builtin_trivially_relocate() { __builtin_trivially_relocate((S*)0, 0, 0); //expected-error {{argument to '__builtin_trivially_relocate' must be relocatable}} __builtin_trivially_relocate((int*)0, 0, 0); //expected-error {{first and second arguments to '__builtin_trivially_relocate' must be of the same type}} - __builtin_trivially_relocate((int*)0, (int*)0, (int*)0); // expected-error-re {{cannot initialize a value of type '{{.*}}' with an rvalue of type 'int *'}} + __builtin_trivially_relocate((int*)0, (int*)0, (int*)0); // expected-error-re {{cannot initialize a value of type '__size_t' (aka '{{.*}}') with an rvalue of type 'int *'}} __builtin_trivially_relocate((int*)0, (int*)0, 0); __builtin_trivially_relocate((R*)0, (R*)0, 0); } diff --git a/clang/test/SemaCXX/enum-scoped.cpp b/clang/test/SemaCXX/enum-scoped.cpp index d7b7923430aff..9fb44bfe58392 100644 --- a/clang/test/SemaCXX/enum-scoped.cpp +++ b/clang/test/SemaCXX/enum-scoped.cpp @@ -35,7 +35,7 @@ int a1[Val2]; int a2[E1::Val1]; #if __cplusplus >= 201703L -// expected-error@-3 {{type 'E1' is not implicitly convertible to 'unsigned long'}} +// expected-error@-3 {{type 'E1' is not implicitly convertible to '__size_t' (aka 'unsigned long')}} #else // expected-error@-5 {{size of array has non-integer type}} #endif @@ -44,7 +44,7 @@ int* p1 = new int[Val2]; int* p2 = new int[E1::Val1]; #if __cplusplus >= 201703L -// expected-error@-3 {{converting 'E1' to incompatible type 'unsigned long'}} +// expected-error@-3 {{converting 'E1' to incompatible type '__size_t'}} #else // expected-error@-5 {{array size expression must have integral or unscoped enumeration type, not 'E1'}} #endif diff --git a/clang/test/SemaCXX/new-delete.cpp b/clang/test/SemaCXX/new-delete.cpp index 9bbee32c58c36..c78e4695a4ddf 100644 --- a/clang/test/SemaCXX/new-delete.cpp +++ b/clang/test/SemaCXX/new-delete.cpp @@ -109,7 +109,7 @@ void bad_news(int *ip) #elif __cplusplus <= 201103L // expected-error@-4 {{array size expression must have integral or unscoped enumeration type, not 'double'}} #else - // expected-warning@-6 {{implicit conversion from 'double' to 'unsigned int' changes value from 1.1 to 1}} + // expected-warning@-6 {{implicit conversion from 'double' to '__size_t' (aka 'unsigned int') changes value from 1.1 to 1}} #endif (void)new int[1][i]; // expected-note {{read of non-const variable 'i' is not allowed in a constant expression}} diff --git a/clang/test/SemaCXX/static-assert-cxx26.cpp b/clang/test/SemaCXX/static-assert-cxx26.cpp index b53c67ee67932..b2ebd2abb785e 100644 --- a/clang/test/SemaCXX/static-assert-cxx26.cpp +++ b/clang/test/SemaCXX/static-assert-cxx26.cpp @@ -19,7 +19,7 @@ struct InvalidSize { const char* data() const; }; static_assert(true, InvalidSize{}); // expected-error {{the message in a static assertion must have a 'size()' member function returning an object convertible to 'std::size_t'}} \ - // expected-error {{value of type 'const char *' is not implicitly convertible to 'unsigned long'}} + // expected-error {{value of type 'const char *' is not implicitly convertible to '__size_t' (aka 'unsigned long')}} struct InvalidData { unsigned long size() const; unsigned long data() const; @@ -371,13 +371,13 @@ struct E { static_assert(true, A{}); // expected-error {{the message in this static assertion is not a constant expression}} // expected-note@-1 {{read of dereferenced one-past-the-end pointer is not allowed in a constant expression}} -static_assert(true, B{}); // expected-error {{call to 'size()' evaluates to -1, which cannot be narrowed to type 'unsigned long'}} +static_assert(true, B{}); // expected-error {{call to 'size()' evaluates to -1, which cannot be narrowed to type '__size_t' (aka 'unsigned long')}} // expected-error@-1 {{the message in this static assertion is not a constant expression}} // expected-note@-2 {{read of dereferenced one-past-the-end pointer is not allowed in a constant expression}} -static_assert(true, C{}); // expected-error {{call to 'size()' evaluates to -1, which cannot be narrowed to type 'unsigned long'}} +static_assert(true, C{}); // expected-error {{call to 'size()' evaluates to -1, which cannot be narrowed to type '__size_t' (aka 'unsigned long')}} // expected-error@-1 {{the message in this static assertion is not a constant expression}} // expected-note@-2 {{read of dereferenced one-past-the-end pointer is not allowed in a constant expression}} -static_assert(true, D{}); // expected-error {{call to 'size()' evaluates to 340282366920938463463374607431768211455, which cannot be narrowed to type 'unsigned long'}} +static_assert(true, D{}); // expected-error {{call to 'size()' evaluates to 340282366920938463463374607431768211455, which cannot be narrowed to type '__size_t' (aka 'unsigned long')}} // expected-error@-1 {{the message in this static assertion is not a constant expression}} // expected-note@-2 {{read of dereferenced one-past-the-end pointer is not allowed in a constant expression}} static_assert(true, E{}); // expected-error {{the message in this static assertion is not a constant expression}} @@ -391,21 +391,21 @@ static_assert( static_assert( false, // expected-error {{static assertion failed}} - B{} // expected-error {{call to 'size()' evaluates to -1, which cannot be narrowed to type 'unsigned long'}} + B{} // expected-error {{call to 'size()' evaluates to -1, which cannot be narrowed to type '__size_t' (aka 'unsigned long')}} // expected-error@-1 {{the message in a static assertion must be produced by a constant expression}} // expected-note@-2 {{read of dereferenced one-past-the-end pointer is not allowed in a constant expression}} ); static_assert( false, // expected-error {{static assertion failed}} - C{} // expected-error {{call to 'size()' evaluates to -1, which cannot be narrowed to type 'unsigned long'}} + C{} // expected-error {{call to 'size()' evaluates to -1, which cannot be narrowed to type '__size_t' (aka 'unsigned long')}} // expected-error@-1 {{the message in a static assertion must be produced by a constant expression}} // expected-note@-2 {{read of dereferenced one-past-the-end pointer is not allowed in a constant expression}} ); static_assert( false, // expected-error {{static assertion failed}} - D{} // expected-error {{call to 'size()' evaluates to 340282366920938463463374607431768211455, which cannot be narrowed to type 'unsigned long'}} + D{} // expected-error {{call to 'size()' evaluates to 340282366920938463463374607431768211455, which cannot be narrowed to type '__size_t' (aka 'unsigned long')}} // expected-error@-1 {{the message in a static assertion must be produced by a constant expression}} // expected-note@-2 {{read of dereferenced one-past-the-end pointer is not allowed in a constant expression}} ); diff --git a/clang/test/SemaCXX/type-aware-new-delete-basic-free-declarations.cpp b/clang/test/SemaCXX/type-aware-new-delete-basic-free-declarations.cpp index c85b92718479a..15a59d5b3330c 100644 --- a/clang/test/SemaCXX/type-aware-new-delete-basic-free-declarations.cpp +++ b/clang/test/SemaCXX/type-aware-new-delete-basic-free-declarations.cpp @@ -75,7 +75,7 @@ template void *operator new(std::type_identity, U); template void operator delete(std::type_identity, U, size_t, std::align_val_t); // expected-error@-1 {{type aware 'operator delete' cannot take a dependent type as its 2nd parameter; use 'void *' instead}} template void operator delete(std::type_identity, void *, U, std::align_val_t); -// expected-error@-1 {{type aware 'operator delete' cannot take a dependent type as its 3rd parameter; use 'unsigned long' instead}} +// expected-error@-1 {{type aware 'operator delete' cannot take a dependent type as its 3rd parameter; use '__size_t' (aka 'unsigned long') instead}} template void operator delete(std::type_identity, void *, size_t, U); // expected-error@-1 {{type aware 'operator delete' cannot take a dependent type as its 4th parameter; use 'std::align_val_t' instead}} template void *operator new(std::type_identity, typename S::size_ty, std::align_val_t); diff --git a/clang/test/SemaCXX/unavailable_aligned_allocation.cpp b/clang/test/SemaCXX/unavailable_aligned_allocation.cpp index 45fdec606ad1b..56c564f170271 100644 --- a/clang/test/SemaCXX/unavailable_aligned_allocation.cpp +++ b/clang/test/SemaCXX/unavailable_aligned_allocation.cpp @@ -65,12 +65,12 @@ void testOveraligned() { #ifdef NO_ERRORS // expected-no-diagnostics #else -// expected-error-re@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-16 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-17 {{if you supply your own aligned allocation functions}} // expected-error-re@-18 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-19 {{if you supply your own aligned allocation functions}} -// expected-error-re@-20 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-20 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-21 {{if you supply your own aligned allocation functions}} // expected-error-re@-22 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-23 {{if you supply your own aligned allocation functions}} @@ -83,12 +83,12 @@ void testOveraligned() { // expected-error-re@-28 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} // expected-note@-29 {{if you supply your own aligned allocation functions}} -// expected-error-re@-29 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-29 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-30 {{if you supply your own aligned allocation functions}} // expected-error-re@-31 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-32 {{if you supply your own aligned allocation functions}} -// expected-error-re@-33 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-33 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-34 {{if you supply your own aligned allocation functions}} // expected-error-re@-35 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-36 {{if you supply your own aligned allocation functions}} @@ -111,19 +111,19 @@ void testOveralignedCheckOS() { // expected-no-diagnostics #else #if defined(IOS) -// expected-error@-7 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on iOS 11 or newer}} +// expected-error@-7 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on iOS 11 or newer}} // expected-error@-8 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on iOS 11 or newer}}} #elif defined(TVOS) -// expected-error@-10 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on tvOS 11 or newer}}} +// expected-error@-10 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on tvOS 11 or newer}}} // expected-error@-11 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on tvOS 11 or newer}}} #elif defined(WATCHOS) -// expected-error@-13 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on watchOS 4 or newer}}} +// expected-error@-13 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on watchOS 4 or newer}}} // expected-error@-14 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}} #elif defined(MACOS) -// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.13 or newer}}} +// expected-error@-16 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on macOS 10.13 or newer}}} // expected-error@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}} #elif defined(ZOS) -// expected-error@-19 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is not available on z/OS}}} +// expected-error@-19 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is not available on z/OS}}} // expected-error@-20 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is not available on z/OS}}} #endif @@ -181,19 +181,19 @@ void testExplicitOperatorNewDeleteOveraligned() { #ifdef NO_ERRORS // expected-no-diagnostics #else -// expected-error-re@-11 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-11 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-12 {{if you supply your own aligned allocation functions}} // expected-error-re@-13 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-14 {{if you supply your own aligned allocation functions}} -// expected-error-re@-15 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-15 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-16 {{if you supply your own aligned allocation functions}} // expected-error-re@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-18 {{if you supply your own aligned allocation functions}} -// expected-error-re@-19 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-19 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-20 {{if you supply your own aligned allocation functions}} // expected-error-re@-21 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} diff --git a/clang/test/SemaObjC/matrix-type-builtins.m b/clang/test/SemaObjC/matrix-type-builtins.m index 21b8bf864271d..3916017cf0fe0 100644 --- a/clang/test/SemaObjC/matrix-type-builtins.m +++ b/clang/test/SemaObjC/matrix-type-builtins.m @@ -27,5 +27,5 @@ void test_element_type_mismatch(u4x4 m, MatrixValue *mv) { __builtin_matrix_column_major_store(mv.value, mv.value, mv.value); // expected-error@-1 {{2nd argument must be a pointer to a valid matrix element type}} - // expected-error@-2 {{casting 'double4x4' (aka 'double __attribute__((matrix_type(4, 4)))') to incompatible type 'unsigned long}} + // expected-error@-2 {{casting 'double4x4' (aka 'double __attribute__((matrix_type(4, 4)))') to incompatible type '__size_t' (aka 'unsigned long')}} } diff --git a/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl b/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl index a44d9dd86b86a..22569fa7b443c 100644 --- a/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl +++ b/clang/test/SemaOpenCL/cl20-device-side-enqueue.cl @@ -87,7 +87,7 @@ kernel void enqueue_kernel_tests(void) { }, 1024, 4294967296L); #ifdef B32 -// expected-warning@-2{{implicit conversion from 'long' to 'unsigned int' changes value from 4294967296 to 0}} +// expected-warning@-2{{implicit conversion from 'long' to '__size_t' (aka 'unsigned int') changes value from 4294967296 to 0}} #endif char c; @@ -97,7 +97,7 @@ kernel void enqueue_kernel_tests(void) { }, c, 1024L); #ifdef WCONV -// expected-warning-re@-2{{implicit conversion changes signedness: 'char' to 'unsigned {{int|long}}'}} +// expected-warning-re@-2{{implicit conversion changes signedness: 'char' to '__size_t' (aka 'unsigned {{int|long}}')}} #endif #define UINT_MAX 4294967295 @@ -107,7 +107,7 @@ kernel void enqueue_kernel_tests(void) { }, sizeof(int), sizeof(int) * UINT_MAX); #ifdef B32 -// expected-warning@-2{{implicit conversion from 'long' to 'unsigned int' changes value from 17179869180 to 4294967292}} +// expected-warning@-2{{implicit conversion from 'long' to '__size_t' (aka 'unsigned int') changes value from 17179869180 to 4294967292}} #endif typedef void (^bl_A_t)(local void *); diff --git a/clang/test/SemaTemplate/type_pack_element.cpp b/clang/test/SemaTemplate/type_pack_element.cpp index 264b4dcdc044d..5ff010c7db29c 100644 --- a/clang/test/SemaTemplate/type_pack_element.cpp +++ b/clang/test/SemaTemplate/type_pack_element.cpp @@ -7,9 +7,9 @@ using test1 = __type_pack_element<0, int>; // CHECK-NEXT: |-name: '__type_pack_element' qualified // CHECK-NEXT: | `-BuiltinTemplateDecl {{.+}} __type_pack_element // CHECK-NEXT: |-TemplateArgument expr '0' -// CHECK-NEXT: | `-ConstantExpr 0x{{[0-9A-Fa-f]+}} 'unsigned long' +// CHECK-NEXT: | `-ConstantExpr 0x{{[0-9A-Fa-f]+}} '__size_t':'unsigned long' // CHECK-NEXT: | |-value: Int 0 -// CHECK-NEXT: | `-ImplicitCastExpr 0x{{[0-9A-Fa-f]+}} 'unsigned long' +// CHECK-NEXT: | `-ImplicitCastExpr 0x{{[0-9A-Fa-f]+}} '__size_t':'unsigned long' // CHECK-NEXT: | `-IntegerLiteral 0x{{[0-9A-Fa-f]+}} 'int' 0 // CHECK-NEXT: |-TemplateArgument type 'int' // CHECK-NEXT: | `-BuiltinType 0x{{[0-9A-Fa-f]+}} 'int' @@ -23,7 +23,7 @@ template struct A { // CHECK-NEXT: |-name: '__type_pack_element' qualified // CHECK-NEXT: | `-BuiltinTemplateDecl {{.+}} __type_pack_element // CHECK-NEXT: |-TemplateArgument expr 'N' -// CHECK-NEXT: | `-ImplicitCastExpr 0x{{[0-9A-Fa-f]+}} 'unsigned long' +// CHECK-NEXT: | `-ImplicitCastExpr 0x{{[0-9A-Fa-f]+}} '__size_t':'unsigned long' // CHECK-NEXT: | `-DeclRefExpr 0x{{[0-9A-Fa-f]+}} 'int' NonTypeTemplateParm 0x{{[0-9A-Fa-f]+}} 'N' 'int' // CHECK-NEXT: `-TemplateArgument type 'Ts...' // CHECK-NEXT: `-PackExpansionType 0x{{[0-9A-Fa-f]+}} 'Ts...' dependent @@ -37,9 +37,9 @@ template struct A { // CHECK-NEXT: |-name: '__type_pack_element' qualified // CHECK-NEXT: | `-BuiltinTemplateDecl {{.+}} __type_pack_element // CHECK-NEXT: |-TemplateArgument expr '0' -// CHECK-NEXT: | `-ConstantExpr 0x{{[0-9A-Fa-f]+}} 'unsigned long' +// CHECK-NEXT: | `-ConstantExpr 0x{{[0-9A-Fa-f]+}} '__size_t':'unsigned long' // CHECK-NEXT: | |-value: Int 0 -// CHECK-NEXT: | `-ImplicitCastExpr 0x{{[0-9A-Fa-f]+}} 'unsigned long' +// CHECK-NEXT: | `-ImplicitCastExpr 0x{{[0-9A-Fa-f]+}} '__size_t':'unsigned long' // CHECK-NEXT: | `-IntegerLiteral 0x{{[0-9A-Fa-f]+}} 'int' 0 // CHECK-NEXT: `-TemplateArgument type 'Ts...' // CHECK-NEXT: `-PackExpansionType 0x{{[0-9A-Fa-f]+}} 'Ts...' dependent @@ -53,7 +53,7 @@ template struct A { // CHECK-NEXT: |-name: '__type_pack_element' qualified // CHECK-NEXT: | `-BuiltinTemplateDecl {{.+}} __type_pack_element // CHECK-NEXT: |-TemplateArgument expr 'N' -// CHECK-NEXT: | `-ImplicitCastExpr 0x{{[0-9A-Fa-f]+}} 'unsigned long' +// CHECK-NEXT: | `-ImplicitCastExpr 0x{{[0-9A-Fa-f]+}} '__size_t':'unsigned long' // CHECK-NEXT: | `-DeclRefExpr 0x{{[0-9A-Fa-f]+}} 'int' NonTypeTemplateParm 0x{{[0-9A-Fa-f]+}} 'N' 'int' // CHECK-NEXT: `-TemplateArgument type 'int' // CHECK-NEXT: `-BuiltinType 0x{{[0-9A-Fa-f]+}} 'int' From 7e2593e6b0e733da153a6b2544bb57ba7e12d583 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Wed, 11 Jun 2025 13:02:15 +0800 Subject: [PATCH 03/52] Revert changes made outside the intended purpose --- clang/test/FixIt/fixit-format-ios-nopedantic.m | 2 +- clang/test/Sema/format-strings-fixit-ssize_t.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/test/FixIt/fixit-format-ios-nopedantic.m b/clang/test/FixIt/fixit-format-ios-nopedantic.m index 836a4b5372f13..db9ac797c2472 100644 --- a/clang/test/FixIt/fixit-format-ios-nopedantic.m +++ b/clang/test/FixIt/fixit-format-ios-nopedantic.m @@ -1,5 +1,5 @@ // RUN: cp %s %t -// RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -Wformat -fixit %t +// RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -Wformat -Werror -fixit %t int printf(const char *restrict, ...); typedef unsigned int NSUInteger; diff --git a/clang/test/Sema/format-strings-fixit-ssize_t.c b/clang/test/Sema/format-strings-fixit-ssize_t.c index a7c5c9c509817..2c83db0b66362 100644 --- a/clang/test/Sema/format-strings-fixit-ssize_t.c +++ b/clang/test/Sema/format-strings-fixit-ssize_t.c @@ -6,7 +6,7 @@ /* This is a test of the various code modification hints that are provided as part of warning or extension diagnostics. All of the warnings will be fixed by -fixit, and the resulting file should - compile cleanly with -pedantic. */ + compile cleanly with -Werror -pedantic. */ int printf(char const *, ...); int scanf(const char *, ...); From bcc45f0361b1526fb1d55c4b91809821f43aab9b Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Wed, 11 Jun 2025 15:54:07 +0800 Subject: [PATCH 04/52] Add ASTContext::getCanonicalSizeType() --- clang/include/clang/AST/ASTContext.h | 2 ++ clang/lib/AST/ASTContext.cpp | 4 ++++ clang/lib/CodeGen/CGCall.cpp | 2 +- clang/lib/CodeGen/CGCoroutine.cpp | 4 ++-- clang/lib/CodeGen/CGObjCMac.cpp | 2 +- clang/lib/Sema/SemaChecking.cpp | 2 +- .../StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | 2 +- 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index bd4600e479b1b..1e161b18f9a6d 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1971,6 +1971,8 @@ class ASTContext : public RefCountedBase { /// The sizeof operator requires this (C99 6.5.3.4p4). QualType getSizeType() const; + CanQualType getCanonicalSizeType() const; + /// Return the unique signed counterpart of /// the integer type corresponding to size_t. QualType getSignedSizeType() const; diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 00f8f87466273..6e3fceede6459 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6751,6 +6751,10 @@ QualType ASTContext::getSizeType() const { return SizeType; } +CanQualType ASTContext::getCanonicalSizeType() const { + return getFromTargetType(Target->getSizeType()); +} + /// Return the unique signed counterpart of the integer type /// corresponding to size_t. QualType ASTContext::getSignedSizeType() const { diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 3ff2597d65e54..72e02ad21a870 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -224,7 +224,7 @@ static void appendParameterTypes( prefix.push_back(FPT->getParamType(I)); if (ExtInfos[I].hasPassObjectSize()) prefix.push_back( - CGT.getContext().getSizeType()->getCanonicalTypeUnqualified()); + CGT.getContext().getCanonicalSizeType()); } addExtParameterInfosForCall(paramInfos, FPT.getTypePtr(), PrefixSize, diff --git a/clang/lib/CodeGen/CGCoroutine.cpp b/clang/lib/CodeGen/CGCoroutine.cpp index 265dedf228e69..fa89e648082ab 100644 --- a/clang/lib/CodeGen/CGCoroutine.cpp +++ b/clang/lib/CodeGen/CGCoroutine.cpp @@ -1002,14 +1002,14 @@ RValue CodeGenFunction::EmitCoroutineIntrinsic(const CallExpr *E, } case llvm::Intrinsic::coro_size: { auto &Context = getContext(); - CanQualType SizeTy = Context.getSizeType()->getCanonicalTypeUnqualified(); + CanQualType SizeTy = Context.getCanonicalSizeType(); llvm::IntegerType *T = Builder.getIntNTy(Context.getTypeSize(SizeTy)); llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::coro_size, T); return RValue::get(Builder.CreateCall(F)); } case llvm::Intrinsic::coro_align: { auto &Context = getContext(); - CanQualType SizeTy = Context.getSizeType()->getCanonicalTypeUnqualified(); + CanQualType SizeTy = Context.getCanonicalSizeType(); llvm::IntegerType *T = Builder.getIntNTy(Context.getTypeSize(SizeTy)); llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::coro_align, T); return RValue::get(Builder.CreateCall(F)); diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 5a0d2a2286bac..3c8a754797f15 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -285,7 +285,7 @@ class ObjCCommonTypesHelper { SmallVector Params; Params.push_back(Ctx.VoidPtrTy); Params.push_back(Ctx.VoidPtrTy); - Params.push_back(Ctx.getSizeType()->getCanonicalTypeUnqualified()); + Params.push_back(Ctx.getCanonicalSizeType()); Params.push_back(Ctx.BoolTy); Params.push_back(Ctx.BoolTy); llvm::FunctionType *FTy = Types.GetFunctionType( diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 9a0d824a26ae6..2cf08903eaeb0 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -5131,7 +5131,7 @@ bool Sema::BuiltinVAStartARMMicrosoft(CallExpr *Call) { << 3 /* parameter mismatch */ << 2 << Arg1->getType() << ConstCharPtrTy; - const QualType SizeTy = Context.getSizeType()->getCanonicalTypeInternal(); + const QualType SizeTy = Context.getCanonicalSizeType(); if (Arg2Ty->getCanonicalTypeInternal().withoutLocalFastQualifiers() != SizeTy) Diag(Arg2->getBeginLoc(), diag::err_typecheck_convert_incompatible) << Arg2->getType() << SizeTy << 1 /* different class */ diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp index 4057d83fed22e..52b3d1e95942c 100644 --- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp @@ -1666,7 +1666,7 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( const QualType IntTy = ACtx.IntTy; const QualType UnsignedIntTy = ACtx.UnsignedIntTy; const QualType LongTy = ACtx.LongTy; - const QualType SizeTyCanonTy = ACtx.getSizeType().getCanonicalType(); + const QualType SizeTyCanonTy = ACtx.getCanonicalSizeType(); const QualType VoidPtrTy = getPointerTy(VoidTy); // void * const QualType IntPtrTy = getPointerTy(IntTy); // int * From 9d6235b8c14227b75522d12b1f973c9b47065bbf Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Thu, 12 Jun 2025 05:11:44 +0800 Subject: [PATCH 05/52] Check typedefs are defined in the appropriate scope --- clang/include/clang/AST/FormatString.h | 4 +- clang/lib/AST/FormatString.cpp | 53 +++++++++++-------- clang/lib/AST/PrintfFormatString.cpp | 2 +- clang/lib/AST/ScanfFormatString.cpp | 2 +- .../test/FixIt/fixit-format-ios-nopedantic.m | 2 +- 5 files changed, 38 insertions(+), 25 deletions(-) diff --git a/clang/include/clang/AST/FormatString.h b/clang/include/clang/AST/FormatString.h index 3560766433fe2..dd1e5b9c3c85a 100644 --- a/clang/include/clang/AST/FormatString.h +++ b/clang/include/clang/AST/FormatString.h @@ -18,6 +18,7 @@ #ifndef LLVM_CLANG_AST_FORMATSTRING_H #define LLVM_CLANG_AST_FORMATSTRING_H +#include "clang/AST/ASTContext.h" #include "clang/AST/CanonicalType.h" #include @@ -489,7 +490,8 @@ class FormatSpecifier { /// For a TypedefType QT, if it is a named integer type such as size_t, /// assign the appropriate value to LM and return true. - static bool namedTypeToLengthModifier(QualType QT, LengthModifier &LM); + static bool namedTypeToLengthModifier(ASTContext &Ctx, QualType QT, + LengthModifier &LM); }; } // end analyze_format_string namespace diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index 0c1fd33b56f25..e4eb8f1776c46 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -13,6 +13,7 @@ #include "clang/AST/FormatString.h" #include "FormatStringParsing.h" +#include "clang/AST/ASTContext.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetInfo.h" #include "llvm/Support/ConvertUTF.h" @@ -321,27 +322,37 @@ bool clang::analyze_format_string::ParseUTF8InvalidSpecifier( // Methods on ArgType. //===----------------------------------------------------------------------===// -static bool namedTypeToLengthModifierKind(QualType QT, +static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, LengthModifier::Kind &K) { for (/**/; const auto *TT = QT->getAs(); QT = TT->getDecl()->getUnderlyingType()) { - StringRef Name = TT->getDecl()->getIdentifier()->getName(); - if (Name == "size_t" || Name == "__size_t") { - K = LengthModifier::AsSizeT; - return true; - } else if (Name == "__signed_size_t" || - Name == "ssize_t" /*Not C99, but common in Unix.*/) { - K = LengthModifier::AsSizeT; - return true; - } else if (Name == "ptrdiff_t" || Name == "__ptrdiff_t") { - K = LengthModifier::AsPtrDiff; - return true; - } else if (Name == "intmax_t") { - K = LengthModifier::AsIntMax; - return true; - } else if (Name == "uintmax_t") { - K = LengthModifier::AsIntMax; - return true; + const auto *TD = TT->getDecl(); + auto const *DC = TT->getDecl()->getDeclContext(); + bool RC = false; + if (Ctx.getLangOpts().C99) { + RC = DC->isTranslationUnit(); + } else if (Ctx.getLangOpts().CPlusPlus) { + RC = DC->isTranslationUnit() || DC->isStdNamespace(); + } + if (RC) { + StringRef Name = TD->getIdentifier()->getName(); + if (Name == "size_t" || Name == "__size_t") { + K = LengthModifier::AsSizeT; + return true; + } else if (Name == "__signed_size_t" || + Name == "ssize_t" /*Not C99, but common in Unix.*/) { + K = LengthModifier::AsSizeT; + return true; + } else if (Name == "ptrdiff_t" || Name == "__ptrdiff_t") { + K = LengthModifier::AsPtrDiff; + return true; + } else if (Name == "intmax_t") { + K = LengthModifier::AsIntMax; + return true; + } else if (Name == "uintmax_t") { + K = LengthModifier::AsIntMax; + return true; + } } } return false; @@ -374,7 +385,7 @@ matchesSizeTPtrdiffT(ASTContext &C, QualType T, QualType E, return T->isUnsignedIntegerType() ? MatchKind::Match : MatchKind::NoMatchSignedness; - if (Kind Actual = Kind::None; namedTypeToLengthModifierKind(T, Actual)) { + if (Kind Actual = Kind::None; namedTypeToLengthModifierKind(C, T, Actual)) { if (Actual == LE) return MatchKind::Match; else if (Actual == Kind::AsPtrDiff || Actual == Kind::AsSizeT) @@ -1281,10 +1292,10 @@ FormatSpecifier::getCorrectedLengthModifier() const { return std::nullopt; } -bool FormatSpecifier::namedTypeToLengthModifier(QualType QT, +bool FormatSpecifier::namedTypeToLengthModifier(ASTContext &Ctx, QualType QT, LengthModifier &LM) { if (LengthModifier::Kind Out = LengthModifier::Kind::None; - namedTypeToLengthModifierKind(QT, Out)) { + namedTypeToLengthModifierKind(Ctx, QT, Out)) { LM.setKind(Out); return true; } diff --git a/clang/lib/AST/PrintfFormatString.cpp b/clang/lib/AST/PrintfFormatString.cpp index 397a1d4c1172f..bcd44f0a85eed 100644 --- a/clang/lib/AST/PrintfFormatString.cpp +++ b/clang/lib/AST/PrintfFormatString.cpp @@ -920,7 +920,7 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt, // Handle size_t, ptrdiff_t, etc. that have dedicated length modifiers in C99. if (LangOpt.C99 || LangOpt.CPlusPlus11) - namedTypeToLengthModifier(QT, LM); + namedTypeToLengthModifier(Ctx, QT, LM); // If fixing the length modifier was enough, we might be done. if (hasValidLengthModifier(Ctx.getTargetInfo(), LangOpt)) { diff --git a/clang/lib/AST/ScanfFormatString.cpp b/clang/lib/AST/ScanfFormatString.cpp index e3926185860db..1227edd47d13d 100644 --- a/clang/lib/AST/ScanfFormatString.cpp +++ b/clang/lib/AST/ScanfFormatString.cpp @@ -506,7 +506,7 @@ bool ScanfSpecifier::fixType(QualType QT, QualType RawQT, // Handle size_t, ptrdiff_t, etc. that have dedicated length modifiers in C99. if (LangOpt.C99 || LangOpt.CPlusPlus11) - namedTypeToLengthModifier(PT, LM); + namedTypeToLengthModifier(Ctx, PT, LM); // If fixing the length modifier was enough, we are done. if (hasValidLengthModifier(Ctx.getTargetInfo(), LangOpt)) { diff --git a/clang/test/FixIt/fixit-format-ios-nopedantic.m b/clang/test/FixIt/fixit-format-ios-nopedantic.m index db9ac797c2472..836a4b5372f13 100644 --- a/clang/test/FixIt/fixit-format-ios-nopedantic.m +++ b/clang/test/FixIt/fixit-format-ios-nopedantic.m @@ -1,5 +1,5 @@ // RUN: cp %s %t -// RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -Wformat -Werror -fixit %t +// RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -Wformat -fixit %t int printf(const char *restrict, ...); typedef unsigned int NSUInteger; From 85cbd4a58ca6e9206a0c9757c539218220b95b75 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Thu, 12 Jun 2025 07:07:16 +0800 Subject: [PATCH 06/52] Move ssize_t to the global scope, as it must ultimately be provided in the global scope --- clang/test/Sema/format-strings-fixit-ssize_t.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/test/Sema/format-strings-fixit-ssize_t.c b/clang/test/Sema/format-strings-fixit-ssize_t.c index 2c83db0b66362..96806517b80f2 100644 --- a/clang/test/Sema/format-strings-fixit-ssize_t.c +++ b/clang/test/Sema/format-strings-fixit-ssize_t.c @@ -11,8 +11,8 @@ int printf(char const *, ...); int scanf(const char *, ...); +typedef long ssize_t; void test(void) { - typedef signed long int ssize_t; printf("%f", (ssize_t) 42); ssize_t s; scanf("%f", &s); From 210fe3b8df368c16bdd5c0964313ed966e57dead Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Thu, 12 Jun 2025 09:05:40 +0800 Subject: [PATCH 07/52] Fix code format --- clang/lib/CodeGen/CGCall.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 72e02ad21a870..9c049390a4918 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -223,8 +223,7 @@ static void appendParameterTypes( for (unsigned I = 0, E = FPT->getNumParams(); I != E; ++I) { prefix.push_back(FPT->getParamType(I)); if (ExtInfos[I].hasPassObjectSize()) - prefix.push_back( - CGT.getContext().getCanonicalSizeType()); + prefix.push_back(CGT.getContext().getCanonicalSizeType()); } addExtParameterInfosForCall(paramInfos, FPT.getTypePtr(), PrefixSize, From ddd73d83017d650c259ee0dde104bce7897cbe8f Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Thu, 12 Jun 2025 13:52:42 +0800 Subject: [PATCH 08/52] Clarifying support for C89 --- clang/lib/AST/ASTContext.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 6e3fceede6459..a57c84b00442e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6742,7 +6742,7 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { /// needs to agree with the definition in . QualType ASTContext::getSizeType() const { if (SizeType.isNull()) { - if (auto const &LO = getLangOpts(); !LO.HLSL && (LO.C99 || LO.CPlusPlus)) + if (!getLangOpts().HLSL) SizeType = getTypedefType(buildImplicitTypedef( getFromTargetType(Target->getSizeType()), "__size_t")); else @@ -6759,7 +6759,7 @@ CanQualType ASTContext::getCanonicalSizeType() const { /// corresponding to size_t. QualType ASTContext::getSignedSizeType() const { if (SignedSizeType.isNull()) { - if (auto const &LO = getLangOpts(); !LO.HLSL && (LO.C99 || LO.CPlusPlus)) + if (!getLangOpts().HLSL) SignedSizeType = getTypedefType(buildImplicitTypedef( getFromTargetType(Target->getSignedSizeType()), "__signed_size_t")); else @@ -6772,7 +6772,7 @@ QualType ASTContext::getSignedSizeType() const { /// defined in . Pointer - pointer requires this (C99 6.5.6p9). QualType ASTContext::getPointerDiffType() const { if (PtrdiffType.isNull()) { - if (auto const &LO = getLangOpts(); !LO.HLSL && (LO.C99 || LO.CPlusPlus)) + if (!getLangOpts().HLSL) PtrdiffType = getTypedefType(buildImplicitTypedef( getFromTargetType(Target->getPtrDiffType(LangAS::Default)), "__ptrdiff_t")); From 6e207dd939057b30296d5858fe9b03f47aa6a685 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 05:34:11 +0800 Subject: [PATCH 09/52] Try add PredefinedSugarType --- clang/include/clang/AST/ASTContext.h | 2 + clang/include/clang/AST/RecursiveASTVisitor.h | 4 ++ clang/include/clang/AST/Type.h | 35 +++++++++++++++++ clang/include/clang/AST/TypeLoc.h | 4 ++ clang/include/clang/AST/TypeProperties.td | 12 ++++++ clang/include/clang/Basic/TypeNodes.td | 1 + .../clang/Serialization/TypeBitCodes.def | 1 + clang/lib/AST/ASTContext.cpp | 21 +++++++++- clang/lib/AST/ASTImporter.cpp | 6 +++ clang/lib/AST/ASTStructuralEquivalence.cpp | 8 ++++ clang/lib/AST/ItaniumMangle.cpp | 4 ++ clang/lib/AST/TypePrinter.cpp | 10 +++++ clang/lib/CodeGen/CGDebugInfo.cpp | 3 +- clang/lib/CodeGen/CodeGenFunction.cpp | 1 + clang/lib/Sema/SemaExpr.cpp | 3 ++ clang/lib/Sema/TreeTransform.h | 28 +++++++++++++ clang/lib/Serialization/ASTReader.cpp | 5 +++ clang/lib/Serialization/ASTWriter.cpp | 6 +++ clang/test/AST/ast-dump-expr-json.c | 9 ++--- clang/test/AST/ast-dump-expr-json.cpp | 9 ++--- clang/test/AST/ast-dump-stmt-json.cpp | 39 +++++++------------ clang/test/AST/ast-dump-types-errors-json.cpp | 3 +- clang/tools/libclang/CIndex.cpp | 5 +++ 23 files changed, 176 insertions(+), 43 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 1e161b18f9a6d..bf54a49234266 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1530,6 +1530,8 @@ class ASTContext : public RefCountedBase { /// and bit count. QualType getDependentBitIntType(bool Unsigned, Expr *BitsExpr) const; + QualType getPredefinedSugarType(uint32_t KD, QualType UnderlyingType) const; + /// Gets the struct used to keep track of the extended descriptor for /// pointer to blocks. QualType getBlockDescriptorExtendedType() const; diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h index a11157c006f92..3f54089bb489b 100644 --- a/clang/include/clang/AST/RecursiveASTVisitor.h +++ b/clang/include/clang/AST/RecursiveASTVisitor.h @@ -1210,6 +1210,8 @@ DEF_TRAVERSE_TYPE(BitIntType, {}) DEF_TRAVERSE_TYPE(DependentBitIntType, { TRY_TO(TraverseStmt(T->getNumBitsExpr())); }) +DEF_TRAVERSE_TYPE(PredefinedSugarType, {}) + #undef DEF_TRAVERSE_TYPE // ----------------- TypeLoc traversal ----------------- @@ -1526,6 +1528,8 @@ DEF_TRAVERSE_TYPELOC(DependentBitIntType, { TRY_TO(TraverseStmt(TL.getTypePtr()->getNumBitsExpr())); }) +DEF_TRAVERSE_TYPELOC(PredefinedSugarType, {}) + #undef DEF_TRAVERSE_TYPELOC // ----------------- Decl traversal ----------------- diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index a6c26a07800c3..e4f4052e5555f 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -8054,6 +8054,41 @@ class DependentBitIntType final : public Type, public llvm::FoldingSetNode { } }; +class PredefinedSugarType final : public Type { +public: + enum Kind { SizeT, SignedSizeT, PtrdiffT }; + friend class ASTContext; + +private: + Kind K; + QualType Underlying; + PredefinedSugarType(Kind KD, QualType UnderlyingType) + : Type(PredefinedSugar, UnderlyingType->getCanonicalTypeInternal(), + TypeDependence::None), + K(KD), Underlying(UnderlyingType) {} + +public: + bool isSugared() const { return true; } + QualType desugar() const { return Underlying; } + Kind getKind() const { return K; } + + StringRef getName() const { + switch (K) { + case SizeT: + return "__size_t"; + case SignedSizeT: + return "__signed_size_t"; + case PtrdiffT: + return "__ptrdiff_t"; + } + llvm_unreachable(""); + } + + static bool classof(const Type *T) { + return T->getTypeClass() == PredefinedSugar; + } +}; + /// A qualifier set is used to build a set of qualifiers. class QualifierCollector : public Qualifiers { public: diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 53c7ea8c65df2..d2569c4f95135 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -2767,6 +2767,10 @@ class DependentBitIntTypeLoc final : public InheritingConcreteTypeLoc {}; +class PredefinedSugarTypeLoc final + : public InheritingConcreteTypeLoc {}; + class ObjCProtocolLoc { ObjCProtocolDecl *Protocol = nullptr; SourceLocation Loc = SourceLocation(); diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td index 6e44bce893e79..6aed935b7c6ce 100644 --- a/clang/include/clang/AST/TypeProperties.td +++ b/clang/include/clang/AST/TypeProperties.td @@ -1028,3 +1028,15 @@ let Class = DependentBitIntType in { return ctx.getDependentBitIntType(isUnsigned, numBitsExpr); }]>; } + +let Class = PredefinedSugarType in { + def : Property<"underlying", QualType> { + let Read = [{ node->desugar() }]; + } + def : Property<"k", UInt32> { + let Read = [{ static_cast(node->getKind()) }]; + } + def : Creator<[{ + return ctx.getPredefinedSugarType(k, underlying); + }]>; +} diff --git a/clang/include/clang/Basic/TypeNodes.td b/clang/include/clang/Basic/TypeNodes.td index 567b8a5ca5a4d..164b3f5727048 100644 --- a/clang/include/clang/Basic/TypeNodes.td +++ b/clang/include/clang/Basic/TypeNodes.td @@ -117,3 +117,4 @@ def PipeType : TypeNode; def AtomicType : TypeNode; def BitIntType : TypeNode; def DependentBitIntType : TypeNode, AlwaysDependent; +def PredefinedSugarType : TypeNode, NeverCanonical; \ No newline at end of file diff --git a/clang/include/clang/Serialization/TypeBitCodes.def b/clang/include/clang/Serialization/TypeBitCodes.def index b8cde2e370960..613eb6af2005a 100644 --- a/clang/include/clang/Serialization/TypeBitCodes.def +++ b/clang/include/clang/Serialization/TypeBitCodes.def @@ -69,5 +69,6 @@ TYPE_BIT_CODE(CountAttributed, COUNT_ATTRIBUTED, 57) TYPE_BIT_CODE(ArrayParameter, ARRAY_PARAMETER, 58) TYPE_BIT_CODE(HLSLAttributedResource, HLSLRESOURCE_ATTRIBUTED, 59) TYPE_BIT_CODE(HLSLInlineSpirv, HLSL_INLINE_SPIRV, 60) +TYPE_BIT_CODE(PredefinedSugar, PREDEFINED_SUGAR, 61) #undef TYPE_BIT_CODE diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index a57c84b00442e..228bdac4dfbee 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -2528,8 +2528,13 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { Align = static_cast(Width); } } + break; + case Type::PredefinedSugar: + return getTypeInfo(cast(T)->desugar().getTypePtr()); + break; + case Type::Pipe: Width = Target->getPointerWidth(LangAS::opencl_global); Align = Target->getPointerAlign(LangAS::opencl_global); @@ -5148,6 +5153,14 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, return QualType(New, 0); } +QualType ASTContext::getPredefinedSugarType(uint32_t KD, + QualType UnderlyingType) const { + auto *New = new (*this, alignof(PredefinedSugarType)) PredefinedSugarType( + static_cast(KD), UnderlyingType); + Types.push_back(New); + return QualType(New, 0); +} + #ifndef NDEBUG static bool NeedsInjectedClassNameType(const RecordDecl *D) { if (!isa(D)) return false; @@ -6743,8 +6756,9 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { QualType ASTContext::getSizeType() const { if (SizeType.isNull()) { if (!getLangOpts().HLSL) - SizeType = getTypedefType(buildImplicitTypedef( - getFromTargetType(Target->getSizeType()), "__size_t")); + SizeType = + getPredefinedSugarType(PredefinedSugarType::Kind::SizeT, + getFromTargetType(Target->getSizeType())); else SizeType = getFromTargetType(Target->getSizeType()); } @@ -14573,6 +14587,9 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X, DX->isCountInBytes(), DX->isOrNull(), CDX); } + case Type::PredefinedSugar: { + return QualType(); + } } llvm_unreachable("Unhandled Type Class"); } diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 003bad225e30c..b765c3282b3e5 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -1894,6 +1894,12 @@ ExpectedType clang::ASTNodeImporter::VisitDependentBitIntType( *ToNumBitsExprOrErr); } +ExpectedType clang::ASTNodeImporter::VisitPredefinedSugarType( + const clang::PredefinedSugarType *T) { + return Importer.getToContext().getPredefinedSugarType(T->getKind(), + T->desugar()); +} + ExpectedType clang::ASTNodeImporter::VisitDependentSizedMatrixType( const clang::DependentSizedMatrixType *T) { Error Err = Error::success(); diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp index 704de8156132c..80d9a81032a27 100644 --- a/clang/lib/AST/ASTStructuralEquivalence.cpp +++ b/clang/lib/AST/ASTStructuralEquivalence.cpp @@ -1480,6 +1480,14 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, return false; break; } + case Type::PredefinedSugar: { + const auto *TP1 = cast(T1); + const auto *TP2 = cast(T2); + + if (TP1->getKind() != TP2->getKind()) + return false; + break; + } } // end switch return true; diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index ecf5be220439b..17ac833fe839f 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/lib/AST/ItaniumMangle.cpp @@ -2523,6 +2523,10 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty, mangleSourceNameWithAbiTags(cast(Ty)->getDecl()); break; + case Type::PredefinedSugar: + mangleType(cast(Ty)->desugar()); + break; + case Type::UnresolvedUsing: mangleSourceNameWithAbiTags( cast(Ty)->getDecl()); diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index 330cfcd962825..23682a01acae8 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -248,6 +248,7 @@ bool TypePrinter::canPrefixQualifiers(const Type *T, case Type::BTFTagAttributed: case Type::HLSLAttributedResource: case Type::HLSLInlineSpirv: + case Type::PredefinedSugar: CanPrefixQualifiers = true; break; @@ -1417,6 +1418,15 @@ void TypePrinter::printDependentBitIntBefore(const DependentBitIntType *T, void TypePrinter::printDependentBitIntAfter(const DependentBitIntType *T, raw_ostream &OS) {} +void TypePrinter::printPredefinedSugarBefore(const PredefinedSugarType *T, + raw_ostream &OS) { + OS << T->getName(); + spaceBeforePlaceHolder(OS); +} + +void TypePrinter::printPredefinedSugarAfter(const PredefinedSugarType *T, + raw_ostream &OS) {} + /// Appends the given scope to the end of a string. void TypePrinter::AppendScope(DeclContext *DC, raw_ostream &OS, DeclarationName NameInScope) { diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index fbcc330aca6bb..b98762e2e4f5a 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -4047,7 +4047,8 @@ llvm::DIType *CGDebugInfo::CreateTypeNode(QualType Ty, llvm::DIFile *Unit) { return CreateType(cast(Ty), Unit); case Type::HLSLInlineSpirv: return CreateType(cast(Ty), Unit); - + case Type::PredefinedSugar: + return getOrCreateType(cast(Ty)->desugar(), Unit); case Type::CountAttributed: case Type::Auto: case Type::Attributed: diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 3302abad87d65..944fd79e930c6 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2485,6 +2485,7 @@ void CodeGenFunction::EmitVariablyModifiedType(QualType type) { case Type::ObjCObjectPointer: case Type::BitInt: case Type::HLSLInlineSpirv: + case Type::PredefinedSugar: llvm_unreachable("type class is never variably-modified!"); case Type::Elaborated: diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 9c322deb55e00..68f1094bcb10c 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -4646,6 +4646,9 @@ static void captureVariablyModifiedType(ASTContext &Context, QualType T, case Type::Atomic: T = cast(Ty)->getValueType(); break; + case Type::PredefinedSugar: + T = cast(Ty)->desugar(); + break; } } while (!T.isNull() && T->isVariablyModifiedType()); } diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index c8d29f0a625f8..2612aa1ab8b75 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -30,6 +30,7 @@ #include "clang/AST/StmtOpenACC.h" #include "clang/AST/StmtOpenMP.h" #include "clang/AST/StmtSYCL.h" +#include "clang/AST/TypeLoc.h" #include "clang/Basic/DiagnosticParse.h" #include "clang/Basic/OpenMPKinds.h" #include "clang/Sema/Designator.h" @@ -1278,6 +1279,9 @@ class TreeTransform { QualType RebuildDependentBitIntType(bool IsUnsigned, Expr *NumBitsExpr, SourceLocation Loc); + QualType RebuildPredefinedSugarType(uint32_t K, QualType Underlying, + SourceLocation Loc); + /// Build a new template name given a nested name specifier, a flag /// indicating whether the "template" keyword was provided, and the template /// that the template name refers to. @@ -7246,6 +7250,24 @@ QualType TreeTransform::TransformDependentBitIntType( return Result; } +template +QualType TreeTransform::TransformPredefinedSugarType( + TypeLocBuilder &TLB, PredefinedSugarTypeLoc TL) { + const PredefinedSugarType *EIT = TL.getTypePtr(); + QualType Result = TL.getType(); + + if (getDerived().AlwaysRebuild()) { + Result = getDerived().RebuildPredefinedSugarType( + EIT->getKind(), EIT->desugar(), TL.getNameLoc()); + if (Result.isNull()) + return QualType(); + } + + PredefinedSugarTypeLoc NewTL = TLB.push(Result); + NewTL.setNameLoc(TL.getNameLoc()); + return Result; +} + /// Simple iterator that traverses the template arguments in a /// container that provides a \c getArgLoc() member function. /// @@ -17432,6 +17454,12 @@ QualType TreeTransform::RebuildDependentBitIntType( return SemaRef.BuildBitIntType(IsUnsigned, NumBitsExpr, Loc); } +template +QualType TreeTransform::RebuildPredefinedSugarType( + uint32_t K, QualType Underlying, SourceLocation Loc) { + return SemaRef.Context.getPredefinedSugarType(K, Underlying); +} + template TemplateName TreeTransform::RebuildTemplateName(CXXScopeSpec &SS, diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index acda5a7c879dd..adbb3493e25dd 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -7453,11 +7453,16 @@ void TypeLocReader::VisitPipeTypeLoc(PipeTypeLoc TL) { void TypeLocReader::VisitBitIntTypeLoc(clang::BitIntTypeLoc TL) { TL.setNameLoc(readSourceLocation()); } + void TypeLocReader::VisitDependentBitIntTypeLoc( clang::DependentBitIntTypeLoc TL) { TL.setNameLoc(readSourceLocation()); } +void TypeLocReader::VisitPredefinedSugarTypeLoc(PredefinedSugarTypeLoc TL) { + TL.setNameLoc(readSourceLocation()); +} + void ASTRecordReader::readTypeLoc(TypeLoc TL, LocSeq *ParentSeq) { LocSeq::State Seq(ParentSeq); TypeLocReader TLR(*this, Seq); diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index ab1b5b333e06a..1f5beaaaf8101 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -702,11 +702,17 @@ void TypeLocWriter::VisitPipeTypeLoc(PipeTypeLoc TL) { void TypeLocWriter::VisitBitIntTypeLoc(clang::BitIntTypeLoc TL) { addSourceLocation(TL.getNameLoc()); } + void TypeLocWriter::VisitDependentBitIntTypeLoc( clang::DependentBitIntTypeLoc TL) { addSourceLocation(TL.getNameLoc()); } +void TypeLocWriter::VisitPredefinedSugarTypeLoc( + clang::PredefinedSugarTypeLoc TL) { + addSourceLocation(TL.getNameLoc()); +} + void ASTWriter::WriteTypeAbbrevs() { using namespace llvm; diff --git a/clang/test/AST/ast-dump-expr-json.c b/clang/test/AST/ast-dump-expr-json.c index e42b626a8eb16..ecb6191c52200 100644 --- a/clang/test/AST/ast-dump-expr-json.c +++ b/clang/test/AST/ast-dump-expr-json.c @@ -3912,8 +3912,7 @@ void PrimaryExpressions(int a) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", @@ -3967,8 +3966,7 @@ void PrimaryExpressions(int a) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", @@ -3994,8 +3992,7 @@ void PrimaryExpressions(int a) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "alignof", diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp index 51afd3f85c3c9..997f734eb303a 100644 --- a/clang/test/AST/ast-dump-expr-json.cpp +++ b/clang/test/AST/ast-dump-expr-json.cpp @@ -1546,8 +1546,7 @@ void TestNonADLCall3() { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "Ts" @@ -1885,8 +1884,7 @@ void TestNonADLCall3() { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", @@ -1964,8 +1962,7 @@ void TestNonADLCall3() { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", diff --git a/clang/test/AST/ast-dump-stmt-json.cpp b/clang/test/AST/ast-dump-stmt-json.cpp index f34cd206fece0..661facc4f712c 100644 --- a/clang/test/AST/ast-dump-stmt-json.cpp +++ b/clang/test/AST/ast-dump-stmt-json.cpp @@ -1147,8 +1147,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", @@ -1460,8 +1459,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1521,8 +1519,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1605,8 +1602,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1666,8 +1662,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1858,8 +1853,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1913,8 +1907,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -2077,8 +2070,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -2132,8 +2124,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -3900,8 +3891,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", @@ -3976,8 +3966,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", @@ -4108,8 +4097,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", @@ -4184,8 +4172,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "castKind": "IntegralCast", diff --git a/clang/test/AST/ast-dump-types-errors-json.cpp b/clang/test/AST/ast-dump-types-errors-json.cpp index 78e4c7dfd2994..d9f918f6c3d72 100644 --- a/clang/test/AST/ast-dump-types-errors-json.cpp +++ b/clang/test/AST/ast-dump-types-errors-json.cpp @@ -61,8 +61,7 @@ using TestContainsErrors = int[sizeof(undef())]; // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "name": "sizeof", diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 3068621d9c004..076a72b167cfe 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -32,6 +32,7 @@ #include "clang/AST/OpenMPClause.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/StmtVisitor.h" +#include "clang/AST/Type.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticCategories.h" #include "clang/Basic/DiagnosticIDs.h" @@ -1683,6 +1684,10 @@ bool CursorVisitor::VisitTypedefTypeLoc(TypedefTypeLoc TL) { return Visit(MakeCursorTypeRef(TL.getTypedefNameDecl(), TL.getNameLoc(), TU)); } +bool CursorVisitor::VisitPredefinedSugarTypeLoc(PredefinedSugarTypeLoc TL) { + return false; +} + bool CursorVisitor::VisitUnresolvedUsingTypeLoc(UnresolvedUsingTypeLoc TL) { return Visit(MakeCursorTypeRef(TL.getDecl(), TL.getNameLoc(), TU)); } From 151903284f480b4f057e352e9d698c2f61441b81 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 10:24:57 +0800 Subject: [PATCH 10/52] Fix tests --- clang/lib/CodeGen/CodeGenFunction.cpp | 2 +- clang/lib/Sema/SemaExprCXX.cpp | 3 +- clang/test/AST/ast-dump-expr-json.cpp | 12 ++--- clang/test/AST/ast-dump-expr.cpp | 12 ++--- clang/test/AST/ast-dump-stmt-json.cpp | 50 ++++++++----------- .../unavailable_aligned_allocation.cpp | 24 ++++----- 6 files changed, 48 insertions(+), 55 deletions(-) diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 944fd79e930c6..23fe8e33af531 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -721,7 +721,7 @@ static bool matchesStlAllocatorFn(const Decl *D, const ASTContext &Ctx) { (MD->getNumParams() != 1 && MD->getNumParams() != 2)) return false; - if (MD->parameters()[0]->getType().getCanonicalType() != Ctx.getSizeType()) + if (MD->parameters()[0]->getType().getCanonicalType() != Ctx.getCanonicalSizeType()) return false; if (MD->getNumParams() == 2) { diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 2546ab5c0a342..fbb4efae2b676 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3404,7 +3404,8 @@ void Sema::DeclareGlobalNewDelete() { GlobalNewDeleteDeclared = true; QualType VoidPtr = Context.getPointerType(Context.VoidTy); - QualType SizeT = Context.getSizeType(); + // FIXME: Why is 'Canonical'SizeType needed here? + QualType SizeT = Context.getCanonicalSizeType(); auto DeclareGlobalAllocationFunctions = [&](OverloadedOperatorKind Kind, QualType Return, QualType Param) { diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp index 997f734eb303a..8fda06f87e2ee 100644 --- a/clang/test/AST/ast-dump-expr-json.cpp +++ b/clang/test/AST/ast-dump-expr-json.cpp @@ -1729,7 +1729,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: }, @@ -1758,7 +1758,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: }, @@ -1788,7 +1788,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1863,7 +1863,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1941,7 +1941,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -2338,7 +2338,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ diff --git a/clang/test/AST/ast-dump-expr.cpp b/clang/test/AST/ast-dump-expr.cpp index 92adb3d7a5c38..246463caee2a3 100644 --- a/clang/test/AST/ast-dump-expr.cpp +++ b/clang/test/AST/ast-dump-expr.cpp @@ -126,23 +126,23 @@ void UnaryExpressions(int *p) { // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' ::new int; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' global Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' global Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' new (int); - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' new int{12}; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} 'int' // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 12 new int[2]; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(__size_t)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(unsigned long)' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 2 new int[2]{1, 2}; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(__size_t)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(unsigned long)' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 2 // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} 'int[2]' @@ -164,7 +164,7 @@ void UnaryExpressions(int *p) { // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' ::delete p; - // CHECK: CXXDeleteExpr 0x{{[^ ]*}} 'void' global Function 0x{{[^ ]*}} 'operator delete' 'void (void *, __size_t) noexcept' + // CHECK: CXXDeleteExpr 0x{{[^ ]*}} 'void' global Function 0x{{[^ ]*}} 'operator delete' 'void (void *, unsigned long) noexcept' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' diff --git a/clang/test/AST/ast-dump-stmt-json.cpp b/clang/test/AST/ast-dump-stmt-json.cpp index 661facc4f712c..1da8be975c82f 100644 --- a/clang/test/AST/ast-dump-stmt-json.cpp +++ b/clang/test/AST/ast-dump-stmt-json.cpp @@ -963,7 +963,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } @@ -994,7 +994,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1126,7 +1126,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1338,7 +1338,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } @@ -1370,7 +1370,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1445,7 +1445,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "mangledName": "_Znwm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1458,8 +1458,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t" +// CHECK-NEXT: "qualType": "unsigned long" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1505,7 +1504,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "mangledName": "_ZnwmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t, std::align_val_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long, std::align_val_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1518,8 +1517,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t" +// CHECK-NEXT: "qualType": "unsigned long" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1588,7 +1586,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "mangledName": "_Znam", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1601,8 +1599,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t" +// CHECK-NEXT: "qualType": "unsigned long" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1648,7 +1645,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "mangledName": "_ZnamSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(__size_t, std::align_val_t)" +// CHECK-NEXT: "qualType": "void *(unsigned long, std::align_val_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1661,8 +1658,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t" +// CHECK-NEXT: "qualType": "unsigned long" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1826,7 +1822,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "mangledName": "_ZdlPvm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1852,8 +1848,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t" +// CHECK-NEXT: "qualType": "unsigned long" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1880,7 +1875,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "mangledName": "_ZdlPvmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, __size_t, std::align_val_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, unsigned long, std::align_val_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1906,8 +1901,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t" +// CHECK-NEXT: "qualType": "unsigned long" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -2043,7 +2037,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete[]", // CHECK-NEXT: "mangledName": "_ZdaPvm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -2069,8 +2063,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t" +// CHECK-NEXT: "qualType": "unsigned long" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -2097,7 +2090,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete[]", // CHECK-NEXT: "mangledName": "_ZdaPvmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, __size_t, std::align_val_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, unsigned long, std::align_val_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -2123,8 +2116,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "desugaredQualType": "unsigned long", -// CHECK-NEXT: "qualType": "__size_t" +// CHECK-NEXT: "qualType": "unsigned long" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { diff --git a/clang/test/SemaCXX/unavailable_aligned_allocation.cpp b/clang/test/SemaCXX/unavailable_aligned_allocation.cpp index 56c564f170271..45fdec606ad1b 100644 --- a/clang/test/SemaCXX/unavailable_aligned_allocation.cpp +++ b/clang/test/SemaCXX/unavailable_aligned_allocation.cpp @@ -65,12 +65,12 @@ void testOveraligned() { #ifdef NO_ERRORS // expected-no-diagnostics #else -// expected-error-re@-16 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-17 {{if you supply your own aligned allocation functions}} // expected-error-re@-18 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-19 {{if you supply your own aligned allocation functions}} -// expected-error-re@-20 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-20 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-21 {{if you supply your own aligned allocation functions}} // expected-error-re@-22 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-23 {{if you supply your own aligned allocation functions}} @@ -83,12 +83,12 @@ void testOveraligned() { // expected-error-re@-28 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} // expected-note@-29 {{if you supply your own aligned allocation functions}} -// expected-error-re@-29 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-29 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-30 {{if you supply your own aligned allocation functions}} // expected-error-re@-31 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-32 {{if you supply your own aligned allocation functions}} -// expected-error-re@-33 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-33 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-34 {{if you supply your own aligned allocation functions}} // expected-error-re@-35 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-36 {{if you supply your own aligned allocation functions}} @@ -111,19 +111,19 @@ void testOveralignedCheckOS() { // expected-no-diagnostics #else #if defined(IOS) -// expected-error@-7 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on iOS 11 or newer}} +// expected-error@-7 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on iOS 11 or newer}} // expected-error@-8 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on iOS 11 or newer}}} #elif defined(TVOS) -// expected-error@-10 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on tvOS 11 or newer}}} +// expected-error@-10 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on tvOS 11 or newer}}} // expected-error@-11 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on tvOS 11 or newer}}} #elif defined(WATCHOS) -// expected-error@-13 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on watchOS 4 or newer}}} +// expected-error@-13 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on watchOS 4 or newer}}} // expected-error@-14 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}} #elif defined(MACOS) -// expected-error@-16 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on macOS 10.13 or newer}}} +// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.13 or newer}}} // expected-error@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}} #elif defined(ZOS) -// expected-error@-19 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is not available on z/OS}}} +// expected-error@-19 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is not available on z/OS}}} // expected-error@-20 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is not available on z/OS}}} #endif @@ -181,19 +181,19 @@ void testExplicitOperatorNewDeleteOveraligned() { #ifdef NO_ERRORS // expected-no-diagnostics #else -// expected-error-re@-11 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-11 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-12 {{if you supply your own aligned allocation functions}} // expected-error-re@-13 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-14 {{if you supply your own aligned allocation functions}} -// expected-error-re@-15 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-15 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-16 {{if you supply your own aligned allocation functions}} // expected-error-re@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-18 {{if you supply your own aligned allocation functions}} -// expected-error-re@-19 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-19 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-20 {{if you supply your own aligned allocation functions}} // expected-error-re@-21 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} From fc573131a069ddb76e0a051fdef0406a97707458 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 10:32:35 +0800 Subject: [PATCH 11/52] Manually resolve conflicts --- clang/test/AST/ast-dump-recovery.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/clang/test/AST/ast-dump-recovery.c b/clang/test/AST/ast-dump-recovery.c index 3093d2998775c..110559f564442 100644 --- a/clang/test/AST/ast-dump-recovery.c +++ b/clang/test/AST/ast-dump-recovery.c @@ -110,23 +110,6 @@ void test4() { }; } -// Verify no crash -void test5_GH62711() { - // CHECK: VAArgExpr {{.*}} 'int' contains-errors - // CHECK-NEXT: | `-ImplicitCastExpr {{.*}} '' contains-errors - // CHECK-NEXT: | `-RecoveryExpr {{.*}} '' contains-errors - if (__builtin_va_arg(undef, int) << 1); -} - -void test6_GH50244() { - double array[16]; - // CHECK: UnaryExprOrTypeTraitExpr {{.*}} '__size_t':'unsigned long' contains-errors sizeof - // CHECK-NEXT: `-CallExpr {{.*}} '' contains-errors - // CHECK-NEXT: |-DeclRefExpr {{.*}} 'int ()' - // CHECK-NEXT: `-RecoveryExpr {{.*}} '' - sizeof array / sizeof foo(undef); -} - // No crash on DeclRefExpr that refers to ValueDecl with invalid initializers. void test7() { int b[] = {""()}; From c702c1883a9c259cf800bca69fcfc85c88b905cd Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 10:55:59 +0800 Subject: [PATCH 12/52] Add support for the new Type in FormatString --- clang/lib/AST/FormatString.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index e4eb8f1776c46..d193e22e9ca6d 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -14,6 +14,7 @@ #include "clang/AST/FormatString.h" #include "FormatStringParsing.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Type.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetInfo.h" #include "llvm/Support/ConvertUTF.h" @@ -327,7 +328,7 @@ static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, for (/**/; const auto *TT = QT->getAs(); QT = TT->getDecl()->getUnderlyingType()) { const auto *TD = TT->getDecl(); - auto const *DC = TT->getDecl()->getDeclContext(); + const auto *DC = TT->getDecl()->getDeclContext(); bool RC = false; if (Ctx.getLangOpts().C99) { RC = DC->isTranslationUnit(); @@ -336,14 +337,13 @@ static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, } if (RC) { StringRef Name = TD->getIdentifier()->getName(); - if (Name == "size_t" || Name == "__size_t") { + if (Name == "size_t") { K = LengthModifier::AsSizeT; return true; - } else if (Name == "__signed_size_t" || - Name == "ssize_t" /*Not C99, but common in Unix.*/) { + } else if (Name == "ssize_t" /*Not C99, but common in Unix.*/) { K = LengthModifier::AsSizeT; return true; - } else if (Name == "ptrdiff_t" || Name == "__ptrdiff_t") { + } else if (Name == "ptrdiff_t") { K = LengthModifier::AsPtrDiff; return true; } else if (Name == "intmax_t") { @@ -355,6 +355,18 @@ static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, } } } + if (const auto *PST = QT->getAs()) { + using Kind = PredefinedSugarType::Kind; + switch (PST->getKind()) { + case Kind::SizeT: + case Kind::SignedSizeT: + K = LengthModifier::AsSizeT; + return true; + case Kind::PtrdiffT: + K = LengthModifier::AsPtrDiff; + return true; + } + } return false; } From 4b6245233ec215178fe7ff36ff3e16ab1c10f1a6 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 11:07:24 +0800 Subject: [PATCH 13/52] Enable __signed_size_t and __ptrdiff_t --- clang/lib/AST/ASTContext.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 228bdac4dfbee..ea640682609f5 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6774,8 +6774,9 @@ CanQualType ASTContext::getCanonicalSizeType() const { QualType ASTContext::getSignedSizeType() const { if (SignedSizeType.isNull()) { if (!getLangOpts().HLSL) - SignedSizeType = getTypedefType(buildImplicitTypedef( - getFromTargetType(Target->getSignedSizeType()), "__signed_size_t")); + SignedSizeType = getPredefinedSugarType( + PredefinedSugarType::Kind::SignedSizeT, + getFromTargetType(Target->getSignedSizeType())); else SignedSizeType = getFromTargetType(Target->getSignedSizeType()); } @@ -6787,9 +6788,9 @@ QualType ASTContext::getSignedSizeType() const { QualType ASTContext::getPointerDiffType() const { if (PtrdiffType.isNull()) { if (!getLangOpts().HLSL) - PtrdiffType = getTypedefType(buildImplicitTypedef( - getFromTargetType(Target->getPtrDiffType(LangAS::Default)), - "__ptrdiff_t")); + PtrdiffType = getPredefinedSugarType( + PredefinedSugarType::Kind::PtrdiffT, + getFromTargetType(Target->getPtrDiffType(LangAS::Default))); else PtrdiffType = getFromTargetType(Target->getPtrDiffType(LangAS::Default)); } From 3ab170b1c468c16a7d459b9e67630807ab8c747a Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 11:22:29 +0800 Subject: [PATCH 14/52] Update the comment to match the latest impl --- clang/lib/AST/ASTContext.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index ea640682609f5..f2a3ab4f84425 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6739,16 +6739,17 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { return getTypeDeclType(const_cast(Decl)); } -// Inject __size_t, __signed_size_t, and __ptrdiff_t to provide portable hints -// and diagnostics. In C and C++, expressions of type size_t can be obtained via -// the sizeof operator, expressions of type ptrdiff_t via pointer subtraction, -// and expressions of type signed size_t via the z literal suffix (since C++23). +// Using PredefinedSugarType makes size_t, signed size_t, and ptrdiff_t behave +// as named sugar types rather than built-in types, enabling better hints and +// diagnostics. In C and C++, expressions of type size_t can be obtained via the +// sizeof operator, expressions of type ptrdiff_t via pointer subtraction, and +// expressions of type signed size_t via the z literal suffix (since C++23). // However, no core language mechanism directly produces an expression of type // unsigned ptrdiff_t. The unsigned ptrdiff_t type is solely required by format // specifiers for printf and scanf. Consequently, no expression's type needs to // be displayed as unsigned ptrdiff_t. Verification of whether a type is // unsigned ptrdiff_t is also unnecessary, as no corresponding typedefs exist. -// Therefore, injecting a typedef for signed ptrdiff_t is not required. +// Therefore, unsigned ptrdiff_t does not need to do that. /// getSizeType - Return the unique type for "size_t" (C99 7.17), the result /// of the sizeof operator (C99 6.5.3.4p4). The value is target dependent and From c26bb5fb1349a4d7d91bb5d93c8b96d65432b410 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 13:33:09 +0800 Subject: [PATCH 15/52] Fix comment --- clang/include/clang/AST/ASTContext.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index bf54a49234266..b5617fb5ea372 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1957,8 +1957,7 @@ class ASTContext : public RefCountedBase { // The core language uses these types as the result types of some expressions, // which are typically standard integer types and consistent with it's - // typedefs (if any). These variables store the typedefs generated in the AST, - // not the typedefs provided in the header files. + // typedefs (if any). mutable QualType SizeType; // __size_t mutable QualType SignedSizeType; // __signed_size_t mutable QualType PtrdiffType; // __ptrdiff_t From b53c4182586fda71e75e043cb04c2f761aa2f0e9 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 13:51:42 +0800 Subject: [PATCH 16/52] Update tests to match the latest impl --- clang/test/AST/ast-dump-expr-json.cpp | 3 +-- clang/test/AST/ast-dump-stmt-json.cpp | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp index 8fda06f87e2ee..79a3cb4e3cfb3 100644 --- a/clang/test/AST/ast-dump-expr-json.cpp +++ b/clang/test/AST/ast-dump-expr-json.cpp @@ -1589,8 +1589,7 @@ void TestNonADLCall3() { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "long", -// CHECK-NEXT: "qualType": "__ptrdiff_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__ptrdiff_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "opcode": "-", diff --git a/clang/test/AST/ast-dump-stmt-json.cpp b/clang/test/AST/ast-dump-stmt-json.cpp index 1da8be975c82f..c327e553a2ab1 100644 --- a/clang/test/AST/ast-dump-stmt-json.cpp +++ b/clang/test/AST/ast-dump-stmt-json.cpp @@ -4986,8 +4986,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "long", -// CHECK-NEXT: "qualType": "__ptrdiff_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__ptrdiff_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "value": "10" @@ -6511,8 +6510,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "type": { // CHECK-NEXT: "desugaredQualType": "long" -// CHECK-NEXT: "qualType": "__ptrdiff_t", -// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}" +// CHECK-NEXT: "qualType": "__ptrdiff_t" // CHECK-NEXT: }, // CHECK-NEXT: "valueCategory": "prvalue", // CHECK-NEXT: "value": "10" From 46a8ede279f995a765898fe1ebe23c91f1bc49bc Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 18:33:08 +0800 Subject: [PATCH 17/52] Fix the errors pointed out in the review --- clang/include/clang/AST/ASTContext.h | 3 +- clang/include/clang/AST/Type.h | 56 ++++++++++++++-------- clang/include/clang/AST/TypeProperties.td | 5 +- clang/include/clang/Basic/TypeNodes.td | 2 +- clang/lib/AST/ASTContext.cpp | 35 ++++++++------ clang/lib/AST/ASTImporter.cpp | 5 +- clang/lib/AST/ASTStructuralEquivalence.cpp | 4 +- clang/lib/AST/FormatString.cpp | 2 +- clang/lib/AST/Type.cpp | 12 +++++ clang/lib/Sema/TreeTransform.h | 13 ++--- clang/test/CXX/drs/cwg2xx.cpp | 2 +- 11 files changed, 85 insertions(+), 54 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index b5617fb5ea372..34af007f122c9 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -25,7 +25,6 @@ #include "clang/AST/RawCommentList.h" #include "clang/AST/SYCLKernelInfo.h" #include "clang/AST/TemplateName.h" -#include "clang/AST/Type.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/PartialDiagnostic.h" #include "clang/Basic/SourceLocation.h" @@ -1530,7 +1529,7 @@ class ASTContext : public RefCountedBase { /// and bit count. QualType getDependentBitIntType(bool Unsigned, Expr *BitsExpr) const; - QualType getPredefinedSugarType(uint32_t KD, QualType UnderlyingType) const; + QualType getPredefinedSugarType(uint32_t KD) const; /// Gets the struct used to keep track of the extended descriptor for /// pointer to blocks. diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index e4f4052e5555f..200bbc97cc07f 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -2258,6 +2258,30 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { unsigned NumExpansions; }; +public: + /// The kind of a tag type. + enum class PredefinedSugarKind { + /// The "size_t" type. + SizeT, + + /// The "signed_size_t" type. + SignedSizeT, + + /// The "ptrdiff_t" type. + PtrdiffT + }; + +protected: + class PresefinedSugarTypeBitfields { + friend class PredefinedSugarType; + + LLVM_PREFERRED_TYPE(TypeBitfields) + unsigned : NumTypeBits; + + LLVM_PREFERRED_TYPE(PredefinedSugarKind) + unsigned Kind : 8; + }; + class CountAttributedTypeBitfields { friend class CountAttributedType; @@ -2297,6 +2321,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { DependentTemplateSpecializationTypeBits; PackExpansionTypeBitfields PackExpansionTypeBits; CountAttributedTypeBitfields CountAttributedTypeBits; + PresefinedSugarTypeBitfields PredefinedSugarTypeBits; }; private: @@ -8056,34 +8081,27 @@ class DependentBitIntType final : public Type, public llvm::FoldingSetNode { class PredefinedSugarType final : public Type { public: - enum Kind { SizeT, SignedSizeT, PtrdiffT }; friend class ASTContext; private: - Kind K; - QualType Underlying; - PredefinedSugarType(Kind KD, QualType UnderlyingType) + PredefinedSugarType(PredefinedSugarKind KD, QualType UnderlyingType) : Type(PredefinedSugar, UnderlyingType->getCanonicalTypeInternal(), - TypeDependence::None), - K(KD), Underlying(UnderlyingType) {} + TypeDependence::None) { + PredefinedSugarTypeBits.Kind = llvm::to_underlying(KD); + } public: bool isSugared() const { return true; } - QualType desugar() const { return Underlying; } - Kind getKind() const { return K; } - - StringRef getName() const { - switch (K) { - case SizeT: - return "__size_t"; - case SignedSizeT: - return "__signed_size_t"; - case PtrdiffT: - return "__ptrdiff_t"; - } - llvm_unreachable(""); + QualType desugar() const { return getCanonicalTypeInternal(); } + PredefinedSugarKind getKind() const { + return PredefinedSugarKind(PredefinedSugarTypeBits.Kind); } + StringRef getName() const; + + static QualType makePredefinedSugarType(ASTContext &Ctx, + PredefinedSugarKind KD); + static bool classof(const Type *T) { return T->getTypeClass() == PredefinedSugar; } diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td index 6aed935b7c6ce..2be200b5117bd 100644 --- a/clang/include/clang/AST/TypeProperties.td +++ b/clang/include/clang/AST/TypeProperties.td @@ -1030,13 +1030,10 @@ let Class = DependentBitIntType in { } let Class = PredefinedSugarType in { - def : Property<"underlying", QualType> { - let Read = [{ node->desugar() }]; - } def : Property<"k", UInt32> { let Read = [{ static_cast(node->getKind()) }]; } def : Creator<[{ - return ctx.getPredefinedSugarType(k, underlying); + return ctx.getPredefinedSugarType(k); }]>; } diff --git a/clang/include/clang/Basic/TypeNodes.td b/clang/include/clang/Basic/TypeNodes.td index 164b3f5727048..971ce541d4831 100644 --- a/clang/include/clang/Basic/TypeNodes.td +++ b/clang/include/clang/Basic/TypeNodes.td @@ -117,4 +117,4 @@ def PipeType : TypeNode; def AtomicType : TypeNode; def BitIntType : TypeNode; def DependentBitIntType : TypeNode, AlwaysDependent; -def PredefinedSugarType : TypeNode, NeverCanonical; \ No newline at end of file +def PredefinedSugarType : TypeNode, NeverCanonical; diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index f2a3ab4f84425..b3a9f2bce7766 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -74,6 +74,7 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/STLForwardCompat.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" @@ -2533,7 +2534,6 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { case Type::PredefinedSugar: return getTypeInfo(cast(T)->desugar().getTypePtr()); - break; case Type::Pipe: Width = Target->getPointerWidth(LangAS::opencl_global); @@ -5153,10 +5153,22 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, return QualType(New, 0); } -QualType ASTContext::getPredefinedSugarType(uint32_t KD, - QualType UnderlyingType) const { +QualType ASTContext::getPredefinedSugarType(uint32_t KD) const { + using Kind = Type::PredefinedSugarKind; + auto getUnderlyingType = [](const ASTContext &Ctx, Kind KDI) -> QualType { + switch (KDI) { + case Kind::SizeT: + return Ctx.getFromTargetType(Ctx.Target->getSizeType()); + case Kind::SignedSizeT: + return Ctx.getFromTargetType(Ctx.Target->getSignedSizeType()); + case Kind::PtrdiffT: + return Ctx.getFromTargetType(Ctx.Target->getPtrDiffType(LangAS::Default)); + } + llvm_unreachable("unexpected kind"); + }; auto *New = new (*this, alignof(PredefinedSugarType)) PredefinedSugarType( - static_cast(KD), UnderlyingType); + static_cast(KD), + getUnderlyingType(*this, static_cast(KD))); Types.push_back(New); return QualType(New, 0); } @@ -6757,9 +6769,8 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { QualType ASTContext::getSizeType() const { if (SizeType.isNull()) { if (!getLangOpts().HLSL) - SizeType = - getPredefinedSugarType(PredefinedSugarType::Kind::SizeT, - getFromTargetType(Target->getSizeType())); + SizeType = getPredefinedSugarType( + llvm::to_underlying(Type::PredefinedSugarKind::SizeT)); else SizeType = getFromTargetType(Target->getSizeType()); } @@ -6776,8 +6787,7 @@ QualType ASTContext::getSignedSizeType() const { if (SignedSizeType.isNull()) { if (!getLangOpts().HLSL) SignedSizeType = getPredefinedSugarType( - PredefinedSugarType::Kind::SignedSizeT, - getFromTargetType(Target->getSignedSizeType())); + llvm::to_underlying(Type::PredefinedSugarKind::SignedSizeT)); else SignedSizeType = getFromTargetType(Target->getSignedSizeType()); } @@ -6790,8 +6800,7 @@ QualType ASTContext::getPointerDiffType() const { if (PtrdiffType.isNull()) { if (!getLangOpts().HLSL) PtrdiffType = getPredefinedSugarType( - PredefinedSugarType::Kind::PtrdiffT, - getFromTargetType(Target->getPtrDiffType(LangAS::Default))); + llvm::to_underlying(Type::PredefinedSugarKind::PtrdiffT)); else PtrdiffType = getFromTargetType(Target->getPtrDiffType(LangAS::Default)); } @@ -14589,9 +14598,7 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X, DX->isCountInBytes(), DX->isOrNull(), CDX); } - case Type::PredefinedSugar: { - return QualType(); - } + case Type::PredefinedSugar:; } llvm_unreachable("Unhandled Type Class"); } diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index b765c3282b3e5..518c319d059e0 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -57,6 +57,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/STLForwardCompat.h" #include "llvm/ADT/ScopeExit.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" @@ -1896,8 +1897,8 @@ ExpectedType clang::ASTNodeImporter::VisitDependentBitIntType( ExpectedType clang::ASTNodeImporter::VisitPredefinedSugarType( const clang::PredefinedSugarType *T) { - return Importer.getToContext().getPredefinedSugarType(T->getKind(), - T->desugar()); + return Importer.getToContext().getPredefinedSugarType( + llvm::to_underlying(T->getKind())); } ExpectedType clang::ASTNodeImporter::VisitDependentSizedMatrixType( diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp index 80d9a81032a27..921e729c47614 100644 --- a/clang/lib/AST/ASTStructuralEquivalence.cpp +++ b/clang/lib/AST/ASTStructuralEquivalence.cpp @@ -1483,9 +1483,11 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, case Type::PredefinedSugar: { const auto *TP1 = cast(T1); const auto *TP2 = cast(T2); - if (TP1->getKind() != TP2->getKind()) return false; + else + assert(TP1->getCanonicalTypeInternal() == + TP2->getCanonicalTypeInternal()); break; } } // end switch diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index d193e22e9ca6d..bb2ca3eef445d 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -356,7 +356,7 @@ static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, } } if (const auto *PST = QT->getAs()) { - using Kind = PredefinedSugarType::Kind; + using Kind = Type::PredefinedSugarKind; switch (PST->getKind()) { case Kind::SizeT: case Kind::SignedSizeT: diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 5bb39b12693fb..d2d75a15a09ca 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -5624,3 +5624,15 @@ HLSLAttributedResourceType::findHandleTypeOnResource(const Type *RT) { } return nullptr; } + +StringRef PredefinedSugarType::getName() const { + switch (getKind()) { + case PredefinedSugarKind::SizeT: + return "__size_t"; + case PredefinedSugarKind::SignedSizeT: + return "__signed_size_t"; + case PredefinedSugarKind::PtrdiffT: + return "__ptrdiff_t"; + } + llvm_unreachable("unexpected kind"); +} \ No newline at end of file diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 2612aa1ab8b75..7fad15cbb64d9 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -1279,8 +1279,7 @@ class TreeTransform { QualType RebuildDependentBitIntType(bool IsUnsigned, Expr *NumBitsExpr, SourceLocation Loc); - QualType RebuildPredefinedSugarType(uint32_t K, QualType Underlying, - SourceLocation Loc); + QualType RebuildPredefinedSugarType(uint32_t K); /// Build a new template name given a nested name specifier, a flag /// indicating whether the "template" keyword was provided, and the template @@ -7257,10 +7256,7 @@ QualType TreeTransform::TransformPredefinedSugarType( QualType Result = TL.getType(); if (getDerived().AlwaysRebuild()) { - Result = getDerived().RebuildPredefinedSugarType( - EIT->getKind(), EIT->desugar(), TL.getNameLoc()); - if (Result.isNull()) - return QualType(); + Result = getDerived().RebuildPredefinedSugarType(EIT->getKind()); } PredefinedSugarTypeLoc NewTL = TLB.push(Result); @@ -17455,9 +17451,8 @@ QualType TreeTransform::RebuildDependentBitIntType( } template -QualType TreeTransform::RebuildPredefinedSugarType( - uint32_t K, QualType Underlying, SourceLocation Loc) { - return SemaRef.Context.getPredefinedSugarType(K, Underlying); +QualType TreeTransform::RebuildPredefinedSugarType(uint32_t K) { + return SemaRef.Context.getPredefinedSugarType(K); } template diff --git a/clang/test/CXX/drs/cwg2xx.cpp b/clang/test/CXX/drs/cwg2xx.cpp index 9c2c46b8e4c0e..556407afa2641 100644 --- a/clang/test/CXX/drs/cwg2xx.cpp +++ b/clang/test/CXX/drs/cwg2xx.cpp @@ -1429,7 +1429,7 @@ namespace cwg299 { // cwg299: 2.8 c++11 // cxx98-11-error@#cwg299-q {{ambiguous conversion of array size expression of type 'T' to an integral or enumeration type}} // cxx98-11-note@#cwg299-int {{conversion to integral type 'int' declared here}} // cxx98-11-note@#cwg299-ushort {{conversion to integral type 'unsigned short' declared here}} - // since-cxx14-error@#cwg299-q {{conversion from 'T' to '__size_t' (aka 'unsigned long') is ambiguous}} + // since-cxx14-error-re@#cwg299-q {{conversion from 'T' to '__size_t' (aka 'unsigned {{long long|long|int}}') is ambiguous}} // since-cxx14-note@#cwg299-int {{candidate function}} // since-cxx14-note@#cwg299-ushort {{candidate function}} } // namespace cwg299 From aabc86637a25d2d48f572b6ace79b182ae86a07a Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 18:35:47 +0800 Subject: [PATCH 18/52] Fix enum-to-integer conversion --- clang/lib/Sema/TreeTransform.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 7fad15cbb64d9..b19bb8c28faf9 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -47,6 +47,7 @@ #include "clang/Sema/SemaPseudoObject.h" #include "clang/Sema/SemaSYCL.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/STLForwardCompat.h" #include "llvm/Support/ErrorHandling.h" #include #include @@ -7256,7 +7257,7 @@ QualType TreeTransform::TransformPredefinedSugarType( QualType Result = TL.getType(); if (getDerived().AlwaysRebuild()) { - Result = getDerived().RebuildPredefinedSugarType(EIT->getKind()); + Result = getDerived().RebuildPredefinedSugarType(llvm::to_underlying(EIT->getKind())); } PredefinedSugarTypeLoc NewTL = TLB.push(Result); From f5acec2f47c3127a9b1fb14510f5505284444922 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 18:48:21 +0800 Subject: [PATCH 19/52] Fix the test of clangd --- clang-tools-extra/clangd/unittests/HoverTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clangd/unittests/HoverTests.cpp b/clang-tools-extra/clangd/unittests/HoverTests.cpp index 69f6df46c87ce..560ad3266846f 100644 --- a/clang-tools-extra/clangd/unittests/HoverTests.cpp +++ b/clang-tools-extra/clangd/unittests/HoverTests.cpp @@ -2794,7 +2794,7 @@ TEST(Hover, All) { })cpp", [](HoverInfo &HI) { HI.Name = "expression"; - HI.Type = "unsigned long"; + HI.Type = "__size_t (aka unsigned long)"; HI.Value = "1"; }}, { @@ -2804,7 +2804,7 @@ TEST(Hover, All) { })cpp", [](HoverInfo &HI) { HI.Name = "expression"; - HI.Type = "unsigned long"; + HI.Type = "__size_t (aka unsigned long)"; HI.Value = "1"; }}, { From 6d427d3ab91f81595d9c944bd53ec5bd8b9eb4e9 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 14 Jun 2025 18:53:45 +0800 Subject: [PATCH 20/52] Fix code format --- clang/lib/CodeGen/CodeGenFunction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 23fe8e33af531..9f9f3c1326507 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -721,7 +721,8 @@ static bool matchesStlAllocatorFn(const Decl *D, const ASTContext &Ctx) { (MD->getNumParams() != 1 && MD->getNumParams() != 2)) return false; - if (MD->parameters()[0]->getType().getCanonicalType() != Ctx.getCanonicalSizeType()) + if (MD->parameters()[0]->getType().getCanonicalType() != + Ctx.getCanonicalSizeType()) return false; if (MD->getNumParams() == 2) { From b487226a6c8643b21164396a1939c4a1d54a41fc Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 15 Jun 2025 04:13:21 +0800 Subject: [PATCH 21/52] Fix tests --- clang-tools-extra/clangd/unittests/HoverTests.cpp | 4 ++-- clang/lib/AST/ASTContext.cpp | 4 +++- clang/lib/CodeGen/CodeGenFunction.cpp | 2 +- clang/lib/Sema/TreeTransform.h | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clang-tools-extra/clangd/unittests/HoverTests.cpp b/clang-tools-extra/clangd/unittests/HoverTests.cpp index 560ad3266846f..6bdc62e1766d2 100644 --- a/clang-tools-extra/clangd/unittests/HoverTests.cpp +++ b/clang-tools-extra/clangd/unittests/HoverTests.cpp @@ -2794,7 +2794,7 @@ TEST(Hover, All) { })cpp", [](HoverInfo &HI) { HI.Name = "expression"; - HI.Type = "__size_t (aka unsigned long)"; + HI.Type = {"__size_t", "unsigned long"}; HI.Value = "1"; }}, { @@ -2804,7 +2804,7 @@ TEST(Hover, All) { })cpp", [](HoverInfo &HI) { HI.Name = "expression"; - HI.Type = "__size_t (aka unsigned long)"; + HI.Type = {"__size_t", "unsigned long"}; HI.Value = "1"; }}, { diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index b3a9f2bce7766..a0abd76c06195 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -14598,7 +14598,9 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X, DX->isCountInBytes(), DX->isOrNull(), CDX); } - case Type::PredefinedSugar:; + case Type::PredefinedSugar: + // FIXME: Should this be reachable here? + return QualType(); } llvm_unreachable("Unhandled Type Class"); } diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 9f9f3c1326507..a41ca02c73b7b 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -722,7 +722,7 @@ static bool matchesStlAllocatorFn(const Decl *D, const ASTContext &Ctx) { return false; if (MD->parameters()[0]->getType().getCanonicalType() != - Ctx.getCanonicalSizeType()) + Ctx.getCanonicalSizeType()) return false; if (MD->getNumParams() == 2) { diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index b19bb8c28faf9..e400e21cb23d7 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -7257,7 +7257,8 @@ QualType TreeTransform::TransformPredefinedSugarType( QualType Result = TL.getType(); if (getDerived().AlwaysRebuild()) { - Result = getDerived().RebuildPredefinedSugarType(llvm::to_underlying(EIT->getKind())); + Result = getDerived().RebuildPredefinedSugarType( + llvm::to_underlying(EIT->getKind())); } PredefinedSugarTypeLoc NewTL = TLB.push(Result); From a60ff6e68aa86f234274d3e7bd19e0dc1d050930 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 15 Jun 2025 05:20:14 +0800 Subject: [PATCH 22/52] Remove unnecessary #include added by clangd --- clang/include/clang/AST/FormatString.h | 1 - clang/lib/AST/ASTContext.cpp | 1 - clang/lib/AST/ASTImporter.cpp | 1 - clang/lib/AST/FormatString.cpp | 3 --- clang/lib/Sema/TreeTransform.h | 2 -- clang/tools/libclang/CIndex.cpp | 1 - 6 files changed, 9 deletions(-) diff --git a/clang/include/clang/AST/FormatString.h b/clang/include/clang/AST/FormatString.h index dd1e5b9c3c85a..a284f2c44d633 100644 --- a/clang/include/clang/AST/FormatString.h +++ b/clang/include/clang/AST/FormatString.h @@ -18,7 +18,6 @@ #ifndef LLVM_CLANG_AST_FORMATSTRING_H #define LLVM_CLANG_AST_FORMATSTRING_H -#include "clang/AST/ASTContext.h" #include "clang/AST/CanonicalType.h" #include diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index a0abd76c06195..4bf899fe62562 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -74,7 +74,6 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/STLForwardCompat.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 518c319d059e0..94220eec4172b 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -57,7 +57,6 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/STLForwardCompat.h" #include "llvm/ADT/ScopeExit.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index bb2ca3eef445d..9193448809cf7 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -11,10 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/AST/FormatString.h" #include "FormatStringParsing.h" -#include "clang/AST/ASTContext.h" -#include "clang/AST/Type.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetInfo.h" #include "llvm/Support/ConvertUTF.h" diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index e400e21cb23d7..28579f71db665 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -30,7 +30,6 @@ #include "clang/AST/StmtOpenACC.h" #include "clang/AST/StmtOpenMP.h" #include "clang/AST/StmtSYCL.h" -#include "clang/AST/TypeLoc.h" #include "clang/Basic/DiagnosticParse.h" #include "clang/Basic/OpenMPKinds.h" #include "clang/Sema/Designator.h" @@ -47,7 +46,6 @@ #include "clang/Sema/SemaPseudoObject.h" #include "clang/Sema/SemaSYCL.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/STLForwardCompat.h" #include "llvm/Support/ErrorHandling.h" #include #include diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 076a72b167cfe..82786fbe71ee1 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -32,7 +32,6 @@ #include "clang/AST/OpenMPClause.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/StmtVisitor.h" -#include "clang/AST/Type.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticCategories.h" #include "clang/Basic/DiagnosticIDs.h" From 17ef365fd2590100c33290e797a86d9b51b40ae5 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Mon, 16 Jun 2025 05:48:36 +0800 Subject: [PATCH 23/52] Actively initialize SizeType, SignedSizeType, PtrdiffType instead of lazy initialization --- clang/include/clang/AST/ASTContext.h | 6 +-- clang/lib/AST/ASTContext.cpp | 63 ++++++++++------------------ 2 files changed, 24 insertions(+), 45 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 34af007f122c9..b0458ab1c0887 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1957,9 +1957,9 @@ class ASTContext : public RefCountedBase { // The core language uses these types as the result types of some expressions, // which are typically standard integer types and consistent with it's // typedefs (if any). - mutable QualType SizeType; // __size_t - mutable QualType SignedSizeType; // __signed_size_t - mutable QualType PtrdiffType; // __ptrdiff_t + QualType SizeType; // __size_t + QualType SignedSizeType; // __signed_size_t + QualType PtrdiffType; // __ptrdiff_t public: /// Return the unique reference to the type for the specified TagDecl /// (struct/union/class/enum) decl. diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 4bf899fe62562..0e2f6f29b04ac 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1516,6 +1516,24 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, MSGuidTagDecl = buildImplicitRecord("_GUID"); getTranslationUnitDecl()->addDecl(MSGuidTagDecl); } + + // size_t (C99TC3 6.5.3.4), signed size_t (C++23 5.13.2) and + // ptrdiff_t (C99TC3 6.5.6) Although these types are not built-in, they are + // part of the core language and are widely used. + if (!LangOpts.HLSL) { + // Using PredefinedSugarType makes these types as named sugar types rather + // than standard integer types, enabling better hints and diagnostics. + SizeType = getPredefinedSugarType( + llvm::to_underlying(Type::PredefinedSugarKind::SizeT)); + SignedSizeType = getPredefinedSugarType( + llvm::to_underlying(Type::PredefinedSugarKind::SignedSizeT)); + PtrdiffType = getPredefinedSugarType( + llvm::to_underlying(Type::PredefinedSugarKind::PtrdiffT)); + } else { + SizeType = getFromTargetType(Target.getSizeType()); + SignedSizeType = getFromTargetType(Target.getSignedSizeType()); + PtrdiffType = getFromTargetType(Target.getPtrDiffType(LangAS::Default)); + } } DiagnosticsEngine &ASTContext::getDiagnostics() const { @@ -6750,31 +6768,10 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { return getTypeDeclType(const_cast(Decl)); } -// Using PredefinedSugarType makes size_t, signed size_t, and ptrdiff_t behave -// as named sugar types rather than built-in types, enabling better hints and -// diagnostics. In C and C++, expressions of type size_t can be obtained via the -// sizeof operator, expressions of type ptrdiff_t via pointer subtraction, and -// expressions of type signed size_t via the z literal suffix (since C++23). -// However, no core language mechanism directly produces an expression of type -// unsigned ptrdiff_t. The unsigned ptrdiff_t type is solely required by format -// specifiers for printf and scanf. Consequently, no expression's type needs to -// be displayed as unsigned ptrdiff_t. Verification of whether a type is -// unsigned ptrdiff_t is also unnecessary, as no corresponding typedefs exist. -// Therefore, unsigned ptrdiff_t does not need to do that. - /// getSizeType - Return the unique type for "size_t" (C99 7.17), the result /// of the sizeof operator (C99 6.5.3.4p4). The value is target dependent and /// needs to agree with the definition in . -QualType ASTContext::getSizeType() const { - if (SizeType.isNull()) { - if (!getLangOpts().HLSL) - SizeType = getPredefinedSugarType( - llvm::to_underlying(Type::PredefinedSugarKind::SizeT)); - else - SizeType = getFromTargetType(Target->getSizeType()); - } - return SizeType; -} +QualType ASTContext::getSizeType() const { return SizeType; } CanQualType ASTContext::getCanonicalSizeType() const { return getFromTargetType(Target->getSizeType()); @@ -6782,29 +6779,11 @@ CanQualType ASTContext::getCanonicalSizeType() const { /// Return the unique signed counterpart of the integer type /// corresponding to size_t. -QualType ASTContext::getSignedSizeType() const { - if (SignedSizeType.isNull()) { - if (!getLangOpts().HLSL) - SignedSizeType = getPredefinedSugarType( - llvm::to_underlying(Type::PredefinedSugarKind::SignedSizeT)); - else - SignedSizeType = getFromTargetType(Target->getSignedSizeType()); - } - return SignedSizeType; -} +QualType ASTContext::getSignedSizeType() const { return SignedSizeType; } /// getPointerDiffType - Return the unique type for "ptrdiff_t" (C99 7.17) /// defined in . Pointer - pointer requires this (C99 6.5.6p9). -QualType ASTContext::getPointerDiffType() const { - if (PtrdiffType.isNull()) { - if (!getLangOpts().HLSL) - PtrdiffType = getPredefinedSugarType( - llvm::to_underlying(Type::PredefinedSugarKind::PtrdiffT)); - else - PtrdiffType = getFromTargetType(Target->getPtrDiffType(LangAS::Default)); - } - return PtrdiffType; -} +QualType ASTContext::getPointerDiffType() const { return PtrdiffType; } /// Return the unique unsigned counterpart of "ptrdiff_t" /// integer type. The standard (C11 7.21.6.1p7) refers to this type From dd2a2567b2e909f3d893ebb383edf1960681147e Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Mon, 16 Jun 2025 06:03:39 +0800 Subject: [PATCH 24/52] Remove the unused function declaration and minor tweaks --- clang/include/clang/AST/ASTContext.h | 18 +++++++++--------- clang/include/clang/AST/Type.h | 5 ++--- clang/include/clang/AST/TypeProperties.td | 4 ++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index b0458ab1c0887..2bf7e7c5e1104 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1977,15 +1977,6 @@ class ASTContext : public RefCountedBase { /// the integer type corresponding to size_t. QualType getSignedSizeType() const; - /// Return the unique type for "ptrdiff_t" (C99 7.17) defined in - /// . Pointer - pointer requires this (C99 6.5.6p9). - QualType getPointerDiffType() const; - - /// Return the unique unsigned counterpart of "ptrdiff_t" - /// integer type. The standard (C11 7.21.6.1p7) refers to this type - /// in the definition of %tu format specifier. - QualType getUnsignedPointerDiffType() const; - /// Return the unique type for "intmax_t" (C99 7.18.1.5), defined in /// . CanQualType getIntMaxType() const; @@ -2025,6 +2016,15 @@ class ASTContext : public RefCountedBase { /// as defined by the target. QualType getUIntPtrType() const; + /// Return the unique type for "ptrdiff_t" (C99 7.17) defined in + /// . Pointer - pointer requires this (C99 6.5.6p9). + QualType getPointerDiffType() const; + + /// Return the unique unsigned counterpart of "ptrdiff_t" + /// integer type. The standard (C11 7.21.6.1p7) refers to this type + /// in the definition of %tu format specifier. + QualType getUnsignedPointerDiffType() const; + /// Return the unique type for "pid_t" defined in /// . We need this to compute the correct type for vfork(). QualType getProcessIDType() const; diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 200bbc97cc07f..0c3cf86540cb6 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -8092,16 +8092,15 @@ class PredefinedSugarType final : public Type { public: bool isSugared() const { return true; } + QualType desugar() const { return getCanonicalTypeInternal(); } + PredefinedSugarKind getKind() const { return PredefinedSugarKind(PredefinedSugarTypeBits.Kind); } StringRef getName() const; - static QualType makePredefinedSugarType(ASTContext &Ctx, - PredefinedSugarKind KD); - static bool classof(const Type *T) { return T->getTypeClass() == PredefinedSugar; } diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td index 2be200b5117bd..98d5564b33bf7 100644 --- a/clang/include/clang/AST/TypeProperties.td +++ b/clang/include/clang/AST/TypeProperties.td @@ -1030,10 +1030,10 @@ let Class = DependentBitIntType in { } let Class = PredefinedSugarType in { - def : Property<"k", UInt32> { + def : Property<"kind", UInt32> { let Read = [{ static_cast(node->getKind()) }]; } def : Creator<[{ - return ctx.getPredefinedSugarType(k); + return ctx.getPredefinedSugarType(kind); }]>; } From 0bbc668bc36df80f8f0518a0c640be6c1db06f21 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Mon, 16 Jun 2025 07:24:12 +0800 Subject: [PATCH 25/52] Use using declarations to expose protected members to simplify the code --- clang/include/clang/AST/Type.h | 12 ++++-------- clang/lib/AST/ASTContext.cpp | 16 +++++++--------- clang/lib/AST/FormatString.cpp | 2 +- clang/lib/AST/Type.cpp | 6 +++--- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 0c3cf86540cb6..5f3b0a6a1a3a0 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -2258,20 +2258,17 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { unsigned NumExpansions; }; -public: - /// The kind of a tag type. enum class PredefinedSugarKind { /// The "size_t" type. SizeT, - /// The "signed_size_t" type. + /// The "signed size_t" type. SignedSizeT, /// The "ptrdiff_t" type. PtrdiffT }; -protected: class PresefinedSugarTypeBitfields { friend class PredefinedSugarType; @@ -8082,9 +8079,10 @@ class DependentBitIntType final : public Type, public llvm::FoldingSetNode { class PredefinedSugarType final : public Type { public: friend class ASTContext; + using Kind = PredefinedSugarKind; private: - PredefinedSugarType(PredefinedSugarKind KD, QualType UnderlyingType) + PredefinedSugarType(Kind KD, QualType UnderlyingType) : Type(PredefinedSugar, UnderlyingType->getCanonicalTypeInternal(), TypeDependence::None) { PredefinedSugarTypeBits.Kind = llvm::to_underlying(KD); @@ -8095,9 +8093,7 @@ class PredefinedSugarType final : public Type { QualType desugar() const { return getCanonicalTypeInternal(); } - PredefinedSugarKind getKind() const { - return PredefinedSugarKind(PredefinedSugarTypeBits.Kind); - } + Kind getKind() const { return Kind(PredefinedSugarTypeBits.Kind); } StringRef getName() const; diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 0e2f6f29b04ac..e4c9d04ba4f31 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1523,12 +1523,11 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, if (!LangOpts.HLSL) { // Using PredefinedSugarType makes these types as named sugar types rather // than standard integer types, enabling better hints and diagnostics. - SizeType = getPredefinedSugarType( - llvm::to_underlying(Type::PredefinedSugarKind::SizeT)); - SignedSizeType = getPredefinedSugarType( - llvm::to_underlying(Type::PredefinedSugarKind::SignedSizeT)); - PtrdiffType = getPredefinedSugarType( - llvm::to_underlying(Type::PredefinedSugarKind::PtrdiffT)); + using Kind = PredefinedSugarType::Kind; + SizeType = getPredefinedSugarType(llvm::to_underlying(Kind::SizeT)); + SignedSizeType = + getPredefinedSugarType(llvm::to_underlying(Kind::SignedSizeT)); + PtrdiffType = getPredefinedSugarType(llvm::to_underlying(Kind::PtrdiffT)); } else { SizeType = getFromTargetType(Target.getSizeType()); SignedSizeType = getFromTargetType(Target.getSignedSizeType()); @@ -5171,7 +5170,7 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, } QualType ASTContext::getPredefinedSugarType(uint32_t KD) const { - using Kind = Type::PredefinedSugarKind; + using Kind = PredefinedSugarType::Kind; auto getUnderlyingType = [](const ASTContext &Ctx, Kind KDI) -> QualType { switch (KDI) { case Kind::SizeT: @@ -5184,8 +5183,7 @@ QualType ASTContext::getPredefinedSugarType(uint32_t KD) const { llvm_unreachable("unexpected kind"); }; auto *New = new (*this, alignof(PredefinedSugarType)) PredefinedSugarType( - static_cast(KD), - getUnderlyingType(*this, static_cast(KD))); + static_cast(KD), getUnderlyingType(*this, static_cast(KD))); Types.push_back(New); return QualType(New, 0); } diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index 9193448809cf7..0579247a0546e 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -353,7 +353,7 @@ static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, } } if (const auto *PST = QT->getAs()) { - using Kind = Type::PredefinedSugarKind; + using Kind = PredefinedSugarType::Kind; switch (PST->getKind()) { case Kind::SizeT: case Kind::SignedSizeT: diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index d2d75a15a09ca..ba4ba227fb5ca 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -5627,11 +5627,11 @@ HLSLAttributedResourceType::findHandleTypeOnResource(const Type *RT) { StringRef PredefinedSugarType::getName() const { switch (getKind()) { - case PredefinedSugarKind::SizeT: + case Kind::SizeT: return "__size_t"; - case PredefinedSugarKind::SignedSizeT: + case Kind::SignedSizeT: return "__signed_size_t"; - case PredefinedSugarKind::PtrdiffT: + case Kind::PtrdiffT: return "__ptrdiff_t"; } llvm_unreachable("unexpected kind"); From 895efceecc2464c16b8ab33ac54ed7077cc664d4 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Fri, 27 Jun 2025 02:43:38 +0800 Subject: [PATCH 26/52] Resolve a conflict --- clang/lib/Serialization/ASTReader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index adbb3493e25dd..e7361fb7e8b8a 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -7463,9 +7463,8 @@ void TypeLocReader::VisitPredefinedSugarTypeLoc(PredefinedSugarTypeLoc TL) { TL.setNameLoc(readSourceLocation()); } -void ASTRecordReader::readTypeLoc(TypeLoc TL, LocSeq *ParentSeq) { - LocSeq::State Seq(ParentSeq); - TypeLocReader TLR(*this, Seq); +void ASTRecordReader::readTypeLoc(TypeLoc TL) { + TypeLocReader TLR(*this); for (; !TL.isNull(); TL = TL.getNextTypeLoc()) TLR.Visit(TL); } From 9ed218e18dc7955534b4ed3a92556c76505d3e33 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Fri, 27 Jun 2025 02:49:24 +0800 Subject: [PATCH 27/52] Temporary remove to resolve the conflict --- clang/lib/Serialization/ASTReader.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index e7361fb7e8b8a..7d13e85b3fd32 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -7459,10 +7459,6 @@ void TypeLocReader::VisitDependentBitIntTypeLoc( TL.setNameLoc(readSourceLocation()); } -void TypeLocReader::VisitPredefinedSugarTypeLoc(PredefinedSugarTypeLoc TL) { - TL.setNameLoc(readSourceLocation()); -} - void ASTRecordReader::readTypeLoc(TypeLoc TL) { TypeLocReader TLR(*this); for (; !TL.isNull(); TL = TL.getNextTypeLoc()) From faf82b187985c3c5a92ddaf2bbceb4c771bb98ee Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Fri, 27 Jun 2025 02:50:38 +0800 Subject: [PATCH 28/52] Update ASTReader.cpp --- clang/lib/Serialization/ASTReader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 22be7de0e9b88..3b55d52a180ca 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -7454,6 +7454,10 @@ void TypeLocReader::VisitDependentBitIntTypeLoc( TL.setNameLoc(readSourceLocation()); } +void TypeLocReader::VisitPredefinedSugarTypeLoc(PredefinedSugarTypeLoc TL) { + TL.setNameLoc(readSourceLocation()); +} + void ASTRecordReader::readTypeLoc(TypeLoc TL) { TypeLocReader TLR(*this); for (; !TL.isNull(); TL = TL.getNextTypeLoc()) From a10bd96beb54f21dfc8d7cda8d328d2f61541960 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 28 Jun 2025 23:19:12 +0800 Subject: [PATCH 29/52] Fix the test of libc++ --- .../sequences/deque/spare_block_handling.pass.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcxx/test/libcxx/containers/sequences/deque/spare_block_handling.pass.cpp b/libcxx/test/libcxx/containers/sequences/deque/spare_block_handling.pass.cpp index 4fa4982de88fa..c5f152a26a766 100644 --- a/libcxx/test/libcxx/containers/sequences/deque/spare_block_handling.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/deque/spare_block_handling.pass.cpp @@ -38,10 +38,10 @@ static void print(const Deque& d) { " : __back_spare() == %zu" " : __capacity() == %zu" " : bytes allocated == %zu\n", - d.size(), - d.__front_spare(), - d.__back_spare(), - d.__capacity(), + std::size_t(d.size()), + std::size_t(d.__front_spare()), + std::size_t(d.__back_spare()), + std::size_t(d.__capacity()), malloc_allocator_base::outstanding_bytes); } From 6a473e02c8402b653e0641f9f3952a8b7e6da4ee Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 29 Jun 2025 01:25:42 +0800 Subject: [PATCH 30/52] Fix some simple issues --- clang/include/clang/AST/Type.h | 2 +- clang/lib/AST/ASTContext.cpp | 7 ++++--- clang/lib/AST/ASTStructuralEquivalence.cpp | 3 --- clang/lib/AST/Type.cpp | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index ef155d367f8bb..d20d3c5ac4976 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -2262,7 +2262,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { /// The "size_t" type. SizeT, - /// The "signed size_t" type. + /// The signed integer type corresponding to "size_t". SignedSizeT, /// The "ptrdiff_t" type. diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 06a1487d895ba..5504b4afd7c06 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5239,7 +5239,7 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, QualType ASTContext::getPredefinedSugarType(uint32_t KD) const { using Kind = PredefinedSugarType::Kind; - auto getUnderlyingType = [](const ASTContext &Ctx, Kind KDI) -> QualType { + auto getCanonicalType = [](const ASTContext &Ctx, Kind KDI) -> QualType { switch (KDI) { case Kind::SizeT: return Ctx.getFromTargetType(Ctx.Target->getSizeType()); @@ -5251,7 +5251,7 @@ QualType ASTContext::getPredefinedSugarType(uint32_t KD) const { llvm_unreachable("unexpected kind"); }; auto *New = new (*this, alignof(PredefinedSugarType)) PredefinedSugarType( - static_cast(KD), getUnderlyingType(*this, static_cast(KD))); + static_cast(KD), getCanonicalType(*this, static_cast(KD))); Types.push_back(New); return QualType(New, 0); } @@ -14565,7 +14565,8 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X, CDX); } case Type::PredefinedSugar: - // FIXME: Should this be reachable here? + assert(cast(X)->getKind() != + cast(Y)->getKind()); return QualType(); } llvm_unreachable("Unhandled Type Class"); diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp index 921e729c47614..a9b9ff7260f9f 100644 --- a/clang/lib/AST/ASTStructuralEquivalence.cpp +++ b/clang/lib/AST/ASTStructuralEquivalence.cpp @@ -1485,9 +1485,6 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, const auto *TP2 = cast(T2); if (TP1->getKind() != TP2->getKind()) return false; - else - assert(TP1->getCanonicalTypeInternal() == - TP2->getCanonicalTypeInternal()); break; } } // end switch diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 8bfe4d7baf31a..d3efcca8556e1 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -5633,4 +5633,4 @@ StringRef PredefinedSugarType::getName() const { return "__ptrdiff_t"; } llvm_unreachable("unexpected kind"); -} \ No newline at end of file +} From 9b9b90a8859d83ad29710867dbee7b2d1bc89fd8 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 29 Jun 2025 03:45:56 +0800 Subject: [PATCH 31/52] Fix other issues --- clang/include/clang/AST/ASTContext.h | 2 +- clang/include/clang/AST/Type.h | 13 +++++++++---- clang/include/clang/AST/TypeProperties.td | 2 +- clang/lib/AST/ASTContext.cpp | 15 ++++++++------- clang/lib/AST/ASTImporter.cpp | 3 +-- clang/lib/AST/Type.cpp | 4 ++-- clang/lib/AST/TypePrinter.cpp | 2 +- clang/lib/Sema/TreeTransform.h | 8 ++++---- 8 files changed, 27 insertions(+), 22 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 55cf977cc653c..a6586bc30e14d 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1567,7 +1567,7 @@ class ASTContext : public RefCountedBase { /// and bit count. QualType getDependentBitIntType(bool Unsigned, Expr *BitsExpr) const; - QualType getPredefinedSugarType(uint32_t KD) const; + QualType getPredefinedSugarType(PredefinedSugarType::Kind KD) const; /// Gets the struct used to keep track of the extended descriptor for /// pointer to blocks. diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index d20d3c5ac4976..44ae655be4320 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -8066,12 +8066,17 @@ class PredefinedSugarType final : public Type { using Kind = PredefinedSugarKind; private: - PredefinedSugarType(Kind KD, QualType UnderlyingType) - : Type(PredefinedSugar, UnderlyingType->getCanonicalTypeInternal(), - TypeDependence::None) { + PredefinedSugarType(Kind KD, const IdentifierInfo *IdentName, + QualType CanonicalType) + : Type(PredefinedSugar, CanonicalType, TypeDependence::None), + Name(IdentName) { PredefinedSugarTypeBits.Kind = llvm::to_underlying(KD); } + static StringRef getName(Kind KD); + + const IdentifierInfo *Name; + public: bool isSugared() const { return true; } @@ -8079,7 +8084,7 @@ class PredefinedSugarType final : public Type { Kind getKind() const { return Kind(PredefinedSugarTypeBits.Kind); } - StringRef getName() const; + const IdentifierInfo *getIdentifier() const { return Name; } static bool classof(const Type *T) { return T->getTypeClass() == PredefinedSugar; diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td index 8f8a849a33251..3114d1180319a 100644 --- a/clang/include/clang/AST/TypeProperties.td +++ b/clang/include/clang/AST/TypeProperties.td @@ -1034,6 +1034,6 @@ let Class = PredefinedSugarType in { let Read = [{ static_cast(node->getKind()) }]; } def : Creator<[{ - return ctx.getPredefinedSugarType(kind); + return ctx.getPredefinedSugarType(static_cast(kind)); }]>; } diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 5504b4afd7c06..8cf71c68be800 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1524,10 +1524,9 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, // Using PredefinedSugarType makes these types as named sugar types rather // than standard integer types, enabling better hints and diagnostics. using Kind = PredefinedSugarType::Kind; - SizeType = getPredefinedSugarType(llvm::to_underlying(Kind::SizeT)); - SignedSizeType = - getPredefinedSugarType(llvm::to_underlying(Kind::SignedSizeT)); - PtrdiffType = getPredefinedSugarType(llvm::to_underlying(Kind::PtrdiffT)); + SizeType = getPredefinedSugarType(Kind::SizeT); + SignedSizeType = getPredefinedSugarType(Kind::SignedSizeT); + PtrdiffType = getPredefinedSugarType(Kind::PtrdiffT); } else { SizeType = getFromTargetType(Target.getSizeType()); SignedSizeType = getFromTargetType(Target.getSignedSizeType()); @@ -5237,7 +5236,8 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, return QualType(New, 0); } -QualType ASTContext::getPredefinedSugarType(uint32_t KD) const { +QualType +ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { using Kind = PredefinedSugarType::Kind; auto getCanonicalType = [](const ASTContext &Ctx, Kind KDI) -> QualType { switch (KDI) { @@ -5250,8 +5250,9 @@ QualType ASTContext::getPredefinedSugarType(uint32_t KD) const { } llvm_unreachable("unexpected kind"); }; - auto *New = new (*this, alignof(PredefinedSugarType)) PredefinedSugarType( - static_cast(KD), getCanonicalType(*this, static_cast(KD))); + auto *New = new (*this, alignof(PredefinedSugarType)) + PredefinedSugarType(KD, &Idents.get(PredefinedSugarType::getName(KD)), + getCanonicalType(*this, static_cast(KD))); Types.push_back(New); return QualType(New, 0); } diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index a88f3207b55fb..efea100622c89 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -1895,8 +1895,7 @@ ExpectedType clang::ASTNodeImporter::VisitDependentBitIntType( ExpectedType clang::ASTNodeImporter::VisitPredefinedSugarType( const clang::PredefinedSugarType *T) { - return Importer.getToContext().getPredefinedSugarType( - llvm::to_underlying(T->getKind())); + return Importer.getToContext().getPredefinedSugarType(T->getKind()); } ExpectedType clang::ASTNodeImporter::VisitDependentSizedMatrixType( diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index d3efcca8556e1..d9c920a19f66a 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -5623,8 +5623,8 @@ HLSLAttributedResourceType::findHandleTypeOnResource(const Type *RT) { return nullptr; } -StringRef PredefinedSugarType::getName() const { - switch (getKind()) { +StringRef PredefinedSugarType::getName(Kind KD) { + switch (KD) { case Kind::SizeT: return "__size_t"; case Kind::SignedSizeT: diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index 927d92c8d18d0..3dfc522f547c0 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -1420,7 +1420,7 @@ void TypePrinter::printDependentBitIntAfter(const DependentBitIntType *T, void TypePrinter::printPredefinedSugarBefore(const PredefinedSugarType *T, raw_ostream &OS) { - OS << T->getName(); + OS << T->getIdentifier()->getName(); spaceBeforePlaceHolder(OS); } diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index b4a1dc79c27f4..b9cdc197f41ca 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -1278,7 +1278,7 @@ class TreeTransform { QualType RebuildDependentBitIntType(bool IsUnsigned, Expr *NumBitsExpr, SourceLocation Loc); - QualType RebuildPredefinedSugarType(uint32_t K); + QualType RebuildPredefinedSugarType(PredefinedSugarType::Kind K); /// Build a new template name given a nested name specifier, a flag /// indicating whether the "template" keyword was provided, and the template @@ -7257,8 +7257,7 @@ QualType TreeTransform::TransformPredefinedSugarType( QualType Result = TL.getType(); if (getDerived().AlwaysRebuild()) { - Result = getDerived().RebuildPredefinedSugarType( - llvm::to_underlying(EIT->getKind())); + Result = getDerived().RebuildPredefinedSugarType(EIT->getKind()); } PredefinedSugarTypeLoc NewTL = TLB.push(Result); @@ -17448,7 +17447,8 @@ QualType TreeTransform::RebuildDependentBitIntType( } template -QualType TreeTransform::RebuildPredefinedSugarType(uint32_t K) { +QualType TreeTransform::RebuildPredefinedSugarType( + PredefinedSugarType::Kind K) { return SemaRef.Context.getPredefinedSugarType(K); } From a753834276701786888fedd2d2cd081cecda7afb Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 29 Jun 2025 04:29:42 +0800 Subject: [PATCH 32/52] Enable HLSL --- clang/lib/AST/ASTContext.cpp | 18 +- ...d_resource_element_compatible_concept.hlsl | 2 +- clang/test/SemaHLSL/Language/AssignArray.hlsl | 4 +- clang/test/SemaHLSL/Language/InitListAST.hlsl | 264 +++++++++--------- 4 files changed, 141 insertions(+), 147 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 8cf71c68be800..cb23655aa7937 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1520,18 +1520,12 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, // size_t (C99TC3 6.5.3.4), signed size_t (C++23 5.13.2) and // ptrdiff_t (C99TC3 6.5.6) Although these types are not built-in, they are // part of the core language and are widely used. - if (!LangOpts.HLSL) { - // Using PredefinedSugarType makes these types as named sugar types rather - // than standard integer types, enabling better hints and diagnostics. - using Kind = PredefinedSugarType::Kind; - SizeType = getPredefinedSugarType(Kind::SizeT); - SignedSizeType = getPredefinedSugarType(Kind::SignedSizeT); - PtrdiffType = getPredefinedSugarType(Kind::PtrdiffT); - } else { - SizeType = getFromTargetType(Target.getSizeType()); - SignedSizeType = getFromTargetType(Target.getSignedSizeType()); - PtrdiffType = getFromTargetType(Target.getPtrDiffType(LangAS::Default)); - } + // Using PredefinedSugarType makes these types as named sugar types rather + // than standard integer types, enabling better hints and diagnostics. + using Kind = PredefinedSugarType::Kind; + SizeType = getPredefinedSugarType(Kind::SizeT); + SignedSizeType = getPredefinedSugarType(Kind::SignedSizeT); + PtrdiffType = getPredefinedSugarType(Kind::PtrdiffT); } DiagnosticsEngine &ASTContext::getDiagnostics() const { diff --git a/clang/test/AST/HLSL/is_structured_resource_element_compatible_concept.hlsl b/clang/test/AST/HLSL/is_structured_resource_element_compatible_concept.hlsl index a4f6e6c44794e..fa8d78f38494a 100644 --- a/clang/test/AST/HLSL/is_structured_resource_element_compatible_concept.hlsl +++ b/clang/test/AST/HLSL/is_structured_resource_element_compatible_concept.hlsl @@ -9,7 +9,7 @@ // CHECK: | `-TemplateTypeParm {{.*}} 'element_type' // CHECK: `-BinaryOperator {{.*}} 'bool' lvalue '>=' // CHECK: |-UnaryExprOrTypeTraitExpr {{.*}} 'bool' sizeof 'element_type' -// CHECK: `-IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK: `-IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 StructuredBuffer Buffer; diff --git a/clang/test/SemaHLSL/Language/AssignArray.hlsl b/clang/test/SemaHLSL/Language/AssignArray.hlsl index 1f813e7a350b1..16b60fe40f806 100644 --- a/clang/test/SemaHLSL/Language/AssignArray.hlsl +++ b/clang/test/SemaHLSL/Language/AssignArray.hlsl @@ -13,7 +13,7 @@ export void fn(int8 A) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector *' // CHECK-NEXT: OpaqueValueExpr {{.*}} 'int8':'vector[2]' lvalue // CHECK-NEXT: DeclRefExpr {{.*}} 'int8':'vector[2]' lvalue Var {{.*}} 'a' 'int8':'vector[2]' -// CHECK-NEXT: ArrayInitIndexExpr {{.*}} 'unsigned long' +// CHECK-NEXT: ArrayInitIndexExpr {{.*}} '__size_t':'unsigned long' int8 b = a; // CHECK-LABEL: VarDecl {{.*}} c 'int8':'vector[2]' cinit @@ -25,7 +25,7 @@ export void fn(int8 A) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector *' // CHECK-NEXT: OpaqueValueExpr {{.*}} 'vector[2]' lvalue // CHECK-NEXT: DeclRefExpr {{.*}} 'vector[2]' lvalue ParmVar {{.*}} 'A' 'vector[2]' -// CHECK-NEXT: ArrayInitIndexExpr {{.*}} 'unsigned long' +// CHECK-NEXT: ArrayInitIndexExpr {{.*}} '__size_t':'unsigned long' int8 c = A; } diff --git a/clang/test/SemaHLSL/Language/InitListAST.hlsl b/clang/test/SemaHLSL/Language/InitListAST.hlsl index 78bf269769ae6..460ec38bb44af 100644 --- a/clang/test/SemaHLSL/Language/InitListAST.hlsl +++ b/clang/test/SemaHLSL/Language/InitListAST.hlsl @@ -97,12 +97,12 @@ TwoFloats case3(int Val) { // CHECK-NEXT: ImplicitCastExpr {{.*}}'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: DeclRefExpr {{.*}} 'int2':'vector' lvalue ParmVar {{.*}} 'TwoVals' 'int2':'vector' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: DeclRefExpr {{.*}} 'int2':'vector' lvalue ParmVar {{.*}} 'TwoVals' 'int2':'vector' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 TwoFloats case4(int2 TwoVals) { TwoFloats TF4 = {TwoVals}; return TF4; @@ -115,11 +115,11 @@ TwoFloats case4(int2 TwoVals) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: DeclRefExpr {{.*}} 'int2':'vector' lvalue ParmVar {{.*}} 'TwoVals' 'int2':'vector' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: DeclRefExpr {{.*}} 'int2':'vector' lvalue ParmVar {{.*}} 'TwoVals' 'int2':'vector' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 TwoInts case5(int2 TwoVals) { TwoInts TI1 = {TwoVals}; return TI1; @@ -209,22 +209,22 @@ Doggo case7(TwoInts TI1, TwoInts TI2, int Val, TwoFloats TF1, TwoFloats TF2, // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'unsigned int' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: MemberExpr {{.*}} 'int' lvalue .TailState {{.*}} @@ -240,32 +240,32 @@ Doggo case7(TwoInts TI1, TwoInts TI2, int Val, TwoFloats TF1, TwoFloats TF2, // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'float4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent @@ -273,32 +273,32 @@ Doggo case7(TwoInts TI1, TwoInts TI2, int Val, TwoFloats TF1, TwoFloats TF2, // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 AnimalBits case8(Doggo D1) { AnimalBits A1 = {D1}; return A1; @@ -317,22 +317,22 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: MemberExpr {{.*}} 'int' lvalue .TailState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' @@ -347,32 +347,32 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'float4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent @@ -380,32 +380,32 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'Doggo' // CHECK-NEXT: InitListExpr {{.*}} 'int4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' @@ -413,25 +413,25 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'uint':'unsigned int' // CHECK-NEXT: MemberExpr {{.*}} 'uint':'unsigned int' lvalue .State {{.*}} @@ -446,43 +446,43 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'float4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'Kitteh[4]' // CHECK-NEXT: InitListExpr {{.*}} 'Kitteh' // CHECK-NEXT: InitListExpr {{.*}} 'int4':'vector' @@ -490,22 +490,22 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: MemberExpr {{.*}} 'int' lvalue .TailState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' @@ -520,32 +520,32 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'float4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent @@ -553,32 +553,32 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'Kitteh' // CHECK-NEXT: InitListExpr {{.*}} 'int4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' @@ -586,25 +586,25 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'uint':'unsigned int' // CHECK-NEXT: MemberExpr {{.*}} 'uint':'unsigned int' lvalue .State {{.*}} @@ -619,65 +619,65 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'float4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'Kitteh' // CHECK-NEXT: InitListExpr {{.*}} 'int4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'int4':'vector' lvalue .LegState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: MemberExpr {{.*}} 'int' lvalue .TailState {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' @@ -692,32 +692,32 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'float4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent @@ -725,32 +725,32 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float4':'vector' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float4 *' // CHECK-NEXT: MemberExpr {{.*}} 'float4[2]' lvalue .EarDirection {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'Doggo' lvalue ParmVar {{.*}} 'D1' 'Doggo' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'Kitteh' // CHECK-NEXT: InitListExpr {{.*}} 'int4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' @@ -758,25 +758,25 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'int' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int *' // CHECK-NEXT: MemberExpr {{.*}} 'int[4]' lvalue .Legs {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'uint':'unsigned int' // CHECK-NEXT: MemberExpr {{.*}} 'uint':'unsigned int' lvalue .State {{.*}} @@ -791,43 +791,43 @@ AnimalBits case8(Doggo D1) { // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .LeftDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 // CHECK-NEXT: InitListExpr {{.*}} 'float4':'vector' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' lvalue vectorcomponent // CHECK-NEXT: MemberExpr {{.*}} 'float4':'vector' lvalue .RightDir {{.*}} // CHECK-NEXT: DeclRefExpr {{.*}} 'AnimalBits' lvalue ParmVar {{.*}} 'A1' 'AnimalBits' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 Zoo case9(Doggo D1, AnimalBits A1) { Zoo Z1 = {D1, A1, D1, A1, D1, A1}; return Z1; @@ -867,28 +867,28 @@ FourFloats case10(TwoFloats TF1, TwoFloats TF2) { // CHECK-NEXT: ExtVectorElementExpr {{.*}} 'vector' xxxx // CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector' lvalue // CHECK-NEXT: DeclRefExpr {{.*}} 'float' lvalue ParmVar {{.*}} 'F' 'float' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' xvalue vectorcomponent // CHECK-NEXT: MaterializeTemporaryExpr {{.*}} 'vector' xvalue // CHECK-NEXT: ExtVectorElementExpr {{.*}} 'vector' xxxx // CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector' lvalue // CHECK-NEXT: DeclRefExpr {{.*}} 'float' lvalue ParmVar {{.*}} 'F' 'float' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' xvalue vectorcomponent // CHECK-NEXT: MaterializeTemporaryExpr {{.*}} 'vector' xvalue // CHECK-NEXT: ExtVectorElementExpr {{.*}} 'vector' xxxx // CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector' lvalue // CHECK-NEXT: DeclRefExpr {{.*}} 'float' lvalue ParmVar {{.*}} 'F' 'float' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 2 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 2 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'float' xvalue vectorcomponent // CHECK-NEXT: MaterializeTemporaryExpr {{.*}} 'vector' xvalue // CHECK-NEXT: ExtVectorElementExpr {{.*}} 'vector' xxxx // CHECK-NEXT: ImplicitCastExpr {{.*}} 'vector' lvalue // CHECK-NEXT: DeclRefExpr {{.*}} 'float' lvalue ParmVar {{.*}} 'F' 'float' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 3 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 3 FourFloats case11(float F) { FourFloats FF1 = {F.xxxx}; return FF1; @@ -1008,52 +1008,52 @@ FourFloats case16() { // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'IntAndFloat' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'IntAndFloat *' // CHECK-NEXT: DeclRefExpr {{.*}} 'IntAndFloat[2]' lvalue Var {{.*}} 'Structs' 'IntAndFloat[2]' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: MemberExpr {{.*}} 'float' lvalue .B {{.*}} // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'IntAndFloat' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'IntAndFloat *' // CHECK-NEXT: DeclRefExpr {{.*}} 'IntAndFloat[2]' lvalue Var {{.*}} 'Structs' 'IntAndFloat[2]' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: MemberExpr {{.*}} 'int' lvalue .A {{.*}} // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'IntAndFloat' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'IntAndFloat *' // CHECK-NEXT: DeclRefExpr {{.*}} 'IntAndFloat[2]' lvalue Var {{.*}} 'Structs' 'IntAndFloat[2]' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: MemberExpr {{.*}} 'float' lvalue .B {{.*}} // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'IntAndFloat' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'IntAndFloat *' // CHECK-NEXT: DeclRefExpr {{.*}} 'IntAndFloat[2]' lvalue Var {{.*}} 'Structs' 'IntAndFloat[2]' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: MemberExpr {{.*}} 'int' lvalue .A {{.*}} // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'IntAndFloat' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'IntAndFloat *' // CHECK-NEXT: DeclRefExpr {{.*}} 'IntAndFloat[2]' lvalue Var {{.*}} 'Structs' 'IntAndFloat[2]' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: MemberExpr {{.*}} 'float' lvalue .B {{.*}} // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'IntAndFloat' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'IntAndFloat *' // CHECK-NEXT: DeclRefExpr {{.*}} 'IntAndFloat[2]' lvalue Var {{.*}} 'Structs' 'IntAndFloat[2]' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 0 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 0 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: MemberExpr {{.*}} 'int' lvalue .A {{.*}} // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'IntAndFloat' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'IntAndFloat *' // CHECK-NEXT: DeclRefExpr {{.*}} 'IntAndFloat[2]' lvalue Var {{.*}} 'Structs' 'IntAndFloat[2]' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' // CHECK-NEXT: MemberExpr {{.*}} 'float' lvalue .B {{.*}} // CHECK-NEXT: ArraySubscriptExpr {{.*}} 'IntAndFloat' lvalue // CHECK-NEXT: ImplicitCastExpr {{.*}} 'IntAndFloat *' // CHECK-NEXT: DeclRefExpr {{.*}} 'IntAndFloat[2]' lvalue Var {{.*}} 'Structs' 'IntAndFloat[2]' -// CHECK-NEXT: IntegerLiteral {{.*}} 'unsigned long' 1 +// CHECK-NEXT: IntegerLiteral {{.*}} '__size_t':'unsigned long' 1 float case17() { IntAndFloat Structs[] = {1,2,3,4}; float Floats[] = {Structs, Structs}; From 816fef94784e9bab853c6ae01a165855dae4c753 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 29 Jun 2025 06:16:20 +0800 Subject: [PATCH 33/52] Use FoldingSetNode --- clang/include/clang/AST/ASTContext.h | 1 + clang/include/clang/AST/Type.h | 10 +++++++++- clang/lib/AST/ASTContext.cpp | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index a6586bc30e14d..0fbfef6ac6cb1 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -258,6 +258,7 @@ class ASTContext : public RefCountedBase { mutable llvm::FoldingSet BitIntTypes; mutable llvm::ContextualFoldingSet DependentBitIntTypes; + mutable llvm::FoldingSet PredefinedSugarTypes; mutable llvm::FoldingSet BTFTagAttributedTypes; llvm::FoldingSet HLSLAttributedResourceTypes; llvm::FoldingSet HLSLInlineSpirvTypes; diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 44ae655be4320..f0d182c4c1318 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -8060,7 +8060,7 @@ class DependentBitIntType final : public Type, public llvm::FoldingSetNode { } }; -class PredefinedSugarType final : public Type { +class PredefinedSugarType final : public Type, public llvm::FoldingSetNode { public: friend class ASTContext; using Kind = PredefinedSugarKind; @@ -8089,6 +8089,14 @@ class PredefinedSugarType final : public Type { static bool classof(const Type *T) { return T->getTypeClass() == PredefinedSugar; } + + void Profile(llvm::FoldingSetNodeID &ID) const { + Profile(ID, llvm::to_underlying(getKind())); + } + + static void Profile(llvm::FoldingSetNodeID &ID, unsigned KD) { + ID.AddInteger(KD); + } }; /// A qualifier set is used to build a set of qualifiers. diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index cb23655aa7937..16ae2062358f0 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5232,7 +5232,16 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, QualType ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { + llvm::FoldingSetNodeID ID; + PredefinedSugarType::Profile(ID, llvm::to_underlying(KD)); + + void *InsertPos = nullptr; + if (PredefinedSugarType *Existing = + PredefinedSugarTypes.FindNodeOrInsertPos(ID, InsertPos)) + return QualType(Existing, 0); + using Kind = PredefinedSugarType::Kind; + auto getCanonicalType = [](const ASTContext &Ctx, Kind KDI) -> QualType { switch (KDI) { case Kind::SizeT: @@ -5244,10 +5253,12 @@ ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { } llvm_unreachable("unexpected kind"); }; + auto *New = new (*this, alignof(PredefinedSugarType)) PredefinedSugarType(KD, &Idents.get(PredefinedSugarType::getName(KD)), getCanonicalType(*this, static_cast(KD))); Types.push_back(New); + PredefinedSugarTypes.InsertNode(New, InsertPos); return QualType(New, 0); } From e8420f0ed963fbf6a603ee7a1c3c835127f3e5d1 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 29 Jun 2025 11:48:12 +0800 Subject: [PATCH 34/52] Improved based on the review --- clang/include/clang/AST/ASTContext.h | 12 ++++----- clang/include/clang/AST/Type.h | 15 ++++------- clang/lib/AST/ASTContext.cpp | 39 ++++++++++++++-------------- clang/lib/AST/FormatString.cpp | 2 ++ clang/lib/AST/Type.cpp | 1 + clang/lib/Sema/TreeTransform.h | 19 +------------- 6 files changed, 33 insertions(+), 55 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 0fbfef6ac6cb1..50d336f7bca5a 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -258,7 +258,6 @@ class ASTContext : public RefCountedBase { mutable llvm::FoldingSet BitIntTypes; mutable llvm::ContextualFoldingSet DependentBitIntTypes; - mutable llvm::FoldingSet PredefinedSugarTypes; mutable llvm::FoldingSet BTFTagAttributedTypes; llvm::FoldingSet HLSLAttributedResourceTypes; llvm::FoldingSet HLSLInlineSpirvTypes; @@ -278,6 +277,11 @@ class ASTContext : public RefCountedBase { mutable llvm::ContextualFoldingSet ArrayParameterTypes; + /// Store the unique Type corresponding to each Kind. + mutable std::array + PredefinedSugarTypes; + /// The set of nested name specifiers. /// /// This set is managed by the NestedNameSpecifier class. @@ -1993,12 +1997,6 @@ class ASTContext : public RefCountedBase { bool IsDependent, QualType Canon) const; - // The core language uses these types as the result types of some expressions, - // which are typically standard integer types and consistent with it's - // typedefs (if any). - QualType SizeType; // __size_t - QualType SignedSizeType; // __signed_size_t - QualType PtrdiffType; // __ptrdiff_t public: /// Return the unique reference to the type for the specified TagDecl /// (struct/union/class/enum) decl. diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index f0d182c4c1318..be6a15560f496 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -2266,7 +2266,10 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { SignedSizeT, /// The "ptrdiff_t" type. - PtrdiffT + PtrdiffT, + + // Indicates how many items the enum has. + Max }; class PresefinedSugarTypeBitfields { @@ -8060,7 +8063,7 @@ class DependentBitIntType final : public Type, public llvm::FoldingSetNode { } }; -class PredefinedSugarType final : public Type, public llvm::FoldingSetNode { +class PredefinedSugarType final : public Type { public: friend class ASTContext; using Kind = PredefinedSugarKind; @@ -8089,14 +8092,6 @@ class PredefinedSugarType final : public Type, public llvm::FoldingSetNode { static bool classof(const Type *T) { return T->getTypeClass() == PredefinedSugar; } - - void Profile(llvm::FoldingSetNodeID &ID) const { - Profile(ID, llvm::to_underlying(getKind())); - } - - static void Profile(llvm::FoldingSetNodeID &ID, unsigned KD) { - ID.AddInteger(KD); - } }; /// A qualifier set is used to build a set of qualifiers. diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 16ae2062358f0..36cbf189008b6 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1516,16 +1516,6 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, MSGuidTagDecl = buildImplicitRecord("_GUID"); getTranslationUnitDecl()->addDecl(MSGuidTagDecl); } - - // size_t (C99TC3 6.5.3.4), signed size_t (C++23 5.13.2) and - // ptrdiff_t (C99TC3 6.5.6) Although these types are not built-in, they are - // part of the core language and are widely used. - // Using PredefinedSugarType makes these types as named sugar types rather - // than standard integer types, enabling better hints and diagnostics. - using Kind = PredefinedSugarType::Kind; - SizeType = getPredefinedSugarType(Kind::SizeT); - SignedSizeType = getPredefinedSugarType(Kind::SignedSizeT); - PtrdiffType = getPredefinedSugarType(Kind::PtrdiffT); } DiagnosticsEngine &ASTContext::getDiagnostics() const { @@ -5232,24 +5222,27 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, QualType ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { - llvm::FoldingSetNodeID ID; - PredefinedSugarType::Profile(ID, llvm::to_underlying(KD)); - void *InsertPos = nullptr; - if (PredefinedSugarType *Existing = - PredefinedSugarTypes.FindNodeOrInsertPos(ID, InsertPos)) - return QualType(Existing, 0); + auto Target = PredefinedSugarTypes[llvm::to_underlying(KD)]; + if (Target != nullptr) + return QualType(Target, 0); using Kind = PredefinedSugarType::Kind; auto getCanonicalType = [](const ASTContext &Ctx, Kind KDI) -> QualType { switch (KDI) { + // size_t (C99TC3 6.5.3.4), signed size_t (C++23 5.13.2) and + // ptrdiff_t (C99TC3 6.5.6) Although these types are not built-in, they + // are part of the core language and are widely used. Using + // PredefinedSugarType makes these types as named sugar types rather than + // standard integer types, enabling better hints and diagnostics. case Kind::SizeT: return Ctx.getFromTargetType(Ctx.Target->getSizeType()); case Kind::SignedSizeT: return Ctx.getFromTargetType(Ctx.Target->getSignedSizeType()); case Kind::PtrdiffT: return Ctx.getFromTargetType(Ctx.Target->getPtrDiffType(LangAS::Default)); + case Kind::Max:; } llvm_unreachable("unexpected kind"); }; @@ -5258,7 +5251,7 @@ ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { PredefinedSugarType(KD, &Idents.get(PredefinedSugarType::getName(KD)), getCanonicalType(*this, static_cast(KD))); Types.push_back(New); - PredefinedSugarTypes.InsertNode(New, InsertPos); + Target = New; return QualType(New, 0); } @@ -6842,7 +6835,9 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { /// getSizeType - Return the unique type for "size_t" (C99 7.17), the result /// of the sizeof operator (C99 6.5.3.4p4). The value is target dependent and /// needs to agree with the definition in . -QualType ASTContext::getSizeType() const { return SizeType; } +QualType ASTContext::getSizeType() const { + return getPredefinedSugarType(PredefinedSugarType::Kind::SizeT); +} CanQualType ASTContext::getCanonicalSizeType() const { return getFromTargetType(Target->getSizeType()); @@ -6850,11 +6845,15 @@ CanQualType ASTContext::getCanonicalSizeType() const { /// Return the unique signed counterpart of the integer type /// corresponding to size_t. -QualType ASTContext::getSignedSizeType() const { return SignedSizeType; } +QualType ASTContext::getSignedSizeType() const { + return getPredefinedSugarType(PredefinedSugarType::Kind::SignedSizeT); +} /// getPointerDiffType - Return the unique type for "ptrdiff_t" (C99 7.17) /// defined in . Pointer - pointer requires this (C99 6.5.6p9). -QualType ASTContext::getPointerDiffType() const { return PtrdiffType; } +QualType ASTContext::getPointerDiffType() const { + return getPredefinedSugarType(PredefinedSugarType::Kind::PtrdiffT); +} /// Return the unique unsigned counterpart of "ptrdiff_t" /// integer type. The standard (C11 7.21.6.1p7) refers to this type diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index 0579247a0546e..7243e4b137979 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -362,6 +362,8 @@ static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, case Kind::PtrdiffT: K = LengthModifier::AsPtrDiff; return true; + case Kind::Max: + llvm_unreachable("unexpected kind"); } } return false; diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index d9c920a19f66a..0a9283b990b15 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -5631,6 +5631,7 @@ StringRef PredefinedSugarType::getName(Kind KD) { return "__signed_size_t"; case Kind::PtrdiffT: return "__ptrdiff_t"; + case Kind::Max:; } llvm_unreachable("unexpected kind"); } diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index b9cdc197f41ca..4822f5ca2de45 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -1278,8 +1278,6 @@ class TreeTransform { QualType RebuildDependentBitIntType(bool IsUnsigned, Expr *NumBitsExpr, SourceLocation Loc); - QualType RebuildPredefinedSugarType(PredefinedSugarType::Kind K); - /// Build a new template name given a nested name specifier, a flag /// indicating whether the "template" keyword was provided, and the template /// that the template name refers to. @@ -7253,16 +7251,7 @@ QualType TreeTransform::TransformDependentBitIntType( template QualType TreeTransform::TransformPredefinedSugarType( TypeLocBuilder &TLB, PredefinedSugarTypeLoc TL) { - const PredefinedSugarType *EIT = TL.getTypePtr(); - QualType Result = TL.getType(); - - if (getDerived().AlwaysRebuild()) { - Result = getDerived().RebuildPredefinedSugarType(EIT->getKind()); - } - - PredefinedSugarTypeLoc NewTL = TLB.push(Result); - NewTL.setNameLoc(TL.getNameLoc()); - return Result; + llvm_unreachable("This type does not need to be transformed."); } /// Simple iterator that traverses the template arguments in a @@ -17446,12 +17435,6 @@ QualType TreeTransform::RebuildDependentBitIntType( return SemaRef.BuildBitIntType(IsUnsigned, NumBitsExpr, Loc); } -template -QualType TreeTransform::RebuildPredefinedSugarType( - PredefinedSugarType::Kind K) { - return SemaRef.Context.getPredefinedSugarType(K); -} - template TemplateName TreeTransform::RebuildTemplateName(CXXScopeSpec &SS, From 2d1cb40a79ce79ea5089513522248faedd13e502 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 29 Jun 2025 11:59:46 +0800 Subject: [PATCH 35/52] Assert out of bounds in advance --- clang/lib/AST/ASTContext.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 36cbf189008b6..3e0e07d7eeb95 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5222,13 +5222,14 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, QualType ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { + using Kind = PredefinedSugarType::Kind; + + assert(KD != Kind::Max); - auto Target = PredefinedSugarTypes[llvm::to_underlying(KD)]; + auto *Target = PredefinedSugarTypes[llvm::to_underlying(KD)]; if (Target != nullptr) return QualType(Target, 0); - using Kind = PredefinedSugarType::Kind; - auto getCanonicalType = [](const ASTContext &Ctx, Kind KDI) -> QualType { switch (KDI) { // size_t (C99TC3 6.5.3.4), signed size_t (C++23 5.13.2) and From 127428272496eff2713462eb36bd70f523ae7325 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 29 Jun 2025 12:06:28 +0800 Subject: [PATCH 36/52] Fixed the unset value --- clang/lib/AST/ASTContext.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 3e0e07d7eeb95..f3288b7456e46 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5226,8 +5226,8 @@ ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { assert(KD != Kind::Max); - auto *Target = PredefinedSugarTypes[llvm::to_underlying(KD)]; - if (Target != nullptr) + if (auto *Target = PredefinedSugarTypes[llvm::to_underlying(KD)]; + Target != nullptr) return QualType(Target, 0); auto getCanonicalType = [](const ASTContext &Ctx, Kind KDI) -> QualType { @@ -5252,7 +5252,7 @@ ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { PredefinedSugarType(KD, &Idents.get(PredefinedSugarType::getName(KD)), getCanonicalType(*this, static_cast(KD))); Types.push_back(New); - Target = New; + PredefinedSugarTypes[llvm::to_underlying(KD)] = New; return QualType(New, 0); } From 6b8f27d71c092817459f1b782b15a34c857c4081 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 29 Jun 2025 12:10:08 +0800 Subject: [PATCH 37/52] Oops, std::array should not be default-initialized --- clang/include/clang/AST/ASTContext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 50d336f7bca5a..76f20218775d6 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -280,7 +280,7 @@ class ASTContext : public RefCountedBase { /// Store the unique Type corresponding to each Kind. mutable std::array - PredefinedSugarTypes; + PredefinedSugarTypes{}; /// The set of nested name specifiers. /// From 33e546e7b5af591d8bd81883250889e572d84d59 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Tue, 1 Jul 2025 03:49:24 +0800 Subject: [PATCH 38/52] Simplify the definition of PredefinedSugarTypeLoc --- clang/include/clang/AST/TypeLoc.h | 13 +++++++++---- clang/lib/Serialization/ASTReader.cpp | 2 +- clang/lib/Serialization/ASTWriter.cpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 2530de97eed13..ee40023338f36 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -2767,10 +2767,6 @@ class DependentBitIntTypeLoc final : public InheritingConcreteTypeLoc {}; -class PredefinedSugarTypeLoc final - : public InheritingConcreteTypeLoc {}; - class ObjCProtocolLoc { ObjCProtocolDecl *Protocol = nullptr; SourceLocation Loc = SourceLocation(); @@ -2787,6 +2783,15 @@ class ObjCProtocolLoc { } }; +struct PredefinedSugarTypeLocInfo {}; // Nothing. + +class PredefinedSugarTypeLoc final + : public ConcreteTypeLoc { +public: + void initializeLocal(ASTContext &Context, SourceLocation loc) {} +}; + } // namespace clang #endif // LLVM_CLANG_AST_TYPELOC_H diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 3b55d52a180ca..d859f4da96466 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -7455,7 +7455,7 @@ void TypeLocReader::VisitDependentBitIntTypeLoc( } void TypeLocReader::VisitPredefinedSugarTypeLoc(PredefinedSugarTypeLoc TL) { - TL.setNameLoc(readSourceLocation()); + // Nothing to do. } void ASTRecordReader::readTypeLoc(TypeLoc TL) { diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index e325f8d6afce6..1674e4028c8c6 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -704,7 +704,7 @@ void TypeLocWriter::VisitDependentBitIntTypeLoc( void TypeLocWriter::VisitPredefinedSugarTypeLoc( clang::PredefinedSugarTypeLoc TL) { - addSourceLocation(TL.getNameLoc()); + // Nothing to do. } void ASTWriter::WriteTypeAbbrevs() { From f3404263fb222766d6a119537d37ae6746c04672 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Tue, 1 Jul 2025 08:13:08 +0800 Subject: [PATCH 39/52] Fix infinite recursion --- clang/include/clang/AST/TypeLoc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index ee40023338f36..be0bc896de3ea 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -2790,6 +2790,7 @@ class PredefinedSugarTypeLoc final PredefinedSugarType, PredefinedSugarTypeLocInfo> { public: void initializeLocal(ASTContext &Context, SourceLocation loc) {} + SourceRange getLocalSourceRange() const { return {}; } }; } // namespace clang From b30617bcaf93178b304e12734897a0d373850759 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Fri, 4 Jul 2025 18:26:55 +0800 Subject: [PATCH 40/52] Try fix the failed tests on Windows --- .../lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index fa6e8e4146804..7b49731f02791 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -1250,7 +1250,7 @@ SVal MallocChecker::evalMulForBufferSize(CheckerContext &C, const Expr *Blocks, SVal BlockBytesVal = C.getSVal(BlockBytes); ProgramStateRef State = C.getState(); SVal TotalSize = SB.evalBinOp(State, BO_Mul, BlocksVal, BlockBytesVal, - SB.getContext().getSizeType()); + SB.getContext().getCanonicalSizeType()); return TotalSize; } @@ -1284,7 +1284,7 @@ static bool isStandardRealloc(const CallEvent &Call) { return FD->getDeclaredReturnType().getDesugaredType(AC) == AC.VoidPtrTy && FD->getParamDecl(0)->getType().getDesugaredType(AC) == AC.VoidPtrTy && FD->getParamDecl(1)->getType().getDesugaredType(AC) == - AC.getSizeType(); + AC.getCanonicalSizeType(); } static bool isGRealloc(const CallEvent &Call) { @@ -1908,7 +1908,7 @@ void MallocChecker::checkTaintedness(CheckerContext &C, const CallEvent &Call, return; SValBuilder &SVB = C.getSValBuilder(); - QualType SizeTy = SVB.getContext().getSizeType(); + QualType SizeTy = SVB.getContext().getCanonicalSizeType(); QualType CmpTy = SVB.getConditionType(); // In case the symbol is tainted, we give a warning if the // size is larger than SIZE_MAX/4 @@ -2884,10 +2884,10 @@ MallocChecker::ReallocMemAux(CheckerContext &C, const CallEvent &Call, return nullptr; // Compare the size argument to 0. - DefinedOrUnknownSVal SizeZero = - svalBuilder.evalEQ(State, TotalSize.castAs(), - svalBuilder.makeIntValWithWidth( - svalBuilder.getContext().getSizeType(), 0)); + DefinedOrUnknownSVal SizeZero = svalBuilder.evalEQ( + State, TotalSize.castAs(), + svalBuilder.makeIntValWithWidth( + svalBuilder.getContext().getCanonicalSizeType(), 0)); ProgramStateRef StatePtrIsNull, StatePtrNotNull; std::tie(StatePtrIsNull, StatePtrNotNull) = State->assume(PtrEQ); From 71fe854e4c6395cad5fe2043e7055ab8b5122c1a Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 5 Jul 2025 07:20:33 +0800 Subject: [PATCH 41/52] Rename Max to NumElements --- clang/include/clang/AST/ASTContext.h | 4 ++-- clang/include/clang/AST/Type.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 76f20218775d6..fb114a29cbee9 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -278,8 +278,8 @@ class ASTContext : public RefCountedBase { ArrayParameterTypes; /// Store the unique Type corresponding to each Kind. - mutable std::array + mutable std::array PredefinedSugarTypes{}; /// The set of nested name specifiers. diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index be6a15560f496..f13667d53c3d4 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -2269,7 +2269,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { PtrdiffT, // Indicates how many items the enum has. - Max + NumElements }; class PresefinedSugarTypeBitfields { From e64becc1d16e784eb3894013fa38afe099c34337 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 5 Jul 2025 08:43:50 +0800 Subject: [PATCH 42/52] Rename Max to NumElements --- clang/lib/AST/ASTContext.cpp | 4 ++-- clang/lib/AST/FormatString.cpp | 2 +- clang/lib/AST/Type.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 175b586eafc89..96c049f3662c9 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5224,7 +5224,7 @@ QualType ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { using Kind = PredefinedSugarType::Kind; - assert(KD != Kind::Max); + assert(KD != Kind::NumElements); if (auto *Target = PredefinedSugarTypes[llvm::to_underlying(KD)]; Target != nullptr) @@ -5243,7 +5243,7 @@ ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { return Ctx.getFromTargetType(Ctx.Target->getSignedSizeType()); case Kind::PtrdiffT: return Ctx.getFromTargetType(Ctx.Target->getPtrDiffType(LangAS::Default)); - case Kind::Max:; + case Kind::NumElements:; } llvm_unreachable("unexpected kind"); }; diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index 7243e4b137979..723b3615c2d38 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -362,7 +362,7 @@ static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, case Kind::PtrdiffT: K = LengthModifier::AsPtrDiff; return true; - case Kind::Max: + case Kind::NumElements: llvm_unreachable("unexpected kind"); } } diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index f7ed30e2d202c..dea6ba4985b5f 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -5622,7 +5622,7 @@ StringRef PredefinedSugarType::getName(Kind KD) { return "__signed_size_t"; case Kind::PtrdiffT: return "__ptrdiff_t"; - case Kind::Max:; + case Kind::NumElements:; } llvm_unreachable("unexpected kind"); } From a713ca4906a21e1f0949c39b9b100cf619510694 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 5 Jul 2025 10:59:50 +0800 Subject: [PATCH 43/52] Fix the ambiguity with operator new/delete --- clang/lib/Sema/SemaExprCXX.cpp | 12 +++-- clang/test/AST/ast-dump-expr-json.cpp | 12 ++--- clang/test/AST/ast-dump-expr.cpp | 12 ++--- clang/test/AST/ast-dump-stmt-json.cpp | 50 +++++++++++-------- .../unavailable_aligned_allocation.cpp | 24 ++++----- 5 files changed, 60 insertions(+), 50 deletions(-) diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 7b33d2ef003dc..0ffc7c5765049 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3397,8 +3397,7 @@ void Sema::DeclareGlobalNewDelete() { GlobalNewDeleteDeclared = true; QualType VoidPtr = Context.getPointerType(Context.VoidTy); - // FIXME: Why is 'Canonical'SizeType needed here? - QualType SizeT = Context.getCanonicalSizeType(); + QualType SizeT = Context.getSizeType(); auto DeclareGlobalAllocationFunctions = [&](OverloadedOperatorKind Kind, QualType Return, QualType Param) { @@ -3455,9 +3454,12 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, if (Func->getNumParams() == Params.size()) { llvm::SmallVector FuncParams; for (auto *P : Func->parameters()) - FuncParams.push_back( - Context.getCanonicalType(P->getType().getUnqualifiedType())); - if (llvm::ArrayRef(FuncParams) == Params) { + FuncParams.push_back(P->getType().getUnqualifiedType()); + if (std::equal(FuncParams.begin(), FuncParams.end(), Params.begin(), + Params.end(), [&](auto <, auto &RT) { + return Context.getCanonicalType(LT) == + Context.getCanonicalType(RT); + })) { // Make the function visible to name lookup, even if we found it in // an unimported module. It either is an implicitly-declared global // allocation function, or is suppressing that function. diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp index 79a3cb4e3cfb3..11026c9d302f0 100644 --- a/clang/test/AST/ast-dump-expr-json.cpp +++ b/clang/test/AST/ast-dump-expr-json.cpp @@ -1728,7 +1728,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: }, @@ -1757,7 +1757,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: }, @@ -1787,7 +1787,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1862,7 +1862,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1940,7 +1940,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -2337,7 +2337,7 @@ void TestNonADLCall3() { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ diff --git a/clang/test/AST/ast-dump-expr.cpp b/clang/test/AST/ast-dump-expr.cpp index 610b5631fe7a0..6fd429d1500a4 100644 --- a/clang/test/AST/ast-dump-expr.cpp +++ b/clang/test/AST/ast-dump-expr.cpp @@ -126,23 +126,23 @@ void UnaryExpressions(int *p) { // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' ::new int; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' global Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' global Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' new (int); - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' new int{12}; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' Function 0x{{[^ ]*}} 'operator new' 'void *(__size_t)' // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} 'int' // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 12 new int[2]; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(__size_t)' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 2 new int[2]{1, 2}; - // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(unsigned long)' + // CHECK: CXXNewExpr 0x{{[^ ]*}} 'int *' array Function 0x{{[^ ]*}} 'operator new[]' 'void *(__size_t)' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} 'int' 2 // CHECK-NEXT: InitListExpr 0x{{[^ ]*}} 'int[2]' @@ -164,7 +164,7 @@ void UnaryExpressions(int *p) { // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' ::delete p; - // CHECK: CXXDeleteExpr 0x{{[^ ]*}} 'void' global Function 0x{{[^ ]*}} 'operator delete' 'void (void *, unsigned long) noexcept' + // CHECK: CXXDeleteExpr 0x{{[^ ]*}} 'void' global Function 0x{{[^ ]*}} 'operator delete' 'void (void *, __size_t) noexcept' // CHECK-NEXT: ImplicitCastExpr // CHECK-NEXT: DeclRefExpr 0x{{[^ ]*}} 'int *' lvalue ParmVar 0x{{[^ ]*}} 'p' 'int *' diff --git a/clang/test/AST/ast-dump-stmt-json.cpp b/clang/test/AST/ast-dump-stmt-json.cpp index c327e553a2ab1..a8f113ce6a3d4 100644 --- a/clang/test/AST/ast-dump-stmt-json.cpp +++ b/clang/test/AST/ast-dump-stmt-json.cpp @@ -963,7 +963,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } @@ -994,7 +994,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1126,7 +1126,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1338,7 +1338,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } @@ -1370,7 +1370,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "kind": "FunctionDecl", // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ @@ -1445,7 +1445,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "mangledName": "_Znwm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1458,7 +1458,8 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1504,7 +1505,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new", // CHECK-NEXT: "mangledName": "_ZnwmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long, std::align_val_t)" +// CHECK-NEXT: "qualType": "void *(__size_t, std::align_val_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1517,7 +1518,8 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1586,7 +1588,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "mangledName": "_Znam", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long)" +// CHECK-NEXT: "qualType": "void *(__size_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1599,7 +1601,8 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1645,7 +1648,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator new[]", // CHECK-NEXT: "mangledName": "_ZnamSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void *(unsigned long, std::align_val_t)" +// CHECK-NEXT: "qualType": "void *(__size_t, std::align_val_t)" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1658,7 +1661,8 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1822,7 +1826,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "mangledName": "_ZdlPvm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1848,7 +1852,8 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -1875,7 +1880,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete", // CHECK-NEXT: "mangledName": "_ZdlPvmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long, std::align_val_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t, std::align_val_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -1901,7 +1906,8 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -2037,7 +2043,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete[]", // CHECK-NEXT: "mangledName": "_ZdaPvm", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -2063,7 +2069,8 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { @@ -2090,7 +2097,7 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: "name": "operator delete[]", // CHECK-NEXT: "mangledName": "_ZdaPvmSt11align_val_t", // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "void (void *, unsigned long, std::align_val_t) noexcept" +// CHECK-NEXT: "qualType": "void (void *, __size_t, std::align_val_t) noexcept" // CHECK-NEXT: }, // CHECK-NEXT: "inner": [ // CHECK-NEXT: { @@ -2116,7 +2123,8 @@ void TestDependentGenericSelectionExpr(Ty T) { // CHECK-NEXT: }, // CHECK-NEXT: "isImplicit": true, // CHECK-NEXT: "type": { -// CHECK-NEXT: "qualType": "unsigned long" +// CHECK-NEXT: "desugaredQualType": "unsigned long", +// CHECK-NEXT: "qualType": "__size_t" // CHECK-NEXT: } // CHECK-NEXT: }, // CHECK-NEXT: { diff --git a/clang/test/SemaCXX/unavailable_aligned_allocation.cpp b/clang/test/SemaCXX/unavailable_aligned_allocation.cpp index 45fdec606ad1b..56c564f170271 100644 --- a/clang/test/SemaCXX/unavailable_aligned_allocation.cpp +++ b/clang/test/SemaCXX/unavailable_aligned_allocation.cpp @@ -65,12 +65,12 @@ void testOveraligned() { #ifdef NO_ERRORS // expected-no-diagnostics #else -// expected-error-re@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-16 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-17 {{if you supply your own aligned allocation functions}} // expected-error-re@-18 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-19 {{if you supply your own aligned allocation functions}} -// expected-error-re@-20 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-20 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-21 {{if you supply your own aligned allocation functions}} // expected-error-re@-22 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-23 {{if you supply your own aligned allocation functions}} @@ -83,12 +83,12 @@ void testOveraligned() { // expected-error-re@-28 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' is {{only|not}} available on}} // expected-note@-29 {{if you supply your own aligned allocation functions}} -// expected-error-re@-29 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-29 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-30 {{if you supply your own aligned allocation functions}} // expected-error-re@-31 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-32 {{if you supply your own aligned allocation functions}} -// expected-error-re@-33 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-33 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-34 {{if you supply your own aligned allocation functions}} // expected-error-re@-35 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-36 {{if you supply your own aligned allocation functions}} @@ -111,19 +111,19 @@ void testOveralignedCheckOS() { // expected-no-diagnostics #else #if defined(IOS) -// expected-error@-7 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on iOS 11 or newer}} +// expected-error@-7 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on iOS 11 or newer}} // expected-error@-8 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on iOS 11 or newer}}} #elif defined(TVOS) -// expected-error@-10 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on tvOS 11 or newer}}} +// expected-error@-10 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on tvOS 11 or newer}}} // expected-error@-11 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on tvOS 11 or newer}}} #elif defined(WATCHOS) -// expected-error@-13 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on watchOS 4 or newer}}} +// expected-error@-13 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on watchOS 4 or newer}}} // expected-error@-14 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}} #elif defined(MACOS) -// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.13 or newer}}} +// expected-error@-16 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is only available on macOS 10.13 or newer}}} // expected-error@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}} #elif defined(ZOS) -// expected-error@-19 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is not available on z/OS}}} +// expected-error@-19 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is not available on z/OS}}} // expected-error@-20 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is not available on z/OS}}} #endif @@ -181,19 +181,19 @@ void testExplicitOperatorNewDeleteOveraligned() { #ifdef NO_ERRORS // expected-no-diagnostics #else -// expected-error-re@-11 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-11 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-12 {{if you supply your own aligned allocation functions}} // expected-error-re@-13 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-14 {{if you supply your own aligned allocation functions}} -// expected-error-re@-15 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-15 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-16 {{if you supply your own aligned allocation functions}} // expected-error-re@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} // expected-note@-18 {{if you supply your own aligned allocation functions}} -// expected-error-re@-19 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is {{only|not}} available on}} +// expected-error-re@-19 {{aligned allocation function of type 'void *(__size_t, enum std::align_val_t)' is {{only|not}} available on}} // expected-note@-20 {{if you supply your own aligned allocation functions}} // expected-error-re@-21 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is {{only|not}} available on}} From 2b6ab4e99d4b59d24b964f5dce6c45e2655e7f20 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 5 Jul 2025 11:32:16 +0800 Subject: [PATCH 44/52] Pass QualType by value --- clang/lib/Sema/SemaExprCXX.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 0ffc7c5765049..05624e583a4b8 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3456,7 +3456,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, for (auto *P : Func->parameters()) FuncParams.push_back(P->getType().getUnqualifiedType()); if (std::equal(FuncParams.begin(), FuncParams.end(), Params.begin(), - Params.end(), [&](auto <, auto &RT) { + Params.end(), [&](QualType LT, QualType RT) { return Context.getCanonicalType(LT) == Context.getCanonicalType(RT); })) { From ad13fc02e9c39bb72ab484c0fb106a50feb05331 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 5 Jul 2025 11:36:33 +0800 Subject: [PATCH 45/52] Use hasSameType instead of comparing the canonical forms --- clang/lib/Sema/SemaExprCXX.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 05624e583a4b8..fb5d1287c98ec 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3457,8 +3457,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, FuncParams.push_back(P->getType().getUnqualifiedType()); if (std::equal(FuncParams.begin(), FuncParams.end(), Params.begin(), Params.end(), [&](QualType LT, QualType RT) { - return Context.getCanonicalType(LT) == - Context.getCanonicalType(RT); + return Context.hasSameType(LT, RT); })) { // Make the function visible to name lookup, even if we found it in // an unimported module. It either is an implicitly-declared global From 2906b8826b843512ac99913a8e5f4b61c18bf486 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sat, 5 Jul 2025 15:31:55 +0800 Subject: [PATCH 46/52] Update FindTargetTests.cpp --- clang-tools-extra/clangd/unittests/FindTargetTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp index 602f61d9ecb41..4d77f9d690ca0 100644 --- a/clang-tools-extra/clangd/unittests/FindTargetTests.cpp +++ b/clang-tools-extra/clangd/unittests/FindTargetTests.cpp @@ -838,7 +838,7 @@ TEST_F(TargetDeclTest, OverloadExpr) { )cpp"; // Sized deallocation is enabled by default in C++14 onwards. EXPECT_DECLS("CXXDeleteExpr", - "void operator delete(void *, unsigned long) noexcept"); + "void operator delete(void *, __size_t) noexcept"); } TEST_F(TargetDeclTest, DependentExprs) { From 76826b0cf78676410617d9b426b7bf5d10707463 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 6 Jul 2025 07:00:30 +0800 Subject: [PATCH 47/52] Add relevant logic to lldb to eliminate warnings and try to fix failed tests --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index 82e07bb8e0ffb..b0b022edc74ea 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -2566,6 +2566,7 @@ RemoveWrappingTypes(QualType type, ArrayRef mask = {}) { case clang::Type::TypeOf: case clang::Type::TypeOfExpr: case clang::Type::Using: + case clang::Type::PredefinedSugar: type = type->getLocallyUnqualifiedSingleStepDesugaredType(); break; default: @@ -4141,6 +4142,7 @@ TypeSystemClang::GetTypeClass(lldb::opaque_compiler_type_t type) { case clang::Type::TypeOf: case clang::Type::TypeOfExpr: case clang::Type::Using: + case clang::Type::PredefinedSugar: llvm_unreachable("Handled in RemoveWrappingTypes!"); case clang::Type::UnaryTransform: break; @@ -4851,6 +4853,7 @@ lldb::Encoding TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type, case clang::Type::TypeOf: case clang::Type::TypeOfExpr: case clang::Type::Using: + case clang::Type::PredefinedSugar: llvm_unreachable("Handled in RemoveWrappingTypes!"); case clang::Type::UnaryTransform: @@ -5152,6 +5155,7 @@ lldb::Format TypeSystemClang::GetFormat(lldb::opaque_compiler_type_t type) { case clang::Type::TypeOf: case clang::Type::TypeOfExpr: case clang::Type::Using: + case clang::Type::PredefinedSugar: llvm_unreachable("Handled in RemoveWrappingTypes!"); case clang::Type::UnaryTransform: break; From c0a939b5c7bfd083c23b7bf54de53b04081382f8 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Sun, 6 Jul 2025 08:25:21 +0800 Subject: [PATCH 48/52] Simplify the check for whether the allocation function has been declared --- clang/lib/Sema/SemaExprCXX.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index fb5d1287c98ec..10c8540cd2faf 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3452,12 +3452,10 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, // non-templated allocation function we are trying to declare here. if (FunctionDecl *Func = dyn_cast(*Alloc)) { if (Func->getNumParams() == Params.size()) { - llvm::SmallVector FuncParams; - for (auto *P : Func->parameters()) - FuncParams.push_back(P->getType().getUnqualifiedType()); - if (std::equal(FuncParams.begin(), FuncParams.end(), Params.begin(), - Params.end(), [&](QualType LT, QualType RT) { - return Context.hasSameType(LT, RT); + if (std::equal(Func->param_begin(), Func->param_end(), Params.begin(), + Params.end(), [&](ParmVarDecl *D, QualType RT) { + return Context.hasSameUnqualifiedType(D->getType(), + RT); })) { // Make the function visible to name lookup, even if we found it in // an unimported module. It either is an implicitly-declared global From 7a0d64a295fbb8751c3b4b22810bc3a41b8c04d0 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Tue, 8 Jul 2025 00:16:17 +0800 Subject: [PATCH 49/52] Improved based on reviews --- clang/include/clang/AST/ASTContext.h | 4 ++-- clang/include/clang/AST/Type.h | 2 +- clang/lib/AST/ASTContext.cpp | 4 ---- clang/lib/AST/FormatString.cpp | 16 +++++----------- clang/lib/AST/Type.cpp | 1 - clang/lib/CodeGen/CodeGenFunction.cpp | 3 +-- clang/lib/Serialization/ASTWriter.cpp | 1 - 7 files changed, 9 insertions(+), 22 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index fb114a29cbee9..6bcdd0f1cb388 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -278,8 +278,8 @@ class ASTContext : public RefCountedBase { ArrayParameterTypes; /// Store the unique Type corresponding to each Kind. - mutable std::array + mutable std::array PredefinedSugarTypes{}; /// The set of nested name specifiers. diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index f13667d53c3d4..57b0ea4111438 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -2269,7 +2269,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { PtrdiffT, // Indicates how many items the enum has. - NumElements + Last = PtrdiffT }; class PresefinedSugarTypeBitfields { diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 96c049f3662c9..78134231e89af 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -2595,7 +2595,6 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { Align = static_cast(Width); } } - break; case Type::PredefinedSugar: @@ -5224,8 +5223,6 @@ QualType ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { using Kind = PredefinedSugarType::Kind; - assert(KD != Kind::NumElements); - if (auto *Target = PredefinedSugarTypes[llvm::to_underlying(KD)]; Target != nullptr) return QualType(Target, 0); @@ -5243,7 +5240,6 @@ ASTContext::getPredefinedSugarType(PredefinedSugarType::Kind KD) const { return Ctx.getFromTargetType(Ctx.Target->getSignedSizeType()); case Kind::PtrdiffT: return Ctx.getFromTargetType(Ctx.Target->getPtrDiffType(LangAS::Default)); - case Kind::NumElements:; } llvm_unreachable("unexpected kind"); }; diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index 723b3615c2d38..0bb737fa6a8af 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -322,17 +322,12 @@ bool clang::analyze_format_string::ParseUTF8InvalidSpecifier( static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, LengthModifier::Kind &K) { - for (/**/; const auto *TT = QT->getAs(); - QT = TT->getDecl()->getUnderlyingType()) { + if (!Ctx.getLangOpts().C99 && !Ctx.getLangOpts().CPlusPlus) + return false; + for (/**/; const auto *TT = QT->getAs(); QT = TT->desugar()) { const auto *TD = TT->getDecl(); const auto *DC = TT->getDecl()->getDeclContext(); - bool RC = false; - if (Ctx.getLangOpts().C99) { - RC = DC->isTranslationUnit(); - } else if (Ctx.getLangOpts().CPlusPlus) { - RC = DC->isTranslationUnit() || DC->isStdNamespace(); - } - if (RC) { + if (DC->isTranslationUnit() || DC->isStdNamespace()) { StringRef Name = TD->getIdentifier()->getName(); if (Name == "size_t") { K = LengthModifier::AsSizeT; @@ -362,9 +357,8 @@ static bool namedTypeToLengthModifierKind(ASTContext &Ctx, QualType QT, case Kind::PtrdiffT: K = LengthModifier::AsPtrDiff; return true; - case Kind::NumElements: - llvm_unreachable("unexpected kind"); } + llvm_unreachable("unexpected kind"); } return false; } diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index dea6ba4985b5f..7444a2f90c5dd 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -5622,7 +5622,6 @@ StringRef PredefinedSugarType::getName(Kind KD) { return "__signed_size_t"; case Kind::PtrdiffT: return "__ptrdiff_t"; - case Kind::NumElements:; } llvm_unreachable("unexpected kind"); } diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 1e124af2ee192..3f2526d300698 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -721,8 +721,7 @@ static bool matchesStlAllocatorFn(const Decl *D, const ASTContext &Ctx) { (MD->getNumParams() != 1 && MD->getNumParams() != 2)) return false; - if (MD->parameters()[0]->getType().getCanonicalType() != - Ctx.getCanonicalSizeType()) + if (!Ctx.hasSameType(MD->parameters()[0]->getType(), Ctx.getSizeType())) return false; if (MD->getNumParams() == 2) { diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 7243cbe4545df..398c4f47443c9 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -692,7 +692,6 @@ void TypeLocWriter::VisitAtomicTypeLoc(AtomicTypeLoc TL) { void TypeLocWriter::VisitPipeTypeLoc(PipeTypeLoc TL) { addSourceLocation(TL.getKWLoc()); } - void TypeLocWriter::VisitBitIntTypeLoc(clang::BitIntTypeLoc TL) { addSourceLocation(TL.getNameLoc()); } From 18f967e8768a008fbedc53bdaca22e059ab0d138 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Tue, 8 Jul 2025 00:21:56 +0800 Subject: [PATCH 50/52] Remove the blank line --- clang/lib/Serialization/ASTWriter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 398c4f47443c9..ff438bcd017e6 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -695,7 +695,6 @@ void TypeLocWriter::VisitPipeTypeLoc(PipeTypeLoc TL) { void TypeLocWriter::VisitBitIntTypeLoc(clang::BitIntTypeLoc TL) { addSourceLocation(TL.getNameLoc()); } - void TypeLocWriter::VisitDependentBitIntTypeLoc( clang::DependentBitIntTypeLoc TL) { addSourceLocation(TL.getNameLoc()); From 18523f1a92f776f0e2e74e527d4aea8a0b8338fe Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Tue, 8 Jul 2025 18:17:27 +0800 Subject: [PATCH 51/52] Update ReleaseNotes.rst --- clang/docs/ReleaseNotes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 73a80b6272d84..0ad8a0fdc4651 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -46,6 +46,7 @@ Potentially Breaking Changes ``endbr64`` instruction at the labels named as possible branch destinations, so it is not safe to use a register-controlled branch instruction to branch to one. (In line with gcc.) +- Added a sugar type `PredefinedSugarType` to improve diagnostic messages. (#GH143653) C/C++ Language Potentially Breaking Changes ------------------------------------------- From 60a2794a9e43b72a14c900150f3971e42d4742d3 Mon Sep 17 00:00:00 2001 From: YexuanXiao Date: Tue, 8 Jul 2025 21:29:48 +0800 Subject: [PATCH 52/52] Reduce more calls to getCanonicalSizeType --- clang/lib/CodeGen/CGCoroutine.cpp | 8 ++++---- clang/lib/Sema/SemaChecking.cpp | 6 ++++-- .../StaticAnalyzer/Checkers/MallocChecker.cpp | 17 +++++++---------- .../SemaCXX/microsoft-varargs-diagnostics.cpp | 6 +++--- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/clang/lib/CodeGen/CGCoroutine.cpp b/clang/lib/CodeGen/CGCoroutine.cpp index fa89e648082ab..e099fad31461c 100644 --- a/clang/lib/CodeGen/CGCoroutine.cpp +++ b/clang/lib/CodeGen/CGCoroutine.cpp @@ -1002,15 +1002,15 @@ RValue CodeGenFunction::EmitCoroutineIntrinsic(const CallExpr *E, } case llvm::Intrinsic::coro_size: { auto &Context = getContext(); - CanQualType SizeTy = Context.getCanonicalSizeType(); - llvm::IntegerType *T = Builder.getIntNTy(Context.getTypeSize(SizeTy)); + llvm::IntegerType *T = + Builder.getIntNTy(Context.getTypeSize(Context.getSizeType())); llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::coro_size, T); return RValue::get(Builder.CreateCall(F)); } case llvm::Intrinsic::coro_align: { auto &Context = getContext(); - CanQualType SizeTy = Context.getCanonicalSizeType(); - llvm::IntegerType *T = Builder.getIntNTy(Context.getTypeSize(SizeTy)); + llvm::IntegerType *T = + Builder.getIntNTy(Context.getTypeSize(Context.getSizeType())); llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::coro_align, T); return RValue::get(Builder.CreateCall(F)); } diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 95097793afb23..5e523fe887318 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -5238,8 +5238,10 @@ bool Sema::BuiltinVAStartARMMicrosoft(CallExpr *Call) { << 3 /* parameter mismatch */ << 2 << Arg1->getType() << ConstCharPtrTy; - const QualType SizeTy = Context.getCanonicalSizeType(); - if (Arg2Ty->getCanonicalTypeInternal().withoutLocalFastQualifiers() != SizeTy) + const QualType SizeTy = Context.getSizeType(); + if (!Context.hasSameType( + Arg2Ty->getCanonicalTypeInternal().withoutLocalFastQualifiers(), + SizeTy)) Diag(Arg2->getBeginLoc(), diag::err_typecheck_convert_incompatible) << Arg2->getType() << SizeTy << 1 /* different class */ << 0 /* qualifier difference */ diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 51cedfa05fc10..289926e68029c 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -1280,11 +1280,9 @@ static bool isStandardRealloc(const CallEvent &Call) { const FunctionDecl *FD = dyn_cast(Call.getDecl()); assert(FD); ASTContext &AC = FD->getASTContext(); - - return FD->getDeclaredReturnType().getDesugaredType(AC) == AC.VoidPtrTy && - FD->getParamDecl(0)->getType().getDesugaredType(AC) == AC.VoidPtrTy && - FD->getParamDecl(1)->getType().getDesugaredType(AC) == - AC.getCanonicalSizeType(); + return AC.hasSameType(FD->getDeclaredReturnType(), AC.VoidPtrTy) && + AC.hasSameType(FD->getParamDecl(0)->getType(), AC.VoidPtrTy) && + AC.hasSameType(FD->getParamDecl(1)->getType(), AC.getSizeType()); } static bool isGRealloc(const CallEvent &Call) { @@ -1292,10 +1290,9 @@ static bool isGRealloc(const CallEvent &Call) { assert(FD); ASTContext &AC = FD->getASTContext(); - return FD->getDeclaredReturnType().getDesugaredType(AC) == AC.VoidPtrTy && - FD->getParamDecl(0)->getType().getDesugaredType(AC) == AC.VoidPtrTy && - FD->getParamDecl(1)->getType().getDesugaredType(AC) == - AC.UnsignedLongTy; + return AC.hasSameType(FD->getDeclaredReturnType(), AC.VoidPtrTy) && + AC.hasSameType(FD->getParamDecl(0)->getType(), AC.VoidPtrTy) && + AC.hasSameType(FD->getParamDecl(1)->getType(), AC.UnsignedLongTy); } void MallocChecker::checkRealloc(ProgramStateRef State, const CallEvent &Call, @@ -1906,7 +1903,7 @@ void MallocChecker::checkTaintedness(CheckerContext &C, const CallEvent &Call, return; SValBuilder &SVB = C.getSValBuilder(); - QualType SizeTy = SVB.getContext().getCanonicalSizeType(); + QualType SizeTy = SVB.getContext().getSizeType(); QualType CmpTy = SVB.getConditionType(); // In case the symbol is tainted, we give a warning if the // size is larger than SIZE_MAX/4 diff --git a/clang/test/SemaCXX/microsoft-varargs-diagnostics.cpp b/clang/test/SemaCXX/microsoft-varargs-diagnostics.cpp index 0b76fdd92dabd..91c4ffda9d818 100644 --- a/clang/test/SemaCXX/microsoft-varargs-diagnostics.cpp +++ b/clang/test/SemaCXX/microsoft-varargs-diagnostics.cpp @@ -22,7 +22,7 @@ void test_non_last_argument(int i, int j, ...) { va_list ap; __va_start(&ap, &i, 4); // expected-error@-1{{passing 'int *' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int *' vs 'const char *')}} - // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}} + // expected-error@-2{{passing 'int' to parameter of incompatible type '__size_t' (aka 'unsigned int'): type mismatch at 3rd parameter ('int' vs '__size_t' (aka 'unsigned int'))}} } void test_stack_allocated(int i, ...) { @@ -30,13 +30,13 @@ void test_stack_allocated(int i, ...) { int j; __va_start(&ap, &j, 4); // expected-error@-1{{passing 'int *' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int *' vs 'const char *')}} - // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}} + // expected-error@-2{{passing 'int' to parameter of incompatible type '__size_t' (aka 'unsigned int'): type mismatch at 3rd parameter ('int' vs '__size_t' (aka 'unsigned int'))}} } void test_non_pointer_addressof(int i, ...) { va_list ap; __va_start(&ap, 1, 4); // expected-error@-1{{passing 'int' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int' vs 'const char *')}} - // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}} + // expected-error@-2{{passing 'int' to parameter of incompatible type '__size_t' (aka 'unsigned int'): type mismatch at 3rd parameter ('int' vs '__size_t' (aka 'unsigned int'))}} }