24 #include "llvm/Support/MemoryBuffer.h"
122 unsigned NumFromArgs,
125 bool Complain =
true);
127 bool Complain =
true);
230 using namespace clang;
237 struct StructuralEquivalenceContext {
244 llvm::DenseMap<Decl *, Decl *> TentativeEquivalences;
248 std::deque<Decl *> DeclsToCheck;
256 bool StrictTypeSpelling;
266 bool StrictTypeSpelling =
false,
267 bool Complain =
true)
268 : C1(C1), C2(C2), NonEquivalentDecls(NonEquivalentDecls),
269 StrictTypeSpelling(StrictTypeSpelling), Complain(Complain),
270 LastDiagFromC2(
false) {}
287 assert(Complain &&
"Not allowed to complain");
289 C1.getDiagnostics().notePriorDiagnosticFrom(C2.getDiagnostics());
290 LastDiagFromC2 =
false;
291 return C1.getDiagnostics().Report(Loc, DiagID);
295 assert(Complain &&
"Not allowed to complain");
297 C2.getDiagnostics().notePriorDiagnosticFrom(C1.getDiagnostics());
298 LastDiagFromC2 =
true;
299 return C2.getDiagnostics().Report(Loc, DiagID);
322 if (!Name1 || !Name2)
323 return Name1 == Name2;
390 llvm_unreachable(
"Invalid template argument kind");
416 if (!Context.StrictTypeSpelling) {
419 T1 = Context.C1.getCanonicalType(T1);
420 T2 = Context.C2.getCanonicalType(T2);
433 TC = Type::FunctionNoProto;
436 TC = Type::FunctionNoProto;
444 if (cast<BuiltinType>(T1)->getKind() != cast<BuiltinType>(T2)->
getKind())
450 cast<ComplexType>(T1)->getElementType(),
458 cast<AdjustedType>(T1)->getOriginalType(),
459 cast<AdjustedType>(T2)->getOriginalType()))
465 cast<PointerType>(T1)->getPointeeType(),
466 cast<PointerType>(T2)->getPointeeType()))
470 case Type::BlockPointer:
472 cast<BlockPointerType>(T1)->getPointeeType(),
473 cast<BlockPointerType>(T2)->getPointeeType()))
477 case Type::LValueReference:
478 case Type::RValueReference: {
487 Ref2->getPointeeTypeAsWritten()))
492 case Type::MemberPointer: {
506 case Type::ConstantArray: {
509 if (!llvm::APInt::isSameValue(Array1->
getSize(), Array2->getSize()))
517 case Type::IncompleteArray:
520 cast<ArrayType>(T2)))
524 case Type::VariableArray: {
537 case Type::DependentSizedArray: {
550 case Type::DependentSizedExtVector: {
552 = cast<DependentSizedExtVectorType>(T1);
554 = cast<DependentSizedExtVectorType>(T2);
560 Vec2->getElementType()))
566 case Type::ExtVector: {
567 const VectorType *Vec1 = cast<VectorType>(T1);
568 const VectorType *Vec2 = cast<VectorType>(T2);
571 Vec2->getElementType()))
580 case Type::FunctionProto: {
587 Proto2->getParamType(
I)))
590 if (Proto1->
isVariadic() != Proto2->isVariadic())
600 Proto2->getExceptionType(
I)))
606 Proto2->getNoexceptExpr()))
615 case Type::FunctionNoProto: {
619 Function2->getReturnType()))
621 if (Function1->
getExtInfo() != Function2->getExtInfo())
626 case Type::UnresolvedUsing:
628 cast<UnresolvedUsingType>(T1)->getDecl(),
629 cast<UnresolvedUsingType>(T2)->getDecl()))
634 case Type::Attributed:
636 cast<AttributedType>(T1)->getModifiedType(),
637 cast<AttributedType>(T2)->getModifiedType()))
640 cast<AttributedType>(T1)->getEquivalentType(),
641 cast<AttributedType>(T2)->getEquivalentType()))
647 cast<ParenType>(T1)->getInnerType(),
648 cast<ParenType>(T2)->getInnerType()))
654 cast<TypedefType>(T1)->getDecl(),
655 cast<TypedefType>(T2)->getDecl()))
659 case Type::TypeOfExpr:
661 cast<TypeOfExprType>(T1)->getUnderlyingExpr(),
662 cast<TypeOfExprType>(T2)->getUnderlyingExpr()))
673 case Type::UnaryTransform:
682 cast<DecltypeType>(T1)->getUnderlyingExpr(),
683 cast<DecltypeType>(T2)->getUnderlyingExpr()))
689 cast<AutoType>(T1)->getDeducedType(),
690 cast<AutoType>(T2)->getDeducedType()))
697 cast<TagType>(T1)->getDecl(),
698 cast<TagType>(T2)->getDecl()))
702 case Type::TemplateTypeParm: {
705 if (Parm1->
getDepth() != Parm2->getDepth())
707 if (Parm1->
getIndex() != Parm2->getIndex())
716 case Type::SubstTemplateTypeParm: {
718 = cast<SubstTemplateTypeParmType>(T1);
720 = cast<SubstTemplateTypeParmType>(T2);
723 QualType(Subst2->getReplacedParameter(), 0)))
727 Subst2->getReplacementType()))
732 case Type::SubstTemplateTypeParmPack: {
734 = cast<SubstTemplateTypeParmPackType>(T1);
736 = cast<SubstTemplateTypeParmPackType>(T2);
739 QualType(Subst2->getReplacedParameter(), 0)))
743 Subst2->getArgumentPack()))
747 case Type::TemplateSpecialization: {
749 = cast<TemplateSpecializationType>(T1);
751 = cast<TemplateSpecializationType>(T2);
753 Spec1->getTemplateName(),
754 Spec2->getTemplateName()))
756 if (Spec1->getNumArgs() != Spec2->getNumArgs())
758 for (
unsigned I = 0, N = Spec1->getNumArgs();
I != N; ++
I) {
760 Spec1->getArg(
I), Spec2->getArg(
I)))
766 case Type::Elaborated: {
770 if (Elab1->
getKeyword() != Elab2->getKeyword())
774 Elab2->getQualifier()))
778 Elab2->getNamedType()))
783 case Type::InjectedClassName: {
788 Inj2->getInjectedSpecializationType()))
793 case Type::DependentName: {
798 Typename2->getQualifier()))
801 Typename2->getIdentifier()))
807 case Type::DependentTemplateSpecialization: {
809 cast<DependentTemplateSpecializationType>(T1);
811 cast<DependentTemplateSpecializationType>(T2);
813 Spec1->getQualifier(),
814 Spec2->getQualifier()))
817 Spec2->getIdentifier()))
819 if (Spec1->getNumArgs() != Spec2->getNumArgs())
821 for (
unsigned I = 0, N = Spec1->getNumArgs();
I != N; ++
I) {
823 Spec1->getArg(
I), Spec2->getArg(
I)))
829 case Type::PackExpansion:
831 cast<PackExpansionType>(T1)->getPattern(),
832 cast<PackExpansionType>(T2)->getPattern()))
836 case Type::ObjCInterface: {
840 Iface1->
getDecl(), Iface2->getDecl()))
845 case Type::ObjCObject: {
850 Obj2->getBaseType()))
857 Obj2->getProtocol(
I)))
863 case Type::ObjCObjectPointer: {
875 cast<AtomicType>(T1)->getValueType(),
876 cast<AtomicType>(T2)->getValueType()))
883 cast<PipeType>(T1)->getElementType(),
917 if (Context.Complain) {
918 Context.Diag2(Owner2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
919 << Context.C2.getTypeDeclType(Owner2);
920 Context.Diag2(Field2->
getLocation(), diag::note_odr_field)
922 Context.Diag1(Field1->
getLocation(), diag::note_odr_field)
929 if (Context.Complain) {
930 Context.Diag2(Owner2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
931 << Context.C2.getTypeDeclType(Owner2);
933 Context.Diag1(Field1->
getLocation(), diag::note_odr_bit_field)
936 Context.Diag2(Field2->
getLocation(), diag::note_odr_not_bit_field)
939 Context.Diag2(Field2->
getLocation(), diag::note_odr_bit_field)
942 Context.Diag1(Field1->
getLocation(), diag::note_odr_not_bit_field)
954 if (Bits1 != Bits2) {
955 if (Context.Complain) {
956 Context.Diag2(Owner2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
957 << Context.C2.getTypeDeclType(Owner2);
958 Context.Diag2(Field2->
getLocation(), diag::note_odr_bit_field)
960 Context.Diag1(Field1->
getLocation(), diag::note_odr_bit_field)
988 if (!F || !F->isAnonymousStructOrUnion())
1004 if (Context.Complain) {
1005 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1006 << Context.C2.getTypeDeclType(D2);
1007 Context.Diag1(D1->
getLocation(), diag::note_odr_tag_kind_here)
1018 if (*Index1 != *Index2)
1030 if (Spec1 && Spec2) {
1033 Spec2->getSpecializedTemplate()))
1043 Spec2->getTemplateArgs().get(
I)))
1048 else if (Spec1 || Spec2)
1060 if (D1CXX->getNumBases() != D2CXX->getNumBases()) {
1061 if (Context.Complain) {
1062 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1063 << Context.C2.getTypeDeclType(D2);
1064 Context.Diag2(D2->
getLocation(), diag::note_odr_number_of_bases)
1065 << D2CXX->getNumBases();
1066 Context.Diag1(D1->
getLocation(), diag::note_odr_number_of_bases)
1067 << D1CXX->getNumBases();
1074 BaseEnd1 = D1CXX->bases_end(),
1075 Base2 = D2CXX->bases_begin();
1079 Base1->getType(), Base2->getType())) {
1080 if (Context.Complain) {
1081 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1082 << Context.C2.getTypeDeclType(D2);
1083 Context.Diag2(Base2->getLocStart(), diag::note_odr_base)
1085 << Base2->getSourceRange();
1086 Context.Diag1(Base1->getLocStart(), diag::note_odr_base)
1088 << Base1->getSourceRange();
1094 if (Base1->isVirtual() != Base2->isVirtual()) {
1095 if (Context.Complain) {
1096 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1097 << Context.C2.getTypeDeclType(D2);
1098 Context.Diag2(Base2->getLocStart(),
1099 diag::note_odr_virtual_base)
1100 << Base2->isVirtual() << Base2->getSourceRange();
1101 Context.Diag1(Base1->getLocStart(), diag::note_odr_base)
1102 << Base1->isVirtual()
1103 << Base1->getSourceRange();
1108 }
else if (D1CXX->getNumBases() > 0) {
1109 if (Context.Complain) {
1110 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1111 << Context.C2.getTypeDeclType(D2);
1113 Context.Diag1(Base1->
getLocStart(), diag::note_odr_base)
1116 Context.Diag2(D2->
getLocation(), diag::note_odr_missing_base);
1127 Field1 != Field1End;
1128 ++Field1, ++Field2) {
1129 if (Field2 == Field2End) {
1130 if (Context.Complain) {
1131 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1132 << Context.C2.getTypeDeclType(D2);
1133 Context.Diag1(Field1->getLocation(), diag::note_odr_field)
1134 << Field1->getDeclName() << Field1->getType();
1135 Context.Diag2(D2->
getLocation(), diag::note_odr_missing_field);
1144 if (Field2 != Field2End) {
1145 if (Context.Complain) {
1146 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1147 << Context.C2.getTypeDeclType(D2);
1148 Context.Diag2(Field2->getLocation(), diag::note_odr_field)
1149 << Field2->getDeclName() << Field2->getType();
1150 Context.Diag1(D1->
getLocation(), diag::note_odr_missing_field);
1165 EC1 != EC1End; ++EC1, ++EC2) {
1166 if (EC2 == EC2End) {
1167 if (Context.Complain) {
1168 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1169 << Context.C2.getTypeDeclType(D2);
1170 Context.Diag1(EC1->getLocation(), diag::note_odr_enumerator)
1171 << EC1->getDeclName()
1172 << EC1->getInitVal().toString(10);
1173 Context.Diag2(D2->
getLocation(), diag::note_odr_missing_enumerator);
1178 llvm::APSInt Val1 = EC1->getInitVal();
1179 llvm::APSInt Val2 = EC2->getInitVal();
1180 if (!llvm::APSInt::isSameValue(Val1, Val2) ||
1182 if (Context.Complain) {
1183 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1184 << Context.C2.getTypeDeclType(D2);
1185 Context.Diag2(EC2->getLocation(), diag::note_odr_enumerator)
1186 << EC2->getDeclName()
1187 << EC2->getInitVal().toString(10);
1188 Context.Diag1(EC1->getLocation(), diag::note_odr_enumerator)
1189 << EC1->getDeclName()
1190 << EC1->getInitVal().toString(10);
1196 if (EC2 != EC2End) {
1197 if (Context.Complain) {
1198 Context.Diag2(D2->
getLocation(), diag::warn_odr_tag_type_inconsistent)
1199 << Context.C2.getTypeDeclType(D2);
1200 Context.Diag2(EC2->getLocation(), diag::note_odr_enumerator)
1201 << EC2->getDeclName()
1202 << EC2->getInitVal().toString(10);
1203 Context.Diag1(D1->
getLocation(), diag::note_odr_missing_enumerator);
1214 if (Params1->
size() != Params2->
size()) {
1215 if (Context.Complain) {
1217 diag::err_odr_different_num_template_parameters)
1218 << Params1->
size() << Params2->
size();
1220 diag::note_odr_template_parameter_list);
1225 for (
unsigned I = 0, N = Params1->
size();
I != N; ++
I) {
1227 if (Context.Complain) {
1229 diag::err_odr_different_template_parameter_kind);
1231 diag::note_odr_template_parameter_here);
1236 if (!Context.IsStructurallyEquivalent(Params1->
getParam(
I),
1250 if (Context.Complain) {
1251 Context.Diag2(D2->
getLocation(), diag::err_odr_parameter_pack_non_pack)
1253 Context.Diag1(D1->
getLocation(), diag::note_odr_parameter_pack_non_pack)
1266 if (Context.Complain) {
1267 Context.Diag2(D2->
getLocation(), diag::err_odr_parameter_pack_non_pack)
1269 Context.Diag1(D1->
getLocation(), diag::note_odr_parameter_pack_non_pack)
1276 if (!Context.IsStructurallyEquivalent(D1->
getType(), D2->
getType())) {
1277 if (Context.Complain) {
1279 diag::err_odr_non_type_parameter_type_inconsistent)
1281 Context.Diag1(D1->
getLocation(), diag::note_odr_value_here)
1294 if (Context.Complain) {
1295 Context.Diag2(D2->
getLocation(), diag::err_odr_parameter_pack_non_pack)
1297 Context.Diag1(D1->
getLocation(), diag::note_odr_parameter_pack_non_pack)
1329 if (Context.NonEquivalentDecls.count(std::make_pair(D1->
getCanonicalDecl(),
1360 bool StructuralEquivalenceContext::Finish() {
1361 while (!DeclsToCheck.empty()) {
1363 Decl *D1 = DeclsToCheck.front();
1364 DeclsToCheck.pop_front();
1366 Decl *D2 = TentativeEquivalences[D1];
1367 assert(D2 &&
"Unrecorded tentative equivalence?");
1369 bool Equivalent =
true;
1373 if (
RecordDecl *Record1 = dyn_cast<RecordDecl>(D1)) {
1374 if (
RecordDecl *Record2 = dyn_cast<RecordDecl>(D2)) {
1377 if (!Name1 && Record1->getTypedefNameForAnonDecl())
1378 Name1 = Record1->getTypedefNameForAnonDecl()->getIdentifier();
1380 if (!Name2 && Record2->getTypedefNameForAnonDecl())
1381 Name2 = Record2->getTypedefNameForAnonDecl()->getIdentifier();
1389 }
else if (
EnumDecl *Enum1 = dyn_cast<EnumDecl>(D1)) {
1390 if (
EnumDecl *Enum2 = dyn_cast<EnumDecl>(D2)) {
1393 if (!Name1 && Enum1->getTypedefNameForAnonDecl())
1394 Name1 = Enum1->getTypedefNameForAnonDecl()->getIdentifier();
1396 if (!Name2 && Enum2->getTypedefNameForAnonDecl())
1397 Name2 = Enum2->getTypedefNameForAnonDecl()->getIdentifier();
1405 }
else if (
TypedefNameDecl *Typedef1 = dyn_cast<TypedefNameDecl>(D1)) {
1408 Typedef2->getIdentifier()) ||
1410 Typedef1->getUnderlyingType(),
1411 Typedef2->getUnderlyingType()))
1418 = dyn_cast<ClassTemplateDecl>(D1)) {
1421 ClassTemplate2->getIdentifier()) ||
1437 = dyn_cast<NonTypeTemplateParmDecl>(D1)) {
1439 = dyn_cast<NonTypeTemplateParmDecl>(D2)) {
1447 = dyn_cast<TemplateTemplateParmDecl>(D1)) {
1449 = dyn_cast<TemplateTemplateParmDecl>(D2)) {
1483 #define SHARED_SINGLETON_TYPE(Expansion)
1484 #define BUILTIN_TYPE(Id, SingletonId) \
1485 case BuiltinType::Id: return Importer.getToContext().SingletonId;
1486 #include "clang/AST/BuiltinTypes.def"
1494 case BuiltinType::Char_U:
1503 case BuiltinType::Char_S:
1512 case BuiltinType::WChar_S:
1513 case BuiltinType::WChar_U:
1519 llvm_unreachable(
"Invalid BuiltinType Kind!");
1524 if (ToElementType.
isNull())
1532 if (ToPointeeType.
isNull())
1541 if (ToPointeeType.
isNull())
1551 if (ToPointeeType.
isNull())
1561 if (ToPointeeType.
isNull())
1570 if (ToPointeeType.
isNull())
1580 if (ToElementType.
isNull())
1592 if (ToElementType.
isNull())
1602 if (ToElementType.
isNull())
1618 if (ToElementType.
isNull())
1628 if (ToElementType.
isNull())
1640 if (ToResultType.
isNull())
1649 if (ToResultType.
isNull())
1658 ArgTypes.push_back(ArgType);
1665 if (ExceptionType.
isNull())
1667 ExceptionTypes.push_back(ExceptionType);
1692 if (ToInnerType.
isNull())
1700 = dyn_cast_or_null<TypedefNameDecl>(Importer.
Import(T->
getDecl()));
1717 if (ToUnderlyingType.
isNull())
1730 if (UnderlyingType.
isNull())
1751 if (!FromDeduced.
isNull()) {
1752 ToDeduced = Importer.
Import(FromDeduced);
1763 = dyn_cast_or_null<RecordDecl>(Importer.
Import(T->
getDecl()));
1772 = dyn_cast_or_null<EnumDecl>(Importer.
Import(T->
getDecl()));
1785 if (!FromModifiedType.
isNull()) {
1786 ToModifiedType = Importer.
Import(FromModifiedType);
1787 if (ToModifiedType.
isNull())
1790 if (!FromEquivalentType.
isNull()) {
1791 ToEquivalentType = Importer.
Import(FromEquivalentType);
1792 if (ToEquivalentType.
isNull())
1797 ToModifiedType, ToEquivalentType);
1811 if (!
QualType(T, 0).isCanonical()) {
1814 ToCanonType =Importer.
Import(FromCanonType);
1815 if (ToCanonType.
isNull())
1819 ToTemplateArgs.data(),
1820 ToTemplateArgs.size(),
1834 if (ToNamedType.
isNull())
1838 ToQualifier, ToNamedType);
1843 = dyn_cast_or_null<ObjCInterfaceDecl>(Importer.
Import(T->
getDecl()));
1858 if (ImportedTypeArg.
isNull())
1861 TypeArgs.push_back(ImportedTypeArg);
1865 for (
auto *
P : T->
quals()) {
1867 = dyn_cast_or_null<ObjCProtocolDecl>(Importer.
Import(
P));
1870 Protocols.push_back(Protocol);
1881 if (ToPointeeType.
isNull())
1923 ToD = Importer.
Import(FromD);
1928 if (
RecordDecl *FromRecord = dyn_cast<RecordDecl>(FromD)) {
1929 if (
RecordDecl *ToRecord = cast_or_null<RecordDecl>(ToD)) {
1930 if (FromRecord->getDefinition() && FromRecord->isCompleteDefinition() && !ToRecord->getDefinition()) {
1937 if (
EnumDecl *FromEnum = dyn_cast<EnumDecl>(FromD)) {
1938 if (
EnumDecl *ToEnum = cast_or_null<EnumDecl>(ToD)) {
1939 if (FromEnum->getDefinition() && !ToEnum->getDefinition()) {
1978 llvm_unreachable(
"Unknown name kind.");
1987 for (
auto *From : FromDC->
decls())
2006 struct CXXRecordDecl::DefinitionData &ToData = ToCXX->data();
2007 struct CXXRecordDecl::DefinitionData &FromData = FromCXX->data();
2008 ToData.UserDeclaredConstructor = FromData.UserDeclaredConstructor;
2009 ToData.UserDeclaredSpecialMembers = FromData.UserDeclaredSpecialMembers;
2010 ToData.Aggregate = FromData.Aggregate;
2011 ToData.PlainOldData = FromData.PlainOldData;
2012 ToData.Empty = FromData.Empty;
2013 ToData.Polymorphic = FromData.Polymorphic;
2014 ToData.Abstract = FromData.Abstract;
2015 ToData.IsStandardLayout = FromData.IsStandardLayout;
2016 ToData.HasNoNonEmptyBases = FromData.HasNoNonEmptyBases;
2017 ToData.HasPrivateFields = FromData.HasPrivateFields;
2018 ToData.HasProtectedFields = FromData.HasProtectedFields;
2019 ToData.HasPublicFields = FromData.HasPublicFields;
2020 ToData.HasMutableFields = FromData.HasMutableFields;
2021 ToData.HasVariantMembers = FromData.HasVariantMembers;
2022 ToData.HasOnlyCMembers = FromData.HasOnlyCMembers;
2023 ToData.HasInClassInitializer = FromData.HasInClassInitializer;
2024 ToData.HasUninitializedReferenceMember
2025 = FromData.HasUninitializedReferenceMember;
2026 ToData.NeedOverloadResolutionForMoveConstructor
2027 = FromData.NeedOverloadResolutionForMoveConstructor;
2028 ToData.NeedOverloadResolutionForMoveAssignment
2029 = FromData.NeedOverloadResolutionForMoveAssignment;
2030 ToData.NeedOverloadResolutionForDestructor
2031 = FromData.NeedOverloadResolutionForDestructor;
2032 ToData.DefaultedMoveConstructorIsDeleted
2033 = FromData.DefaultedMoveConstructorIsDeleted;
2034 ToData.DefaultedMoveAssignmentIsDeleted
2035 = FromData.DefaultedMoveAssignmentIsDeleted;
2036 ToData.DefaultedDestructorIsDeleted = FromData.DefaultedDestructorIsDeleted;
2037 ToData.HasTrivialSpecialMembers = FromData.HasTrivialSpecialMembers;
2038 ToData.HasIrrelevantDestructor = FromData.HasIrrelevantDestructor;
2039 ToData.HasConstexprNonCopyMoveConstructor
2040 = FromData.HasConstexprNonCopyMoveConstructor;
2041 ToData.DefaultedDefaultConstructorIsConstexpr
2042 = FromData.DefaultedDefaultConstructorIsConstexpr;
2043 ToData.HasConstexprDefaultConstructor
2044 = FromData.HasConstexprDefaultConstructor;
2045 ToData.HasNonLiteralTypeFieldsOrBases
2046 = FromData.HasNonLiteralTypeFieldsOrBases;
2048 ToData.UserProvidedDefaultConstructor
2049 = FromData.UserProvidedDefaultConstructor;
2050 ToData.DeclaredSpecialMembers = FromData.DeclaredSpecialMembers;
2051 ToData.ImplicitCopyConstructorHasConstParam
2052 = FromData.ImplicitCopyConstructorHasConstParam;
2053 ToData.ImplicitCopyAssignmentHasConstParam
2054 = FromData.ImplicitCopyAssignmentHasConstParam;
2055 ToData.HasDeclaredCopyConstructorWithConstParam
2056 = FromData.HasDeclaredCopyConstructorWithConstParam;
2057 ToData.HasDeclaredCopyAssignmentWithConstParam
2058 = FromData.HasDeclaredCopyAssignmentWithConstParam;
2059 ToData.IsLambda = FromData.IsLambda;
2062 for (
const auto &Base1 : FromCXX->
bases()) {
2068 if (Base1.isPackExpansion())
2069 EllipsisLoc = Importer.
Import(Base1.getEllipsisLoc());
2078 Base1.isBaseOfClass(),
2079 Base1.getAccessSpecifierAsWritten(),
2080 Importer.
Import(Base1.getTypeSourceInfo()),
2084 ToCXX->setBases(Bases.data(), Bases.size());
2124 if (ToPromotionType.
isNull())
2141 ToParams.reserve(Params->
size());
2143 PEnd = Params->
end();
2149 ToParams.push_back(cast<NamedDecl>(To));
2182 if (!To || ToType.
isNull())
2223 llvm::makeArrayRef(ToPack).copy(Importer.
getToContext()));
2227 llvm_unreachable(
"Invalid template argument kind");
2231 unsigned NumFromArgs,
2233 for (
unsigned I = 0;
I != NumFromArgs; ++
I) {
2238 ToArgs.push_back(To);
2252 ToRecord = ToOriginRecord;
2259 return Ctx.IsStructurallyEquivalent(FromRecord, ToRecord);
2264 StructuralEquivalenceContext Ctx(
2267 return Ctx.IsStructurallyEquivalent(FromVar, ToVar);
2274 return Ctx.IsStructurallyEquivalent(FromEnum, ToEnum);
2280 const llvm::APSInt &FromVal = FromEC->
getInitVal();
2281 const llvm::APSInt &ToVal = ToEC->
getInitVal();
2283 return FromVal.isSigned() == ToVal.isSigned() &&
2284 FromVal.getBitWidth() == ToVal.getBitWidth() &&
2293 return Ctx.IsStructurallyEquivalent(From, To);
2301 return Ctx.IsStructurallyEquivalent(From, To);
2338 MergeWithNamespace = cast<NamespaceDecl>(DC)->getAnonymousNamespace();
2343 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2347 if (
NamespaceDecl *FoundNS = dyn_cast<NamespaceDecl>(FoundDecls[
I])) {
2348 MergeWithNamespace = FoundNS;
2349 ConflictingDecls.clear();
2353 ConflictingDecls.push_back(FoundDecls[I]);
2356 if (!ConflictingDecls.empty()) {
2358 ConflictingDecls.data(),
2359 ConflictingDecls.size());
2378 TU->setAnonymousNamespace(ToNamespace);
2380 cast<NamespaceDecl>(DC)->setAnonymousNamespace(ToNamespace);
2409 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2410 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2413 dyn_cast<TypedefNameDecl>(FoundDecls[
I])) {
2415 FoundTypedef->getUnderlyingType()))
2416 return Importer.
Imported(D, FoundTypedef);
2419 ConflictingDecls.push_back(FoundDecls[I]);
2422 if (!ConflictingDecls.empty()) {
2424 ConflictingDecls.data(),
2425 ConflictingDecls.size());
2452 ToTypedef->setLexicalDeclContext(LexicalDC);
2492 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2493 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2496 Decl *Found = FoundDecls[
I];
2499 Found = Tag->getDecl();
2502 if (
EnumDecl *FoundEnum = dyn_cast<EnumDecl>(Found)) {
2504 return Importer.
Imported(D, FoundEnum);
2507 ConflictingDecls.push_back(FoundDecls[
I]);
2510 if (!ConflictingDecls.empty()) {
2512 ConflictingDecls.data(),
2513 ConflictingDecls.size());
2532 if (ToIntegerType.
isNull())
2548 if (Definition && Definition != D) {
2549 Decl *ImportedDef = Importer.
Import(Definition);
2553 return Importer.
Imported(D, ImportedDef);
2581 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2582 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2585 Decl *Found = FoundDecls[
I];
2588 Found = Tag->getDecl();
2591 if (
RecordDecl *FoundRecord = dyn_cast<RecordDecl>(Found)) {
2593 FoundRecord->isAnonymousStructOrUnion()) {
2600 if (*Index1 != *Index2)
2610 == FoundDef->isAnonymousStructOrUnion() &&
2616 return Importer.
Imported(D, FoundDef);
2625 if (FoundRecord->hasExternalLexicalStorage() &&
2626 !FoundRecord->isCompleteDefinition())
2631 if (FoundRecord->isCompleteDefinition() &&
2636 AdoptDecl = FoundRecord;
2638 }
else if (!SearchName) {
2643 ConflictingDecls.push_back(FoundDecls[
I]);
2646 if (!ConflictingDecls.empty() && SearchName) {
2648 ConflictingDecls.data(),
2649 ConflictingDecls.size());
2657 if (isa<CXXRecordDecl>(D)) {
2706 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2707 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2711 = dyn_cast<EnumConstantDecl>(FoundDecls[
I])) {
2713 return Importer.
Imported(D, FoundEnumConstant);
2716 ConflictingDecls.push_back(FoundDecls[I]);
2719 if (!ConflictingDecls.empty()) {
2721 ConflictingDecls.data(),
2722 ConflictingDecls.size());
2738 Importer.
Imported(D, ToEnumerator);
2740 return ToEnumerator;
2761 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2762 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2765 if (
FunctionDecl *FoundFunction = dyn_cast<FunctionDecl>(FoundDecls[
I])) {
2766 if (FoundFunction->hasExternalFormalLinkage() &&
2769 FoundFunction->getType())) {
2771 return Importer.
Imported(D, FoundFunction);
2782 Importer.
ToDiag(Loc, diag::err_odr_function_type_inconsistent)
2783 << Name << D->
getType() << FoundFunction->getType();
2784 Importer.
ToDiag(FoundFunction->getLocation(),
2785 diag::note_odr_value_here)
2786 << FoundFunction->getType();
2790 ConflictingDecls.push_back(FoundDecls[I]);
2793 if (!ConflictingDecls.empty()) {
2795 ConflictingDecls.data(),
2796 ConflictingDecls.size());
2807 bool usedDifferentExceptionSpec =
false;
2821 FromFPT->getReturnType(), FromFPT->getParamTypes(), DefaultEPI);
2822 usedDifferentExceptionSpec =
true;
2838 Parameters.push_back(ToP);
2847 cast<CXXRecordDecl>(DC),
2850 FromConstructor->isExplicit(),
2854 }
else if (isa<CXXDestructorDecl>(D)) {
2856 cast<CXXRecordDecl>(DC),
2862 = dyn_cast<CXXConversionDecl>(D)) {
2864 cast<CXXRecordDecl>(DC),
2868 FromConversion->isExplicit(),
2871 }
else if (
CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) {
2873 cast<CXXRecordDecl>(DC),
2876 Method->getStorageClass(),
2877 Method->isInlineSpecified(),
2899 for (
unsigned I = 0, N = Parameters.size();
I != N; ++
I) {
2900 Parameters[
I]->setOwningFunction(ToFunction);
2903 ToFunction->setParams(Parameters);
2905 if (usedDifferentExceptionSpec) {
2915 if (
Stmt *ToBody = Importer.
Import(FromBody)) {
2954 if (isa<FieldDecl>(*D) || isa<IndirectFieldDecl>(*D))
2975 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2976 if (
FieldDecl *FoundField = dyn_cast<FieldDecl>(FoundDecls[
I])) {
2982 FoundField->getType())) {
2987 Importer.
ToDiag(Loc, diag::err_odr_field_type_inconsistent)
2988 << Name << D->
getType() << FoundField->getType();
2989 Importer.
ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
2990 << FoundField->getType();
3034 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3036 = dyn_cast<IndirectFieldDecl>(FoundDecls[
I])) {
3042 FoundField->getType(),
3049 if (!Name && I < N-1)
3052 Importer.
ToDiag(Loc, diag::err_odr_field_type_inconsistent)
3053 << Name << D->
getType() << FoundField->getType();
3054 Importer.
ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
3055 << FoundField->getType();
3069 for (
auto *PI : D->
chain()) {
3073 NamedChain[i++] = cast<NamedDecl>(D);
3085 Importer.
Imported(D, ToIndirectField);
3087 return ToIndirectField;
3104 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3105 if (
ObjCIvarDecl *FoundIvar = dyn_cast<ObjCIvarDecl>(FoundDecls[
I])) {
3107 FoundIvar->getType())) {
3112 Importer.
ToDiag(Loc, diag::err_odr_ivar_type_inconsistent)
3113 << Name << D->
getType() << FoundIvar->getType();
3114 Importer.
ToDiag(FoundIvar->getLocation(), diag::note_odr_value_here)
3115 << FoundIvar->getType();
3131 cast<ObjCContainerDecl>(DC),
3157 VarDecl *MergeWithVar =
nullptr;
3162 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3163 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
3166 if (
VarDecl *FoundVar = dyn_cast<VarDecl>(FoundDecls[
I])) {
3168 if (FoundVar->hasExternalFormalLinkage() &&
3171 FoundVar->getType())) {
3172 MergeWithVar = FoundVar;
3180 if (FoundArray && TArray) {
3181 if (isa<IncompleteArrayType>(FoundArray) &&
3182 isa<ConstantArrayType>(TArray)) {
3188 FoundVar->setType(T);
3189 MergeWithVar = FoundVar;
3191 }
else if (isa<IncompleteArrayType>(TArray) &&
3192 isa<ConstantArrayType>(FoundArray)) {
3193 MergeWithVar = FoundVar;
3198 Importer.
ToDiag(Loc, diag::err_odr_variable_type_inconsistent)
3199 << Name << D->
getType() << FoundVar->getType();
3200 Importer.
ToDiag(FoundVar->getLocation(), diag::note_odr_value_here)
3201 << FoundVar->getType();
3205 ConflictingDecls.push_back(FoundDecls[I]);
3211 Importer.
Imported(D, MergeWithVar);
3215 Importer.
ToDiag(ExistingDef->getLocation(),
3216 diag::err_odr_variable_multiple_def)
3218 Importer.
FromDiag(DDef->getLocation(), diag::note_odr_defined_here);
3220 Expr *Init = Importer.
Import(DDef->getInit());
3222 if (DDef->isInitKnownICE()) {
3225 Eval->
IsICE = DDef->isInitICE();
3230 return MergeWithVar;
3233 if (!ConflictingDecls.empty()) {
3235 ConflictingDecls.data(),
3236 ConflictingDecls.size());
3294 return Importer.
Imported(D, ToParm);
3327 return Importer.
Imported(D, ToParm);
3343 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3344 if (
ObjCMethodDecl *FoundMethod = dyn_cast<ObjCMethodDecl>(FoundDecls[
I])) {
3350 FoundMethod->getReturnType())) {
3351 Importer.
ToDiag(Loc, diag::err_odr_objc_method_result_type_inconsistent)
3353 << FoundMethod->getReturnType();
3354 Importer.
ToDiag(FoundMethod->getLocation(),
3355 diag::note_odr_objc_method_here)
3361 if (D->
param_size() != FoundMethod->param_size()) {
3362 Importer.
ToDiag(Loc, diag::err_odr_objc_method_num_params_inconsistent)
3364 << D->
param_size() << FoundMethod->param_size();
3365 Importer.
ToDiag(FoundMethod->getLocation(),
3366 diag::note_odr_objc_method_here)
3373 PEnd = D->
param_end(), FoundP = FoundMethod->param_begin();
3374 P != PEnd; ++
P, ++FoundP) {
3376 (*FoundP)->getType())) {
3377 Importer.
FromDiag((*P)->getLocation(),
3378 diag::err_odr_objc_method_param_type_inconsistent)
3380 << (*P)->getType() << (*FoundP)->getType();
3381 Importer.
ToDiag((*FoundP)->getLocation(), diag::note_odr_value_here)
3382 << (*FoundP)->getType();
3389 if (D->
isVariadic() != FoundMethod->isVariadic()) {
3390 Importer.
ToDiag(Loc, diag::err_odr_objc_method_variadic_inconsistent)
3392 Importer.
ToDiag(FoundMethod->getLocation(),
3393 diag::note_odr_objc_method_here)
3399 return Importer.
Imported(D, FoundMethod);
3421 for (
auto *FromP : D->
params()) {
3426 ToParams.push_back(ToP);
3430 for (
unsigned I = 0, N = ToParams.size();
I != N; ++
I) {
3518 FromProto != FromProtoEnd;
3519 ++FromProto, ++FromProtoLoc) {
3521 = cast_or_null<ObjCProtocolDecl>(Importer.
Import(*FromProto));
3524 Protocols.push_back(ToProto);
3525 ProtocolLocs.push_back(Importer.
Import(*FromProtoLoc));
3542 = cast_or_null<ObjCCategoryImplDecl>(
3572 FromProto != FromProtoEnd;
3573 ++FromProto, ++FromProtoLoc) {
3575 = cast_or_null<ObjCProtocolDecl>(Importer.
Import(*FromProto));
3578 Protocols.push_back(ToProto);
3579 ProtocolLocs.push_back(Importer.
Import(*FromProtoLoc));
3598 if (Definition && Definition != D) {
3599 Decl *ImportedDef = Importer.
Import(Definition);
3603 return Importer.
Imported(D, ImportedDef);
3619 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3623 if ((MergeWithProtocol = dyn_cast<ObjCProtocolDecl>(FoundDecls[
I])))
3670 Importer.
Imported(D, ToLinkageSpec);
3672 return ToLinkageSpec;
3682 FromSuper = cast_or_null<ObjCInterfaceDecl>(Importer.
Import(FromSuper));
3688 if ((
bool)FromSuper != (
bool)ToSuper ||
3691 diag::err_odr_objc_superclass_inconsistent)
3698 diag::note_odr_objc_missing_superclass);
3701 diag::note_odr_objc_superclass)
3705 diag::note_odr_objc_missing_superclass);
3733 FromProto != FromProtoEnd;
3734 ++FromProto, ++FromProtoLoc) {
3736 = cast_or_null<ObjCProtocolDecl>(Importer.
Import(*FromProto));
3739 Protocols.push_back(ToProto);
3740 ProtocolLocs.push_back(Importer.
Import(*FromProtoLoc));
3775 for (
auto fromTypeParam : *list) {
3776 auto toTypeParam = cast_or_null<ObjCTypeParamDecl>(
3777 Importer.
Import(fromTypeParam));
3781 toTypeParams.push_back(toTypeParam);
3785 Importer.
Import(list->getLAngleLoc()),
3787 Importer.
Import(list->getRAngleLoc()));
3795 if (Definition && Definition != D) {
3796 Decl *ImportedDef = Importer.
Import(Definition);
3800 return Importer.
Imported(D, ImportedDef);
3817 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3821 if ((MergeWithIface = dyn_cast<ObjCInterfaceDecl>(FoundDecls[
I])))
3897 Super = cast_or_null<ObjCInterfaceDecl>(
3937 diag::err_odr_objc_superclass_inconsistent)
3943 diag::note_odr_objc_superclass)
3947 diag::note_odr_objc_missing_superclass);
3950 diag::note_odr_objc_superclass)
3954 diag::note_odr_objc_missing_superclass);
3979 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3981 = dyn_cast<ObjCPropertyDecl>(FoundDecls[
I])) {
3984 FoundProp->getType())) {
3985 Importer.
ToDiag(Loc, diag::err_odr_objc_property_type_inconsistent)
3986 << Name << D->
getType() << FoundProp->getType();
3987 Importer.
ToDiag(FoundProp->getLocation(), diag::note_odr_value_here)
3988 << FoundProp->getType();
4057 Ivar = cast_or_null<ObjCIvarDecl>(
4081 diag::err_odr_objc_property_impl_kind_inconsistent)
4086 diag::note_odr_objc_property_impl_kind)
4096 diag::err_odr_objc_synthesize_ivar_inconsistent)
4101 diag::note_odr_objc_synthesize_ivar_here)
4173 if (!TemplateParams)
4198 return Importer.
Imported(D, ImportedDef);
4216 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
4220 Decl *Found = FoundDecls[
I];
4222 = dyn_cast<ClassTemplateDecl>(Found)) {
4228 FoundTemplate->getTemplatedDecl());
4229 return Importer.
Imported(D, FoundTemplate);
4233 ConflictingDecls.push_back(FoundDecls[
I]);
4236 if (!ConflictingDecls.empty()) {
4238 ConflictingDecls.data(),
4239 ConflictingDecls.size());
4253 DC, StartLoc, IdLoc,
4262 if (!TemplateParams)
4266 Loc,
Name, TemplateParams,
4269 D2Templated->setDescribedClassTemplate(D2);
4277 Importer.
Imported(DTemplated, D2Templated);
4280 !D2Templated->isCompleteDefinition()) {
4293 if (Definition && Definition != D) {
4294 Decl *ImportedDef = Importer.
Import(Definition);
4298 return Importer.
Imported(D, ImportedDef);
4302 = cast_or_null<ClassTemplateDecl>(Importer.
Import(
4331 void *InsertPos =
nullptr;
4345 return Importer.
Imported(D, FoundDef);
4354 TemplateArgs.data(),
4355 TemplateArgs.size(),
4360 ClassTemplate->AddSpecialization(D2, InsertPos);
4389 return Importer.
Imported(D, ImportedDef);
4404 "Variable templates cannot be declared at function scope");
4408 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
4412 Decl *Found = FoundDecls[
I];
4413 if (
VarTemplateDecl *FoundTemplate = dyn_cast<VarTemplateDecl>(Found)) {
4417 FoundTemplate->getTemplatedDecl());
4418 return Importer.
Imported(D, FoundTemplate);
4422 ConflictingDecls.push_back(FoundDecls[
I]);
4425 if (!ConflictingDecls.empty()) {
4427 ConflictingDecls.data(),
4428 ConflictingDecls.size());
4462 if (!TemplateParams)
4475 Importer.
Imported(DTemplated, D2Templated);
4491 if (Definition && Definition != D) {
4492 Decl *ImportedDef = Importer.
Import(Definition);
4496 return Importer.
Imported(D, ImportedDef);
4527 void *InsertPos =
nullptr;
4529 TemplateArgs, InsertPos);
4542 return Importer.
Imported(D, FoundDef);
4555 Importer.
getToContext(), DC, StartLoc, IdLoc, VarTemplate, T, TInfo,
4561 VarTemplate->AddSpecialization(D2, InsertPos);
4585 size_t NumDecls = DG.
end() - DG.
begin();
4587 auto &_Importer = this->Importer;
4588 std::transform(DG.
begin(), DG.
end(), ToDecls.begin(),
4590 return _Importer.Import(D);
4598 Importer.
FromDiag(S->getLocStart(), diag::err_unsupported_ast_node)
4599 << S->getStmtClassName();
4605 for (
Decl *ToD : ToDG) {
4622 auto &_Importer = this->Importer;
4625 return _Importer.Import(CS);
4627 for (
Stmt *ToS : ToStmts) {
4635 ToLBraceLoc, ToRBraceLoc);
4643 if (!ToRHS && S->
getRHS())
4649 ToCaseLoc, ToEllipsisLoc,
4667 if (!ToLabelDecl && S->
getDecl())
4681 std::transform(FromAttrs.begin(), FromAttrs.end(), ToAttrs.begin(),
4682 [&_ToContext](
const Attr *A) ->
const Attr * {
4683 return A->
clone(_ToContext);
4685 for (
const Attr *ToA : ToAttrs) {
4693 ToAttrs, ToSubStmt);
4698 VarDecl *ToConditionVariable =
nullptr;
4700 ToConditionVariable =
4701 dyn_cast_or_null<VarDecl>(Importer.
Import(FromConditionVariable));
4702 if (!ToConditionVariable)
4706 if (!ToCondition && S->
getCond())
4709 if (!ToThenStmt && S->
getThen())
4713 if (!ToElseStmt && S->
getElse())
4716 ToIfLoc, ToConditionVariable,
4717 ToCondition, ToThenStmt,
4718 ToElseLoc, ToElseStmt);
4722 VarDecl *ToConditionVariable =
nullptr;
4724 ToConditionVariable =
4725 dyn_cast_or_null<VarDecl>(Importer.
Import(FromConditionVariable));
4726 if (!ToConditionVariable)
4730 if (!ToCondition && S->
getCond())
4747 if (LastChainedSwitchCase)
4751 LastChainedSwitchCase = ToSC;
4757 VarDecl *ToConditionVariable =
nullptr;
4759 ToConditionVariable =
4760 dyn_cast_or_null<VarDecl>(Importer.
Import(FromConditionVariable));
4761 if (!ToConditionVariable)
4765 if (!ToCondition && S->
getCond())
4772 ToConditionVariable,
4773 ToCondition, ToBody,
4782 if (!ToCondition && S->
getCond())
4788 ToDoLoc, ToWhileLoc,
4797 if (!ToCondition && S->
getCond())
4799 VarDecl *ToConditionVariable =
nullptr;
4801 ToConditionVariable =
4802 dyn_cast_or_null<VarDecl>(Importer.
Import(FromConditionVariable));
4803 if (!ToConditionVariable)
4807 if (!ToInc && S->
getInc())
4816 ToInit, ToCondition,
4817 ToConditionVariable,
4819 ToForLoc, ToLParenLoc,
4826 ToLabel = dyn_cast_or_null<LabelDecl>(Importer.
Import(FromLabel));
4833 ToGotoLoc, ToLabelLoc);
4862 VarDecl *ToNRVOCandidate = cast_or_null<VarDecl>(Importer.
Import(NRVOCandidate));
4863 if (!ToNRVOCandidate && NRVOCandidate)
4871 VarDecl *ToExceptionDecl =
nullptr;
4874 dyn_cast_or_null<VarDecl>(Importer.
Import(FromExceptionDecl));
4875 if (!ToExceptionDecl)
4892 for (
unsigned HI = 0, HE = S->
getNumHandlers(); HI != HE; ++HI) {
4894 if (
Stmt *ToHandler = Importer.
Import(FromHandler))
4895 ToHandlers[HI] = ToHandler;
4916 if (!ToInc && S->
getInc())
4932 ToForLoc, ToCoawaitLoc,
4933 ToColonLoc, ToRParenLoc);
4957 VarDecl *ToExceptionDecl =
nullptr;
4960 dyn_cast_or_null<VarDecl>(Importer.
Import(FromExceptionDecl));
4961 if (!ToExceptionDecl)
4990 if (
Stmt *ToCatchStmt = Importer.
Import(FromCatchStmt))
4991 ToCatchStmts[CI] = ToCatchStmt;
4999 ToAtTryLoc, ToAtTryStmt,
5000 ToCatchStmts.begin(), ToCatchStmts.size(),
5015 ToAtSynchronizedLoc, ToSynchExpr, ToSynchBody);
5040 Importer.
FromDiag(E->getLocStart(), diag::err_unsupported_ast_node)
5041 << E->getStmtClassName();
5141 SubExpr, ResultType,
5172 if (CompLHSType.
isNull())
5176 if (CompResultType.
isNull())
5191 CompLHSType, CompResultType,
5239 SubExpr, &BasePath, TInfo,
5259 return _Importer.
Import(AE);
5261 for (
Expr *ToA : ToArgs) {
5307 ToMember, ToFoundDecl, ToMemberNameInfo,
5325 for (
unsigned ai = 0, ae = NumArgs; ai != ae; ++ai) {
5336 for (
unsigned ai = 0, ae = NumArgs; ai != ae; ++ai)
5337 ToArgs_Copied[ai] = ToArgs[ai];
5341 llvm::makeArrayRef(ToArgs_Copied, NumArgs), T, E->
getValueKind(),
5348 : ToContext(ToContext), FromContext(FromContext),
5349 ToFileManager(ToFileManager), FromFileManager(FromFileManager),
5350 Minimal(MinimalImport), LastDiagFromFrom(
false)
5366 = ImportedTypes.find(fromTy);
5367 if (Pos != ImportedTypes.end())
5398 if (Pos != ImportedDecls.end()) {
5399 Decl *ToD = Pos->second;
5415 if (Pos != ImportedDecls.end()) {
5416 Decl *ToD = Pos->second;
5427 ImportedDecls[FromD] = ToD;
5429 if (
TagDecl *FromTag = dyn_cast<TagDecl>(FromD)) {
5431 if (FromTag->getTypedefNameForAnonDecl())
5432 AnonTagsWithPendingTypedefs.push_back(FromTag);
5433 }
else if (
TypedefNameDecl *FromTypedef = dyn_cast<TypedefNameDecl>(FromD)) {
5437 FromTag = AnonTagsWithPendingTypedefs.begin(),
5438 FromTagEnd = AnonTagsWithPendingTypedefs.end();
5439 FromTag != FromTagEnd; ++FromTag) {
5440 if ((*FromTag)->getTypedefNameForAnonDecl() == FromTypedef) {
5441 if (
TagDecl *ToTag = cast_or_null<TagDecl>(
Import(*FromTag))) {
5443 ToTag->setTypedefNameForAnonDecl(cast<TypedefNameDecl>(ToD));
5444 AnonTagsWithPendingTypedefs.erase(FromTag);
5464 if (
RecordDecl *ToRecord = dyn_cast<RecordDecl>(ToDC)) {
5465 RecordDecl *FromRecord = cast<RecordDecl>(FromDC);
5466 if (ToRecord->isCompleteDefinition()) {
5474 }
else if (
EnumDecl *ToEnum = dyn_cast<EnumDecl>(ToDC)) {
5475 EnumDecl *FromEnum = cast<EnumDecl>(FromDC);
5476 if (ToEnum->isCompleteDefinition()) {
5486 if (ToClass->getDefinition()) {
5496 if (ToProto->getDefinition()) {
5513 return cast_or_null<Expr>(
Import(cast<Stmt>(FromE)));
5522 if (Pos != ImportedStmts.end())
5527 Stmt *ToS = Importer.Visit(FromS);
5532 ImportedStmts[FromS] = ToS;
5577 bool bTemplate = FromNNS->
getKind() ==
5586 llvm_unreachable(
"Invalid nested name specifier kind");
5607 E = FromStorage->
end();
5665 = cast_or_null<TemplateTemplateParmDecl>(
5680 llvm_unreachable(
"Invalid template name kind");
5709 = ImportedFileIDs.find(FromID);
5710 if (Pos != ImportedFileIDs.end())
5716 assert(FromSLoc.
isFile() &&
"Cannot handle macro expansions yet");
5724 if (Cache->OrigEntry && Cache->OrigEntry->getDir()) {
5729 const FileEntry *Entry = ToFileManager.
getFile(Cache->OrigEntry->getName());
5736 const llvm::MemoryBuffer *
5737 FromBuf = Cache->getBuffer(FromContext.
getDiagnostics(), FromSM);
5738 std::unique_ptr<llvm::MemoryBuffer> ToBuf
5739 = llvm::MemoryBuffer::getMemBufferCopy(FromBuf->getBuffer(),
5740 FromBuf->getBufferIdentifier());
5746 ImportedFileIDs[FromID] = ToID;
5755 if (
DeclContext *FromDC = cast<DeclContext>(From)) {
5758 if (
RecordDecl *ToRecord = dyn_cast<RecordDecl>(To)) {
5759 if (!ToRecord->getDefinition()) {
5766 if (
EnumDecl *ToEnum = dyn_cast<EnumDecl>(To)) {
5767 if (!ToEnum->getDefinition()) {
5775 if (!ToIFace->getDefinition()) {
5783 if (!ToProto->getDefinition()) {
5847 llvm_unreachable(
"Invalid DeclarationName Kind!");
5872 unsigned NumDecls) {
5877 if (LastDiagFromFrom)
5880 LastDiagFromFrom =
false;
5885 if (!LastDiagFromFrom)
5888 LastDiagFromFrom =
true;
5894 if (!
ID->getDefinition())
5895 ID->startDefinition();
5898 if (!PD->getDefinition())
5899 PD->startDefinition();
5901 else if (
TagDecl *TD = dyn_cast<TagDecl>(D)) {
5902 if (!TD->getDefinition() && !TD->isBeingDefined()) {
5903 TD->startDefinition();
5904 TD->setCompleteDefinition(
true);
5908 assert (0 &&
"CompleteDecl called on a Decl that can't be completed");
5913 ImportedDecls[From] = To;
5924 StructuralEquivalenceContext Ctx(FromContext, ToContext, NonEquivalentDecls,
5926 return Ctx.IsStructurallyEquivalent(From, To);
unsigned getNumElements() const
static NamespaceDecl * Create(ASTContext &C, DeclContext *DC, bool Inline, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, NamespaceDecl *PrevDecl)
param_const_iterator param_begin() const
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
SourceRange getParenOrBraceRange() const
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs=llvm::None)
Sets the method's parameters and selector source locations.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType) const
Defines the clang::ASTContext interface.
QualType getExceptionType(unsigned i) const
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
SourceLocation getEnd() const
const SwitchCase * getNextSwitchCase() const
void setOwningFunction(DeclContext *FD)
setOwningFunction - Sets the function declaration that owns this ParmVarDecl.
Expr * getSizeExpr() const
QualType getUnderlyingType() const
TemplateParameterList * ImportTemplateParameterList(TemplateParameterList *Params)
Stmt * VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S)
Qualifiers getLocalQualifiers() const
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifie...
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
CastKind getCastKind() const
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
static unsigned getFieldIndex(Decl *F)
void setImplicit(bool I=true)
Decl * VisitCXXMethodDecl(CXXMethodDecl *D)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
QualType VisitVectorType(const VectorType *T)
Decl * VisitEnumDecl(EnumDecl *D)
unsigned getDepth() const
bool isMinimalImport() const
Whether the importer will perform a minimal import, creating to-be-completed forward declarations whe...
Stmt * VisitDoStmt(DoStmt *S)
const DeclGroupRef getDeclGroup() const
Smart pointer class that efficiently represents Objective-C method names.
This is a discriminated union of FileInfo and ExpansionInfo.
void setAnonymousStructOrUnion(bool Anon)
PointerType - C99 6.7.5.1 - Pointer Declarators.
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
A (possibly-)qualified type.
ImplementationControl getImplementationControl() const
QualType VisitDecltypeType(const DecltypeType *T)
TemplateName getReplacement() const
SourceRange getBracketsRange() const
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
Stmt * VisitCaseStmt(CaseStmt *S)
ObjCInterfaceDecl * getClassInterface()
Implements support for file system lookup, file system caching, and directory search management...
void startDefinition()
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...
bool isBitField() const
Determines whether this field is a bitfield.
bool hasLeadingEmptyMacro() const
SourceLocation getLParenLoc() const
ObjCTypeParamList * ImportObjCTypeParamList(ObjCTypeParamList *list)
QualType getType() const
Retrieves the type of the base class.
bool isElidable() const
Whether this construction is elidable.
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
Defines the clang::FileManager interface and associated types.
protocol_iterator protocol_end() const
QualType getComplexType(QualType T) const
Return the uniqued reference to the type for a complex number with the specified element type...
Stmt * VisitObjCAtCatchStmt(ObjCAtCatchStmt *S)
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
Decl * VisitDecl(Decl *D)
bool isKindOfTypeAsWritten() const
Whether this is a "__kindof" type as written.
PropertyControl getPropertyImplementation() const
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
static CXXConstructExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, CXXConstructorDecl *D, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Stmt * VisitContinueStmt(ContinueStmt *S)
CharacterKind getKind() const
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID. ...
SourceLocation getCXXLiteralOperatorNameLoc() const
getCXXLiteralOperatorNameLoc - Returns the location of the literal operator name (not the operator ke...
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
bool isParameterPack() const
Returns whether this is a parameter pack.
FunctionType - C99 6.7.5.3 - Function Declarators.
CXXCatchStmt * getHandler(unsigned i)
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
bool IsICE
Whether this statement is an integral constant expression, or in C++11, whether the statement is a co...
const Expr * getInitExpr() const
bool isArgumentType() const
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
IfStmt - This represents an if/then/else.
ClassTemplateSpecializationDecl * findSpecialization(ArrayRef< TemplateArgument > Args, void *&InsertPos)
Return the specialization with the provided arguments if it exists, otherwise return the insertion po...
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type...
Expr * VisitImplicitCastExpr(ImplicitCastExpr *E)
IdentifierInfo * getCXXLiteralIdentifier() const
getCXXLiteralIdentifier - If this name is the name of a literal operator, retrieve the identifier ass...
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
Expr * VisitCXXConstructExpr(CXXConstructExpr *E)
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
Defines the SourceManager interface.
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
Expr * VisitBinaryOperator(BinaryOperator *E)
Represents a qualified type name for which the type name is dependent.
The template argument is an expression, and we've not resolved it to one of the other forms yet...
QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
Unary type transforms.
SourceLocation getForLoc() const
static TemplateTemplateParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D, unsigned P, bool ParameterPack, IdentifierInfo *Id, TemplateParameterList *Params)
CXXRecordDecl * getTemplatedDecl() const
Get the underlying class declarations of the template.
QualType getUnderlyingType() const
Decl - This represents one declaration (or definition), e.g.
AccessSpecifier getAccess() const
DeclGroupRef ImportDeclGroup(DeclGroupRef DG)
chain_range chain() const
VarDecl * getDefinition(ASTContext &)
Get the real (not just tentative) definition for this declaration.
Represents a C++11 auto or C++14 decltype(auto) type.
void setPure(bool P=true)
Represents an attribute applied to a statement.
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
ParenExpr - This represents a parethesized expression, e.g.
static ObjCPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type...
TemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon, QualType Aliased)
QualType getPointeeType() const
IdentifierInfo * getAsIdentifierInfo() const
getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in this declaration name, or NULL if this declaration name isn't a simple identifier.
The base class of the type hierarchy.
static ClassTemplateSpecializationDecl * Create(ASTContext &Context, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, ClassTemplateDecl *SpecializedTemplate, const TemplateArgument *Args, unsigned NumArgs, ClassTemplateSpecializationDecl *PrevDecl)
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
enumerator_iterator enumerator_end() const
Represents Objective-C's @throw statement.
QualType VisitTemplateSpecializationType(const TemplateSpecializationType *T)
DependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, unsigned NumArgs, const TemplateArgument *Args, QualType Canon)
QualType getRecordType(const RecordDecl *Decl) const
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Declaration of a variable template.
SourceLocation getIfLoc() const
TemplateTemplateParmDecl * getParameterPack() const
Retrieve the template template parameter pack being substituted.
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
NamespaceDecl - Represent a C++ namespace.
protocol_loc_iterator protocol_loc_begin() const
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
Represents a call to a C++ constructor.
SourceLocation getCoawaitLoc() const
RetTy Visit(const Type *T)
Performs the operation associated with this visitor object.
void setSpecializationKind(TemplateSpecializationKind TSK)
virtual void completeDefinition()
completeDefinition - Notes that the definition of this type is now complete.
NamedDecl * getParam(unsigned Idx)
Decl * VisitFieldDecl(FieldDecl *D)
A container of type source information.
RefQualifierKind RefQualifier
void setSwitchCaseList(SwitchCase *SC)
Set the case list for this switch statement.
const Stmt * getElse() const
unsigned getIndex() const
Decl * VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
SourceLocation getOperatorLoc() const
Expr * getAsExpr() const
Retrieve the template argument as an expression.
void setTemplateArgsInfo(const TemplateArgumentListInfo &ArgsInfo)
ObjCProtocolList::iterator protocol_iterator
enumerator_iterator enumerator_begin() const
const TemplateArgument & get(unsigned Idx) const
Retrieve the template argument at a given index.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
SourceLocation getLocEnd() const LLVM_READONLY
void localUncachedLookup(DeclarationName Name, SmallVectorImpl< NamedDecl * > &Results)
A simplistic name lookup mechanism that performs name lookup into this declaration context without co...
Represents a C++ constructor within a class.
bool isSpelledAsLValue() const
A template template parameter that has been substituted for some other template name.
Expr * getInClassInitializer() const
getInClassInitializer - Get the C++11 in-class initializer for this member, or null if one has not be...
InClassInitStyle getInClassInitStyle() const
getInClassInitStyle - Get the kind of (C++11) in-class initializer which this field has...
bool hasExplicitTemplateArgs() const
Determines whether the member name was followed by an explicit template argument list.
const llvm::APInt & getSize() const
protocol_loc_iterator protocol_loc_begin() const
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
SourceLocation getIncludeLoc() const
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
CharacteristicKind getFileCharacteristic() const
Return whether this is a system header or not.
An identifier, stored as an IdentifierInfo*.
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
QualType VisitPointerType(const PointerType *T)
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
virtual Decl * GetOriginalDecl(Decl *To)
Called by StructuralEquivalenceContext.
void setImplementation(ObjCCategoryImplDecl *ImplD)
SourceLocation getReturnLoc() const
static CXXConversionDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isExplicit, bool isConstexpr, SourceLocation EndLocation)
bool isFileVarDecl() const
isFileVarDecl - Returns true for file scoped variable declaration.
static NestedNameSpecifier * Create(const ASTContext &Context, NestedNameSpecifier *Prefix, IdentifierInfo *II)
Builds a specifier combining a prefix and an identifier.
unsigned getIndex() const
Retrieve the index into its type parameter list.
void setCXXLiteralOperatorNameLoc(SourceLocation Loc)
setCXXLiteralOperatorNameLoc - Sets the location of the literal operator name (not the operator keywo...
const Expr * getCallee() const
Stmt * VisitLabelStmt(LabelStmt *S)
SourceLocation getIvarRBraceLoc() const
Expr * VisitIntegerLiteral(IntegerLiteral *E)
Represents an empty template argument, e.g., one that has not been deduced.
Extra information about a function prototype.
AccessSpecifier getAccess() const
AutoTypeKeyword getKeyword() const
TypeSourceInfo * getSuperClassTInfo() const
field_iterator field_begin() const
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
SourceLocation getLocation() const
Retrieve the location of the literal.
Decl * VisitVarDecl(VarDecl *D)
A namespace, stored as a NamespaceDecl*.
DiagnosticBuilder ToDiag(SourceLocation Loc, unsigned DiagID)
Report a diagnostic in the "to" context.
SourceLocation getDoLoc() const
UnaryExprOrTypeTrait getKind() const
Expr * VisitUnaryOperator(UnaryOperator *E)
Stores a list of template parameters for a TemplateDecl and its derived classes.
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
static bool ImportCastPath(CastExpr *E, CXXCastPath &Path)
QualType Import(QualType FromT)
Import the given type from the "from" context into the "to" context.
Qualifiers getIndexTypeQualifiers() const
unsigned param_size() const
unsigned getValue() const
TemplateTemplateParmDecl * getParameter() const
ParmVarDecl - Represents a parameter to a function.
Represents the result of substituting a type for a template type parameter.
bool ImportTemplateArguments(const TemplateArgument *FromArgs, unsigned NumFromArgs, SmallVectorImpl< TemplateArgument > &ToArgs)
SourceLocation getDefaultLoc() const
SourceLocation getLocation() const
SourceLocation getEllipsisLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the category interface associated with this implementat...
TypeSourceInfo * getTypeSourceInfo() const
EvaluatedStmt * ensureEvaluatedStmt() const
Convert the initializer for this declaration to the elaborated EvaluatedStmt form, which contains extra information on the evaluated value of the initializer.
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
bool hasExternalFormalLinkage() const
True if this decl has external linkage.
LabelStmt - Represents a label, which has a substatement.
unsigned getNumParams() const
Kind getPropertyImplementation() const
RecordDecl - Represents a struct/union/class.
ObjCProtocolList::iterator protocol_iterator
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class. ...
Decl * VisitObjCCategoryDecl(ObjCCategoryDecl *D)
QualType VisitBlockPointerType(const BlockPointerType *T)
virtual DeclarationName HandleNameConflict(DeclarationName Name, DeclContext *DC, unsigned IDNS, NamedDecl **Decls, unsigned NumDecls)
Cope with a name conflict when importing a declaration into the given context.
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
QualType getElementType() const
DeclarationName getName() const
getName - Returns the embedded declaration name.
FunctionType::ExtInfo ExtInfo
One of these records is kept for each identifier that is lexed.
Represents a class template specialization, which refers to a class template with a given set of temp...
void setIntegerType(QualType T)
Set the underlying integer type.
unsigned getIndexTypeCVRQualifiers() const
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Decl * VisitTypedefDecl(TypedefDecl *D)
DiagnosticBuilder FromDiag(SourceLocation Loc, unsigned DiagID)
Report a diagnostic in the "from" context.
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
Decl * VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
Expr * VisitCompoundAssignOperator(CompoundAssignOperator *E)
Represents a class type in Objective C.
static RecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, RecordDecl *PrevDecl=nullptr)
Expr * getSizeExpr() const
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
Represents a dependent template name that cannot be resolved prior to template instantiation.
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
bool CheckedICE
Whether we already checked whether this statement was an integral constant expression.
bool isIdentifier() const
Determine whether this template name refers to an identifier.
Decl * VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
QualType VisitMemberPointerType(const MemberPointerType *T)
SourceLocation getLocStart() const LLVM_READONLY
protocol_iterator protocol_begin() const
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size...
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this class.
QualType VisitParenType(const ParenType *T)
bool isPure() const
Whether this virtual function is pure, i.e.
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
void startDefinition()
Starts the definition of this tag declaration.
void setSuperClass(TypeSourceInfo *superClass)
SourceLocation getCaseLoc() const
CXXRecordDecl * getDefinition() const
unsigned size() const
Retrieve the number of template arguments in this template argument list.
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
TagKind getTagKind() const
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
Represents the result of substituting a set of types for a template type parameter pack...
static DeclRefExpr * Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *D, bool RefersToEnclosingVariableOrCapture, SourceLocation NameLoc, QualType T, ExprValueKind VK, NamedDecl *FoundD=nullptr, const TemplateArgumentListInfo *TemplateArgs=nullptr)
QualType getTypeOfType(QualType t) const
getTypeOfType - Unlike many "get<Type>" functions, we don't unique TypeOfType nodes...
Expr * VisitExpr(Expr *E)
Decl * VisitObjCImplementationDecl(ObjCImplementationDecl *D)
SourceLocation getLBracLoc() const
void startDefinition()
Starts the definition of this Objective-C protocol.
bool isNull() const
Determine whether this is the empty selector.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
QualType VisitObjCInterfaceType(const ObjCInterfaceType *T)
SourceLocation getRParenLoc() const
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
QualType getUnderlyingType() const
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
QualType VisitComplexType(const ComplexType *T)
SourceLocation getCategoryNameLoc() const
bool isFPContractable() const
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Expr * getUnderlyingExpr() const
const VarDecl * getCatchParamDecl() const
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
SourceLocation getWhileLoc() const
Represents Objective-C's @catch statement.
const CompoundStmt * getSynchBody() const
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
IndirectGotoStmt - This represents an indirect goto.
QualType VisitVariableArrayType(const VariableArrayType *T)
Stmt * VisitBreakStmt(BreakStmt *S)
Decl * VisitCXXConstructorDecl(CXXConstructorDecl *D)
TemplateArgument getArgumentPack() const
An rvalue reference type, per C++11 [dcl.ref].
param_type_range param_types() const
SourceLocation getLAngleLoc() const
QualType getParenType(QualType NamedType) const
const Stmt * getFinallyBody() const
ForStmt - This represents a 'for (init;cond;inc)' stmt.
A qualified template name, where the qualification is kept to describe the source code as written...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
SourceLocation getLocWithOffset(int Offset) const
Return a source location with the specified offset from this SourceLocation.
static ObjCInterfaceDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, ObjCTypeParamList *typeParamList, ObjCInterfaceDecl *PrevDecl, SourceLocation ClassLoc=SourceLocation(), bool isInternal=false)
QualType VisitElaboratedType(const ElaboratedType *T)
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
const LangOptions & getLangOpts() const
Stmt * VisitAttributedStmt(AttributedStmt *S)
Namespaces, declared with 'namespace foo {}'.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isInline() const
Returns true if this is an inline namespace declaration.
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
void setCXXOperatorNameRange(SourceRange R)
setCXXOperatorNameRange - Sets the range of the operator name (without the operator keyword)...
SourceLocation getIvarLBraceLoc() const
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
static ObjCCategoryDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation AtLoc, SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc, IdentifierInfo *Id, ObjCInterfaceDecl *IDecl, ObjCTypeParamList *typeParamList, SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
QualType getBaseType() const
Gets the base type of this object type.
SourceLocation getAtFinallyLoc() const
static ObjCPropertyImplDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, Kind PK, ObjCIvarDecl *ivarDecl, SourceLocation ivarLoc)
protocol_iterator protocol_end() const
QualType getReturnType() const
static EnumConstantDecl * Create(ASTContext &C, EnumDecl *DC, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *E, const llvm::APSInt &V)
SourceLocation getRParenLoc() const
Stmt * getHandlerBlock() const
SourceLocation getLParen() const
Get the location of the left parentheses '('.
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
TemplateName getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param, TemplateName replacement) const
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
Decl * VisitObjCPropertyDecl(ObjCPropertyDecl *D)
Represents a typeof (or typeof) expression (a GCC extension).
Expr * VisitCharacterLiteral(CharacterLiteral *E)
static TemplateTypeParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation KeyLoc, SourceLocation NameLoc, unsigned D, unsigned P, IdentifierInfo *Id, bool Typename, bool ParameterPack)
Expr * getNoexceptExpr() const
A builtin binary operation expression such as "x + y" or "x <= y".
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
RecordDecl * getDecl() const
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef< Stmt * > handlers)
Decl * VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Selector getSetterName() const
Stmt * VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S)
SourceLocation getThrowLoc()
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
void setSpecializationKind(TemplateSpecializationKind TSK)
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
const Stmt * getCatchBody() const
Decl * VisitObjCProtocolDecl(ObjCProtocolDecl *D)
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
TypeClass getTypeClass() const
Represents an Objective-C protocol declaration.
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
bool IsStructurallyEquivalent(QualType From, QualType To, bool Complain=true)
Determine whether the given types are structurally equivalent.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
static VarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S)
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value 'V' and type 'type'.
Stmt * VisitNullStmt(NullStmt *S)
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
Stmt * VisitCXXCatchStmt(CXXCatchStmt *S)
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
Represents an ObjC class declaration.
SourceLocation getLocEnd() const LLVM_READONLY
Represents a linkage specification.
Expr * VisitCStyleCastExpr(CStyleCastExpr *E)
Stmt * VisitCXXTryStmt(CXXTryStmt *S)
detail::InMemoryDirectory::const_iterator I
PropertyAttributeKind getPropertyAttributes() const
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
bool ImportDefinition(RecordDecl *From, RecordDecl *To, ImportDefinitionKind Kind=IDK_Default)
ASTImporter(ASTContext &ToContext, FileManager &ToFileManager, ASTContext &FromContext, FileManager &FromFileManager, bool MinimalImport)
Create a new AST importer.
known_categories_range known_categories() const
CanQualType UnsignedCharTy
static FunctionDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation NLoc, DeclarationName N, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInlineSpecified=false, bool hasWrittenPrototype=true, bool isConstexprSpecified=false)
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getIvarLBraceLoc() const
Import the default subset of the definition, which might be nothing (if minimal import is set) or mig...
SourceLocation getSwitchLoc() const
void addDeclInternal(Decl *D)
Add the declaration D into this context, but suppress searches for external declarations with the sam...
SourceLocation getAtStartLoc() const
Stmt * VisitDeclStmt(DeclStmt *S)
ObjCProtocolDecl * getProtocol(unsigned I) const
Fetch a protocol by index.
Represents an extended vector type where either the type or size is dependent.
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
DiagnosticsEngine & getDiagnostics() const
field_iterator field_end() const
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
SourceLocation getAtLoc() const
EnumDecl * getDecl() const
QualType getTemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon=QualType()) const
Represents a K&R-style 'int foo()' function, which has no information available about its arguments...
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
SourceLocation getOperatorLoc() const LLVM_READONLY
Decl * VisitTypedefNameDecl(TypedefNameDecl *D, bool IsAlias)
Optional< unsigned > getNumTemplateExpansions() const
Retrieve the number of expansions that a template template argument expansion will produce...
const FileEntry * getFile(StringRef Filename, bool OpenFile=false, bool CacheFailure=true)
Lookup, cache, and verify the specified file (real or virtual).
void completeDefinition(QualType NewType, QualType PromotionType, unsigned NumPositiveBits, unsigned NumNegativeBits)
completeDefinition - When created, the EnumDecl corresponds to a forward-declared enum...
QualType getInjectedSpecializationType() const
Decl * VisitCXXDestructorDecl(CXXDestructorDecl *D)
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
SourceLocation getLocStart() const LLVM_READONLY
QualType VisitObjCObjectType(const ObjCObjectType *T)
ExtInfo getExtInfo() const
SourceLocation getTryLoc() const
QualType getObjCObjectType(QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
Legacy interface: cannot provide type arguments or __kindof.
llvm::APInt getValue() const
TypeAliasDecl - Represents the declaration of a typedef-name via a C++0x alias-declaration.
A little helper class used to produce diagnostics.
CompoundStmt - This represents a group of statements like { stmt stmt }.
QualType getParamType(unsigned i) const
Represents a prototype with parameter type info, e.g.
Decl * VisitRecordDecl(RecordDecl *D)
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
SourceLocation getLocStart() const LLVM_READONLY
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
Decl * VisitCXXConversionDecl(CXXConversionDecl *D)
static ImplicitCastExpr * Create(const ASTContext &Context, QualType T, CastKind Kind, Expr *Operand, const CXXCastPath *BasePath, ExprValueKind Cat)
DeclarationNameTable DeclarationNames
A dependent template name that has not been resolved to a template (or set of templates).
unsigned getChainingSize() const
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
protocol_loc_iterator protocol_loc_begin() const
NamedDecl * getDecl() const
Stmt * VisitObjCForCollectionStmt(ObjCForCollectionStmt *S)
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
ImportDefinitionKind
What we should import from the definition.
SourceLocation getSuperClassLoc() const
ID
Defines the set of possible language-specific address spaces.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
void setInClassInitializer(Expr *Init)
setInClassInitializer - Set the C++11 in-class initializer for this member.
SourceLocation getColonLoc() const
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl...
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
static NestedNameSpecifier * SuperSpecifier(const ASTContext &Context, CXXRecordDecl *RD)
Returns the nested name specifier representing the __super scope for the given CXXRecordDecl.
static CXXDestructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isImplicitlyDeclared)
Represents an array type in C++ whose size is a value-dependent expression.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
Expr * VisitParenExpr(ParenExpr *E)
LabelDecl * getDecl() const
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
QualType getPointeeType() const
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
Stmt * VisitGotoStmt(GotoStmt *S)
StringRef getName() const
Return the actual identifier string.
Decl * VisitEnumConstantDecl(EnumConstantDecl *D)
SourceLocation getRParenLoc() const
static ObjCMethodDecl * Create(ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc, Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance=true, bool isVariadic=false, bool isPropertyAccessor=false, bool isImplicitlyDeclared=false, bool isDefined=false, ImplementationControl impControl=None, bool HasRelatedResultType=false)
Stmt * VisitCXXForRangeStmt(CXXForRangeStmt *S)
unsigned getNumArgs() const
bool isEmpty() const
Evaluates true when this declaration name is empty.
Declaration of a template type parameter.
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "while" statement, if any.
FileID createFileID(const FileEntry *SourceFile, SourceLocation IncludePos, SrcMgr::CharacteristicKind FileCharacter, int LoadedID=0, unsigned LoadedOffset=0)
Create a new FileID that represents the specified file being #included from the specified IncludePosi...
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
ObjCIvarDecl * getPropertyIvarDecl() const
Expr * VisitDeclRefExpr(DeclRefExpr *E)
protocol_iterator protocol_begin() const
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
static ClassTemplateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl, ClassTemplateDecl *PrevDecl)
Create a class template node.
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
Retrieve the template name that corresponds to a non-empty lookup.
Expr * getBitWidth() const
static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, QualType T1, QualType T2)
Determine structural equivalence of two types.
SourceLocation getRParenLoc() const
bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord, bool Complain=true)
Represents a C++ destructor within a class.
TranslationUnitDecl * getTranslationUnitDecl() const
SourceLocation getGotoLoc() const
Expr * getUnderlyingExpr() const
void setRBraceLoc(SourceLocation L)
Stmt * VisitIfStmt(IfStmt *S)
QualType getNamedType() const
Retrieve the type named by the qualified-id.
ArgKind getKind() const
Return the kind of stored template argument.
SourceLocation getLocation() const
ExtProtoInfo getExtProtoInfo() const
Decl * VisitLinkageSpecDecl(LinkageSpecDecl *D)
static ObjCTypeParamDecl * Create(ASTContext &ctx, DeclContext *dc, ObjCTypeParamVariance variance, SourceLocation varianceLoc, unsigned index, SourceLocation nameLoc, IdentifierInfo *name, SourceLocation colonLoc, TypeSourceInfo *boundInfo)
DeclContext * getDeclContext()
A structure for storing the information associated with a substituted template template parameter...
QualType VisitFunctionNoProtoType(const FunctionNoProtoType *T)
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
ParmVarDecl *const * param_iterator
Represents Objective-C's @synchronized statement.
const char * getDeclKindName() const
void setGetterName(Selector Sel)
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
CXXTryStmt - A C++ try block, including all handlers.
protocol_iterator protocol_begin() const
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Represents a C++ template name within the type system.
Represents the type decltype(expr) (C++11).
QualType VisitConstantArrayType(const ConstantArrayType *T)
A namespace alias, stored as a NamespaceAliasDecl*.
void setImplementation(ObjCImplementationDecl *ImplD)
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
SourceLocation getEndLoc() const
Stmt * VisitObjCAtTryStmt(ObjCAtTryStmt *S)
const SwitchCase * getSwitchCaseList() const
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Expr * getSubExpr() const
SourceLocation getLabelLoc() const
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type...
bool isInstanceMethod() const
bool isFunctionOrMethod() const
void ImportDeclarationNameLoc(const DeclarationNameInfo &From, DeclarationNameInfo &To)
QualType getCXXNameType() const
getCXXNameType - If this name is one of the C++ names (of a constructor, destructor, or conversion function), return the type associated with that name.
Decl * GetAlreadyImportedOrNull(Decl *FromD)
Return the copy of the given declaration in the "to" context if it has already been imported from the...
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
const TemplateArgument * data() const
Retrieve a pointer to the template argument list.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Represents a GCC generic vector type.
An lvalue reference type, per C++11 [dcl.ref].
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Stmt * VisitReturnStmt(ReturnStmt *S)
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
static AttributedStmt * Create(const ASTContext &C, SourceLocation Loc, ArrayRef< const Attr * > Attrs, Stmt *SubStmt)
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
QualType getElementType() const
QualType getComputationLHSType() const
Represents a C++ conversion function within a class.
The result type of a method or function.
CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ [expr.cast]), which uses the syntax (Type)expr.
RecordDecl * getDefinition() const
getDefinition - Returns the RecordDecl that actually defines this struct/union/class.
A type, stored as a Type*.
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
SourceLocation getSemiLoc() const
TypeSourceInfo * getTypeSourceInfo() const
QualType getReplacementType() const
Gets the type that was substituted for the template parameter.
TypedefNameDecl * getTypedefNameForAnonDecl() const
const Expr * getAnyInitializer() const
getAnyInitializer - Get the initializer for this variable, no matter which declaration it is attached...
SourceLocation getAtLoc() const
TypeSourceInfo * getReturnTypeSourceInfo() const
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Decl * VisitObjCMethodDecl(ObjCMethodDecl *D)
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
static CXXRecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl=nullptr, bool DelayTypeCreation=false)
DoStmt - This represents a 'do/while' stmt.
ObjCCategoryDecl * getCategoryDecl() const
param_const_iterator param_end() const
QualType getComputationResultType() const
QualType VisitEnumType(const EnumType *T)
LabelDecl * getLabel() const
static TemplateParameterList * Create(const ASTContext &C, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef< NamedDecl * > Params, SourceLocation RAngleLoc)
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
Stmt * getBody(const FunctionDecl *&Definition) const
getBody - Retrieve the body (definition) of the function.
SourceLocation getOperatorLoc() const
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
A template template parameter pack that has been substituted for a template template argument pack...
ASTContext & getFromContext() const
Retrieve the context that AST nodes are being imported from.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
SourceLocation getGotoLoc() const
SourceLocation getExternLoc() const
SelectorTable & Selectors
Decl * VisitIndirectFieldDecl(IndirectFieldDecl *D)
ExceptionSpecificationType Type
The kind of exception specification this is.
Decl * VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
Encodes a location in the source.
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Determines whether this field is a representative for an anonymous struct ...
Sugar for parentheses used when specifying types.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
QualType VisitFunctionProtoType(const FunctionProtoType *T)
const TemplateArgument * iterator
QualType getElementType() const
unsigned getBitWidthValue(const ASTContext &Ctx) const
Represents typeof(type), a GCC extension.
Interfaces are the core concept in Objective-C for object oriented design.
const TemplateArgumentListInfo & getTemplateArgsInfo() const
QualType VisitBuiltinType(const BuiltinType *T)
SourceLocation getLocStart() const LLVM_READONLY
A structure for storing an already-substituted template template parameter pack.
static CXXConstructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isExplicit, bool isInline, bool isImplicitlyDeclared, bool isConstexpr)
OverloadedOperatorKind getCXXOverloadedOperator() const
getCXXOverloadedOperator - If this name is the name of an overloadable operator in C++ (e...
TagDecl - Represents the declaration of a struct/union/class/enum.
TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template apply...
static Optional< unsigned > findAnonymousStructOrUnionIndex(RecordDecl *Anon)
Find the index of the given anonymous struct/union within its context.
ASTContext & getASTContext() const LLVM_READONLY
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location, which defaults to the empty location.
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
static QualType getUnderlyingType(const SubRegion *R)
Decl * VisitTranslationUnitDecl(TranslationUnitDecl *D)
LabelDecl - Represents the declaration of a label.
void setPropertyAttributesAsWritten(PropertyAttributeKind PRVal)
const Expr * getCond() const
VectorKind getVectorKind() const
Cached information about one file (either on disk or in the virtual file system). ...
SourceLocation getIdentLoc() const
Decl * VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
Expr * VisitMemberExpr(MemberExpr *E)
bool getSynthesize() const
Represents a static or instance method of a struct/union/class.
unsigned getDepth() const
Retrieve the depth of the template parameter.
bool shouldForceImportDeclContext(ImportDefinitionKind IDK)
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
QualType getIncompleteArrayType(QualType EltTy, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return a unique reference to the type for an incomplete array of the specified element type...
Decl * VisitFunctionDecl(FunctionDecl *D)
ObjCCategoryDecl - Represents a category declaration.
const ObjCInterfaceDecl * getClassInterface() const
bool isPropertyAccessor() const
void addDecl(NamedDecl *D)
QualType VisitTypedefType(const TypedefType *T)
SourceLocation getContinueLoc() const
const FileInfo & getFile() const
Represents one property declaration in an Objective-C interface.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "switch" statement, if any.
TypedefNameDecl * getDecl() const
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
ASTNodeImporter(ASTImporter &Importer)
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Stmt * VisitForStmt(ForStmt *S)
unsigned getNumProtocols() const
Return the number of qualifying protocols in this interface type, or 0 if there are none...
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
A simple visitor class that helps create declaration visitors.
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
SourceLocation getBegin() const
QualType getReturnType() const
const T * castAs() const
Member-template castAs<specific type>.
QualType getAttributedType(AttributedType::Kind attrKind, QualType modifiedType, QualType equivalentType)
QualType VisitRecordType(const RecordType *T)
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent) const
C++11 deduced auto type.
Decl * VisitVarTemplateDecl(VarTemplateDecl *D)
Stmt * VisitCompoundStmt(CompoundStmt *S)
Stmt * VisitIndirectGotoStmt(IndirectGotoStmt *S)
Decl * VisitImplicitParamDecl(ImplicitParamDecl *D)
SourceLocation getAtSynchronizedLoc() const
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Stmt * VisitWhileStmt(WhileStmt *S)
Attr * clone(ASTContext &C) const
Expr * VisitCallExpr(CallExpr *E)
SourceLocation getCategoryNameLoc() const
QualType VisitObjCObjectPointerType(const ObjCObjectPointerType *T)
void setHasInheritedDefaultArg(bool I=true)
SourceLocation getForLoc() const
QualType getType() const
Return the type wrapped by this type source info.
SourceLocation getLParenLoc() const
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
static MemberExpr * Create(const ASTContext &C, Expr *base, bool isarrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *memberdecl, DeclAccessPair founddecl, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *targs, QualType ty, ExprValueKind VK, ExprObjectKind OK)
The injected class name of a C++ class template or class template partial specialization.
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
QualType getPointeeType() const
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
void setVirtualAsWritten(bool V)
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
static TypeAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
CompoundAssignOperator - For compound assignments (e.g.
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
A POD class for pairing a NamedDecl* with an access specifier.
const char * getTypeClassName() const
Expr * getSizeExpr() const
Base class for declarations which introduce a typedef-name.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Whether this is an anonymous struct or union.
Represents a template argument.
SourceLocation getLocation() const
QualType getMemberPointerType(QualType T, const Type *Cls) const
Return the uniqued reference to the type for a member pointer to the specified type in the specified ...
bool ImportDeclParts(NamedDecl *D, DeclContext *&DC, DeclContext *&LexicalDC, DeclarationName &Name, NamedDecl *&ToD, SourceLocation &Loc)
QualType getAsType() const
Retrieve the type for a type template argument.
static DeclGroupRef Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "if" statement, if any.
NonEquivalentDeclSet & getNonEquivalentDecls()
Return the set of declarations that we know are not equivalent.
Represents a template name that was expressed as a qualified name.
NullStmt - This is the null statement ";": C99 6.8.3p3.
Selector getObjCSelector() const
getObjCSelector - Get the Objective-C selector stored in this declaration name.
TemplateName getSubstTemplateTemplateParmPack(TemplateTemplateParmDecl *Param, const TemplateArgument &ArgPack) const
ObjCCategoryDecl * FindCategoryDeclaration(IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
static ParmVarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
static LinkageSpecDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation ExternLoc, SourceLocation LangLoc, LanguageIDs Lang, bool HasBraces)
virtual void CompleteDecl(Decl *D)
Called for ObjCInterfaceDecl, ObjCProtocolDecl, and TagDecl.
static const Type * getElementType(const Expr *BaseExpr)
SourceRange getCXXOperatorNameRange() const
getCXXOperatorNameRange - Gets the range of the operator name (without the operator keyword)...
SourceLocation getLParenLoc() const
ObjCCategoryImplDecl * getImplementation() const
void ImportDeclContext(DeclContext *FromDC, bool ForceImport=false)
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
static NonTypeTemplateParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, unsigned D, unsigned P, IdentifierInfo *Id, QualType T, bool ParameterPack, TypeSourceInfo *TInfo)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
SourceLocation getStarLoc() const
The base class of all kinds of template declarations (e.g., class, function, etc.).
TemplateArgument ImportTemplateArgument(const TemplateArgument &From)
QualType VisitIncompleteArrayType(const IncompleteArrayType *T)
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
virtual Decl * Imported(Decl *From, Decl *To)
Note that we have imported the "from" declaration by mapping it to the (potentially-newly-created) "t...
ObjCIvarDecl * getPropertyIvarDecl() const
const Stmt * getBody() const
SourceLocation getLocStart() const LLVM_READONLY
QualType getPromotionType() const
getPromotionType - Return the integer type that enumerators should promote to.
The template argument is a pack expansion of a template name that was provided for a template templat...
QualType VisitAttributedType(const AttributedType *T)
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
static bool IsArrayStructurallyEquivalent(StructuralEquivalenceContext &Context, const ArrayType *Array1, const ArrayType *Array2)
Determine structural equivalence for the common part of array types.
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
QualType getEquivalentType() const
const llvm::APSInt & getInitVal() const
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
bool isParameterPack() const
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
SourceLocation getPropertyIvarDeclLoc() const
bool hasWrittenPrototype() const
const ContentCache * getContentCache() const
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
DeclarationName - The name of a declaration.
Represents the declaration of an Objective-C type parameter.
const Expr * getSynchExpr() const
Expr * VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E)
unsigned getNumHandlers() const
Selector getGetterName() const
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
DefinitionKind isThisDeclarationADefinition(ASTContext &) const
Check whether this declaration is a definition.
bool isUsed(bool CheckUsedAttr=true) const
Whether this declaration was used, meaning that a definition is required.
static ObjCImplementationDecl * Create(ASTContext &C, DeclContext *DC, ObjCInterfaceDecl *classInterface, ObjCInterfaceDecl *superDecl, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation superLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
Decl * VisitClassTemplateDecl(ClassTemplateDecl *D)
A set of unresolved declarations.
SourceLocation getWhileLoc() const
SourceLocation getLocStart() const LLVM_READONLY
bool isNull() const
Determine whether this template argument has no value.
EnumDecl - Represents an enum.
detail::InMemoryDirectory::const_iterator E
A pointer to member type per C++ 8.3.3 - Pointers to members.
QualType getModifiedType() const
const Expr * getRetValue() const
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Tags, declared with 'struct foo;' and referenced with 'struct foo'.
unsigned getNumArgs() const
A type that was preceded by the 'template' keyword, stored as a Type*.
static EnumDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, EnumDecl *PrevDecl, bool IsScoped, bool IsScopedUsingClassTag, bool IsFixed)
body_iterator body_begin()
Decl * VisitObjCIvarDecl(ObjCIvarDecl *D)
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
VarTemplateSpecializationDecl * findSpecialization(ArrayRef< TemplateArgument > Args, void *&InsertPos)
Return the specialization with the provided arguments if it exists, otherwise return the insertion po...
Decl * VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
unsigned getDepth() const
Get the nesting depth of the template parameter.
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
const Stmt * getThen() const
QualType VisitLValueReferenceType(const LValueReferenceType *T)
Represents a pointer to an Objective C object.
SwitchStmt - This represents a 'switch' stmt.
SourceLocation getAtCatchLoc() const
bool hasInheritedDefaultArg() const
static ObjCIvarDecl * Create(ASTContext &C, ObjCContainerDecl *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW=nullptr, bool synthesized=false)
SourceLocation getRParenLoc() const
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
ObjCMethodDecl * getGetterMethodDecl() const
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Complex values, per C99 6.2.5p11.
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
void setIsUsed()
Set whether the declaration is used, in the sense of odr-use.
VarDecl * getTemplatedDecl() const
Get the underlying variable declarations of the template.
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
static VarTemplateSpecializationDecl * Create(ASTContext &Context, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, VarTemplateDecl *SpecializedTemplate, QualType T, TypeSourceInfo *TInfo, StorageClass S, const TemplateArgument *Args, unsigned NumArgs)
const T * getAs() const
Member-template getAs<specific type>'.
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate...
DeclStmt * getBeginEndStmt()
unsigned getTypeQuals() const
const Stmt * getSubStmt() const
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T)
Represents Objective-C's collection statement.
ObjCMethodDecl * getSetterMethodDecl() const
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV)
Can create any sort of selector.
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
static CStyleCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *BasePath, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation R)
QualType getIntegralType() const
Retrieve the type of the integral value.
ObjCProtocolList::iterator protocol_iterator
bool isNull() const
Determine whether this template name is NULL.
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
void setSwitchLoc(SourceLocation L)
ExtVectorType - Extended vector type.
QualType getInnerType() const
virtual void CompleteType(TagDecl *Tag)
Gives the external AST source an opportunity to complete an incomplete type.
Base for LValueReferenceType and RValueReferenceType.
void setSetterName(Selector Sel)
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
CXXConstructorDecl * getConstructor() const
SourceLocation getRBraceLoc() const
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
Represents Objective-C's @finally statement.
static CXXMethodDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInline, bool isConstexpr, SourceLocation EndLocation)
The template argument is a type.
ObjCImplementationDecl * getImplementation() const
The template argument is actually a parameter pack.
protocol_iterator protocol_end() const
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl...
Represents a base class of a C++ class.
QualType VisitUnaryTransformType(const UnaryTransformType *T)
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
SourceLocation getRParenLoc() const
void setNamedTypeInfo(TypeSourceInfo *TInfo)
setNamedTypeInfo - Sets the source type info associated to the name.
Decl * VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
SourceManager & getSourceManager()
SourceLocation getForLoc() const
DeclStmt * getRangeStmt()
Stmt * VisitObjCAtThrowStmt(ObjCAtThrowStmt *S)
GotoStmt - This represents a direct goto.
ArrayRef< const Attr * > getAttrs() const
void ImportDefinition(Decl *From)
Import the definition of the given declaration, including all of the declarations it contains...
void setHadMultipleCandidates(bool V=true)
Sets the flag telling whether this expression refers to a function that was resolved from an overload...
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
const Type * getClass() const
ObjCPropertyDecl * getPropertyDecl() const
SourceLocation getAttrLoc() const
AccessControl getAccessControl() const
Decl * VisitTypeAliasDecl(TypeAliasDecl *D)
Expr * NoexceptExpr
Noexcept expression, if this is EST_ComputedNoexcept.
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
QualType getTypeOfExprType(Expr *e) const
GCC extension.
An attributed type is a type to which a type attribute has been applied.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node...
const Expr * getSubExpr() const
QualType getVariableArrayType(QualType EltTy, Expr *NumElts, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
Return a non-unique reference to the type for a variable array of the specified element type...
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum...
Represents a C++ struct/union/class.
ContinueStmt - This represents a continue.
SourceLocation getRParenLoc() const
The template argument is a template name that was provided for a template template parameter...
void setDescribedVarTemplate(VarTemplateDecl *Template)
Represents a C array with an unspecified size.
SourceLocation getBreakLoc() const
CXXCatchStmt - This represents a C++ catch block.
ObjCIvarDecl - Represents an ObjC instance variable.
static TypedefDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
ArraySizeModifier getSizeModifier() const
ElaboratedTypeKeyword getKeyword() const
WhileStmt - This represents a 'while' stmt.
A structure for storing the information associated with an overloaded template name.
SourceLocation getColonLoc() const
const Expr * getCond() const
SourceLocation getElseLoc() const
static VarTemplateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, VarDecl *Decl)
Create a variable template node.
Declaration of a class template.
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorType::VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
Stmt * VisitSwitchStmt(SwitchStmt *S)
This class is used for builtin types like 'int'.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
CompoundStmt * getTryBlock()
void setPropertyAttributes(PropertyAttributeKind PRVal)
Represents Objective-C's @try ... @catch ... @finally statement.
unsigned getIndex() const
Retrieve the index of the template parameter.
const Expr * getThrowExpr() const
QualType getParamTypeForDecl() const
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
ASTContext & getToContext() const
Retrieve the context that AST nodes are being imported into.
static IndirectFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, NamedDecl **CH, unsigned CHS)
ObjCInterfaceDecl * getSuperClass() const
PropertyAttributeKind getPropertyAttributesAsWritten() const
Stmt * VisitDefaultStmt(DefaultStmt *S)
QualType getPointeeTypeAsWritten() const
SourceLocation getRBracLoc() const
Import only the bare bones needed to establish a valid DeclContext.
SourceLocation getColonLoc() const
static Decl::Kind getKind(const Decl *D)
QualType VisitExtVectorType(const ExtVectorType *T)
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
void setNextSwitchCase(SwitchCase *SC)
SourceLocation getIvarRBraceLoc() const
const Stmt * getTryBody() const
Retrieve the @try body.
TranslationUnitDecl - The top declaration context.
void ImportDefinitionIfNeeded(Decl *FromD, Decl *ToD=nullptr)
QualType VisitTypeOfExprType(const TypeOfExprType *T)
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
VarDecl * getExceptionDecl() const
A reference to a declared variable, function, enum, etc.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const
C++11 decltype.
SourceLocation getRAngleLoc() const
QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize, ArrayType::ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return the unique reference to the type for a constant array of the specified element type...
QualType getElementType() const
BreakStmt - This represents a break.
SourceLocation getLocForStartOfFile(FileID FID) const
Return the source location corresponding to the first byte of the specified file. ...
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
DeclStmt * getLoopVarStmt()
A set of overloaded template declarations.
SourceLocation getRParenLoc() const
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
void setLexicalDeclContext(DeclContext *DC)
NamedDecl - This represents a decl with a name.
DeclarationNameInfo getNameInfo() const
static ObjCCategoryImplDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc)
static DeclarationName getUsingDirectiveName()
getUsingDirectiveName - Return name for all using-directives.
void setAccess(AccessSpecifier AS)
Represents a C array with a specified size that is not an integer-constant-expression.
EnumDecl * getDefinition() const
Decl * VisitNamespaceDecl(NamespaceDecl *D)
Represents a C++ namespace alias.
Decl * VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
Stmt * VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S)
SourceLocation getStartLoc() const
std::pair< FileID, unsigned > getDecomposedLoc(SourceLocation Loc) const
Decompose the specified location into a raw FileID + Offset pair.
SourceRange getSourceRange() const LLVM_READONLY
Retrieves the source range that contains the entire base specifier.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
TypeSourceInfo * getTypeSourceInfo() const
static FieldDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
The global specifier '::'. There is no stored value.
void setType(QualType newType)
Decl * VisitParmVarDecl(ParmVarDecl *D)
SourceLocation getCatchLoc() const
QualType VisitRValueReferenceType(const RValueReferenceType *T)
Represents Objective-C's @autoreleasepool Statement.
QualType VisitAutoType(const AutoType *T)
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
ArrayRef< QualType > exceptions() const
bool isBeingDefined() const
isBeingDefined - Return true if this decl is currently being defined.
This class handles loading and caching of source files into memory.
Represents the canonical version of C arrays with a specified constant size.
ExceptionSpecInfo ExceptionSpec
QualType VisitType(const Type *T)
DeclContext * ImportContext(DeclContext *FromDC)
Import the given declaration context from the "from" AST context into the "to" AST context...
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
static ObjCAtTryStmt * Create(const ASTContext &Context, SourceLocation atTryLoc, Stmt *atTryStmt, Stmt **CatchStmts, unsigned NumCatchStmts, Stmt *atFinallyStmt)
Stmt * VisitStmt(Stmt *S)
Attr - This represents one attribute.
QualType VisitTypeOfType(const TypeOfType *T)
A single template declaration.
NamedDecl *const * iterator
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
bool isMutable() const
isMutable - Determines whether this field is mutable (C++ only).
bool hasInClassInitializer() const
hasInClassInitializer - Determine whether this member has a C++11 in-class initializer.
TypeSourceInfo * getArgumentTypeInfo() const
unsigned getNumExceptions() const
Structure used to store a statement, the constant value to which it was evaluated (if any)...
const ObjCInterfaceDecl * getSuperClass() const
SourceLocation getTemplateLoc() const
static NestedNameSpecifier * GlobalSpecifier(const ASTContext &Context)
Returns the nested name specifier representing the global scope.
void notePriorDiagnosticFrom(const DiagnosticsEngine &Other)
Note that the prior diagnostic was emitted by some other DiagnosticsEngine, and we may be attaching a...
QualType getDeducedType() const
Get the type deduced for this auto type, or null if it's either not been deduced or was deduced to a ...