diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 83e9bbdf0fe9..5506f01ebc60 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1332,9 +1332,9 @@ class ASTContext : public RefCountedBase { return CanQualType::CreateUnsafe(getComplexType((QualType) T)); } - QualType getHyperobjectType(QualType T, Expr *R, Expr *I) const; - CanQualType getHyperobjectType(CanQualType T, Expr *R, Expr *I) const { - return CanQualType::CreateUnsafe(getHyperobjectType((QualType) T, R, I)); + QualType getHyperobjectType(QualType T, Expr *I, Expr *R) const; + CanQualType getHyperobjectType(CanQualType T, Expr *I, Expr *R) const { + return CanQualType::CreateUnsafe(getHyperobjectType((QualType) T, I, R)); } /// Return the uniqued reference to the type for a pointer to diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td index ff37c36ca577..3e104698130b 100644 --- a/clang/include/clang/AST/TypeProperties.td +++ b/clang/include/clang/AST/TypeProperties.td @@ -21,15 +21,15 @@ let Class = HyperobjectType in { def : Property<"elementType", QualType> { let Read = [{ node->getElementType() }]; } - def : Property<"reduce", ExprRef> { - let Read = [{ node->getReduce() }]; - } def : Property<"identity", ExprRef> { let Read = [{ node->getIdentity() }]; } + def : Property<"reduce", ExprRef> { + let Read = [{ node->getReduce() }]; + } def : Creator<[{ - return ctx.getHyperobjectType(elementType, reduce, identity); + return ctx.getHyperobjectType(elementType, identity, reduce); }]>; } diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index ec399ced7643..2ff892365c3c 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -1161,7 +1161,7 @@ ExpectedType ASTNodeImporter::VisitHyperobjectType(const HyperobjectType *T) { return ToReduceOrErr.takeError(); return Importer.getToContext().getHyperobjectType( - *ToElementTypeOrErr, *ToReduceOrErr, *ToIdentityOrErr); + *ToElementTypeOrErr, *ToIdentityOrErr, *ToReduceOrErr); } ExpectedType ASTNodeImporter::VisitComplexType(const ComplexType *T) { diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp index 039329dfb983..b69ea17e2269 100644 --- a/clang/lib/AST/ASTStructuralEquivalence.cpp +++ b/clang/lib/AST/ASTStructuralEquivalence.cpp @@ -844,7 +844,7 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, const HyperobjectType *H2 = cast(T2); Expr *R1 = H1->getReduce(), *R2 = H2->getReduce(); Expr *I1 = H1->getIdentity(), *I2 = H2->getIdentity(); - if (!!I2 != !!I2 || !!R1 != !!R2) + if (!!I1 != !!I2 || !!R1 != !!R2) return false; if (I1 && !IsStructurallyEquivalent(Context, I1, I2)) return false; diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 807bea2b5be6..117de409d76d 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -1272,8 +1272,8 @@ class TreeTransform { QualType RebuildDependentBitIntType(bool IsUnsigned, Expr *NumBitsExpr, SourceLocation Loc); - QualType RebuildHyperobjectType(QualType ElementType, Expr *R, - Expr *I, SourceLocation Loc); + QualType RebuildHyperobjectType(QualType ElementType, Expr *I, + Expr *R, SourceLocation Loc); /// Build a new template name given a nested name specifier, a flag /// indicating whether the "template" keyword was provided, and the template