Lines Matching +full:ref2 +full:-

1 //===- ASTStructuralEquivalence.cpp ---------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
59 //===----------------------------------------------------------------------===//
136 Context, Name1.getCXXDeductionGuideTemplate()->getDeclName(), in IsStructurallyEquivalent()
137 Name2.getCXXDeductionGuideTemplate()->getDeclName())) in IsStructurallyEquivalent()
174 return IsStructurallyEquivalent(Context, E1->getLabel(), E2->getLabel()); in IsStmtEquivalent()
178 return E1->getOp() == E2->getOp(); in IsStmtEquivalent()
182 return E1->getOpcode() == E2->getOpcode(); in IsStmtEquivalent()
186 // FIXME: IsStructurallyEquivalent requires non-const Decls. in IsStmtEquivalent()
187 Decl *Callee1 = const_cast<Decl *>(E1->getCalleeDecl()); in IsStmtEquivalent()
188 Decl *Callee2 = const_cast<Decl *>(E2->getCalleeDecl()); in IsStmtEquivalent()
204 return E1->getValue() == E2->getValue() && E1->getKind() == E2->getKind(); in IsStmtEquivalent()
217 return E1->size() == E2->size(); in IsStmtEquivalent()
221 const ValueDecl *Decl1 = DRE1->getDecl(); in IsStmtEquivalent()
222 const ValueDecl *Decl2 = DRE2->getDecl(); in IsStmtEquivalent()
231 if (!IsStructurallyEquivalent(Context, DE1->getDeclName(), in IsStmtEquivalent()
232 DE2->getDeclName())) in IsStmtEquivalent()
234 return IsStructurallyEquivalent(Context, DE1->getQualifier(), in IsStmtEquivalent()
235 DE2->getQualifier()); in IsStmtEquivalent()
239 return IsStructurallyEquivalent(Context, E1->getType(), E2->getType()); in IsStmtEquivalent()
244 return E1->getTrait() == E2->getTrait() && E1->getValue() == E2->getValue(); in IsStmtEquivalent()
248 return E1->isExact() == E2->isExact() && E1->getValue() == E2->getValue(); in IsStmtEquivalent()
253 for (auto Pair : zip_longest(E1->getAssocTypeSourceInfos(), in IsStmtEquivalent()
254 E2->getAssocTypeSourceInfos())) { in IsStmtEquivalent()
261 if (!IsStructurallyEquivalent(Context, (*Child1)->getType(), in IsStmtEquivalent()
262 (*Child2)->getType())) in IsStmtEquivalent()
271 return IsStructurallyEquivalent(Context, CastE1->getType(), in IsStmtEquivalent()
272 CastE2->getType()); in IsStmtEquivalent()
276 return E1->getValue() == E2->getValue(); in IsStmtEquivalent()
280 return IsStructurallyEquivalent(Context, E1->getFoundDecl(), in IsStmtEquivalent()
281 E2->getFoundDecl()); in IsStmtEquivalent()
293 LabelDecl *L1 = S1->getLabel(); in IsStmtEquivalent()
294 LabelDecl *L2 = S2->getLabel(); in IsStmtEquivalent()
298 IdentifierInfo *Name1 = L1->getIdentifier(); in IsStmtEquivalent()
299 IdentifierInfo *Name2 = L2->getIdentifier(); in IsStmtEquivalent()
304 return E1->getIdentKind() == E2->getIdentKind(); in IsStmtEquivalent()
308 return E1->getTemplateDepth() == E2->getTemplateDepth(); in IsStmtEquivalent()
312 return E1->getBytes() == E2->getBytes(); in IsStmtEquivalent()
317 if (!IsStructurallyEquivalent(Context, E1->getAssociatedDecl(), in IsStmtEquivalent()
318 E2->getAssociatedDecl())) in IsStmtEquivalent()
320 if (E1->getIndex() != E2->getIndex()) in IsStmtEquivalent()
322 if (E1->getPackIndex() != E2->getPackIndex()) in IsStmtEquivalent()
329 return IsStructurallyEquivalent(Context, E1->getArgumentPack(), in IsStmtEquivalent()
330 E2->getArgumentPack()); in IsStmtEquivalent()
334 if (E1->getTrait() != E2->getTrait()) in IsStmtEquivalent()
337 for (auto Pair : zip_longest(E1->getArgs(), E2->getArgs())) { in IsStmtEquivalent()
344 if (!IsStructurallyEquivalent(Context, (*Child1)->getType(), in IsStmtEquivalent()
345 (*Child2)->getType())) in IsStmtEquivalent()
353 if (!IsStructurallyEquivalent(Context, E1->getMember(), E2->getMember())) { in IsStmtEquivalent()
356 return IsStructurallyEquivalent(Context, E1->getBaseType(), in IsStmtEquivalent()
357 E2->getBaseType()); in IsStmtEquivalent()
362 if (E1->getKind() != E2->getKind()) in IsStmtEquivalent()
364 return IsStructurallyEquivalent(Context, E1->getTypeOfArgument(), in IsStmtEquivalent()
365 E2->getTypeOfArgument()); in IsStmtEquivalent()
369 return E1->getOpcode() == E2->getOpcode(); in IsStmtEquivalent()
378 if (!IsStructurallyEquivalent(Context, E1->getName(), E2->getName())) in IsStmtEquivalent()
381 if (static_cast<bool>(E1->getQualifier()) != in IsStmtEquivalent()
382 static_cast<bool>(E2->getQualifier())) in IsStmtEquivalent()
384 if (E1->getQualifier() && in IsStmtEquivalent()
385 !IsStructurallyEquivalent(Context, E1->getQualifier(), in IsStmtEquivalent()
386 E2->getQualifier())) in IsStmtEquivalent()
389 if (E1->getNumTemplateArgs() != E2->getNumTemplateArgs()) in IsStmtEquivalent()
391 const TemplateArgumentLoc *Args1 = E1->getTemplateArgs(); in IsStmtEquivalent()
392 const TemplateArgumentLoc *Args2 = E2->getTemplateArgs(); in IsStmtEquivalent()
393 for (unsigned int ArgI = 0, ArgN = E1->getNumTemplateArgs(); ArgI < ArgN; in IsStmtEquivalent()
402 return E1->getValue() == E2->getValue(); in IsStmtEquivalent()
429 if (S1->getStmtClass() != S2->getStmtClass()) in IsEquivalent()
433 // the root class 'Stmt' (e.g. 'BinaryOperator' -> 'Expr' -> 'Stmt'). Cast in IsEquivalent()
437 switch (S1->getStmtClass()) { in IsEquivalent()
455 return UnaryOperator::getOverloadedOperator(E1->getOpcode()) == in IsStructurallyEquivalent()
456 E2->getOperator() && in IsStructurallyEquivalent()
457 IsStructurallyEquivalent(Context, E1->getSubExpr(), E2->getArg(0)); in IsStructurallyEquivalent()
463 return E1->getOperator() == in IsStructurallyEquivalent()
464 UnaryOperator::getOverloadedOperator(E2->getOpcode()) && in IsStructurallyEquivalent()
465 IsStructurallyEquivalent(Context, E1->getArg(0), E2->getSubExpr()); in IsStructurallyEquivalent()
471 return BinaryOperator::getOverloadedOperator(E1->getOpcode()) == in IsStructurallyEquivalent()
472 E2->getOperator() && in IsStructurallyEquivalent()
473 IsStructurallyEquivalent(Context, E1->getLHS(), E2->getArg(0)) && in IsStructurallyEquivalent()
474 IsStructurallyEquivalent(Context, E1->getRHS(), E2->getArg(1)); in IsStructurallyEquivalent()
480 return E1->getOperator() == in IsStructurallyEquivalent()
481 BinaryOperator::getOverloadedOperator(E2->getOpcode()) && in IsStructurallyEquivalent()
482 IsStructurallyEquivalent(Context, E1->getArg(0), E2->getLHS()) && in IsStructurallyEquivalent()
483 IsStructurallyEquivalent(Context, E1->getArg(1), E2->getRHS()); in IsStructurallyEquivalent()
494 // The more heavyweight node is only created if the definition-time name in IsStructurallyEquivalent()
519 for (auto Pair : zip_longest(S1->children(), S2->children())) { in IsStructurallyEquivalent()
538 return Name1->getName() == Name2->getName(); in IsStructurallyEquivalent()
541 /// Determine whether two nested-name-specifiers are equivalent.
545 if (NNS1->getKind() != NNS2->getKind()) in IsStructurallyEquivalent()
548 NestedNameSpecifier *Prefix1 = NNS1->getPrefix(), in IsStructurallyEquivalent()
549 *Prefix2 = NNS2->getPrefix(); in IsStructurallyEquivalent()
557 switch (NNS1->getKind()) { in IsStructurallyEquivalent()
559 return IsStructurallyEquivalent(NNS1->getAsIdentifier(), in IsStructurallyEquivalent()
560 NNS2->getAsIdentifier()); in IsStructurallyEquivalent()
562 return IsStructurallyEquivalent(Context, NNS1->getAsNamespace(), in IsStructurallyEquivalent()
563 NNS2->getAsNamespace()); in IsStructurallyEquivalent()
565 return IsStructurallyEquivalent(Context, NNS1->getAsNamespaceAlias(), in IsStructurallyEquivalent()
566 NNS2->getAsNamespaceAlias()); in IsStructurallyEquivalent()
569 return IsStructurallyEquivalent(Context, QualType(NNS1->getAsType(), 0), in IsStructurallyEquivalent()
570 QualType(NNS2->getAsType(), 0)); in IsStructurallyEquivalent()
574 return IsStructurallyEquivalent(Context, NNS1->getAsRecordDecl(), in IsStructurallyEquivalent()
575 NNS2->getAsRecordDecl()); in IsStructurallyEquivalent()
602 OverloadedTemplateStorage::iterator I1 = OS1->begin(), I2 = OS2->begin(), in IsStructurallyEquivalent()
603 E1 = OS1->end(), E2 = OS2->end(); in IsStructurallyEquivalent()
613 return TN1->getDeclName() == TN2->getDeclName(); in IsStructurallyEquivalent()
619 if (!IsStructurallyEquivalent(Context, DN1->getQualifier(), in IsStructurallyEquivalent()
620 DN2->getQualifier())) in IsStructurallyEquivalent()
622 if (DN1->isIdentifier() && DN2->isIdentifier()) in IsStructurallyEquivalent()
623 return IsStructurallyEquivalent(DN1->getIdentifier(), in IsStructurallyEquivalent()
624 DN2->getIdentifier()); in IsStructurallyEquivalent()
625 else if (DN1->isOverloadedOperator() && DN2->isOverloadedOperator()) in IsStructurallyEquivalent()
626 return DN1->getOperator() == DN2->getOperator(); in IsStructurallyEquivalent()
634 return IsStructurallyEquivalent(Context, P1->getArgumentPack(), in IsStructurallyEquivalent()
635 P2->getArgumentPack()) && in IsStructurallyEquivalent()
636 IsStructurallyEquivalent(Context, P1->getAssociatedDecl(), in IsStructurallyEquivalent()
637 P2->getAssociatedDecl()) && in IsStructurallyEquivalent()
638 P1->getIndex() == P2->getIndex(); in IsStructurallyEquivalent()
735 if (!IsStructurallyEquivalent(Context, Array1->getElementType(), in IsArrayStructurallyEquivalent()
736 Array2->getElementType())) in IsArrayStructurallyEquivalent()
738 if (Array1->getSizeModifier() != Array2->getSizeModifier()) in IsArrayStructurallyEquivalent()
740 if (Array1->getIndexTypeQualifiers() != Array2->getIndexTypeQualifiers()) in IsArrayStructurallyEquivalent()
777 auto Spec1 = Proto1->getExceptionSpecType(); in IsEquivalentExceptionSpec()
778 auto Spec2 = Proto2->getExceptionSpecType(); in IsEquivalentExceptionSpec()
786 if (Proto1->getNumExceptions() != Proto2->getNumExceptions()) in IsEquivalentExceptionSpec()
788 for (unsigned I = 0, N = Proto1->getNumExceptions(); I != N; ++I) { in IsEquivalentExceptionSpec()
789 if (!IsStructurallyEquivalent(Context, Proto1->getExceptionType(I), in IsEquivalentExceptionSpec()
790 Proto2->getExceptionType(I))) in IsEquivalentExceptionSpec()
794 if (!IsStructurallyEquivalent(Context, Proto1->getNoexceptExpr(), in IsEquivalentExceptionSpec()
795 Proto2->getNoexceptExpr())) in IsEquivalentExceptionSpec()
812 // We aren't being strict about token-to-token equivalence of types, in IsStructurallyEquivalent()
821 Type::TypeClass TC = T1->getTypeClass(); in IsStructurallyEquivalent()
823 if (T1->getTypeClass() != T2->getTypeClass()) { in IsStructurallyEquivalent()
826 if (T1->getTypeClass() == Type::FunctionProto && in IsStructurallyEquivalent()
827 T2->getTypeClass() == Type::FunctionNoProto) in IsStructurallyEquivalent()
829 else if (T1->getTypeClass() == Type::FunctionNoProto && in IsStructurallyEquivalent()
830 T2->getTypeClass() == Type::FunctionProto) in IsStructurallyEquivalent()
839 if (cast<BuiltinType>(T1)->getKind() != cast<BuiltinType>(T2)->getKind()) in IsStructurallyEquivalent()
845 cast<ComplexType>(T1)->getElementType(), in IsStructurallyEquivalent()
846 cast<ComplexType>(T2)->getElementType())) in IsStructurallyEquivalent()
854 cast<AdjustedType>(T1)->getOriginalType(), in IsStructurallyEquivalent()
855 cast<AdjustedType>(T2)->getOriginalType())) in IsStructurallyEquivalent()
861 cast<PointerType>(T1)->getPointeeType(), in IsStructurallyEquivalent()
862 cast<PointerType>(T2)->getPointeeType())) in IsStructurallyEquivalent()
868 cast<BlockPointerType>(T1)->getPointeeType(), in IsStructurallyEquivalent()
869 cast<BlockPointerType>(T2)->getPointeeType())) in IsStructurallyEquivalent()
876 const auto *Ref2 = cast<ReferenceType>(T2); in IsStructurallyEquivalent() local
877 if (Ref1->isSpelledAsLValue() != Ref2->isSpelledAsLValue()) in IsStructurallyEquivalent()
879 if (Ref1->isInnerRef() != Ref2->isInnerRef()) in IsStructurallyEquivalent()
881 if (!IsStructurallyEquivalent(Context, Ref1->getPointeeTypeAsWritten(), in IsStructurallyEquivalent()
882 Ref2->getPointeeTypeAsWritten())) in IsStructurallyEquivalent()
890 if (!IsStructurallyEquivalent(Context, MemPtr1->getPointeeType(), in IsStructurallyEquivalent()
891 MemPtr2->getPointeeType())) in IsStructurallyEquivalent()
893 if (!IsStructurallyEquivalent(Context, QualType(MemPtr1->getClass(), 0), in IsStructurallyEquivalent()
894 QualType(MemPtr2->getClass(), 0))) in IsStructurallyEquivalent()
902 if (!llvm::APInt::isSameValue(Array1->getSize(), Array2->getSize())) in IsStructurallyEquivalent()
919 if (!IsStructurallyEquivalent(Context, Array1->getSizeExpr(), in IsStructurallyEquivalent()
920 Array2->getSizeExpr())) in IsStructurallyEquivalent()
932 if (!IsStructurallyEquivalent(Context, Array1->getSizeExpr(), in IsStructurallyEquivalent()
933 Array2->getSizeExpr())) in IsStructurallyEquivalent()
945 if (!IsStructurallyEquivalent(Context, DepAddressSpace1->getAddrSpaceExpr(), in IsStructurallyEquivalent()
946 DepAddressSpace2->getAddrSpaceExpr())) in IsStructurallyEquivalent()
948 if (!IsStructurallyEquivalent(Context, DepAddressSpace1->getPointeeType(), in IsStructurallyEquivalent()
949 DepAddressSpace2->getPointeeType())) in IsStructurallyEquivalent()
958 if (!IsStructurallyEquivalent(Context, Vec1->getSizeExpr(), in IsStructurallyEquivalent()
959 Vec2->getSizeExpr())) in IsStructurallyEquivalent()
961 if (!IsStructurallyEquivalent(Context, Vec1->getElementType(), in IsStructurallyEquivalent()
962 Vec2->getElementType())) in IsStructurallyEquivalent()
970 if (Vec1->getVectorKind() != Vec2->getVectorKind()) in IsStructurallyEquivalent()
972 if (!IsStructurallyEquivalent(Context, Vec1->getSizeExpr(), in IsStructurallyEquivalent()
973 Vec2->getSizeExpr())) in IsStructurallyEquivalent()
975 if (!IsStructurallyEquivalent(Context, Vec1->getElementType(), in IsStructurallyEquivalent()
976 Vec2->getElementType())) in IsStructurallyEquivalent()
985 if (!IsStructurallyEquivalent(Context, Vec1->getElementType(), in IsStructurallyEquivalent()
986 Vec2->getElementType())) in IsStructurallyEquivalent()
988 if (Vec1->getNumElements() != Vec2->getNumElements()) in IsStructurallyEquivalent()
990 if (Vec1->getVectorKind() != Vec2->getVectorKind()) in IsStructurallyEquivalent()
1000 if (!IsStructurallyEquivalent(Context, Mat1->getRowExpr(), in IsStructurallyEquivalent()
1001 Mat2->getRowExpr()) || in IsStructurallyEquivalent()
1002 !IsStructurallyEquivalent(Context, Mat1->getColumnExpr(), in IsStructurallyEquivalent()
1003 Mat2->getColumnExpr()) || in IsStructurallyEquivalent()
1004 !IsStructurallyEquivalent(Context, Mat1->getElementType(), in IsStructurallyEquivalent()
1005 Mat2->getElementType())) in IsStructurallyEquivalent()
1015 if (!IsStructurallyEquivalent(Context, Mat1->getElementType(), in IsStructurallyEquivalent()
1016 Mat2->getElementType()) || in IsStructurallyEquivalent()
1017 Mat1->getNumRows() != Mat2->getNumRows() || in IsStructurallyEquivalent()
1018 Mat1->getNumColumns() != Mat2->getNumColumns()) in IsStructurallyEquivalent()
1027 if (Proto1->getNumParams() != Proto2->getNumParams()) in IsStructurallyEquivalent()
1029 for (unsigned I = 0, N = Proto1->getNumParams(); I != N; ++I) { in IsStructurallyEquivalent()
1030 if (!IsStructurallyEquivalent(Context, Proto1->getParamType(I), in IsStructurallyEquivalent()
1031 Proto2->getParamType(I))) in IsStructurallyEquivalent()
1034 if (Proto1->isVariadic() != Proto2->isVariadic()) in IsStructurallyEquivalent()
1037 if (Proto1->getMethodQuals() != Proto2->getMethodQuals()) in IsStructurallyEquivalent()
1055 if (!IsStructurallyEquivalent(Context, Function1->getReturnType(), in IsStructurallyEquivalent()
1056 Function2->getReturnType())) in IsStructurallyEquivalent()
1058 if (!IsStructurallyEquivalent(Context, Function1->getExtInfo(), in IsStructurallyEquivalent()
1059 Function2->getExtInfo())) in IsStructurallyEquivalent()
1066 cast<UnresolvedUsingType>(T1)->getDecl(), in IsStructurallyEquivalent()
1067 cast<UnresolvedUsingType>(T2)->getDecl())) in IsStructurallyEquivalent()
1073 cast<AttributedType>(T1)->getModifiedType(), in IsStructurallyEquivalent()
1074 cast<AttributedType>(T2)->getModifiedType())) in IsStructurallyEquivalent()
1077 Context, cast<AttributedType>(T1)->getEquivalentType(), in IsStructurallyEquivalent()
1078 cast<AttributedType>(T2)->getEquivalentType())) in IsStructurallyEquivalent()
1084 cast<CountAttributedType>(T1)->desugar(), in IsStructurallyEquivalent()
1085 cast<CountAttributedType>(T2)->desugar())) in IsStructurallyEquivalent()
1091 Context, cast<BTFTagAttributedType>(T1)->getWrappedType(), in IsStructurallyEquivalent()
1092 cast<BTFTagAttributedType>(T2)->getWrappedType())) in IsStructurallyEquivalent()
1097 if (!IsStructurallyEquivalent(Context, cast<ParenType>(T1)->getInnerType(), in IsStructurallyEquivalent()
1098 cast<ParenType>(T2)->getInnerType())) in IsStructurallyEquivalent()
1104 Context, cast<MacroQualifiedType>(T1)->getUnderlyingType(), in IsStructurallyEquivalent()
1105 cast<MacroQualifiedType>(T2)->getUnderlyingType())) in IsStructurallyEquivalent()
1110 if (!IsStructurallyEquivalent(Context, cast<UsingType>(T1)->getFoundDecl(), in IsStructurallyEquivalent()
1111 cast<UsingType>(T2)->getFoundDecl())) in IsStructurallyEquivalent()
1114 cast<UsingType>(T1)->getUnderlyingType(), in IsStructurallyEquivalent()
1115 cast<UsingType>(T2)->getUnderlyingType())) in IsStructurallyEquivalent()
1120 if (!IsStructurallyEquivalent(Context, cast<TypedefType>(T1)->getDecl(), in IsStructurallyEquivalent()
1121 cast<TypedefType>(T2)->getDecl()) || in IsStructurallyEquivalent()
1122 !IsStructurallyEquivalent(Context, cast<TypedefType>(T1)->desugar(), in IsStructurallyEquivalent()
1123 cast<TypedefType>(T2)->desugar())) in IsStructurallyEquivalent()
1129 Context, cast<TypeOfExprType>(T1)->getUnderlyingExpr(), in IsStructurallyEquivalent()
1130 cast<TypeOfExprType>(T2)->getUnderlyingExpr())) in IsStructurallyEquivalent()
1136 cast<TypeOfType>(T1)->getUnmodifiedType(), in IsStructurallyEquivalent()
1137 cast<TypeOfType>(T2)->getUnmodifiedType())) in IsStructurallyEquivalent()
1143 Context, cast<UnaryTransformType>(T1)->getUnderlyingType(), in IsStructurallyEquivalent()
1144 cast<UnaryTransformType>(T2)->getUnderlyingType())) in IsStructurallyEquivalent()
1150 cast<DecltypeType>(T1)->getUnderlyingExpr(), in IsStructurallyEquivalent()
1151 cast<DecltypeType>(T2)->getUnderlyingExpr())) in IsStructurallyEquivalent()
1158 if (!IsStructurallyEquivalent(Context, Auto1->getDeducedType(), in IsStructurallyEquivalent()
1159 Auto2->getDeducedType())) in IsStructurallyEquivalent()
1161 if (Auto1->isConstrained() != Auto2->isConstrained()) in IsStructurallyEquivalent()
1163 if (Auto1->isConstrained()) { in IsStructurallyEquivalent()
1164 if (Auto1->getTypeConstraintConcept() != in IsStructurallyEquivalent()
1165 Auto2->getTypeConstraintConcept()) in IsStructurallyEquivalent()
1168 Auto1->getTypeConstraintArguments(), in IsStructurallyEquivalent()
1169 Auto2->getTypeConstraintArguments())) in IsStructurallyEquivalent()
1178 if (!IsStructurallyEquivalent(Context, DT1->getTemplateName(), in IsStructurallyEquivalent()
1179 DT2->getTemplateName())) in IsStructurallyEquivalent()
1181 if (!IsStructurallyEquivalent(Context, DT1->getDeducedType(), in IsStructurallyEquivalent()
1182 DT2->getDeducedType())) in IsStructurallyEquivalent()
1189 if (!IsStructurallyEquivalent(Context, cast<TagType>(T1)->getDecl(), in IsStructurallyEquivalent()
1190 cast<TagType>(T2)->getDecl())) in IsStructurallyEquivalent()
1198 Parm1->getDepth() != Parm2->getDepth()) in IsStructurallyEquivalent()
1200 if (Parm1->getIndex() != Parm2->getIndex()) in IsStructurallyEquivalent()
1202 if (Parm1->isParameterPack() != Parm2->isParameterPack()) in IsStructurallyEquivalent()
1212 if (!IsStructurallyEquivalent(Context, Subst1->getReplacementType(), in IsStructurallyEquivalent()
1213 Subst2->getReplacementType())) in IsStructurallyEquivalent()
1215 if (!IsStructurallyEquivalent(Context, Subst1->getAssociatedDecl(), in IsStructurallyEquivalent()
1216 Subst2->getAssociatedDecl())) in IsStructurallyEquivalent()
1218 if (Subst1->getIndex() != Subst2->getIndex()) in IsStructurallyEquivalent()
1220 if (Subst1->getPackIndex() != Subst2->getPackIndex()) in IsStructurallyEquivalent()
1228 if (!IsStructurallyEquivalent(Context, Subst1->getAssociatedDecl(), in IsStructurallyEquivalent()
1229 Subst2->getAssociatedDecl())) in IsStructurallyEquivalent()
1231 if (Subst1->getIndex() != Subst2->getIndex()) in IsStructurallyEquivalent()
1233 if (!IsStructurallyEquivalent(Context, Subst1->getArgumentPack(), in IsStructurallyEquivalent()
1234 Subst2->getArgumentPack())) in IsStructurallyEquivalent()
1242 if (!IsStructurallyEquivalent(Context, Spec1->getTemplateName(), in IsStructurallyEquivalent()
1243 Spec2->getTemplateName())) in IsStructurallyEquivalent()
1245 if (!IsStructurallyEquivalent(Context, Spec1->template_arguments(), in IsStructurallyEquivalent()
1246 Spec2->template_arguments())) in IsStructurallyEquivalent()
1257 if (Elab1->getKeyword() != Elab2->getKeyword()) in IsStructurallyEquivalent()
1259 if (!IsStructurallyEquivalent(Context, Elab1->getQualifier(), in IsStructurallyEquivalent()
1260 Elab2->getQualifier())) in IsStructurallyEquivalent()
1262 if (!IsStructurallyEquivalent(Context, Elab1->getNamedType(), in IsStructurallyEquivalent()
1263 Elab2->getNamedType())) in IsStructurallyEquivalent()
1272 Inj1->getInjectedSpecializationType(), in IsStructurallyEquivalent()
1273 Inj2->getInjectedSpecializationType())) in IsStructurallyEquivalent()
1281 if (!IsStructurallyEquivalent(Context, Typename1->getQualifier(), in IsStructurallyEquivalent()
1282 Typename2->getQualifier())) in IsStructurallyEquivalent()
1284 if (!IsStructurallyEquivalent(Typename1->getIdentifier(), in IsStructurallyEquivalent()
1285 Typename2->getIdentifier())) in IsStructurallyEquivalent()
1294 if (!IsStructurallyEquivalent(Context, Spec1->getQualifier(), in IsStructurallyEquivalent()
1295 Spec2->getQualifier())) in IsStructurallyEquivalent()
1297 if (!IsStructurallyEquivalent(Spec1->getIdentifier(), in IsStructurallyEquivalent()
1298 Spec2->getIdentifier())) in IsStructurallyEquivalent()
1300 if (!IsStructurallyEquivalent(Context, Spec1->template_arguments(), in IsStructurallyEquivalent()
1301 Spec2->template_arguments())) in IsStructurallyEquivalent()
1308 cast<PackExpansionType>(T1)->getPattern(), in IsStructurallyEquivalent()
1309 cast<PackExpansionType>(T2)->getPattern())) in IsStructurallyEquivalent()
1315 cast<PackIndexingType>(T1)->getPattern(), in IsStructurallyEquivalent()
1316 cast<PackIndexingType>(T2)->getPattern())) in IsStructurallyEquivalent()
1318 cast<PackIndexingType>(T1)->getIndexExpr(), in IsStructurallyEquivalent()
1319 cast<PackIndexingType>(T2)->getIndexExpr())) in IsStructurallyEquivalent()
1326 if (!IsStructurallyEquivalent(Context, Iface1->getDecl(), in IsStructurallyEquivalent()
1327 Iface2->getDecl())) in IsStructurallyEquivalent()
1335 if (!IsStructurallyEquivalent(Context, Obj1->getDecl(), Obj2->getDecl())) in IsStructurallyEquivalent()
1338 if (Obj1->getNumProtocols() != Obj2->getNumProtocols()) in IsStructurallyEquivalent()
1340 for (unsigned I = 0, N = Obj1->getNumProtocols(); I != N; ++I) { in IsStructurallyEquivalent()
1341 if (!IsStructurallyEquivalent(Context, Obj1->getProtocol(I), in IsStructurallyEquivalent()
1342 Obj2->getProtocol(I))) in IsStructurallyEquivalent()
1351 if (!IsStructurallyEquivalent(Context, Obj1->getBaseType(), in IsStructurallyEquivalent()
1352 Obj2->getBaseType())) in IsStructurallyEquivalent()
1354 if (Obj1->getNumProtocols() != Obj2->getNumProtocols()) in IsStructurallyEquivalent()
1356 for (unsigned I = 0, N = Obj1->getNumProtocols(); I != N; ++I) { in IsStructurallyEquivalent()
1357 if (!IsStructurallyEquivalent(Context, Obj1->getProtocol(I), in IsStructurallyEquivalent()
1358 Obj2->getProtocol(I))) in IsStructurallyEquivalent()
1367 if (!IsStructurallyEquivalent(Context, Ptr1->getPointeeType(), in IsStructurallyEquivalent()
1368 Ptr2->getPointeeType())) in IsStructurallyEquivalent()
1374 if (!IsStructurallyEquivalent(Context, cast<AtomicType>(T1)->getValueType(), in IsStructurallyEquivalent()
1375 cast<AtomicType>(T2)->getValueType())) in IsStructurallyEquivalent()
1380 if (!IsStructurallyEquivalent(Context, cast<PipeType>(T1)->getElementType(), in IsStructurallyEquivalent()
1381 cast<PipeType>(T2)->getElementType())) in IsStructurallyEquivalent()
1388 if (Int1->isUnsigned() != Int2->isUnsigned() || in IsStructurallyEquivalent()
1389 Int1->getNumBits() != Int2->getNumBits()) in IsStructurallyEquivalent()
1397 if (Int1->isUnsigned() != Int2->isUnsigned() || in IsStructurallyEquivalent()
1398 !IsStructurallyEquivalent(Context, Int1->getNumBitsExpr(), in IsStructurallyEquivalent()
1399 Int2->getNumBitsExpr())) in IsStructurallyEquivalent()
1410 IdentifierInfo *Name1 = D1->getIdentifier(); in IsStructurallyEquivalent()
1411 IdentifierInfo *Name2 = D2->getIdentifier(); in IsStructurallyEquivalent()
1415 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType())) in IsStructurallyEquivalent()
1419 // definition. Like a forward-declaration matches a class definition, variable in IsStructurallyEquivalent()
1421 if (D1->isThisDeclarationADefinition() != D2->isThisDeclarationADefinition()) in IsStructurallyEquivalent()
1424 if (D1->getStorageClass() != D2->getStorageClass()) in IsStructurallyEquivalent()
1427 return IsStructurallyEquivalent(Context, D1->getInit(), D2->getInit()); in IsStructurallyEquivalent()
1433 const auto *Owner2 = cast<Decl>(Field2->getDeclContext()); in IsStructurallyEquivalent()
1438 if (Field1->isAnonymousStructOrUnion() && in IsStructurallyEquivalent()
1439 Field2->isAnonymousStructOrUnion()) { in IsStructurallyEquivalent()
1440 RecordDecl *D1 = Field1->getType()->castAs<RecordType>()->getDecl(); in IsStructurallyEquivalent()
1441 RecordDecl *D2 = Field2->getType()->castAs<RecordType>()->getDecl(); in IsStructurallyEquivalent()
1446 IdentifierInfo *Name1 = Field1->getIdentifier(); in IsStructurallyEquivalent()
1447 IdentifierInfo *Name2 = Field2->getIdentifier(); in IsStructurallyEquivalent()
1451 Owner2->getLocation(), in IsStructurallyEquivalent()
1454 Context.Diag2(Field2->getLocation(), diag::note_odr_field_name) in IsStructurallyEquivalent()
1455 << Field2->getDeclName(); in IsStructurallyEquivalent()
1456 Context.Diag1(Field1->getLocation(), diag::note_odr_field_name) in IsStructurallyEquivalent()
1457 << Field1->getDeclName(); in IsStructurallyEquivalent()
1462 if (!IsStructurallyEquivalent(Context, Field1->getType(), in IsStructurallyEquivalent()
1463 Field2->getType())) { in IsStructurallyEquivalent()
1466 Owner2->getLocation(), in IsStructurallyEquivalent()
1469 Context.Diag2(Field2->getLocation(), diag::note_odr_field) in IsStructurallyEquivalent()
1470 << Field2->getDeclName() << Field2->getType(); in IsStructurallyEquivalent()
1471 Context.Diag1(Field1->getLocation(), diag::note_odr_field) in IsStructurallyEquivalent()
1472 << Field1->getDeclName() << Field1->getType(); in IsStructurallyEquivalent()
1477 if (Field1->isBitField()) in IsStructurallyEquivalent()
1478 return IsStructurallyEquivalent(Context, Field1->getBitWidth(), in IsStructurallyEquivalent()
1479 Field2->getBitWidth()); in IsStructurallyEquivalent()
1487 const auto *Owner2 = cast<RecordDecl>(Field2->getDeclContext()); in IsStructurallyEquivalent()
1497 Method1->getDeclKind() == Method2->getDeclKind() && in IsStructurallyEquivalent()
1498 Method1->getRefQualifier() == Method2->getRefQualifier() && in IsStructurallyEquivalent()
1499 Method1->getAccess() == Method2->getAccess() && in IsStructurallyEquivalent()
1500 Method1->getOverloadedOperator() == Method2->getOverloadedOperator() && in IsStructurallyEquivalent()
1501 Method1->isStatic() == Method2->isStatic() && in IsStructurallyEquivalent()
1502 Method1->isImplicitObjectMemberFunction() == in IsStructurallyEquivalent()
1503 Method2->isImplicitObjectMemberFunction() && in IsStructurallyEquivalent()
1504 Method1->isConst() == Method2->isConst() && in IsStructurallyEquivalent()
1505 Method1->isVolatile() == Method2->isVolatile() && in IsStructurallyEquivalent()
1506 Method1->isVirtual() == Method2->isVirtual() && in IsStructurallyEquivalent()
1507 Method1->isPureVirtual() == Method2->isPureVirtual() && in IsStructurallyEquivalent()
1508 Method1->isDefaulted() == Method2->isDefaulted() && in IsStructurallyEquivalent()
1509 Method1->isDeleted() == Method2->isDeleted(); in IsStructurallyEquivalent()
1516 if (!Constructor1->getExplicitSpecifier().isEquivalent( in IsStructurallyEquivalent()
1517 Constructor2->getExplicitSpecifier())) in IsStructurallyEquivalent()
1523 if (!Conversion1->getExplicitSpecifier().isEquivalent( in IsStructurallyEquivalent()
1524 Conversion2->getExplicitSpecifier())) in IsStructurallyEquivalent()
1526 if (!IsStructurallyEquivalent(Context, Conversion1->getConversionType(), in IsStructurallyEquivalent()
1527 Conversion2->getConversionType())) in IsStructurallyEquivalent()
1531 const IdentifierInfo *Name1 = Method1->getIdentifier(); in IsStructurallyEquivalent()
1532 const IdentifierInfo *Name2 = Method2->getIdentifier(); in IsStructurallyEquivalent()
1540 Method1->getType(), Method2->getType())) in IsStructurallyEquivalent()
1550 assert(D1->isLambda() && D2->isLambda() && in IsStructurallyEquivalentLambdas()
1552 if (!IsStructurallyEquivalent(Context, D1->getLambdaCallOperator(), in IsStructurallyEquivalentLambdas()
1553 D2->getLambdaCallOperator())) in IsStructurallyEquivalentLambdas()
1567 DeclContext *DC1 = D1->getDeclContext()->getNonTransparentContext(); in IsRecordContextStructurallyEquivalent()
1568 DeclContext *DC2 = D2->getDeclContext()->getNonTransparentContext(); in IsRecordContextStructurallyEquivalent()
1572 if ((DC1->isFunctionOrMethod() && DC2->isTranslationUnit()) || in IsRecordContextStructurallyEquivalent()
1573 (DC2->isFunctionOrMethod() && DC1->isTranslationUnit())) in IsRecordContextStructurallyEquivalent()
1576 if (DC1->getDeclKind() != DC2->getDeclKind()) in IsRecordContextStructurallyEquivalent()
1578 if (DC1->isTranslationUnit()) in IsRecordContextStructurallyEquivalent()
1580 if (DC1->isInlineNamespace() != DC2->isInlineNamespace()) in IsRecordContextStructurallyEquivalent()
1584 if (!DC1->isInlineNamespace() && in IsRecordContextStructurallyEquivalent()
1585 !IsStructurallyEquivalent(ND1->getIdentifier(), ND2->getIdentifier())) in IsRecordContextStructurallyEquivalent()
1595 DC1 = DC1->getParent()->getNonTransparentContext(); in IsRecordContextStructurallyEquivalent()
1596 DC2 = DC2->getParent()->getNonTransparentContext(); in IsRecordContextStructurallyEquivalent()
1603 auto GetName = [](const TagDecl &D) -> const IdentifierInfo * { in NameIsStructurallyEquivalent()
1607 return TypedefName->getIdentifier(); in NameIsStructurallyEquivalent()
1620 if (D1->isUnion() != D2->isUnion()) { in IsStructurallyEquivalent()
1622 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic( in IsStructurallyEquivalent()
1625 Context.Diag1(D1->getLocation(), diag::note_odr_tag_kind_here) in IsStructurallyEquivalent()
1626 << D1->getDeclName() << (unsigned)D1->getTagKind(); in IsStructurallyEquivalent()
1631 if (!D1->getDeclName() && !D2->getDeclName()) { in IsStructurallyEquivalent()
1657 if (!IsStructurallyEquivalent(Context, Spec1->getSpecializedTemplate(), in IsStructurallyEquivalent()
1658 Spec2->getSpecializedTemplate())) in IsStructurallyEquivalent()
1662 if (Spec1->getTemplateArgs().size() != Spec2->getTemplateArgs().size()) in IsStructurallyEquivalent()
1665 for (unsigned I = 0, N = Spec1->getTemplateArgs().size(); I != N; ++I) in IsStructurallyEquivalent()
1666 if (!IsStructurallyEquivalent(Context, Spec1->getTemplateArgs().get(I), in IsStructurallyEquivalent()
1667 Spec2->getTemplateArgs().get(I))) in IsStructurallyEquivalent()
1678 D1 = D1->getDefinition(); in IsStructurallyEquivalent()
1679 D2 = D2->getDefinition(); in IsStructurallyEquivalent()
1689 if (D1->hasExternalLexicalStorage() || D2->hasExternalLexicalStorage()) in IsStructurallyEquivalent()
1694 if (D1->isBeingDefined() || D2->isBeingDefined()) in IsStructurallyEquivalent()
1699 if (D1CXX->hasExternalLexicalStorage() && in IsStructurallyEquivalent()
1700 !D1CXX->isCompleteDefinition()) { in IsStructurallyEquivalent()
1701 D1CXX->getASTContext().getExternalSource()->CompleteType(D1CXX); in IsStructurallyEquivalent()
1704 if (D1CXX->isLambda() != D2CXX->isLambda()) in IsStructurallyEquivalent()
1706 if (D1CXX->isLambda()) { in IsStructurallyEquivalent()
1711 if (D1CXX->getNumBases() != D2CXX->getNumBases()) { in IsStructurallyEquivalent()
1713 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1717 Context.Diag2(D2->getLocation(), diag::note_odr_number_of_bases) in IsStructurallyEquivalent()
1718 << D2CXX->getNumBases(); in IsStructurallyEquivalent()
1719 Context.Diag1(D1->getLocation(), diag::note_odr_number_of_bases) in IsStructurallyEquivalent()
1720 << D1CXX->getNumBases(); in IsStructurallyEquivalent()
1726 for (CXXRecordDecl::base_class_iterator Base1 = D1CXX->bases_begin(), in IsStructurallyEquivalent()
1727 BaseEnd1 = D1CXX->bases_end(), in IsStructurallyEquivalent()
1728 Base2 = D2CXX->bases_begin(); in IsStructurallyEquivalent()
1730 if (!IsStructurallyEquivalent(Context, Base1->getType(), in IsStructurallyEquivalent()
1731 Base2->getType())) { in IsStructurallyEquivalent()
1733 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1737 Context.Diag2(Base2->getBeginLoc(), diag::note_odr_base) in IsStructurallyEquivalent()
1738 << Base2->getType() << Base2->getSourceRange(); in IsStructurallyEquivalent()
1739 Context.Diag1(Base1->getBeginLoc(), diag::note_odr_base) in IsStructurallyEquivalent()
1740 << Base1->getType() << Base1->getSourceRange(); in IsStructurallyEquivalent()
1745 // Check virtual vs. non-virtual inheritance mismatch. in IsStructurallyEquivalent()
1746 if (Base1->isVirtual() != Base2->isVirtual()) { in IsStructurallyEquivalent()
1748 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1752 Context.Diag2(Base2->getBeginLoc(), diag::note_odr_virtual_base) in IsStructurallyEquivalent()
1753 << Base2->isVirtual() << Base2->getSourceRange(); in IsStructurallyEquivalent()
1754 Context.Diag1(Base1->getBeginLoc(), diag::note_odr_base) in IsStructurallyEquivalent()
1755 << Base1->isVirtual() << Base1->getSourceRange(); in IsStructurallyEquivalent()
1762 CXXRecordDecl::friend_iterator Friend2 = D2CXX->friend_begin(), in IsStructurallyEquivalent()
1763 Friend2End = D2CXX->friend_end(); in IsStructurallyEquivalent()
1764 for (CXXRecordDecl::friend_iterator Friend1 = D1CXX->friend_begin(), in IsStructurallyEquivalent()
1765 Friend1End = D1CXX->friend_end(); in IsStructurallyEquivalent()
1769 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1773 Context.Diag1((*Friend1)->getFriendLoc(), diag::note_odr_friend); in IsStructurallyEquivalent()
1774 Context.Diag2(D2->getLocation(), diag::note_odr_missing_friend); in IsStructurallyEquivalent()
1781 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1785 Context.Diag1((*Friend1)->getFriendLoc(), diag::note_odr_friend); in IsStructurallyEquivalent()
1786 Context.Diag2((*Friend2)->getFriendLoc(), diag::note_odr_friend); in IsStructurallyEquivalent()
1794 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1798 Context.Diag2((*Friend2)->getFriendLoc(), diag::note_odr_friend); in IsStructurallyEquivalent()
1799 Context.Diag1(D1->getLocation(), diag::note_odr_missing_friend); in IsStructurallyEquivalent()
1803 } else if (D1CXX->getNumBases() > 0) { in IsStructurallyEquivalent()
1805 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1809 const CXXBaseSpecifier *Base1 = D1CXX->bases_begin(); in IsStructurallyEquivalent()
1810 Context.Diag1(Base1->getBeginLoc(), diag::note_odr_base) in IsStructurallyEquivalent()
1811 << Base1->getType() << Base1->getSourceRange(); in IsStructurallyEquivalent()
1812 Context.Diag2(D2->getLocation(), diag::note_odr_missing_base); in IsStructurallyEquivalent()
1820 RecordDecl::field_iterator Field2 = D2->field_begin(), in IsStructurallyEquivalent()
1821 Field2End = D2->field_end(); in IsStructurallyEquivalent()
1822 for (RecordDecl::field_iterator Field1 = D1->field_begin(), in IsStructurallyEquivalent()
1823 Field1End = D1->field_end(); in IsStructurallyEquivalent()
1827 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1831 Context.Diag1(Field1->getLocation(), diag::note_odr_field) in IsStructurallyEquivalent()
1832 << Field1->getDeclName() << Field1->getType(); in IsStructurallyEquivalent()
1833 Context.Diag2(D2->getLocation(), diag::note_odr_missing_field); in IsStructurallyEquivalent()
1844 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic( in IsStructurallyEquivalent()
1847 Context.Diag2(Field2->getLocation(), diag::note_odr_field) in IsStructurallyEquivalent()
1848 << Field2->getDeclName() << Field2->getType(); in IsStructurallyEquivalent()
1849 Context.Diag1(D1->getLocation(), diag::note_odr_missing_field); in IsStructurallyEquivalent()
1860 const llvm::APSInt &FromVal = D1->getInitVal(); in IsStructurallyEquivalent()
1861 const llvm::APSInt &ToVal = D2->getInitVal(); in IsStructurallyEquivalent()
1869 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier())) in IsStructurallyEquivalent()
1873 return IsStructurallyEquivalent(Context, D1->getInitExpr(), in IsStructurallyEquivalent()
1874 D2->getInitExpr()); in IsStructurallyEquivalent()
1886 D1 = D1->getDefinition(); in IsStructurallyEquivalent()
1887 D2 = D2->getDefinition(); in IsStructurallyEquivalent()
1891 EnumDecl::enumerator_iterator EC2 = D2->enumerator_begin(), in IsStructurallyEquivalent()
1892 EC2End = D2->enumerator_end(); in IsStructurallyEquivalent()
1893 for (EnumDecl::enumerator_iterator EC1 = D1->enumerator_begin(), in IsStructurallyEquivalent()
1894 EC1End = D1->enumerator_end(); in IsStructurallyEquivalent()
1898 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1902 Context.Diag1(EC1->getLocation(), diag::note_odr_enumerator) in IsStructurallyEquivalent()
1903 << EC1->getDeclName() << toString(EC1->getInitVal(), 10); in IsStructurallyEquivalent()
1904 Context.Diag2(D2->getLocation(), diag::note_odr_missing_enumerator); in IsStructurallyEquivalent()
1909 llvm::APSInt Val1 = EC1->getInitVal(); in IsStructurallyEquivalent()
1910 llvm::APSInt Val2 = EC2->getInitVal(); in IsStructurallyEquivalent()
1912 !IsStructurallyEquivalent(EC1->getIdentifier(), EC2->getIdentifier())) { in IsStructurallyEquivalent()
1914 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1918 Context.Diag2(EC2->getLocation(), diag::note_odr_enumerator) in IsStructurallyEquivalent()
1919 << EC2->getDeclName() << toString(EC2->getInitVal(), 10); in IsStructurallyEquivalent()
1920 Context.Diag1(EC1->getLocation(), diag::note_odr_enumerator) in IsStructurallyEquivalent()
1921 << EC1->getDeclName() << toString(EC1->getInitVal(), 10); in IsStructurallyEquivalent()
1929 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic( in IsStructurallyEquivalent()
1932 Context.Diag2(EC2->getLocation(), diag::note_odr_enumerator) in IsStructurallyEquivalent()
1933 << EC2->getDeclName() << toString(EC2->getInitVal(), 10); in IsStructurallyEquivalent()
1934 Context.Diag1(D1->getLocation(), diag::note_odr_missing_enumerator); in IsStructurallyEquivalent()
1945 if (Params1->size() != Params2->size()) { in IsStructurallyEquivalent()
1947 Context.Diag2(Params2->getTemplateLoc(), in IsStructurallyEquivalent()
1950 << Params1->size() << Params2->size(); in IsStructurallyEquivalent()
1951 Context.Diag1(Params1->getTemplateLoc(), in IsStructurallyEquivalent()
1957 for (unsigned I = 0, N = Params1->size(); I != N; ++I) { in IsStructurallyEquivalent()
1958 if (Params1->getParam(I)->getKind() != Params2->getParam(I)->getKind()) { in IsStructurallyEquivalent()
1960 Context.Diag2(Params2->getParam(I)->getLocation(), in IsStructurallyEquivalent()
1963 Context.Diag1(Params1->getParam(I)->getLocation(), in IsStructurallyEquivalent()
1969 if (!IsStructurallyEquivalent(Context, Params1->getParam(I), in IsStructurallyEquivalent()
1970 Params2->getParam(I))) in IsStructurallyEquivalent()
1980 if (D1->isParameterPack() != D2->isParameterPack()) { in IsStructurallyEquivalent()
1982 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
1985 << D2->isParameterPack(); in IsStructurallyEquivalent()
1986 Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack) in IsStructurallyEquivalent()
1987 << D1->isParameterPack(); in IsStructurallyEquivalent()
1998 if (D1->isParameterPack() != D2->isParameterPack()) { in IsStructurallyEquivalent()
2000 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
2003 << D2->isParameterPack(); in IsStructurallyEquivalent()
2004 Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack) in IsStructurallyEquivalent()
2005 << D1->isParameterPack(); in IsStructurallyEquivalent()
2009 if (!Context.IgnoreTemplateParmDepth && D1->getDepth() != D2->getDepth()) in IsStructurallyEquivalent()
2011 if (D1->getIndex() != D2->getIndex()) in IsStructurallyEquivalent()
2014 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType())) { in IsStructurallyEquivalent()
2016 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
2019 << D2->getType() << D1->getType(); in IsStructurallyEquivalent()
2020 Context.Diag1(D1->getLocation(), diag::note_odr_value_here) in IsStructurallyEquivalent()
2021 << D1->getType(); in IsStructurallyEquivalent()
2032 if (D1->isParameterPack() != D2->isParameterPack()) { in IsStructurallyEquivalent()
2034 Context.Diag2(D2->getLocation(), in IsStructurallyEquivalent()
2037 << D2->isParameterPack(); in IsStructurallyEquivalent()
2038 Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack) in IsStructurallyEquivalent()
2039 << D1->isParameterPack(); in IsStructurallyEquivalent()
2045 return IsStructurallyEquivalent(Context, D1->getTemplateParameters(), in IsStructurallyEquivalent()
2046 D2->getTemplateParameters()); in IsStructurallyEquivalent()
2051 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier())) in IsTemplateDeclCommonStructurallyEquivalent()
2053 if (!D1->getIdentifier()) // Special name in IsTemplateDeclCommonStructurallyEquivalent()
2054 if (D1->getNameAsString() != D2->getNameAsString()) in IsTemplateDeclCommonStructurallyEquivalent()
2056 return IsStructurallyEquivalent(Ctx, D1->getTemplateParameters(), in IsTemplateDeclCommonStructurallyEquivalent()
2057 D2->getTemplateParameters()); in IsTemplateDeclCommonStructurallyEquivalent()
2068 return IsStructurallyEquivalent(Context, D1->getTemplatedDecl(), in IsStructurallyEquivalent()
2069 D2->getTemplatedDecl()); in IsStructurallyEquivalent()
2080 return IsStructurallyEquivalent(Context, D1->getTemplatedDecl()->getType(), in IsStructurallyEquivalent()
2081 D2->getTemplatedDecl()->getType()); in IsStructurallyEquivalent()
2092 return IsStructurallyEquivalent(Context, D1->getTemplatedDecl(), in IsStructurallyEquivalent()
2093 D2->getTemplatedDecl()); in IsStructurallyEquivalent()
2104 return IsStructurallyEquivalent(Context, D1->getConstraintExpr(), in IsStructurallyEquivalent()
2105 D2->getConstraintExpr()); in IsStructurallyEquivalent()
2110 if ((D1->getFriendType() && D2->getFriendDecl()) || in IsStructurallyEquivalent()
2111 (D1->getFriendDecl() && D2->getFriendType())) { in IsStructurallyEquivalent()
2114 if (D1->getFriendType() && D2->getFriendType()) in IsStructurallyEquivalent()
2116 D1->getFriendType()->getType(), in IsStructurallyEquivalent()
2117 D2->getFriendType()->getType()); in IsStructurallyEquivalent()
2118 if (D1->getFriendDecl() && D2->getFriendDecl()) in IsStructurallyEquivalent()
2119 return IsStructurallyEquivalent(Context, D1->getFriendDecl(), in IsStructurallyEquivalent()
2120 D2->getFriendDecl()); in IsStructurallyEquivalent()
2126 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier())) in IsStructurallyEquivalent()
2129 return IsStructurallyEquivalent(Context, D1->getUnderlyingType(), in IsStructurallyEquivalent()
2130 D2->getUnderlyingType()); in IsStructurallyEquivalent()
2135 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier())) in IsStructurallyEquivalent()
2138 if (D1->isOverloadedOperator()) { in IsStructurallyEquivalent()
2139 if (!D2->isOverloadedOperator()) in IsStructurallyEquivalent()
2141 if (D1->getOverloadedOperator() != D2->getOverloadedOperator()) in IsStructurallyEquivalent()
2146 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType())) in IsStructurallyEquivalent()
2155 if (D1->getAccessControl() != D2->getAccessControl()) in IsStructurallyEquivalent()
2165 Context.ToCtx.getObjCInterfaceType(D2->getContainingInterface()); in IsStructurallyEquivalent()
2173 Method1->isInstanceMethod() == Method2->isInstanceMethod() && in IsStructurallyEquivalent()
2174 Method1->isVariadic() == Method2->isVariadic() && in IsStructurallyEquivalent()
2175 Method1->isDirectMethod() == Method2->isDirectMethod(); in IsStructurallyEquivalent()
2180 Selector Selector1 = Method1->getSelector(), in IsStructurallyEquivalent()
2181 Selector2 = Method2->getSelector(); in IsStructurallyEquivalent()
2186 // slots. And if there are no arguments, compare the first-and-only slot. in IsStructurallyEquivalent()
2195 if (!IsStructurallyEquivalent(Context, Method1->getReturnType(), in IsStructurallyEquivalent()
2196 Method2->getReturnType())) in IsStructurallyEquivalent()
2199 Method1->param_size() == Method2->param_size() && in IsStructurallyEquivalent()
2202 ParamT1 = Method1->param_type_begin(), in IsStructurallyEquivalent()
2203 ParamT1End = Method1->param_type_end(), in IsStructurallyEquivalent()
2204 ParamT2 = Method2->param_type_begin(), in IsStructurallyEquivalent()
2205 ParamT2End = Method2->param_type_end(); in IsStructurallyEquivalent()
2218 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier())) in IsStructurallyEquivalent()
2221 const ObjCInterfaceDecl *Intf1 = D1->getClassInterface(), in IsStructurallyEquivalent()
2222 *Intf2 = D2->getClassInterface(); in IsStructurallyEquivalent()
2227 !IsStructurallyEquivalent(Intf1->getIdentifier(), Intf2->getIdentifier())) in IsStructurallyEquivalent()
2231 ObjCCategoryDecl::protocol_iterator Protocol2 = D2->protocol_begin(), in IsStructurallyEquivalent()
2232 Protocol2End = D2->protocol_end(); in IsStructurallyEquivalent()
2233 for (ObjCCategoryDecl::protocol_iterator Protocol1 = D1->protocol_begin(), in IsStructurallyEquivalent()
2234 Protocol1End = D1->protocol_end(); in IsStructurallyEquivalent()
2238 if (!IsStructurallyEquivalent((*Protocol1)->getIdentifier(), in IsStructurallyEquivalent()
2239 (*Protocol2)->getIdentifier())) in IsStructurallyEquivalent()
2248 ObjCCategoryDecl::ivar_iterator Ivar2 = D2->ivar_begin(), in IsStructurallyEquivalent()
2249 Ivar2End = D2->ivar_end(); in IsStructurallyEquivalent()
2250 for (ObjCCategoryDecl::ivar_iterator Ivar1 = D1->ivar_begin(), in IsStructurallyEquivalent()
2251 Ivar1End = D1->ivar_end(); in IsStructurallyEquivalent()
2262 ObjCCategoryDecl::method_iterator Method2 = D2->meth_begin(), in IsStructurallyEquivalent()
2263 Method2End = D2->meth_end(); in IsStructurallyEquivalent()
2264 for (ObjCCategoryDecl::method_iterator Method1 = D1->meth_begin(), in IsStructurallyEquivalent()
2265 Method1End = D1->meth_end(); in IsStructurallyEquivalent()
2283 D1 = D1->getCanonicalDecl(); in IsStructurallyEquivalent()
2284 D2 = D2->getCanonicalDecl(); in IsStructurallyEquivalent()
2324 ASTContext &Context = Anon->getASTContext(); in findUntaggedStructOrUnionIndex()
2327 const auto *Owner = dyn_cast<RecordDecl>(Anon->getDeclContext()); in findUntaggedStructOrUnionIndex()
2332 for (const auto *D : Owner->noload_decls()) { in findUntaggedStructOrUnionIndex()
2337 if (F->isAnonymousStructOrUnion()) { in findUntaggedStructOrUnionIndex()
2338 if (Context.hasSameType(F->getType(), AnonTy)) in findUntaggedStructOrUnionIndex()
2346 QualType FieldType = F->getType(); in findUntaggedStructOrUnionIndex()
2349 FieldType = ElabType->getNamedType(); in findUntaggedStructOrUnionIndex()
2352 const RecordDecl *RecDecl = RecType->getDecl(); in findUntaggedStructOrUnionIndex()
2353 if (RecDecl->getDeclContext() == Owner && !RecDecl->getIdentifier()) { in findUntaggedStructOrUnionIndex()
2450 TemplateDecl *Template1 = D1->getDescribedTemplate(); in CheckCommonEquivalence()
2451 TemplateDecl *Template2 = D2->getDescribedTemplate(); in CheckCommonEquivalence()
2466 if (D1->getKind() != D2->getKind()) in CheckKindSpecificEquivalence()
2471 switch (D1->getKind()) { in CheckKindSpecificEquivalence()