24 #include "llvm/Support/MemoryBuffer.h"
127 unsigned NumFromArgs,
130 bool Complain =
true);
132 bool Complain =
true);
258 template<
typename IIter,
typename OIter>
262 std::transform(Ibegin, Iend, Obegin,
263 [&ImporterRef](ItemT From) -> ItemT {
264 return ImporterRef.
Import(From);
268 template<
typename IIter,
typename OIter>
273 std::transform(Ibegin, Iend, Obegin,
274 [&ImporterRef, &Failed](ItemT *From) -> ItemT * {
275 ItemT *To = ImporterRef.
Import(From);
285 using namespace clang;
292 struct StructuralEquivalenceContext {
299 llvm::DenseMap<Decl *, Decl *> TentativeEquivalences;
303 std::deque<Decl *> DeclsToCheck;
311 bool StrictTypeSpelling;
321 bool StrictTypeSpelling =
false,
322 bool Complain =
true)
323 : C1(C1), C2(C2), NonEquivalentDecls(NonEquivalentDecls),
324 StrictTypeSpelling(StrictTypeSpelling), Complain(Complain),
325 LastDiagFromC2(
false) {}
342 assert(Complain &&
"Not allowed to complain");
344 C1.getDiagnostics().notePriorDiagnosticFrom(C2.getDiagnostics());
345 LastDiagFromC2 =
false;
346 return C1.getDiagnostics().Report(Loc, DiagID);
350 assert(Complain &&
"Not allowed to complain");
352 C2.getDiagnostics().notePriorDiagnosticFrom(C1.getDiagnostics());
353 LastDiagFromC2 =
true;
354 return C2.getDiagnostics().Report(Loc, DiagID);
377 if (!Name1 || !Name2)
378 return Name1 == Name2;
445 llvm_unreachable(
"Invalid template argument kind");
471 if (!Context.StrictTypeSpelling) {
474 T1 = Context.C1.getCanonicalType(T1);
475 T2 = Context.C2.getCanonicalType(T2);
488 TC = Type::FunctionNoProto;
491 TC = Type::FunctionNoProto;
499 if (cast<BuiltinType>(T1)->getKind() != cast<BuiltinType>(T2)->
getKind())
505 cast<ComplexType>(T1)->getElementType(),
506 cast<ComplexType>(T2)->getElementType()))
513 cast<AdjustedType>(T1)->getOriginalType(),
514 cast<AdjustedType>(T2)->getOriginalType()))
520 cast<PointerType>(T1)->getPointeeType(),
521 cast<PointerType>(T2)->getPointeeType()))
525 case Type::BlockPointer:
527 cast<BlockPointerType>(T1)->getPointeeType(),
528 cast<BlockPointerType>(T2)->getPointeeType()))
532 case Type::LValueReference:
533 case Type::RValueReference: {
542 Ref2->getPointeeTypeAsWritten()))
547 case Type::MemberPointer: {
561 case Type::ConstantArray: {
564 if (!llvm::APInt::isSameValue(Array1->
getSize(), Array2->getSize()))
572 case Type::IncompleteArray:
575 cast<ArrayType>(T2)))
579 case Type::VariableArray: {
592 case Type::DependentSizedArray: {
605 case Type::DependentSizedExtVector: {
607 = cast<DependentSizedExtVectorType>(T1);
609 = cast<DependentSizedExtVectorType>(T2);
615 Vec2->getElementType()))
621 case Type::ExtVector: {
622 const VectorType *Vec1 = cast<VectorType>(T1);
623 const VectorType *Vec2 = cast<VectorType>(T2);
626 Vec2->getElementType()))
635 case Type::FunctionProto: {
642 Proto2->getParamType(
I)))
645 if (Proto1->
isVariadic() != Proto2->isVariadic())
655 Proto2->getExceptionType(
I)))
661 Proto2->getNoexceptExpr()))
670 case Type::FunctionNoProto: {
674 Function2->getReturnType()))
676 if (Function1->
getExtInfo() != Function2->getExtInfo())
681 case Type::UnresolvedUsing:
683 cast<UnresolvedUsingType>(T1)->getDecl(),
684 cast<UnresolvedUsingType>(T2)->getDecl()))
689 case Type::Attributed:
691 cast<AttributedType>(T1)->getModifiedType(),
692 cast<AttributedType>(T2)->getModifiedType()))
695 cast<AttributedType>(T1)->getEquivalentType(),
696 cast<AttributedType>(T2)->getEquivalentType()))
702 cast<ParenType>(T1)->getInnerType(),
703 cast<ParenType>(T2)->getInnerType()))
709 cast<TypedefType>(T1)->getDecl(),
710 cast<TypedefType>(T2)->getDecl()))
714 case Type::TypeOfExpr:
716 cast<TypeOfExprType>(T1)->getUnderlyingExpr(),
717 cast<TypeOfExprType>(T2)->getUnderlyingExpr()))
728 case Type::UnaryTransform:
737 cast<DecltypeType>(T1)->getUnderlyingExpr(),
738 cast<DecltypeType>(T2)->getUnderlyingExpr()))
744 cast<AutoType>(T1)->getDeducedType(),
745 cast<AutoType>(T2)->getDeducedType()))
752 cast<TagType>(T1)->getDecl(),
753 cast<TagType>(T2)->getDecl()))
757 case Type::TemplateTypeParm: {
760 if (Parm1->
getDepth() != Parm2->getDepth())
762 if (Parm1->
getIndex() != Parm2->getIndex())
771 case Type::SubstTemplateTypeParm: {
773 = cast<SubstTemplateTypeParmType>(T1);
775 = cast<SubstTemplateTypeParmType>(T2);
778 QualType(Subst2->getReplacedParameter(), 0)))
782 Subst2->getReplacementType()))
787 case Type::SubstTemplateTypeParmPack: {
789 = cast<SubstTemplateTypeParmPackType>(T1);
791 = cast<SubstTemplateTypeParmPackType>(T2);
794 QualType(Subst2->getReplacedParameter(), 0)))
798 Subst2->getArgumentPack()))
802 case Type::TemplateSpecialization: {
804 = cast<TemplateSpecializationType>(T1);
806 = cast<TemplateSpecializationType>(T2);
808 Spec1->getTemplateName(),
809 Spec2->getTemplateName()))
811 if (Spec1->getNumArgs() != Spec2->getNumArgs())
813 for (
unsigned I = 0, N = Spec1->getNumArgs();
I != N; ++
I) {
815 Spec1->getArg(
I), Spec2->getArg(
I)))
821 case Type::Elaborated: {
825 if (Elab1->
getKeyword() != Elab2->getKeyword())
829 Elab2->getQualifier()))
833 Elab2->getNamedType()))
838 case Type::InjectedClassName: {
843 Inj2->getInjectedSpecializationType()))
848 case Type::DependentName: {
853 Typename2->getQualifier()))
856 Typename2->getIdentifier()))
862 case Type::DependentTemplateSpecialization: {
864 cast<DependentTemplateSpecializationType>(T1);
866 cast<DependentTemplateSpecializationType>(T2);
868 Spec1->getQualifier(),
869 Spec2->getQualifier()))
872 Spec2->getIdentifier()))
874 if (Spec1->getNumArgs() != Spec2->getNumArgs())
876 for (
unsigned I = 0, N = Spec1->getNumArgs();
I != N; ++
I) {
878 Spec1->getArg(
I), Spec2->getArg(
I)))
884 case Type::PackExpansion:
886 cast<PackExpansionType>(T1)->getPattern(),
887 cast<PackExpansionType>(T2)->getPattern()))
891 case Type::ObjCInterface: {
895 Iface1->
getDecl(), Iface2->getDecl()))
900 case Type::ObjCObject: {
905 Obj2->getBaseType()))
912 Obj2->getProtocol(
I)))
918 case Type::ObjCObjectPointer: {
930 cast<AtomicType>(T1)->getValueType(),
931 cast<AtomicType>(T2)->getValueType()))
938 cast<PipeType>(T1)->getElementType(),
939 cast<PipeType>(T2)->getElementType()))
952 RecordDecl *Owner2 = cast<RecordDecl>(Field2->getDeclContext());
972 if (Context.Complain) {
973 Context.Diag2(Owner2->getLocation(), diag::warn_odr_tag_type_inconsistent)
974 << Context.C2.getTypeDeclType(Owner2);
975 Context.Diag2(Field2->getLocation(), diag::note_odr_field)
977 Context.Diag1(Field1->getLocation(), diag::note_odr_field)
984 if (Context.Complain) {
985 Context.Diag2(Owner2->getLocation(), diag::warn_odr_tag_type_inconsistent)
986 << Context.C2.getTypeDeclType(Owner2);
988 Context.Diag1(Field1->getLocation(), diag::note_odr_bit_field)
991 Context.Diag2(Field2->getLocation(), diag::note_odr_not_bit_field)
994 Context.Diag2(Field2->getLocation(), diag::note_odr_bit_field)
997 Context.Diag1(Field1->getLocation(), diag::note_odr_not_bit_field)
1009 if (Bits1 != Bits2) {
1010 if (Context.Complain) {
1011 Context.Diag2(Owner2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1012 << Context.C2.getTypeDeclType(Owner2);
1013 Context.Diag2(Field2->getLocation(), diag::note_odr_bit_field)
1015 Context.Diag1(Field1->getLocation(), diag::note_odr_bit_field)
1046 if (F->isAnonymousStructOrUnion()) {
1056 if (
const auto *RecType = dyn_cast<RecordType>(FieldType)) {
1057 const RecordDecl *RecDecl = RecType->getDecl();
1058 if (RecDecl->getDeclContext() == Owner &&
1075 if (Context.Complain) {
1076 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1077 << Context.C2.getTypeDeclType(D2);
1078 Context.Diag1(D1->getLocation(), diag::note_odr_tag_kind_here)
1089 if (*Index1 != *Index2)
1101 if (Spec1 && Spec2) {
1104 Spec2->getSpecializedTemplate()))
1114 Spec2->getTemplateArgs().get(
I)))
1119 else if (Spec1 || Spec2)
1131 if (D1CXX->getNumBases() != D2CXX->getNumBases()) {
1132 if (Context.Complain) {
1133 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1134 << Context.C2.getTypeDeclType(D2);
1135 Context.Diag2(D2->getLocation(), diag::note_odr_number_of_bases)
1136 << D2CXX->getNumBases();
1137 Context.Diag1(D1->getLocation(), diag::note_odr_number_of_bases)
1138 << D1CXX->getNumBases();
1145 BaseEnd1 = D1CXX->bases_end(),
1146 Base2 = D2CXX->bases_begin();
1150 Base1->getType(), Base2->getType())) {
1151 if (Context.Complain) {
1152 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1153 << Context.C2.getTypeDeclType(D2);
1154 Context.Diag2(Base2->getLocStart(), diag::note_odr_base)
1156 << Base2->getSourceRange();
1157 Context.Diag1(Base1->getLocStart(), diag::note_odr_base)
1159 << Base1->getSourceRange();
1165 if (Base1->isVirtual() != Base2->isVirtual()) {
1166 if (Context.Complain) {
1167 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1168 << Context.C2.getTypeDeclType(D2);
1169 Context.Diag2(Base2->getLocStart(),
1170 diag::note_odr_virtual_base)
1171 << Base2->isVirtual() << Base2->getSourceRange();
1172 Context.Diag1(Base1->getLocStart(), diag::note_odr_base)
1173 << Base1->isVirtual()
1174 << Base1->getSourceRange();
1179 }
else if (D1CXX->getNumBases() > 0) {
1180 if (Context.Complain) {
1181 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1182 << Context.C2.getTypeDeclType(D2);
1184 Context.Diag1(Base1->
getLocStart(), diag::note_odr_base)
1187 Context.Diag2(D2->getLocation(), diag::note_odr_missing_base);
1198 Field1 != Field1End;
1199 ++Field1, ++Field2) {
1200 if (Field2 == Field2End) {
1201 if (Context.Complain) {
1202 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1203 << Context.C2.getTypeDeclType(D2);
1204 Context.Diag1(Field1->getLocation(), diag::note_odr_field)
1205 << Field1->getDeclName() << Field1->getType();
1206 Context.Diag2(D2->getLocation(), diag::note_odr_missing_field);
1215 if (Field2 != Field2End) {
1216 if (Context.Complain) {
1217 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1218 << Context.C2.getTypeDeclType(D2);
1219 Context.Diag2(Field2->getLocation(), diag::note_odr_field)
1220 << Field2->getDeclName() << Field2->getType();
1221 Context.Diag1(D1->getLocation(), diag::note_odr_missing_field);
1236 EC1 != EC1End; ++EC1, ++EC2) {
1237 if (EC2 == EC2End) {
1238 if (Context.Complain) {
1239 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1240 << Context.C2.getTypeDeclType(D2);
1241 Context.Diag1(EC1->getLocation(), diag::note_odr_enumerator)
1242 << EC1->getDeclName()
1243 << EC1->getInitVal().toString(10);
1244 Context.Diag2(D2->getLocation(), diag::note_odr_missing_enumerator);
1249 llvm::APSInt Val1 = EC1->getInitVal();
1250 llvm::APSInt Val2 = EC2->getInitVal();
1251 if (!llvm::APSInt::isSameValue(Val1, Val2) ||
1253 if (Context.Complain) {
1254 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1255 << Context.C2.getTypeDeclType(D2);
1256 Context.Diag2(EC2->getLocation(), diag::note_odr_enumerator)
1257 << EC2->getDeclName()
1258 << EC2->getInitVal().toString(10);
1259 Context.Diag1(EC1->getLocation(), diag::note_odr_enumerator)
1260 << EC1->getDeclName()
1261 << EC1->getInitVal().toString(10);
1267 if (EC2 != EC2End) {
1268 if (Context.Complain) {
1269 Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)
1270 << Context.C2.getTypeDeclType(D2);
1271 Context.Diag2(EC2->getLocation(), diag::note_odr_enumerator)
1272 << EC2->getDeclName()
1273 << EC2->getInitVal().toString(10);
1274 Context.Diag1(D1->getLocation(), diag::note_odr_missing_enumerator);
1285 if (Params1->
size() != Params2->
size()) {
1286 if (Context.Complain) {
1288 diag::err_odr_different_num_template_parameters)
1289 << Params1->
size() << Params2->
size();
1291 diag::note_odr_template_parameter_list);
1296 for (
unsigned I = 0, N = Params1->
size();
I != N; ++
I) {
1298 if (Context.Complain) {
1299 Context.Diag2(Params2->
getParam(
I)->getLocation(),
1300 diag::err_odr_different_template_parameter_kind);
1301 Context.Diag1(Params1->
getParam(
I)->getLocation(),
1302 diag::note_odr_template_parameter_here);
1307 if (!Context.IsStructurallyEquivalent(Params1->
getParam(
I),
1321 if (Context.Complain) {
1322 Context.Diag2(D2->getLocation(), diag::err_odr_parameter_pack_non_pack)
1324 Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack)
1337 if (Context.Complain) {
1338 Context.Diag2(D2->getLocation(), diag::err_odr_parameter_pack_non_pack)
1340 Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack)
1347 if (!Context.IsStructurallyEquivalent(D1->
getType(), D2->
getType())) {
1348 if (Context.Complain) {
1349 Context.Diag2(D2->getLocation(),
1350 diag::err_odr_non_type_parameter_type_inconsistent)
1352 Context.Diag1(D1->getLocation(), diag::note_odr_value_here)
1365 if (Context.Complain) {
1366 Context.Diag2(D2->getLocation(), diag::err_odr_parameter_pack_non_pack)
1368 Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack)
1400 if (Context.NonEquivalentDecls.count(std::make_pair(D1->getCanonicalDecl(),
1401 D2->getCanonicalDecl())))
1405 Decl *&EquivToD1 = Context.TentativeEquivalences[D1->getCanonicalDecl()];
1407 return EquivToD1 == D2->getCanonicalDecl();
1410 EquivToD1 = D2->getCanonicalDecl();
1411 Context.DeclsToCheck.push_back(D1->getCanonicalDecl());
1431 bool StructuralEquivalenceContext::Finish() {
1432 while (!DeclsToCheck.empty()) {
1434 Decl *D1 = DeclsToCheck.front();
1435 DeclsToCheck.pop_front();
1437 Decl *D2 = TentativeEquivalences[D1];
1438 assert(D2 &&
"Unrecorded tentative equivalence?");
1440 bool Equivalent =
true;
1444 if (
RecordDecl *Record1 = dyn_cast<RecordDecl>(D1)) {
1445 if (
RecordDecl *Record2 = dyn_cast<RecordDecl>(D2)) {
1448 if (!Name1 && Record1->getTypedefNameForAnonDecl())
1449 Name1 = Record1->getTypedefNameForAnonDecl()->getIdentifier();
1451 if (!Name2 && Record2->getTypedefNameForAnonDecl())
1452 Name2 = Record2->getTypedefNameForAnonDecl()->getIdentifier();
1460 }
else if (
EnumDecl *Enum1 = dyn_cast<EnumDecl>(D1)) {
1461 if (
EnumDecl *Enum2 = dyn_cast<EnumDecl>(D2)) {
1464 if (!Name1 && Enum1->getTypedefNameForAnonDecl())
1465 Name1 = Enum1->getTypedefNameForAnonDecl()->getIdentifier();
1467 if (!Name2 && Enum2->getTypedefNameForAnonDecl())
1468 Name2 = Enum2->getTypedefNameForAnonDecl()->getIdentifier();
1476 }
else if (
TypedefNameDecl *Typedef1 = dyn_cast<TypedefNameDecl>(D1)) {
1479 Typedef2->getIdentifier()) ||
1481 Typedef1->getUnderlyingType(),
1482 Typedef2->getUnderlyingType()))
1489 = dyn_cast<ClassTemplateDecl>(D1)) {
1492 ClassTemplate2->getIdentifier()) ||
1508 = dyn_cast<NonTypeTemplateParmDecl>(D1)) {
1510 = dyn_cast<NonTypeTemplateParmDecl>(D2)) {
1518 = dyn_cast<TemplateTemplateParmDecl>(D1)) {
1520 = dyn_cast<TemplateTemplateParmDecl>(D2)) {
1532 NonEquivalentDecls.insert(std::make_pair(D1->getCanonicalDecl(),
1533 D2->getCanonicalDecl()));
1554 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1555 case BuiltinType::Id: \
1556 return Importer.getToContext().SingletonId;
1557 #include "clang/Basic/OpenCLImageTypes.def"
1558 #define SHARED_SINGLETON_TYPE(Expansion)
1559 #define BUILTIN_TYPE(Id, SingletonId) \
1560 case BuiltinType::Id: return Importer.getToContext().SingletonId;
1561 #include "clang/AST/BuiltinTypes.def"
1569 case BuiltinType::Char_U:
1578 case BuiltinType::Char_S:
1587 case BuiltinType::WChar_S:
1588 case BuiltinType::WChar_U:
1594 llvm_unreachable(
"Invalid BuiltinType Kind!");
1599 if (ToElementType.
isNull())
1607 if (ToPointeeType.
isNull())
1616 if (ToPointeeType.
isNull())
1626 if (ToPointeeType.
isNull())
1636 if (ToPointeeType.
isNull())
1645 if (ToPointeeType.
isNull())
1655 if (ToElementType.
isNull())
1667 if (ToElementType.
isNull())
1677 if (ToElementType.
isNull())
1693 if (ToElementType.
isNull())
1703 if (ToElementType.
isNull())
1715 if (ToResultType.
isNull())
1724 if (ToResultType.
isNull())
1733 ArgTypes.push_back(ArgType);
1740 if (ExceptionType.
isNull())
1742 ExceptionTypes.push_back(ExceptionType);
1767 if (ToInnerType.
isNull())
1775 = dyn_cast_or_null<TypedefNameDecl>(Importer.
Import(T->
getDecl()));
1792 if (ToUnderlyingType.
isNull())
1805 if (UnderlyingType.
isNull())
1826 if (!FromDeduced.
isNull()) {
1827 ToDeduced = Importer.
Import(FromDeduced);
1860 = dyn_cast_or_null<RecordDecl>(Importer.
Import(T->
getDecl()));
1869 = dyn_cast_or_null<EnumDecl>(Importer.
Import(T->
getDecl()));
1882 if (!FromModifiedType.
isNull()) {
1883 ToModifiedType = Importer.
Import(FromModifiedType);
1884 if (ToModifiedType.
isNull())
1887 if (!FromEquivalentType.
isNull()) {
1888 ToEquivalentType = Importer.
Import(FromEquivalentType);
1889 if (ToEquivalentType.
isNull())
1894 ToModifiedType, ToEquivalentType);
1901 cast_or_null<TemplateTypeParmDecl>(Importer.
Import(T->
getDecl()));
1902 if (!ParmDecl && T->
getDecl())
1920 if (!
QualType(T, 0).isCanonical()) {
1923 ToCanonType =Importer.
Import(FromCanonType);
1924 if (ToCanonType.
isNull())
1942 if (ToNamedType.
isNull())
1946 ToQualifier, ToNamedType);
1951 = dyn_cast_or_null<ObjCInterfaceDecl>(Importer.
Import(T->
getDecl()));
1966 if (ImportedTypeArg.
isNull())
1969 TypeArgs.push_back(ImportedTypeArg);
1973 for (
auto *
P : T->
quals()) {
1975 = dyn_cast_or_null<ObjCProtocolDecl>(Importer.
Import(
P));
1978 Protocols.push_back(Protocol);
1989 if (ToPointeeType.
isNull())
2009 if (D->getDeclContext() != D->getLexicalDeclContext()) {
2010 LexicalDC = Importer.
ImportContext(D->getLexicalDeclContext());
2021 Loc = Importer.
Import(D->getLocation());
2031 ToD = Importer.
Import(FromD);
2036 if (
RecordDecl *FromRecord = dyn_cast<RecordDecl>(FromD)) {
2037 if (
RecordDecl *ToRecord = cast_or_null<RecordDecl>(ToD)) {
2038 if (FromRecord->getDefinition() && FromRecord->isCompleteDefinition() && !ToRecord->getDefinition()) {
2045 if (
EnumDecl *FromEnum = dyn_cast<EnumDecl>(FromD)) {
2046 if (
EnumDecl *ToEnum = cast_or_null<EnumDecl>(ToD)) {
2047 if (FromEnum->getDefinition() && !ToEnum->getDefinition()) {
2086 llvm_unreachable(
"Unknown name kind.");
2095 for (
auto *From : FromDC->
decls())
2114 struct CXXRecordDecl::DefinitionData &ToData = ToCXX->data();
2115 struct CXXRecordDecl::DefinitionData &FromData = FromCXX->data();
2116 ToData.UserDeclaredConstructor = FromData.UserDeclaredConstructor;
2117 ToData.UserDeclaredSpecialMembers = FromData.UserDeclaredSpecialMembers;
2118 ToData.Aggregate = FromData.Aggregate;
2119 ToData.PlainOldData = FromData.PlainOldData;
2120 ToData.Empty = FromData.Empty;
2121 ToData.Polymorphic = FromData.Polymorphic;
2122 ToData.Abstract = FromData.Abstract;
2123 ToData.IsStandardLayout = FromData.IsStandardLayout;
2124 ToData.HasNoNonEmptyBases = FromData.HasNoNonEmptyBases;
2125 ToData.HasPrivateFields = FromData.HasPrivateFields;
2126 ToData.HasProtectedFields = FromData.HasProtectedFields;
2127 ToData.HasPublicFields = FromData.HasPublicFields;
2128 ToData.HasMutableFields = FromData.HasMutableFields;
2129 ToData.HasVariantMembers = FromData.HasVariantMembers;
2130 ToData.HasOnlyCMembers = FromData.HasOnlyCMembers;
2131 ToData.HasInClassInitializer = FromData.HasInClassInitializer;
2132 ToData.HasUninitializedReferenceMember
2133 = FromData.HasUninitializedReferenceMember;
2134 ToData.HasUninitializedFields = FromData.HasUninitializedFields;
2135 ToData.HasInheritedConstructor = FromData.HasInheritedConstructor;
2136 ToData.HasInheritedAssignment = FromData.HasInheritedAssignment;
2137 ToData.NeedOverloadResolutionForMoveConstructor
2138 = FromData.NeedOverloadResolutionForMoveConstructor;
2139 ToData.NeedOverloadResolutionForMoveAssignment
2140 = FromData.NeedOverloadResolutionForMoveAssignment;
2141 ToData.NeedOverloadResolutionForDestructor
2142 = FromData.NeedOverloadResolutionForDestructor;
2143 ToData.DefaultedMoveConstructorIsDeleted
2144 = FromData.DefaultedMoveConstructorIsDeleted;
2145 ToData.DefaultedMoveAssignmentIsDeleted
2146 = FromData.DefaultedMoveAssignmentIsDeleted;
2147 ToData.DefaultedDestructorIsDeleted = FromData.DefaultedDestructorIsDeleted;
2148 ToData.HasTrivialSpecialMembers = FromData.HasTrivialSpecialMembers;
2149 ToData.HasIrrelevantDestructor = FromData.HasIrrelevantDestructor;
2150 ToData.HasConstexprNonCopyMoveConstructor
2151 = FromData.HasConstexprNonCopyMoveConstructor;
2152 ToData.HasDefaultedDefaultConstructor
2153 = FromData.HasDefaultedDefaultConstructor;
2154 ToData.DefaultedDefaultConstructorIsConstexpr
2155 = FromData.DefaultedDefaultConstructorIsConstexpr;
2156 ToData.HasConstexprDefaultConstructor
2157 = FromData.HasConstexprDefaultConstructor;
2158 ToData.HasNonLiteralTypeFieldsOrBases
2159 = FromData.HasNonLiteralTypeFieldsOrBases;
2161 ToData.UserProvidedDefaultConstructor
2162 = FromData.UserProvidedDefaultConstructor;
2163 ToData.DeclaredSpecialMembers = FromData.DeclaredSpecialMembers;
2164 ToData.ImplicitCopyConstructorHasConstParam
2165 = FromData.ImplicitCopyConstructorHasConstParam;
2166 ToData.ImplicitCopyAssignmentHasConstParam
2167 = FromData.ImplicitCopyAssignmentHasConstParam;
2168 ToData.HasDeclaredCopyConstructorWithConstParam
2169 = FromData.HasDeclaredCopyConstructorWithConstParam;
2170 ToData.HasDeclaredCopyAssignmentWithConstParam
2171 = FromData.HasDeclaredCopyAssignmentWithConstParam;
2172 ToData.IsLambda = FromData.IsLambda;
2175 for (
const auto &Base1 : FromCXX->
bases()) {
2181 if (Base1.isPackExpansion())
2182 EllipsisLoc = Importer.
Import(Base1.getEllipsisLoc());
2191 Base1.isBaseOfClass(),
2192 Base1.getAccessSpecifierAsWritten(),
2193 Importer.
Import(Base1.getTypeSourceInfo()),
2197 ToCXX->setBases(Bases.data(), Bases.size());
2237 if (ToPromotionType.
isNull())
2254 ToParams.reserve(Params->
size());
2256 PEnd = Params->
end();
2262 ToParams.push_back(cast<NamedDecl>(To));
2295 if (!To || ToType.
isNull())
2336 llvm::makeArrayRef(ToPack).copy(Importer.
getToContext()));
2340 llvm_unreachable(
"Invalid template argument kind");
2344 unsigned NumFromArgs,
2346 for (
unsigned I = 0;
I != NumFromArgs; ++
I) {
2351 ToArgs.push_back(To);
2365 ToRecord = ToOriginRecord;
2369 ToRecord->getASTContext(),
2372 return Ctx.IsStructurallyEquivalent(FromRecord, ToRecord);
2377 StructuralEquivalenceContext Ctx(
2380 return Ctx.IsStructurallyEquivalent(FromVar, ToVar);
2387 return Ctx.IsStructurallyEquivalent(FromEnum, ToEnum);
2393 const llvm::APSInt &FromVal = FromEC->
getInitVal();
2394 const llvm::APSInt &ToVal = ToEC->
getInitVal();
2396 return FromVal.isSigned() == ToVal.isSigned() &&
2397 FromVal.getBitWidth() == ToVal.getBitWidth() &&
2406 return Ctx.IsStructurallyEquivalent(From, To);
2414 return Ctx.IsStructurallyEquivalent(From, To);
2418 Importer.
FromDiag(D->getLocation(), diag::err_unsupported_ast_node)
2419 << D->getDeclKindName();
2446 if (!accessSpecDecl)
2451 accessSpecDecl->setLexicalDeclContext(DC);
2476 MergeWithNamespace = cast<NamespaceDecl>(DC)->getAnonymousNamespace();
2481 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2482 if (!FoundDecls[
I]->isInIdentifierNamespace(Decl::IDNS_Namespace))
2485 if (
NamespaceDecl *FoundNS = dyn_cast<NamespaceDecl>(FoundDecls[
I])) {
2486 MergeWithNamespace = FoundNS;
2487 ConflictingDecls.clear();
2491 ConflictingDecls.push_back(FoundDecls[I]);
2494 if (!ConflictingDecls.empty()) {
2496 ConflictingDecls.data(),
2497 ConflictingDecls.size());
2509 ToNamespace->setLexicalDeclContext(LexicalDC);
2516 TU->setAnonymousNamespace(ToNamespace);
2518 cast<NamespaceDecl>(DC)->setAnonymousNamespace(ToNamespace);
2544 unsigned IDNS = Decl::IDNS_Ordinary;
2547 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2548 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2551 dyn_cast<TypedefNameDecl>(FoundDecls[
I])) {
2553 FoundTypedef->getUnderlyingType()))
2554 return Importer.
Imported(D, FoundTypedef);
2557 ConflictingDecls.push_back(FoundDecls[I]);
2560 if (!ConflictingDecls.empty()) {
2562 ConflictingDecls.data(),
2563 ConflictingDecls.size());
2589 ToTypedef->setAccess(D->getAccess());
2590 ToTypedef->setLexicalDeclContext(LexicalDC);
2620 DC, Importer.
Import(D->getLocation()),
2622 Importer.
Import(D->getLocStart()))
2624 DC, Importer.
Import(D->getLocation()),
2632 ToLabel->setStmt(Label);
2633 ToLabel->setLexicalDeclContext(LexicalDC);
2650 unsigned IDNS = Decl::IDNS_Tag;
2654 IDNS = Decl::IDNS_Ordinary;
2656 IDNS |= Decl::IDNS_Ordinary;
2663 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2664 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2667 Decl *Found = FoundDecls[
I];
2670 Found = Tag->getDecl();
2673 if (
EnumDecl *FoundEnum = dyn_cast<EnumDecl>(Found)) {
2675 return Importer.
Imported(D, FoundEnum);
2678 ConflictingDecls.push_back(FoundDecls[
I]);
2681 if (!ConflictingDecls.empty()) {
2683 ConflictingDecls.data(),
2684 ConflictingDecls.size());
2696 D2->setAccess(D->getAccess());
2697 D2->setLexicalDeclContext(LexicalDC);
2703 if (ToIntegerType.
isNull())
2719 if (Definition && Definition != D) {
2720 Decl *ImportedDef = Importer.
Import(Definition);
2724 return Importer.
Imported(D, ImportedDef);
2738 unsigned IDNS = Decl::IDNS_Tag;
2742 IDNS = Decl::IDNS_Ordinary;
2744 IDNS |= Decl::IDNS_Ordinary;
2752 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2753 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2756 Decl *Found = FoundDecls[
I];
2759 Found = Tag->getDecl();
2762 if (
RecordDecl *FoundRecord = dyn_cast<RecordDecl>(Found)) {
2764 FoundRecord->isAnonymousStructOrUnion()) {
2771 if (*Index1 != *Index2)
2781 == FoundDef->isAnonymousStructOrUnion() &&
2787 return Importer.
Imported(D, FoundDef);
2796 if (FoundRecord->hasExternalLexicalStorage() &&
2797 !FoundRecord->isCompleteDefinition())
2798 FoundRecord->getASTContext().getExternalSource()->CompleteType(FoundRecord);
2800 D->getASTContext().getExternalSource()->CompleteType(D);
2802 if (FoundRecord->isCompleteDefinition() &&
2807 AdoptDecl = FoundRecord;
2809 }
else if (!SearchName) {
2814 ConflictingDecls.push_back(FoundDecls[
I]);
2817 if (!ConflictingDecls.empty() && SearchName) {
2819 ConflictingDecls.data(),
2820 ConflictingDecls.size());
2829 if (
CXXRecordDecl *DCXX = llvm::dyn_cast<CXXRecordDecl>(D)) {
2830 if (DCXX->isLambda()) {
2834 DCXX->isDependentLambda(),
2835 DCXX->isGenericLambda(),
2836 DCXX->getLambdaCaptureDefault());
2837 Decl *CDecl = Importer.
Import(DCXX->getLambdaContextDecl());
2838 if (DCXX->getLambdaContextDecl() && !CDecl)
2841 }
else if (DCXX->isInjectedClassName()) {
2845 const bool DelayTypeCreation =
true;
2850 D2CXX, llvm::dyn_cast<CXXRecordDecl>(DC));
2858 D2->setAccess(D->getAccess());
2865 D2->setLexicalDeclContext(LexicalDC);
2898 unsigned IDNS = Decl::IDNS_Ordinary;
2901 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2902 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2906 = dyn_cast<EnumConstantDecl>(FoundDecls[
I])) {
2908 return Importer.
Imported(D, FoundEnumConstant);
2911 ConflictingDecls.push_back(FoundDecls[I]);
2914 if (!ConflictingDecls.empty()) {
2916 ConflictingDecls.data(),
2917 ConflictingDecls.size());
2931 ToEnumerator->setAccess(D->getAccess());
2932 ToEnumerator->setLexicalDeclContext(LexicalDC);
2933 Importer.
Imported(D, ToEnumerator);
2935 return ToEnumerator;
2953 unsigned IDNS = Decl::IDNS_Ordinary;
2956 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
2957 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
2960 if (
FunctionDecl *FoundFunction = dyn_cast<FunctionDecl>(FoundDecls[
I])) {
2961 if (FoundFunction->hasExternalFormalLinkage() &&
2964 FoundFunction->getType())) {
2966 return Importer.
Imported(D, FoundFunction);
2977 Importer.
ToDiag(Loc, diag::err_odr_function_type_inconsistent)
2978 << Name << D->
getType() << FoundFunction->getType();
2979 Importer.
ToDiag(FoundFunction->getLocation(),
2980 diag::note_odr_value_here)
2981 << FoundFunction->getType();
2985 ConflictingDecls.push_back(FoundDecls[I]);
2988 if (!ConflictingDecls.empty()) {
2990 ConflictingDecls.data(),
2991 ConflictingDecls.size());
3002 bool usedDifferentExceptionSpec =
false;
3016 FromFPT->getReturnType(), FromFPT->getParamTypes(), DefaultEPI);
3017 usedDifferentExceptionSpec =
true;
3033 Parameters.push_back(ToP);
3042 cast<CXXRecordDecl>(DC),
3045 FromConstructor->isExplicit(),
3049 if (
unsigned NumInitializers = FromConstructor->getNumCtorInitializers()) {
3053 cast_or_null<CXXCtorInitializer>(Importer.
Import(
I));
3056 CtorInitializers.push_back(ToI);
3060 std::copy(CtorInitializers.begin(), CtorInitializers.end(), Memory);
3063 ToCtor->setNumCtorInitializers(NumInitializers);
3065 }
else if (isa<CXXDestructorDecl>(D)) {
3067 cast<CXXRecordDecl>(DC),
3073 = dyn_cast<CXXConversionDecl>(D)) {
3075 cast<CXXRecordDecl>(DC),
3079 FromConversion->isExplicit(),
3081 Importer.
Import(D->getLocEnd()));
3082 }
else if (
CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) {
3084 cast<CXXRecordDecl>(DC),
3087 Method->getStorageClass(),
3088 Method->isInlineSpecified(),
3090 Importer.
Import(D->getLocEnd()));
3102 ToFunction->setAccess(D->getAccess());
3103 ToFunction->setLexicalDeclContext(LexicalDC);
3110 for (
unsigned I = 0, N = Parameters.size();
I != N; ++
I) {
3111 Parameters[
I]->setOwningFunction(ToFunction);
3114 ToFunction->setParams(Parameters);
3116 if (usedDifferentExceptionSpec) {
3126 if (
Stmt *ToBody = Importer.
Import(FromBody)) {
3165 if (isa<FieldDecl>(*D) || isa<IndirectFieldDecl>(*D))
3186 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3187 if (
FieldDecl *FoundField = dyn_cast<FieldDecl>(FoundDecls[
I])) {
3193 FoundField->getType())) {
3198 Importer.
ToDiag(Loc, diag::err_odr_field_type_inconsistent)
3199 << Name << D->
getType() << FoundField->getType();
3200 Importer.
ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
3201 << FoundField->getType();
3221 ToField->setAccess(D->getAccess());
3222 ToField->setLexicalDeclContext(LexicalDC);
3224 Expr *ToInitializer = Importer.
Import(FromInitializer);
3230 ToField->setImplicit(D->isImplicit());
3250 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3252 = dyn_cast<IndirectFieldDecl>(FoundDecls[
I])) {
3258 FoundField->getType(),
3265 if (!Name && I < N-1)
3268 Importer.
ToDiag(Loc, diag::err_odr_field_type_inconsistent)
3269 << Name << D->
getType() << FoundField->getType();
3270 Importer.
ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
3271 << FoundField->getType();
3285 for (
auto *PI : D->
chain()) {
3289 NamedChain[i++] = cast<NamedDecl>(D);
3296 for (
const auto *
Attr : D->attrs())
3299 ToIndirectField->setAccess(D->getAccess());
3300 ToIndirectField->setLexicalDeclContext(LexicalDC);
3301 Importer.
Imported(D, ToIndirectField);
3303 return ToIndirectField;
3320 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3321 if (
ObjCIvarDecl *FoundIvar = dyn_cast<ObjCIvarDecl>(FoundDecls[
I])) {
3323 FoundIvar->getType())) {
3328 Importer.
ToDiag(Loc, diag::err_odr_ivar_type_inconsistent)
3329 << Name << D->
getType() << FoundIvar->getType();
3330 Importer.
ToDiag(FoundIvar->getLocation(), diag::note_odr_value_here)
3331 << FoundIvar->getType();
3347 cast<ObjCContainerDecl>(DC),
3352 ToIvar->setLexicalDeclContext(LexicalDC);
3373 VarDecl *MergeWithVar =
nullptr;
3375 unsigned IDNS = Decl::IDNS_Ordinary;
3378 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3379 if (!FoundDecls[
I]->isInIdentifierNamespace(IDNS))
3382 if (
VarDecl *FoundVar = dyn_cast<VarDecl>(FoundDecls[
I])) {
3384 if (FoundVar->hasExternalFormalLinkage() &&
3387 FoundVar->getType())) {
3388 MergeWithVar = FoundVar;
3396 if (FoundArray && TArray) {
3397 if (isa<IncompleteArrayType>(FoundArray) &&
3398 isa<ConstantArrayType>(TArray)) {
3404 FoundVar->setType(T);
3405 MergeWithVar = FoundVar;
3407 }
else if (isa<IncompleteArrayType>(TArray) &&
3408 isa<ConstantArrayType>(FoundArray)) {
3409 MergeWithVar = FoundVar;
3414 Importer.
ToDiag(Loc, diag::err_odr_variable_type_inconsistent)
3415 << Name << D->
getType() << FoundVar->getType();
3416 Importer.
ToDiag(FoundVar->getLocation(), diag::note_odr_value_here)
3417 << FoundVar->getType();
3421 ConflictingDecls.push_back(FoundDecls[I]);
3427 Importer.
Imported(D, MergeWithVar);
3431 Importer.
ToDiag(ExistingDef->getLocation(),
3432 diag::err_odr_variable_multiple_def)
3434 Importer.
FromDiag(DDef->getLocation(), diag::note_odr_defined_here);
3436 Expr *Init = Importer.
Import(DDef->getInit());
3438 if (DDef->isInitKnownICE()) {
3441 Eval->
IsICE = DDef->isInitICE();
3446 return MergeWithVar;
3449 if (!ConflictingDecls.empty()) {
3451 ConflictingDecls.data(),
3452 ConflictingDecls.size());
3471 ToVar->setAccess(D->getAccess());
3472 ToVar->setLexicalDeclContext(LexicalDC);
3510 return Importer.
Imported(D, ToParm);
3541 ToParm->setIsUsed();
3543 return Importer.
Imported(D, ToParm);
3559 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3560 if (
ObjCMethodDecl *FoundMethod = dyn_cast<ObjCMethodDecl>(FoundDecls[
I])) {
3566 FoundMethod->getReturnType())) {
3567 Importer.
ToDiag(Loc, diag::err_odr_objc_method_result_type_inconsistent)
3569 << FoundMethod->getReturnType();
3570 Importer.
ToDiag(FoundMethod->getLocation(),
3571 diag::note_odr_objc_method_here)
3577 if (D->
param_size() != FoundMethod->param_size()) {
3578 Importer.
ToDiag(Loc, diag::err_odr_objc_method_num_params_inconsistent)
3580 << D->
param_size() << FoundMethod->param_size();
3581 Importer.
ToDiag(FoundMethod->getLocation(),
3582 diag::note_odr_objc_method_here)
3589 PEnd = D->
param_end(), FoundP = FoundMethod->param_begin();
3590 P != PEnd; ++
P, ++FoundP) {
3592 (*FoundP)->getType())) {
3593 Importer.
FromDiag((*P)->getLocation(),
3594 diag::err_odr_objc_method_param_type_inconsistent)
3596 << (*P)->getType() << (*FoundP)->getType();
3597 Importer.
ToDiag((*FoundP)->getLocation(), diag::note_odr_value_here)
3598 << (*FoundP)->getType();
3605 if (D->
isVariadic() != FoundMethod->isVariadic()) {
3606 Importer.
ToDiag(Loc, diag::err_odr_objc_method_variadic_inconsistent)
3608 Importer.
ToDiag(FoundMethod->getLocation(),
3609 diag::note_odr_objc_method_here)
3615 return Importer.
Imported(D, FoundMethod);
3642 ToParams.push_back(ToP);
3646 for (
unsigned I = 0, N = ToParams.size();
I != N; ++
I) {
3654 ToMethod->setLexicalDeclContext(LexicalDC);
3680 Importer.
Import(D->getLocation()),
3685 Result->setLexicalDeclContext(LexicalDC);
3719 ToCategory->setLexicalDeclContext(LexicalDC);
3734 FromProto != FromProtoEnd;
3735 ++FromProto, ++FromProtoLoc) {
3737 = cast_or_null<ObjCProtocolDecl>(Importer.
Import(*FromProto));
3740 Protocols.push_back(ToProto);
3741 ProtocolLocs.push_back(Importer.
Import(*FromProtoLoc));
3758 = cast_or_null<ObjCCategoryImplDecl>(
3788 FromProto != FromProtoEnd;
3789 ++FromProto, ++FromProtoLoc) {
3791 = cast_or_null<ObjCProtocolDecl>(Importer.
Import(*FromProto));
3794 Protocols.push_back(ToProto);
3795 ProtocolLocs.push_back(Importer.
Import(*FromProtoLoc));
3814 if (Definition && Definition != D) {
3815 Decl *ImportedDef = Importer.
Import(Definition);
3819 return Importer.
Imported(D, ImportedDef);
3835 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
3836 if (!FoundDecls[
I]->isInIdentifierNamespace(Decl::IDNS_ObjCProtocol))
3839 if ((MergeWithProtocol = dyn_cast<ObjCProtocolDecl>(FoundDecls[
I])))
3849 ToProto->setLexicalDeclContext(LexicalDC);
3883 ToLinkageSpec->setLexicalDeclContext(LexicalDC);
3886 Importer.
Imported(D, ToLinkageSpec);
3888 return ToLinkageSpec;
3898 FromSuper = cast_or_null<ObjCInterfaceDecl>(Importer.
Import(FromSuper));
3904 if ((
bool)FromSuper != (
bool)ToSuper ||
3906 Importer.
ToDiag(To->getLocation(),
3907 diag::err_odr_objc_superclass_inconsistent)
3913 Importer.
ToDiag(To->getLocation(),
3914 diag::note_odr_objc_missing_superclass);
3917 diag::note_odr_objc_superclass)
3920 Importer.
FromDiag(From->getLocation(),
3921 diag::note_odr_objc_missing_superclass);
3949 FromProto != FromProtoEnd;
3950 ++FromProto, ++FromProtoLoc) {
3952 = cast_or_null<ObjCProtocolDecl>(Importer.
Import(*FromProto));
3955 Protocols.push_back(ToProto);
3956 ProtocolLocs.push_back(Importer.
Import(*FromProtoLoc));
3991 for (
auto fromTypeParam : *list) {
3992 auto toTypeParam = cast_or_null<ObjCTypeParamDecl>(
3993 Importer.
Import(fromTypeParam));
3997 toTypeParams.push_back(toTypeParam);
4001 Importer.
Import(list->getLAngleLoc()),
4003 Importer.
Import(list->getRAngleLoc()));
4011 if (Definition && Definition != D) {
4012 Decl *ImportedDef = Importer.
Import(Definition);
4016 return Importer.
Imported(D, ImportedDef);
4033 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
4034 if (!FoundDecls[
I]->isInIdentifierNamespace(Decl::IDNS_Ordinary))
4037 if ((MergeWithIface = dyn_cast<ObjCInterfaceDecl>(FoundDecls[
I])))
4050 ToIface->setLexicalDeclContext(LexicalDC);
4081 Importer.
Import(D->getLocation()),
4086 if (D->getDeclContext() != D->getLexicalDeclContext()) {
4087 LexicalDC = Importer.
ImportContext(D->getLexicalDeclContext());
4091 ToImpl->setLexicalDeclContext(LexicalDC);
4113 Super = cast_or_null<ObjCInterfaceDecl>(
4126 Importer.
Import(D->getLocation()),
4132 if (D->getDeclContext() != D->getLexicalDeclContext()) {
4137 Impl->setLexicalDeclContext(LexicalDC);
4152 Importer.
ToDiag(Impl->getLocation(),
4153 diag::err_odr_objc_superclass_inconsistent)
4158 Importer.
ToDiag(Impl->getLocation(),
4159 diag::note_odr_objc_superclass)
4162 Importer.
ToDiag(Impl->getLocation(),
4163 diag::note_odr_objc_missing_superclass);
4165 Importer.
FromDiag(D->getLocation(),
4166 diag::note_odr_objc_superclass)
4169 Importer.
FromDiag(D->getLocation(),
4170 diag::note_odr_objc_missing_superclass);
4195 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
4197 = dyn_cast<ObjCPropertyDecl>(FoundDecls[
I])) {
4200 FoundProp->getType())) {
4201 Importer.
ToDiag(Loc, diag::err_odr_objc_property_type_inconsistent)
4202 << Name << D->
getType() << FoundProp->getType();
4203 Importer.
ToDiag(FoundProp->getLocation(), diag::note_odr_value_here)
4204 << FoundProp->getType();
4231 ToProperty->setLexicalDeclContext(LexicalDC);
4260 if (D->getDeclContext() != D->getLexicalDeclContext()) {
4261 LexicalDC = Importer.
ImportContext(D->getLexicalDeclContext());
4273 Ivar = cast_or_null<ObjCIvarDecl>(
4285 Importer.
Import(D->getLocation()),
4290 ToImpl->setLexicalDeclContext(LexicalDC);
4297 Importer.
ToDiag(ToImpl->getLocation(),
4298 diag::err_odr_objc_property_impl_kind_inconsistent)
4302 Importer.
FromDiag(D->getLocation(),
4303 diag::note_odr_objc_property_impl_kind)
4313 diag::err_odr_objc_synthesize_ivar_inconsistent)
4318 diag::note_odr_objc_synthesize_ivar_here)
4339 Importer.
Import(D->getLocation()),
4390 if (!TemplateParams)
4415 return Importer.
Imported(D, ImportedDef);
4433 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
4434 if (!FoundDecls[
I]->isInIdentifierNamespace(Decl::IDNS_Ordinary))
4437 Decl *Found = FoundDecls[
I];
4439 = dyn_cast<ClassTemplateDecl>(Found)) {
4445 FoundTemplate->getTemplatedDecl());
4446 return Importer.
Imported(D, FoundTemplate);
4450 ConflictingDecls.push_back(FoundDecls[
I]);
4453 if (!ConflictingDecls.empty()) {
4455 ConflictingDecls.data(),
4456 ConflictingDecls.size());
4468 Importer.
Import(DTemplated));
4474 return AlreadyImported;
4479 if (!TemplateParams)
4483 Loc,
Name, TemplateParams,
4486 D2Templated->setDescribedClassTemplate(D2);
4488 D2->setAccess(D->getAccess());
4489 D2->setLexicalDeclContext(LexicalDC);
4494 Importer.
Imported(DTemplated, D2Templated);
4497 !D2Templated->isCompleteDefinition()) {
4510 if (Definition && Definition != D) {
4511 Decl *ImportedDef = Importer.
Import(Definition);
4515 return Importer.
Imported(D, ImportedDef);
4519 = cast_or_null<ClassTemplateDecl>(Importer.
Import(
4525 DeclContext *DC = ClassTemplate->getDeclContext();
4530 if (D->getDeclContext() != D->getLexicalDeclContext()) {
4531 LexicalDC = Importer.
ImportContext(D->getLexicalDeclContext());
4548 void *InsertPos =
nullptr;
4562 return Importer.
Imported(D, FoundDef);
4576 ClassTemplate->AddSpecialization(D2, InsertPos);
4582 D2->setLexicalDeclContext(LexicalDC);
4605 return Importer.
Imported(D, ImportedDef);
4620 "Variable templates cannot be declared at function scope");
4624 for (
unsigned I = 0, N = FoundDecls.size();
I != N; ++
I) {
4625 if (!FoundDecls[
I]->isInIdentifierNamespace(Decl::IDNS_Ordinary))
4628 Decl *Found = FoundDecls[
I];
4629 if (
VarTemplateDecl *FoundTemplate = dyn_cast<VarTemplateDecl>(Found)) {
4633 FoundTemplate->getTemplatedDecl());
4634 return Importer.
Imported(D, FoundTemplate);
4638 ConflictingDecls.push_back(FoundDecls[
I]);
4641 if (!ConflictingDecls.empty()) {
4643 ConflictingDecls.data(),
4644 ConflictingDecls.size());
4664 D2Templated->setAccess(DTemplated->getAccess());
4666 D2Templated->setLexicalDeclContext(LexicalDC);
4678 if (!TemplateParams)
4685 D2->setAccess(D->getAccess());
4686 D2->setLexicalDeclContext(LexicalDC);
4691 Importer.
Imported(DTemplated, D2Templated);
4707 if (Definition && Definition != D) {
4708 Decl *ImportedDef = Importer.
Import(Definition);
4712 return Importer.
Imported(D, ImportedDef);
4726 if (D->getDeclContext() != D->getLexicalDeclContext()) {
4727 LexicalDC = Importer.
ImportContext(D->getLexicalDeclContext());
4743 void *InsertPos =
nullptr;
4745 TemplateArgs, InsertPos);
4758 return Importer.
Imported(D, FoundDef);
4771 Importer.
getToContext(), DC, StartLoc, IdLoc, VarTemplate, T, TInfo,
4777 VarTemplate->AddSpecialization(D2, InsertPos);
4783 D2->setLexicalDeclContext(LexicalDC);
4801 size_t NumDecls = DG.
end() - DG.
begin();
4803 auto &_Importer = this->Importer;
4804 std::transform(DG.
begin(), DG.
end(), ToDecls.begin(),
4806 return _Importer.Import(D);
4814 Importer.
FromDiag(S->getLocStart(), diag::err_unsupported_ast_node)
4815 << S->getStmtClassName();
4826 Names.push_back(ToII);
4832 Names.push_back(ToII);
4841 Clobbers.push_back(Clobber);
4850 Constraints.push_back(Output);
4858 Constraints.push_back(Input);
4892 for (
Decl *ToD : ToDG) {
4917 ToLBraceLoc, ToRBraceLoc);
4925 if (!ToRHS && S->
getRHS())
4931 ToCaseLoc, ToEllipsisLoc,
4949 if (!ToLabelDecl && S->
getDecl())
4963 std::transform(FromAttrs.begin(), FromAttrs.end(), ToAttrs.begin(),
4964 [&_ToContext](
const Attr *A) ->
const Attr * {
4965 return A->
clone(_ToContext);
4967 for (
const Attr *ToA : ToAttrs) {
4975 ToAttrs, ToSubStmt);
4983 VarDecl *ToConditionVariable =
nullptr;
4985 ToConditionVariable =
4986 dyn_cast_or_null<VarDecl>(Importer.
Import(FromConditionVariable));
4987 if (!ToConditionVariable)
4991 if (!ToCondition && S->
getCond())
4994 if (!ToThenStmt && S->
getThen())
4998 if (!ToElseStmt && S->
getElse())
5003 ToConditionVariable,
5004 ToCondition, ToThenStmt,
5005 ToElseLoc, ToElseStmt);
5012 VarDecl *ToConditionVariable =
nullptr;
5014 ToConditionVariable =
5015 dyn_cast_or_null<VarDecl>(Importer.
Import(FromConditionVariable));
5016 if (!ToConditionVariable)
5020 if (!ToCondition && S->
getCond())
5024 ToConditionVariable, ToCondition);
5037 if (LastChainedSwitchCase)
5041 LastChainedSwitchCase = ToSC;
5047 VarDecl *ToConditionVariable =
nullptr;
5049 ToConditionVariable =
5050 dyn_cast_or_null<VarDecl>(Importer.
Import(FromConditionVariable));
5051 if (!ToConditionVariable)
5055 if (!ToCondition && S->
getCond())
5062 ToConditionVariable,
5063 ToCondition, ToBody,
5072 if (!ToCondition && S->
getCond())
5078 ToDoLoc, ToWhileLoc,
5087 if (!ToCondition && S->
getCond())
5089 VarDecl *ToConditionVariable =
nullptr;
5091 ToConditionVariable =
5092 dyn_cast_or_null<VarDecl>(Importer.
Import(FromConditionVariable));
5093 if (!ToConditionVariable)
5097 if (!ToInc && S->
getInc())
5106 ToInit, ToCondition,
5107 ToConditionVariable,
5109 ToForLoc, ToLParenLoc,
5116 ToLabel = dyn_cast_or_null<LabelDecl>(Importer.
Import(FromLabel));
5123 ToGotoLoc, ToLabelLoc);
5152 VarDecl *ToNRVOCandidate = cast_or_null<VarDecl>(Importer.
Import(NRVOCandidate));
5153 if (!ToNRVOCandidate && NRVOCandidate)
5161 VarDecl *ToExceptionDecl =
nullptr;
5164 dyn_cast_or_null<VarDecl>(Importer.
Import(FromExceptionDecl));
5165 if (!ToExceptionDecl)
5182 for (
unsigned HI = 0, HE = S->
getNumHandlers(); HI != HE; ++HI) {
5184 if (
Stmt *ToHandler = Importer.
Import(FromHandler))
5185 ToHandlers[HI] = ToHandler;
5210 if (!ToInc && S->
getInc())
5226 ToForLoc, ToCoawaitLoc,
5227 ToColonLoc, ToRParenLoc);
5251 VarDecl *ToExceptionDecl =
nullptr;
5254 dyn_cast_or_null<VarDecl>(Importer.
Import(FromExceptionDecl));
5255 if (!ToExceptionDecl)
5284 if (
Stmt *ToCatchStmt = Importer.
Import(FromCatchStmt))
5285 ToCatchStmts[CI] = ToCatchStmt;
5293 ToAtTryLoc, ToAtTryStmt,
5294 ToCatchStmts.begin(), ToCatchStmts.size(),
5309 ToAtSynchronizedLoc, ToSynchExpr, ToSynchBody);
5334 Importer.
FromDiag(E->getLocStart(), diag::err_unsupported_ast_node)
5335 << E->getStmtClassName();
5449 IndexExprs[
I - 1] = Arg;
5455 llvm::transform(DIE->
designators(), Designators.begin(),
5461 if (D.isFieldDesignator() && !D.getFieldName())
5519 Locations.data(), Locations.size());
5641 SubExpr, ResultType,
5717 Common, OpaqueValue, Cond, TrueExpr, FalseExpr,
5742 if (CompLHSType.
isNull())
5746 if (CompResultType.
isNull())
5761 CompLHSType, CompResultType,
5809 SubExpr, &BasePath, TInfo,
5908 ToMember, ToFoundDecl, ToMemberNameInfo,
5926 for (
unsigned ai = 0, ae = NumArgs; ai != ae; ++ai) {
5937 for (
unsigned ai = 0, ae = NumArgs; ai != ae; ++ai)
5938 ToArgs_Copied[ai] = ToArgs[ai];
5942 llvm::makeArrayRef(ToArgs_Copied, NumArgs), T, E->
getValueKind(),
5978 Importer.
Import(SyntForm));
5992 FieldDecl *ToField = llvm::dyn_cast_or_null<FieldDecl>(
6018 if (isa<CXXStaticCastExpr>(E)) {
6020 Importer.
getToContext(), ToType, VK, CK, ToOp, &BasePath,
6021 ToWritten, ToOperatorLoc, ToRParenLoc, ToAngleBrackets);
6022 }
else if (isa<CXXDynamicCastExpr>(E)) {
6024 Importer.
getToContext(), ToType, VK, CK, ToOp, &BasePath,
6025 ToWritten, ToOperatorLoc, ToRParenLoc, ToAngleBrackets);
6026 }
else if (isa<CXXReinterpretCastExpr>(E)) {
6028 Importer.
getToContext(), ToType, VK, CK, ToOp, &BasePath,
6029 ToWritten, ToOperatorLoc, ToRParenLoc, ToAngleBrackets);
6038 : ToContext(ToContext), FromContext(FromContext),
6039 ToFileManager(ToFileManager), FromFileManager(FromFileManager),
6040 Minimal(MinimalImport), LastDiagFromFrom(
false)
6056 = ImportedTypes.find(fromTy);
6057 if (Pos != ImportedTypes.end())
6088 if (Pos != ImportedDecls.end()) {
6089 Decl *ToD = Pos->second;
6105 if (Pos != ImportedDecls.end()) {
6106 Decl *ToD = Pos->second;
6117 ImportedDecls[FromD] = ToD;
6119 if (
TagDecl *FromTag = dyn_cast<TagDecl>(FromD)) {
6121 if (FromTag->getTypedefNameForAnonDecl())
6122 AnonTagsWithPendingTypedefs.push_back(FromTag);
6123 }
else if (
TypedefNameDecl *FromTypedef = dyn_cast<TypedefNameDecl>(FromD)) {
6127 FromTag = AnonTagsWithPendingTypedefs.begin(),
6128 FromTagEnd = AnonTagsWithPendingTypedefs.end();
6129 FromTag != FromTagEnd; ++FromTag) {
6130 if ((*FromTag)->getTypedefNameForAnonDecl() == FromTypedef) {
6131 if (
TagDecl *ToTag = cast_or_null<TagDecl>(
Import(*FromTag))) {
6133 ToTag->setTypedefNameForAnonDecl(cast<TypedefNameDecl>(ToD));
6134 AnonTagsWithPendingTypedefs.erase(FromTag);
6154 if (
RecordDecl *ToRecord = dyn_cast<RecordDecl>(ToDC)) {
6155 RecordDecl *FromRecord = cast<RecordDecl>(FromDC);
6156 if (ToRecord->isCompleteDefinition()) {
6164 }
else if (
EnumDecl *ToEnum = dyn_cast<EnumDecl>(ToDC)) {
6165 EnumDecl *FromEnum = cast<EnumDecl>(FromDC);
6166 if (ToEnum->isCompleteDefinition()) {
6176 if (ToClass->getDefinition()) {
6186 if (ToProto->getDefinition()) {
6203 return cast_or_null<Expr>(
Import(cast<Stmt>(FromE)));
6212 if (Pos != ImportedStmts.end())
6217 Stmt *ToS = Importer.Visit(FromS);
6222 ImportedStmts[FromS] = ToS;
6267 bool bTemplate = FromNNS->
getKind() ==
6276 llvm_unreachable(
"Invalid nested name specifier kind");
6297 E = FromStorage->
end();
6355 = cast_or_null<TemplateTemplateParmDecl>(
6370 llvm_unreachable(
"Invalid template name kind");
6399 = ImportedFileIDs.find(FromID);
6400 if (Pos != ImportedFileIDs.end())
6406 assert(FromSLoc.
isFile() &&
"Cannot handle macro expansions yet");
6414 if (Cache->OrigEntry && Cache->OrigEntry->getDir()) {
6419 const FileEntry *Entry = ToFileManager.
getFile(Cache->OrigEntry->getName());
6426 const llvm::MemoryBuffer *
6427 FromBuf = Cache->getBuffer(FromContext.
getDiagnostics(), FromSM);
6428 std::unique_ptr<llvm::MemoryBuffer> ToBuf
6429 = llvm::MemoryBuffer::getMemBufferCopy(FromBuf->getBuffer(),
6430 FromBuf->getBufferIdentifier());
6436 ImportedFileIDs[FromID] = ToID;
6442 if (!ToExpr && From->
getInit())
6478 return new (ToContext)
6489 for (
unsigned AII = 0; AII < NumArrayIndices; ++AII) {
6499 ToAIs.data(), NumArrayIndices);
6511 if (
DeclContext *FromDC = cast<DeclContext>(From)) {
6514 if (
RecordDecl *ToRecord = dyn_cast<RecordDecl>(To)) {
6515 if (!ToRecord->getDefinition()) {
6522 if (
EnumDecl *ToEnum = dyn_cast<EnumDecl>(To)) {
6523 if (!ToEnum->getDefinition()) {
6531 if (!ToIFace->getDefinition()) {
6539 if (!ToProto->getDefinition()) {
6603 llvm_unreachable(
"Invalid DeclarationName Kind!");
6633 unsigned NumDecls) {
6638 if (LastDiagFromFrom)
6641 LastDiagFromFrom =
false;
6646 if (!LastDiagFromFrom)
6649 LastDiagFromFrom =
true;
6655 if (!
ID->getDefinition())
6656 ID->startDefinition();
6659 if (!PD->getDefinition())
6660 PD->startDefinition();
6662 else if (
TagDecl *TD = dyn_cast<TagDecl>(D)) {
6663 if (!TD->getDefinition() && !TD->isBeingDefined()) {
6664 TD->startDefinition();
6665 TD->setCompleteDefinition(
true);
6669 assert (0 &&
"CompleteDecl called on a Decl that can't be completed");
6674 if (From->hasAttrs()) {
6675 for (
Attr *FromAttr : From->getAttrs())
6676 To->addAttr(FromAttr->clone(To->getASTContext()));
6678 if (From->isUsed()) {
6681 if (From->isImplicit()) {
6684 ImportedDecls[From] = To;
6695 StructuralEquivalenceContext Ctx(FromContext, ToContext, NonEquivalentDecls,
6697 return Ctx.IsStructurallyEquivalent(From, To);
SourceLocation getRParenLoc() const
unsigned getNumElements() const
Represents a single C99 designator.
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.
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType) const
tokloc_iterator tokloc_begin() const
Defines the clang::ASTContext interface.
unsigned getNumArrayIndices() const
Determine the number of implicit array indices used while described an array member initialization...
unsigned getNumInits() const
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...
Expr * VisitCXXMemberCallExpr(CXXMemberCallExpr *E)
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
CastKind getCastKind() const
The null pointer literal (C++11 [lex.nullptr])
Expr * VisitConditionalOperator(ConditionalOperator *E)
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
static unsigned getFieldIndex(Decl *F)
This represents a GCC inline-assembly statement extension.
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)
unsigned getNumOutputs() const
TypeSourceInfo * getTypeSourceInfo() const
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...
void setArrayFiller(Expr *filler)
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)
CompoundStmt * getSubStmt()
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.
outputs_iterator end_outputs()
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)
Expr * getInit() const
Retrieve the initializer value.
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.
static CXXDynamicCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind Kind, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *Written, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
Expr * VisitCXXConstructExpr(CXXConstructExpr *E)
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
Defines the SourceManager interface.
tokloc_iterator tokloc_end() const
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
CXXRecordDecl * getDecl() 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
SourceLocation getLParenLoc() const
SourceLocation getLocStart() const LLVM_READONLY
unsigned size() const
Returns the number of designators in this initializer.
AccessSpecifier getAccess() const
DeclGroupRef ImportDeclGroup(DeclGroupRef DG)
VarDecl * getDefinition(ASTContext &)
Get the real (not just tentative) definition for this declaration.
unsigned getBuiltinID() const
Return a value indicating whether this is a builtin function.
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...
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.
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
enumerator_iterator enumerator_end() const
Represents Objective-C's @throw statement.
SourceLocation getRBracketLoc() const
QualType VisitTemplateSpecializationType(const TemplateSpecializationType *T)
SourceLocation getLabelLoc() const
QualType getRecordType(const RecordDecl *Decl) const
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
InitListExpr * getSyntacticForm() const
DependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgument > Args, QualType Canon)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Declaration of a variable template.
SourceLocation getIfLoc() const
SourceLocation getRParenLoc() 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.
static StringLiteral * Create(const ASTContext &C, StringRef Str, StringKind Kind, bool Pascal, QualType Ty, const SourceLocation *Loc, unsigned NumStrs)
This is the "fully general" constructor that allows representation of strings formed from multiple co...
QualType VisitInjectedClassNameType(const InjectedClassNameType *T)
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 getEllipsisLoc() const
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.
IdentType getIdentType() const
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
bool hadArrayRangeDesignator() 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.
static CXXConstructExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
An identifier, stored as an IdentifierInfo*.
Expr * VisitStringLiteral(StringLiteral *E)
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.
Expr * getInit() const
Get the initializer.
CompoundLiteralExpr - [C99 6.5.2.5].
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.
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)
TemplateTypeParmDecl * getDecl() const
A namespace, stored as a NamespaceDecl*.
DiagnosticBuilder ToDiag(SourceLocation Loc, unsigned DiagID)
Report a diagnostic in the "to" context.
SourceLocation getDoLoc() const
SourceLocation getRParenLoc() const
UnaryExprOrTypeTrait getKind() const
Expr * VisitUnaryOperator(UnaryOperator *E)
Stores a list of template parameters for a TemplateDecl and its derived classes.
Expr * VisitAtomicExpr(AtomicExpr *E)
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
static bool ImportCastPath(CastExpr *E, CXXCastPath &Path)
Qualifiers getIndexTypeQualifiers() const
QualType Import(QualType FromT)
Import the given type from the "from" context into the "to" context.
unsigned param_size() const
unsigned getValue() const
TemplateTemplateParmDecl * getParameter() const
static AccessSpecDecl * Create(ASTContext &C, AccessSpecifier AS, DeclContext *DC, SourceLocation ASLoc, SourceLocation ColonLoc)
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()'.
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the category interface associated with this implementat...
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getEllipsisLoc() 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.
Represents a C99 designated initializer expression.
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.
inputs_iterator begin_inputs()
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.
Expr * getSubExpr(unsigned Idx) const
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template.
unsigned getNumInputs() const
Designator ImportDesignator(const Designator &D)
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.
bool ImportArrayChecked(IIter Ibegin, IIter Iend, OIter Obegin)
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
SourceLocation getAmpAmpLoc() 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 isMemberInitializer() const
Determine whether this initializer is initializing a non-static data member.
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)
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
SourceLocation getCaseLoc() const
CXXRecordDecl * getDefinition() const
static CXXCtorInitializer * Create(ASTContext &Context, FieldDecl *Member, SourceLocation MemberLoc, SourceLocation L, Expr *Init, SourceLocation R, VarDecl **Indices, unsigned NumIndices)
Creates a new member initializer that optionally contains array indices used to describe an elementwi...
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
Represents an access specifier followed by colon ':'.
void startDefinition()
Starts the definition of this Objective-C protocol.
static CXXRecordDecl * CreateLambda(const ASTContext &C, DeclContext *DC, TypeSourceInfo *Info, SourceLocation Loc, bool DependentLambda, bool IsGeneric, LambdaCaptureDefault CaptureDefault)
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.
Describes an C or C++ initializer list.
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
IdentifierInfo * getOutputIdentifier(unsigned i) 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.
outputs_iterator begin_outputs()
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)
bool isInline() const
Returns true if this is an inline namespace declaration.
IndirectFieldDecl * getIndirectMember() const
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.
QualType VisitTemplateTypeParmType(const TemplateTypeParmType *T)
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)
const Expr * getSubExpr() const
static TemplateTypeParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation KeyLoc, SourceLocation NameLoc, unsigned D, unsigned P, IdentifierInfo *Id, bool Typename, bool ParameterPack)
SourceLocation getRParenLoc() const
Expr * getNoexceptExpr() const
A builtin binary operation expression such as "x + y" or "x <= y".
SourceLocation getLocation() const
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
void setLambdaMangling(unsigned ManglingNumber, Decl *ContextDecl)
Set the mangling number and context declaration for a lambda class.
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
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)
LabelStmt * getStmt() const
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)
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
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
FieldDecl * getField()
Get the field whose initializer will be used.
Represents an Objective-C protocol declaration.
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
StringLiteral * getClobberStringLiteral(unsigned i)
bool IsStructurallyEquivalent(QualType From, QualType To, bool Complain=true)
Determine whether the given types are structurally equivalent.
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)
SourceLocation getLParenLoc() const
ASTImporter(ASTContext &ToContext, FileManager &ToFileManager, ASTContext &FromContext, FileManager &FromFileManager, bool MinimalImport)
Create a new AST importer.
known_categories_range known_categories() const
CanQualType UnsignedCharTy
Expr * VisitGNUNullExpr(GNUNullExpr *E)
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)
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.
Represents the this expression in C++.
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
SourceLocation getBuiltinLoc() const
EnumDecl * getDecl() 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.
ConditionalOperator - The ?: ternary operator.
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 }.
SourceLocation getAsmLoc() const
QualType getParamType(unsigned i) const
Represents a prototype with parameter type info, e.g.
IdentifierInfo * getFieldName() const
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)
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
CastKind
CastKind - The kind of operation required for a conversion.
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.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
ImportDefinitionKind
What we should import from the definition.
Represents a call to the builtin function __builtin_va_arg.
SourceLocation getSuperClassLoc() const
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.
SourceLocation getThrowLoc() const LLVM_READONLY
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
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
unsigned getNumExprs() 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.
IdentifierInfo * getInputIdentifier(unsigned i) const
llvm::MutableArrayRef< Designator > designators()
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)
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
SourceLocation getLParenLoc() const
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
void setSyntacticForm(InitListExpr *Init)
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.
SourceLocation getLBraceLoc() const
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
Retrieve the template name that corresponds to a non-empty lookup.
Expr * getBitWidth() const
ArrayRef< NamedDecl * > chain() 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.
static CXXStaticCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *Written, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
ArgKind getKind() const
Return the kind of stored template argument.
SourceLocation getLocation() const
ExtProtoInfo getExtProtoInfo() const
static Optional< unsigned > findUntaggedStructOrUnionIndex(RecordDecl *Anon)
Find the index of the given anonymous struct/union within its context.
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
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)
Expr * VisitAddrLabelExpr(AddrLabelExpr *E)
Decl * VisitAccessSpecDecl(AccessSpecDecl *D)
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.
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
Expr * VisitPredefinedExpr(PredefinedExpr *E)
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
static FloatingLiteral * Create(const ASTContext &C, const llvm::APFloat &V, bool isexact, QualType Type, SourceLocation L)
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.
SourceRange getAngleBrackets() const LLVM_READONLY
SourceLocation getMemberLocation() const
SourceLocation getEndLoc() const
Stmt * VisitObjCAtTryStmt(ObjCAtTryStmt *S)
const SwitchCase * getSwitchCaseList() const
SourceLocation getQuestionLoc() const
Expr * VisitCXXThisExpr(CXXThisExpr *E)
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Expr * getSubExpr() const
bool isIndirectMemberInitializer() 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 getLParenLoc() const
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)
unsigned getNumSubExprs() const
Retrieve the total number of subexpressions in this designated initializer expression, including the actual initialized value and any expressions that occur within array and array-range designators.
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
bool isArrayRangeDesignator() 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)
ArrayRef< ParmVarDecl * > parameters() const
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.
Expr * VisitParenListExpr(ParenListExpr *E)
A template template parameter pack that has been substituted for a template template argument pack...
SourceLocation getDotLoc() const
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.
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
SourceLocation getGotoLoc() const
SourceLocation getExternLoc() const
const StringLiteral * getAsmString() const
SelectorTable & Selectors
Decl * VisitIndirectFieldDecl(IndirectFieldDecl *D)
ExceptionSpecificationType Type
The kind of exception specification this is.
static ClassTemplateSpecializationDecl * Create(ASTContext &Context, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, ClassTemplateDecl *SpecializedTemplate, ArrayRef< TemplateArgument > Args, ClassTemplateSpecializationDecl *PrevDecl)
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.
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
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
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.
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...
Represents a call to a member function that may be written either with member call syntax (e...
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)
void setCtorInitializers(CXXCtorInitializer **Initializers)
QualType getTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon=QualType()) const
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>::".
ArrayRef< ParmVarDecl * > parameters() const
bool isBaseVirtual() const
Returns whether the base is virtual or not.
SourceLocation getLBracketLoc() const
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
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>.
bool isPropertyAccessor() const
void addDecl(NamedDecl *D)
QualType VisitTypedefType(const TypedefType *T)
SourceLocation getContinueLoc() const
const FileInfo & getFile() const
StringLiteral * getFunctionName()
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
const internal::VariadicDynCastAllOfMatcher< Decl, AccessSpecDecl > accessSpecDecl
Matches C++ access specifier declarations.
bool isPackExpansion() const
Determine whether this initializer is a pack expansion.
static CXXDefaultInitExpr * Create(const ASTContext &C, SourceLocation Loc, FieldDecl *Field)
Field is the non-static data member whose default initializer is used by this expression.
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...
Expr ** getInits()
Retrieve the set of initializers.
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>.
static DesignatedInitExpr * Create(const ASTContext &C, llvm::ArrayRef< Designator > Designators, ArrayRef< Expr * > IndexExprs, SourceLocation EqualOrColonLoc, bool GNUSyntax, Expr *Init)
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)
Expr * VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E)
SourceLocation getAtSynchronizedLoc() const
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Stmt * VisitWhileStmt(WhileStmt *S)
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Attr * clone(ASTContext &C) const
Expr * VisitCallExpr(CallExpr *E)
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
SourceLocation getCategoryNameLoc() const
Decl * VisitLabelDecl(LabelDecl *D)
QualType VisitObjCObjectPointerType(const ObjCObjectPointerType *T)
void setHasInheritedDefaultArg(bool I=true)
SourceLocation getForLoc() const
void sawArrayRangeDesignator(bool ARD=true)
QualType getType() const
Return the type wrapped by this type source info.
static CXXReinterpretCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind Kind, Expr *Op, const CXXCastPath *Path, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
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)
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
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
AddrLabelExpr - The GNU address of label extension, representing &&label.
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.
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Represents a template name that was expressed as a qualified name.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
SourceLocation getExprLoc() const LLVM_READONLY
NullStmt - This is the null statement ";": C99 6.8.3p3.
Selector getObjCSelector() const
getObjCSelector - Get the Objective-C selector stored in this declaration name.
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
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...
Expr * VisitCXXNamedCastExpr(CXXNamedCastExpr *E)
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.
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)
[C99 6.4.2.2] - A predefined identifier such as func.
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...
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
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.
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
DefinitionKind isThisDeclarationADefinition(ASTContext &) const
Check whether this declaration is a definition.
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)
QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *ParmDecl=nullptr) const
Retrieve the template type parameter type for a template parameter or parameter pack with the given d...
A set of unresolved declarations.
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
SourceLocation getWhileLoc() const
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
SourceLocation getLocStart() const LLVM_READONLY
bool isNull() const
Determine whether this template argument has no value.
StringKind getKind() const
EnumDecl - Represents an enum.
void ImportArray(IIter Ibegin, IIter Iend, OIter Obegin)
detail::InMemoryDirectory::const_iterator E
A pointer to member type per C++ 8.3.3 - Pointers to members.
QualType getModifiedType() const
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
const Expr * getRetValue() const
Expr * VisitImplicitValueInitExpr(ImplicitValueInitExpr *ILE)
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
SourceLocation getLocation() const
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
FieldDecl * getMember() const
If this is a member initializer, returns the declaration of the non-static data member being initiali...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
unsigned getNumArgs() const
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
void setInitializedFieldInUnion(FieldDecl *FD)
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...
static LabelDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdentL, IdentifierInfo *II)
llvm::APFloat getValue() const
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)
Expr * VisitFloatingLiteral(FloatingLiteral *E)
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.
VarDecl * getTemplatedDecl() const
Get the underlying variable declarations of the template.
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
const T * getAs() const
Member-template getAs<specific type>'.
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate...
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.
Represents a C++ base or member initializer.
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
Expr * VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E)
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 setBuiltinID(unsigned ID)
TypeSourceInfo * getWrittenTypeInfo() const
void setSwitchLoc(SourceLocation L)
ExtVectorType - Extended vector type.
QualType getInnerType() const
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
Get the constructor that this expression will (ultimately) call.
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.
DesignatedInitExpr::Designator Designator
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.
LabelDecl * getLabel() const
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.
const Expr * getInitializer() const
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
SourceLocation getLocation() const
DeclStmt * getRangeStmt()
Stmt * VisitObjCAtThrowStmt(ObjCAtThrowStmt *S)
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
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...
A use of a default initializer in a constructor or in aggregate initialization.
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.
Expr * VisitInitListExpr(InitListExpr *E)
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).
const StringLiteral * getInputConstraintLiteral(unsigned i) const
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...
SourceLocation getBuiltinLoc() const
bool hasArrayFiller() const
Return true if this is an array initializer and its array "filler" has been set.
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
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.
static IndirectFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, llvm::MutableArrayRef< NamedDecl * > CH)
ContinueStmt - This represents a continue.
Expr * VisitDesignatedInitExpr(DesignatedInitExpr *E)
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.
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
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
ObjCPropertyQueryKind getQueryKind() 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.
Expr * VisitVAArgExpr(VAArgExpr *E)
const Expr * getThrowExpr() const
QualType getParamTypeForDecl() const
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
StringLiteral - This represents a string literal expression, e.g.
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.
Expr * VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E)
ObjCInterfaceDecl * getSuperClass() const
Expr * VisitOpaqueValueExpr(OpaqueValueExpr *E)
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)
Abstract class common to all of the C++ "named"/"keyword" casts.
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
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)
VarDecl * getArrayIndex(unsigned I)
Retrieve a particular array index variable used to describe an array member initialization.
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.
Expr * VisitBinaryConditionalOperator(BinaryConditionalOperator *E)
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...
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Expr * VisitCompoundLiteralExpr(CompoundLiteralExpr *E)
bool isFieldDesignator() const
DeclStmt * getLoopVarStmt()
unsigned getNumClobbers() const
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
A set of overloaded template declarations.
SourceLocation getRParenLoc() const
unsigned getFirstExprIndex() const
A trivial tuple used to represent a source range.
static VarTemplateSpecializationDecl * Create(ASTContext &Context, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, VarTemplateDecl *SpecializedTemplate, QualType T, TypeSourceInfo *TInfo, StorageClass S, ArrayRef< TemplateArgument > Args)
NamedDecl - This represents a decl with a name.
DeclarationNameInfo getNameInfo() const
SourceLocation getRParenLoc() const
A boolean literal, per ([C++ lex.bool] Boolean literals).
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.
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.
SourceLocation getLocation() const
DeclStmt * getBeginStmt()
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)
static CXXConstructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isExplicit, bool isInline, bool isImplicitlyDeclared, bool isConstexpr, InheritedConstructor Inherited=InheritedConstructor())
SourceLocation ColonLoc
Location of ':'.
Decl * VisitParmVarDecl(ParmVarDecl *D)
SourceLocation getCatchLoc() const
QualType VisitRValueReferenceType(const RValueReferenceType *T)
Represents Objective-C's @autoreleasepool Statement.
Stmt * VisitGCCAsmStmt(GCCAsmStmt *S)
QualType VisitAutoType(const AutoType *T)
TemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon, QualType Aliased)
SourceLocation getFieldLoc() const
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
bool isArrayDesignator() const
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)
Represents an implicitly-generated value initialization of an object of a given type.
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.
SourceLocation getColonLoc() const
Expr * VisitStmtExpr(StmtExpr *E)
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).
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
inputs_iterator end_inputs()
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 ...