25 #include "llvm/Support/MemoryBuffer.h" 135 unsigned NumFromArgs,
137 template <
typename InContainerTy>
141 bool Complain =
true);
143 bool Complain =
true);
305 template<
typename IIter,
typename OIter>
309 std::transform(Ibegin, Iend, Obegin,
310 [&ImporterRef](ItemT From) -> ItemT {
311 return ImporterRef.
Import(From);
315 template<
typename IIter,
typename OIter>
320 std::transform(Ibegin, Iend, Obegin,
321 [&ImporterRef, &Failed](ItemT *From) -> ItemT * {
322 ItemT *To = cast_or_null<ItemT>(
323 ImporterRef.
Import(From));
331 template<
typename InContainerTy,
typename OutContainerTy>
333 OutContainerTy &OutContainer) {
335 OutContainer.begin());
338 template<
typename InContainerTy,
typename OIter>
352 using namespace clang;
355 Importer.FromDiag(
SourceLocation(), diag::err_unsupported_ast_node)
362 if(UnderlyingType.
isNull())
365 return Importer.getToContext().getAtomicType(UnderlyingType);
370 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 371 case BuiltinType::Id: \ 372 return Importer.getToContext().SingletonId; 373 #include "clang/Basic/OpenCLImageTypes.def" 374 #define SHARED_SINGLETON_TYPE(Expansion) 375 #define BUILTIN_TYPE(Id, SingletonId) \ 376 case BuiltinType::Id: return Importer.getToContext().SingletonId; 377 #include "clang/AST/BuiltinTypes.def" 385 case BuiltinType::Char_U:
389 if (Importer.getToContext().getLangOpts().CharIsSigned)
390 return Importer.getToContext().UnsignedCharTy;
392 return Importer.getToContext().CharTy;
394 case BuiltinType::Char_S:
398 if (!Importer.getToContext().getLangOpts().CharIsSigned)
399 return Importer.getToContext().SignedCharTy;
401 return Importer.getToContext().CharTy;
403 case BuiltinType::WChar_S:
404 case BuiltinType::WChar_U:
407 return Importer.getToContext().WCharTy;
410 llvm_unreachable(
"Invalid BuiltinType Kind!");
418 return Importer.getToContext().getDecayedType(OrigT);
423 if (ToElementType.
isNull())
426 return Importer.getToContext().getComplexType(ToElementType);
431 if (ToPointeeType.
isNull())
434 return Importer.getToContext().getPointerType(ToPointeeType);
440 if (ToPointeeType.
isNull())
443 return Importer.getToContext().getBlockPointerType(ToPointeeType);
450 if (ToPointeeType.
isNull())
453 return Importer.getToContext().getLValueReferenceType(ToPointeeType);
460 if (ToPointeeType.
isNull())
463 return Importer.getToContext().getRValueReferenceType(ToPointeeType);
469 if (ToPointeeType.
isNull())
473 return Importer.getToContext().getMemberPointerType(ToPointeeType,
479 if (ToElementType.
isNull())
482 return Importer.getToContext().getConstantArrayType(ToElementType,
491 if (ToElementType.
isNull())
494 return Importer.getToContext().getIncompleteArrayType(ToElementType,
501 if (ToElementType.
isNull())
509 return Importer.getToContext().getVariableArrayType(ToElementType, Size,
517 if (ToElementType.
isNull())
520 return Importer.getToContext().getVectorType(ToElementType,
527 if (ToElementType.
isNull())
530 return Importer.getToContext().getExtVectorType(ToElementType,
539 if (ToResultType.
isNull())
542 return Importer.getToContext().getFunctionNoProtoType(ToResultType,
548 if (ToResultType.
isNull())
554 QualType ArgType = Importer.Import(A);
557 ArgTypes.push_back(ArgType);
563 QualType ExceptionType = Importer.Import(E);
564 if (ExceptionType.
isNull())
566 ExceptionTypes.push_back(ExceptionType);
586 return Importer.getToContext().
getFunctionType(ToResultType, ArgTypes, ToEPI);
592 Importer.Import(T->
getDecl()));
597 cast_or_null<UnresolvedUsingTypenameDecl>(
602 return Importer.getToContext().getTypeDeclType(ToD, ToPrevD);
610 return Importer.getToContext().getParenType(ToInnerType);
615 = dyn_cast_or_null<TypedefNameDecl>(Importer.Import(T->
getDecl()));
619 return Importer.getToContext().getTypeDeclType(ToDecl);
627 return Importer.getToContext().getTypeOfExprType(ToExpr);
632 if (ToUnderlyingType.
isNull())
635 return Importer.getToContext().getTypeOfType(ToUnderlyingType);
645 if (UnderlyingType.
isNull())
648 return Importer.getToContext().getDecltypeType(ToExpr, UnderlyingType);
657 return Importer.getToContext().getUnaryTransformType(ToBaseType,
666 if (!FromDeduced.
isNull()) {
667 ToDeduced = Importer.Import(FromDeduced);
672 return Importer.getToContext().getAutoType(ToDeduced, T->
getKeyword(),
700 = dyn_cast_or_null<RecordDecl>(Importer.Import(T->
getDecl()));
704 return Importer.getToContext().getTagDeclType(ToDecl);
709 = dyn_cast_or_null<EnumDecl>(Importer.Import(T->
getDecl()));
713 return Importer.getToContext().getTagDeclType(ToDecl);
722 if (!FromModifiedType.
isNull()) {
723 ToModifiedType = Importer.Import(FromModifiedType);
724 if (ToModifiedType.
isNull())
727 if (!FromEquivalentType.
isNull()) {
728 ToEquivalentType = Importer.Import(FromEquivalentType);
729 if (ToEquivalentType.
isNull())
733 return Importer.getToContext().getAttributedType(T->
getAttrKind(),
734 ToModifiedType, ToEquivalentType);
741 cast_or_null<TemplateTypeParmDecl>(Importer.Import(T->
getDecl()));
745 return Importer.getToContext().getTemplateTypeParmType(
752 cast_or_null<TemplateTypeParmType>(Importer.Import(
762 return Importer.getToContext().getSubstTemplateTypeParmType(
763 Replaced, Replacement);
777 if (!
QualType(T, 0).isCanonical()) {
780 ToCanonType =Importer.Import(FromCanonType);
784 return Importer.getToContext().getTemplateSpecializationType(ToTemplate,
802 return Importer.getToContext().getElaboratedType(T->
getKeyword(),
803 ToQualifier, ToNamedType);
811 return Importer.getToContext().getPackExpansionType(Pattern,
817 = dyn_cast_or_null<ObjCInterfaceDecl>(Importer.Import(T->
getDecl()));
821 return Importer.getToContext().getObjCInterfaceType(Class);
831 QualType ImportedTypeArg = Importer.Import(TypeArg);
832 if (ImportedTypeArg.
isNull())
835 TypeArgs.push_back(ImportedTypeArg);
839 for (
auto *
P : T->
quals()) {
841 = dyn_cast_or_null<ObjCProtocolDecl>(Importer.Import(
P));
844 Protocols.push_back(Protocol);
847 return Importer.getToContext().getObjCObjectType(ToBaseType, TypeArgs,
855 if (ToPointeeType.
isNull())
858 return Importer.getToContext().getObjCObjectPointerType(ToPointeeType);
888 ToD = cast_or_null<NamedDecl>(Importer.GetAlreadyImportedOrNull(D));
897 ToD = Importer.Import(FromD);
902 if (
RecordDecl *FromRecord = dyn_cast<RecordDecl>(FromD)) {
903 if (
RecordDecl *ToRecord = cast_or_null<RecordDecl>(ToD)) {
904 if (FromRecord->getDefinition() && FromRecord->isCompleteDefinition() && !ToRecord->getDefinition()) {
911 if (
EnumDecl *FromEnum = dyn_cast<EnumDecl>(FromD)) {
912 if (
EnumDecl *ToEnum = cast_or_null<EnumDecl>(ToD)) {
913 if (FromEnum->getDefinition() && !ToEnum->getDefinition()) {
953 llvm_unreachable(
"Unknown name kind.");
957 if (Importer.isMinimalImport() && !ForceImport) {
958 Importer.ImportContext(FromDC);
962 for (
auto *From : FromDC->
decls())
963 Importer.Import(From);
981 struct CXXRecordDecl::DefinitionData &ToData = ToCXX->data();
982 struct CXXRecordDecl::DefinitionData &FromData = FromCXX->data();
983 ToData.UserDeclaredConstructor = FromData.UserDeclaredConstructor;
984 ToData.UserDeclaredSpecialMembers = FromData.UserDeclaredSpecialMembers;
985 ToData.Aggregate = FromData.Aggregate;
986 ToData.PlainOldData = FromData.PlainOldData;
987 ToData.Empty = FromData.Empty;
988 ToData.Polymorphic = FromData.Polymorphic;
989 ToData.Abstract = FromData.Abstract;
990 ToData.IsStandardLayout = FromData.IsStandardLayout;
991 ToData.HasNoNonEmptyBases = FromData.HasNoNonEmptyBases;
992 ToData.HasPrivateFields = FromData.HasPrivateFields;
993 ToData.HasProtectedFields = FromData.HasProtectedFields;
994 ToData.HasPublicFields = FromData.HasPublicFields;
995 ToData.HasMutableFields = FromData.HasMutableFields;
996 ToData.HasVariantMembers = FromData.HasVariantMembers;
997 ToData.HasOnlyCMembers = FromData.HasOnlyCMembers;
998 ToData.HasInClassInitializer = FromData.HasInClassInitializer;
999 ToData.HasUninitializedReferenceMember
1000 = FromData.HasUninitializedReferenceMember;
1001 ToData.HasUninitializedFields = FromData.HasUninitializedFields;
1002 ToData.HasInheritedConstructor = FromData.HasInheritedConstructor;
1003 ToData.HasInheritedAssignment = FromData.HasInheritedAssignment;
1004 ToData.NeedOverloadResolutionForCopyConstructor
1005 = FromData.NeedOverloadResolutionForCopyConstructor;
1006 ToData.NeedOverloadResolutionForMoveConstructor
1007 = FromData.NeedOverloadResolutionForMoveConstructor;
1008 ToData.NeedOverloadResolutionForMoveAssignment
1009 = FromData.NeedOverloadResolutionForMoveAssignment;
1010 ToData.NeedOverloadResolutionForDestructor
1011 = FromData.NeedOverloadResolutionForDestructor;
1012 ToData.DefaultedCopyConstructorIsDeleted
1013 = FromData.DefaultedCopyConstructorIsDeleted;
1014 ToData.DefaultedMoveConstructorIsDeleted
1015 = FromData.DefaultedMoveConstructorIsDeleted;
1016 ToData.DefaultedMoveAssignmentIsDeleted
1017 = FromData.DefaultedMoveAssignmentIsDeleted;
1018 ToData.DefaultedDestructorIsDeleted = FromData.DefaultedDestructorIsDeleted;
1019 ToData.HasTrivialSpecialMembers = FromData.HasTrivialSpecialMembers;
1020 ToData.HasIrrelevantDestructor = FromData.HasIrrelevantDestructor;
1021 ToData.HasConstexprNonCopyMoveConstructor
1022 = FromData.HasConstexprNonCopyMoveConstructor;
1023 ToData.HasDefaultedDefaultConstructor
1024 = FromData.HasDefaultedDefaultConstructor;
1025 ToData.CanPassInRegisters = FromData.CanPassInRegisters;
1026 ToData.DefaultedDefaultConstructorIsConstexpr
1027 = FromData.DefaultedDefaultConstructorIsConstexpr;
1028 ToData.HasConstexprDefaultConstructor
1029 = FromData.HasConstexprDefaultConstructor;
1030 ToData.HasNonLiteralTypeFieldsOrBases
1031 = FromData.HasNonLiteralTypeFieldsOrBases;
1033 ToData.UserProvidedDefaultConstructor
1034 = FromData.UserProvidedDefaultConstructor;
1035 ToData.DeclaredSpecialMembers = FromData.DeclaredSpecialMembers;
1036 ToData.ImplicitCopyConstructorCanHaveConstParamForVBase
1037 = FromData.ImplicitCopyConstructorCanHaveConstParamForVBase;
1038 ToData.ImplicitCopyConstructorCanHaveConstParamForNonVBase
1039 = FromData.ImplicitCopyConstructorCanHaveConstParamForNonVBase;
1040 ToData.ImplicitCopyAssignmentHasConstParam
1041 = FromData.ImplicitCopyAssignmentHasConstParam;
1042 ToData.HasDeclaredCopyConstructorWithConstParam
1043 = FromData.HasDeclaredCopyConstructorWithConstParam;
1044 ToData.HasDeclaredCopyAssignmentWithConstParam
1045 = FromData.HasDeclaredCopyAssignmentWithConstParam;
1046 ToData.IsLambda = FromData.IsLambda;
1049 for (
const auto &Base1 : FromCXX->
bases()) {
1050 QualType T = Importer.Import(Base1.getType());
1055 if (Base1.isPackExpansion())
1056 EllipsisLoc = Importer.Import(Base1.getEllipsisLoc());
1062 new (Importer.getToContext())
1065 Base1.isBaseOfClass(),
1066 Base1.getAccessSpecifierAsWritten(),
1067 Importer.Import(Base1.getTypeSourceInfo()),
1071 ToCXX->setBases(Bases.data(), Bases.size());
1106 QualType T = Importer.Import(Importer.getFromContext().getTypeDeclType(From));
1111 if (ToPromotionType.
isNull())
1131 Expr *ToRequiresClause;
1133 ToRequiresClause = Importer.Import(R);
1134 if (!ToRequiresClause)
1137 ToRequiresClause =
nullptr;
1171 if (!To || ToType.
isNull())
1212 llvm::makeArrayRef(ToPack).copy(Importer.getToContext()));
1216 llvm_unreachable(
"Invalid template argument kind");
1225 Expr *E = Importer.Import(FromInfo.getAsExpr());
1230 if (
TypeSourceInfo *TSI = Importer.Import(FromInfo.getAsTypeSourceInfo()))
1236 Importer.Import(FromInfo.getTemplateQualifierLoc()),
1237 Importer.Import(FromInfo.getTemplateNameLoc()),
1238 Importer.Import(FromInfo.getTemplateEllipsisLoc()));
1244 unsigned NumFromArgs,
1246 for (
unsigned I = 0; I != NumFromArgs; ++I) {
1251 ToArgs.push_back(To);
1257 template <
typename InContainerTy>
1260 for (
const auto &FromLoc : Container) {
1273 Decl *ToOrigin = Importer.GetOriginalDecl(ToRecord);
1277 ToRecord = ToOriginRecord;
1282 Importer.getNonEquivalentDecls(),
1290 Importer.getFromContext(), Importer.getToContext(),
1291 Importer.getNonEquivalentDecls(),
false, Complain);
1297 Importer.getToContext(),
1298 Importer.getNonEquivalentDecls());
1305 Importer.getFromContext(), Importer.getToContext(),
1306 Importer.getNonEquivalentDecls(),
false,
false);
1313 const llvm::APSInt &FromVal = FromEC->
getInitVal();
1314 const llvm::APSInt &ToVal = ToEC->
getInitVal();
1316 return FromVal.isSigned() == ToVal.isSigned() &&
1317 FromVal.getBitWidth() == ToVal.getBitWidth() &&
1324 Importer.getToContext(),
1325 Importer.getNonEquivalentDecls());
1332 Importer.getToContext(),
1333 Importer.getNonEquivalentDecls());
1338 Importer.FromDiag(D->
getLocation(), diag::err_unsupported_ast_node)
1361 Importer.Imported(D, ToD);
1370 Importer.Imported(D, ToD);
1389 if (!accessSpecDecl)
1415 StringLiteral *ToMsg = cast_or_null<StringLiteral>(Importer.Import(FromMsg));
1416 if (!ToMsg && FromMsg)
1420 Importer.getToContext(), DC, Loc, AssertExpr, ToMsg,
1425 Importer.Imported(D, ToD);
1448 MergeWithNamespace = cast<NamespaceDecl>(DC)->getAnonymousNamespace();
1453 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
1457 if (
NamespaceDecl *FoundNS = dyn_cast<NamespaceDecl>(FoundDecls[I])) {
1458 MergeWithNamespace = FoundNS;
1459 ConflictingDecls.clear();
1463 ConflictingDecls.push_back(FoundDecls[I]);
1466 if (!ConflictingDecls.empty()) {
1468 ConflictingDecls.data(),
1469 ConflictingDecls.size());
1488 TU->setAnonymousNamespace(ToNamespace);
1490 cast<NamespaceDecl>(DC)->setAnonymousNamespace(ToNamespace);
1493 Importer.Imported(D, ToNamespace);
1532 Importer.Imported(D, ToD);
1557 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
1558 if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
1561 dyn_cast<TypedefNameDecl>(FoundDecls[I])) {
1563 FoundTypedef->getUnderlyingType()))
1564 return Importer.Imported(D, FoundTypedef);
1567 ConflictingDecls.push_back(FoundDecls[I]);
1570 if (!ConflictingDecls.empty()) {
1571 Name = Importer.HandleNameConflict(Name, DC, IDNS,
1572 ConflictingDecls.data(),
1573 ConflictingDecls.size());
1600 ToTypedef->setLexicalDeclContext(LexicalDC);
1601 Importer.Imported(D, ToTypedef);
1634 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
1635 if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
1637 if (
auto *FoundAlias =
1638 dyn_cast<TypeAliasTemplateDecl>(FoundDecls[I]))
1639 return Importer.Imported(D, FoundAlias);
1640 ConflictingDecls.push_back(FoundDecls[I]);
1643 if (!ConflictingDecls.empty()) {
1644 Name = Importer.HandleNameConflict(Name, DC, IDNS,
1645 ConflictingDecls.data(),
1646 ConflictingDecls.size());
1657 NamedDecl *TemplDecl = cast_or_null<NamedDecl>(
1663 Importer.getToContext(), DC, Loc, Name, Params, TemplDecl);
1667 Importer.Imported(D, ToAlias);
1693 Importer.Imported(D, ToLabel);
1699 ToLabel->setStmt(Label);
1700 ToLabel->setLexicalDeclContext(LexicalDC);
1722 }
else if (Importer.getToContext().getLangOpts().CPlusPlus)
1730 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
1731 if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
1734 Decl *Found = FoundDecls[I];
1737 Found = Tag->getDecl();
1740 if (
EnumDecl *FoundEnum = dyn_cast<EnumDecl>(Found)) {
1742 return Importer.Imported(D, FoundEnum);
1745 ConflictingDecls.push_back(FoundDecls[I]);
1748 if (!ConflictingDecls.empty()) {
1749 Name = Importer.HandleNameConflict(Name, DC, IDNS,
1750 ConflictingDecls.data(),
1751 ConflictingDecls.size());
1765 Importer.Imported(D, D2);
1770 if (ToIntegerType.
isNull())
1786 if (Definition && Definition != D) {
1787 Decl *ImportedDef = Importer.Import(Definition);
1791 return Importer.Imported(D, ImportedDef);
1810 }
else if (Importer.getToContext().getLangOpts().CPlusPlus)
1821 if (!FoundDecls.empty()) {
1827 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
1828 if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
1831 Decl *Found = FoundDecls[I];
1834 Found = Tag->getDecl();
1837 if (
RecordDecl *FoundRecord = dyn_cast<RecordDecl>(Found)) {
1839 FoundRecord->isAnonymousStructOrUnion()) {
1846 findUntaggedStructOrUnionIndex(FoundRecord)) {
1847 if (*Index1 != *Index2)
1853 PrevDecl = FoundRecord;
1859 == FoundDef->isAnonymousStructOrUnion() &&
1865 return Importer.Imported(D, FoundDef);
1874 if (FoundRecord->hasExternalLexicalStorage() &&
1875 !FoundRecord->isCompleteDefinition())
1880 if (FoundRecord->isCompleteDefinition() &&
1885 AdoptDecl = FoundRecord;
1887 }
else if (!SearchName) {
1892 ConflictingDecls.push_back(FoundDecls[I]);
1895 if (!ConflictingDecls.empty() && SearchName) {
1896 Name = Importer.HandleNameConflict(Name, DC, IDNS,
1897 ConflictingDecls.data(),
1898 ConflictingDecls.size());
1907 if (
CXXRecordDecl *DCXX = llvm::dyn_cast<CXXRecordDecl>(D)) {
1908 if (DCXX->isLambda()) {
1909 TypeSourceInfo *TInfo = Importer.Import(DCXX->getLambdaTypeInfo());
1912 DCXX->isDependentLambda(),
1913 DCXX->isGenericLambda(),
1914 DCXX->getLambdaCaptureDefault());
1915 Decl *CDecl = Importer.Import(DCXX->getLambdaContextDecl());
1916 if (DCXX->getLambdaContextDecl() && !CDecl)
1919 }
else if (DCXX->isInjectedClassName()) {
1923 const bool DelayTypeCreation =
true;
1925 Importer.getToContext(), D->
getTagKind(), DC, StartLoc, Loc,
1927 Importer.getToContext().getTypeDeclType(
1928 D2CXX, llvm::dyn_cast<CXXRecordDecl>(DC));
1938 Importer.Imported(D, D2);
1941 DCXX->getDescribedClassTemplate()) {
1943 Importer.Import(FromDescribed));
1949 DCXX->getMemberSpecializationInfo()) {
1951 MemberInfo->getTemplateSpecializationKind();
1954 cast_or_null<CXXRecordDecl>(Importer.Import(FromInst));
1955 if (FromInst && !ToInst)
1959 Importer.Import(MemberInfo->getPointOfInstantiation()));
1978 Importer.Imported(D, D2);
2008 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
2009 if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
2013 = dyn_cast<EnumConstantDecl>(FoundDecls[I])) {
2015 return Importer.Imported(D, FoundEnumConstant);
2018 ConflictingDecls.push_back(FoundDecls[I]);
2021 if (!ConflictingDecls.empty()) {
2022 Name = Importer.HandleNameConflict(Name, DC, IDNS,
2023 ConflictingDecls.data(),
2024 ConflictingDecls.size());
2040 Importer.Imported(D, ToEnumerator);
2042 return ToEnumerator;
2065 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
2066 if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
2069 if (
FunctionDecl *FoundFunction = dyn_cast<FunctionDecl>(FoundDecls[I])) {
2070 if (FoundFunction->hasExternalFormalLinkage() &&
2072 if (Importer.IsStructurallyEquivalent(D->
getType(),
2073 FoundFunction->getType())) {
2077 if (D == FromBodyDecl && !FoundFunction->
hasBody()) {
2079 FoundWithoutBody = FoundFunction;
2082 return Importer.Imported(D, FoundFunction);
2089 if (Importer.getToContext().getLangOpts().CPlusPlus)
2093 Importer.ToDiag(Loc, diag::err_odr_function_type_inconsistent)
2094 << Name << D->
getType() << FoundFunction->getType();
2095 Importer.ToDiag(FoundFunction->getLocation(),
2096 diag::note_odr_value_here)
2097 << FoundFunction->getType();
2101 ConflictingDecls.push_back(FoundDecls[I]);
2104 if (!ConflictingDecls.empty()) {
2105 Name = Importer.HandleNameConflict(Name, DC, IDNS,
2106 ConflictingDecls.data(),
2107 ConflictingDecls.size());
2118 bool usedDifferentExceptionSpec =
false;
2131 FromTy = Importer.getFromContext().getFunctionType(
2132 FromFPT->getReturnType(), FromFPT->getParamTypes(), DefaultEPI);
2133 usedDifferentExceptionSpec =
true;
2145 ParmVarDecl *ToP = cast_or_null<ParmVarDecl>(Importer.Import(
P));
2149 Parameters.push_back(ToP);
2158 cast<CXXRecordDecl>(DC),
2161 FromConstructor->isExplicit(),
2165 if (
unsigned NumInitializers = FromConstructor->getNumCtorInitializers()) {
2169 cast_or_null<CXXCtorInitializer>(Importer.Import(I));
2172 CtorInitializers.push_back(ToI);
2176 std::copy(CtorInitializers.begin(), CtorInitializers.end(), Memory);
2179 ToCtor->setNumCtorInitializers(NumInitializers);
2181 }
else if (isa<CXXDestructorDecl>(D)) {
2183 cast<CXXRecordDecl>(DC),
2189 = dyn_cast<CXXConversionDecl>(D)) {
2191 cast<CXXRecordDecl>(DC),
2195 FromConversion->isExplicit(),
2198 }
else if (
CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) {
2200 cast<CXXRecordDecl>(DC),
2203 Method->getStorageClass(),
2204 Method->isInlineSpecified(),
2223 Importer.Imported(D, ToFunction);
2226 for (
unsigned I = 0, N = Parameters.size(); I != N; ++I) {
2227 Parameters[I]->setOwningFunction(ToFunction);
2230 ToFunction->setParams(Parameters);
2232 if (FoundWithoutBody) {
2238 if (usedDifferentExceptionSpec) {
2248 if (
Stmt *ToBody = Importer.Import(FromBody)) {
2258 if (
auto *FromCXXMethod = dyn_cast<CXXMethodDecl>(D))
2290 if (isa<FieldDecl>(*D) || isa<IndirectFieldDecl>(*D))
2311 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
2312 if (
FieldDecl *FoundField = dyn_cast<FieldDecl>(FoundDecls[I])) {
2317 if (Importer.IsStructurallyEquivalent(D->
getType(),
2318 FoundField->getType())) {
2319 Importer.Imported(D, FoundField);
2323 Importer.ToDiag(Loc, diag::err_odr_field_type_inconsistent)
2324 << Name << D->
getType() << FoundField->getType();
2325 Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
2326 << FoundField->getType();
2349 Expr *ToInitializer = Importer.Import(FromInitializer);
2356 Importer.Imported(D, ToField);
2375 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
2377 = dyn_cast<IndirectFieldDecl>(FoundDecls[I])) {
2382 if (Importer.IsStructurallyEquivalent(D->
getType(),
2383 FoundField->getType(),
2385 Importer.Imported(D, FoundField);
2390 if (!Name && I < N-1)
2393 Importer.ToDiag(Loc, diag::err_odr_field_type_inconsistent)
2394 << Name << D->
getType() << FoundField->getType();
2395 Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
2396 << FoundField->getType();
2410 for (
auto *PI : D->
chain()) {
2411 Decl *D = Importer.Import(PI);
2414 NamedChain[i++] = cast<NamedDecl>(D);
2424 ToIndirectField->setAccess(D->
getAccess());
2425 ToIndirectField->setLexicalDeclContext(LexicalDC);
2426 Importer.Imported(D, ToIndirectField);
2428 return ToIndirectField;
2436 if (!DC || !LexicalDC)
2441 auto *RD = cast<CXXRecordDecl>(DC);
2442 FriendDecl *ImportedFriend = RD->getFirstFriend();
2444 Importer.getFromContext(), Importer.getToContext(),
2445 Importer.getNonEquivalentDecls(),
false,
false);
2447 while (ImportedFriend) {
2448 if (D->
getFriendDecl() && ImportedFriend->getFriendDecl()) {
2450 ImportedFriend->getFriendDecl()))
2451 return Importer.Imported(D, ImportedFriend);
2453 }
else if (D->
getFriendType() && ImportedFriend->getFriendType()) {
2454 if (Importer.IsStructurallyEquivalent(
2456 ImportedFriend->getFriendType()->getType(),
true))
2457 return Importer.Imported(D, ImportedFriend);
2459 ImportedFriend = ImportedFriend->getNextFriend();
2465 ToFU = cast_or_null<NamedDecl>(Importer.Import(FriendD));
2474 for (
unsigned I = 0; I < D->NumTPLists; I++) {
2478 ToTPLists[I] = List;
2486 Importer.Imported(D, FrD);
2487 RD->pushFriendDecl(FrD);
2509 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
2510 if (
ObjCIvarDecl *FoundIvar = dyn_cast<ObjCIvarDecl>(FoundDecls[I])) {
2511 if (Importer.IsStructurallyEquivalent(D->
getType(),
2512 FoundIvar->getType())) {
2513 Importer.Imported(D, FoundIvar);
2517 Importer.ToDiag(Loc, diag::err_odr_ivar_type_inconsistent)
2518 << Name << D->
getType() << FoundIvar->getType();
2519 Importer.ToDiag(FoundIvar->getLocation(), diag::note_odr_value_here)
2520 << FoundIvar->getType();
2536 cast<ObjCContainerDecl>(DC),
2542 Importer.Imported(D, ToIvar);
2562 VarDecl *MergeWithVar =
nullptr;
2567 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
2568 if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
2571 if (
VarDecl *FoundVar = dyn_cast<VarDecl>(FoundDecls[I])) {
2573 if (FoundVar->hasExternalFormalLinkage() &&
2575 if (Importer.IsStructurallyEquivalent(D->
getType(),
2576 FoundVar->getType())) {
2577 MergeWithVar = FoundVar;
2582 = Importer.getToContext().getAsArrayType(FoundVar->getType());
2584 = Importer.getToContext().getAsArrayType(D->
getType());
2585 if (FoundArray && TArray) {
2586 if (isa<IncompleteArrayType>(FoundArray) &&
2587 isa<ConstantArrayType>(TArray)) {
2593 FoundVar->setType(T);
2594 MergeWithVar = FoundVar;
2596 }
else if (isa<IncompleteArrayType>(TArray) &&
2597 isa<ConstantArrayType>(FoundArray)) {
2598 MergeWithVar = FoundVar;
2603 Importer.ToDiag(Loc, diag::err_odr_variable_type_inconsistent)
2604 << Name << D->
getType() << FoundVar->getType();
2605 Importer.ToDiag(FoundVar->getLocation(), diag::note_odr_value_here)
2606 << FoundVar->getType();
2610 ConflictingDecls.push_back(FoundDecls[I]);
2616 Importer.Imported(D, MergeWithVar);
2620 Importer.ToDiag(ExistingDef->getLocation(),
2621 diag::err_odr_variable_multiple_def)
2623 Importer.FromDiag(DDef->getLocation(), diag::note_odr_defined_here);
2625 Expr *Init = Importer.Import(DDef->getInit());
2627 if (DDef->isInitKnownICE()) {
2630 Eval->
IsICE = DDef->isInitICE();
2635 return MergeWithVar;
2638 if (!ConflictingDecls.empty()) {
2639 Name = Importer.HandleNameConflict(Name, DC, IDNS,
2640 ConflictingDecls.data(),
2641 ConflictingDecls.size());
2662 Importer.Imported(D, ToVar);
2682 DeclContext *DC = Importer.getToContext().getTranslationUnitDecl();
2701 return Importer.Imported(D, ToParm);
2707 DeclContext *DC = Importer.getToContext().getTranslationUnitDecl();
2734 Expr *ToDefArg =
nullptr;
2735 Expr *FromDefArg =
nullptr;
2738 ToDefArg = Importer.Import(FromDefArg);
2744 ToDefArg = Importer.Import(FromDefArg);
2747 if (FromDefArg && !ToDefArg)
2753 return Importer.Imported(D, ToParm);
2769 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
2770 if (
ObjCMethodDecl *FoundMethod = dyn_cast<ObjCMethodDecl>(FoundDecls[I])) {
2776 FoundMethod->getReturnType())) {
2777 Importer.ToDiag(Loc, diag::err_odr_objc_method_result_type_inconsistent)
2779 << FoundMethod->getReturnType();
2780 Importer.ToDiag(FoundMethod->getLocation(),
2781 diag::note_odr_objc_method_here)
2787 if (D->
param_size() != FoundMethod->param_size()) {
2788 Importer.ToDiag(Loc, diag::err_odr_objc_method_num_params_inconsistent)
2790 << D->
param_size() << FoundMethod->param_size();
2791 Importer.ToDiag(FoundMethod->getLocation(),
2792 diag::note_odr_objc_method_here)
2799 PEnd = D->
param_end(), FoundP = FoundMethod->param_begin();
2800 P != PEnd; ++
P, ++FoundP) {
2801 if (!Importer.IsStructurallyEquivalent((*P)->getType(),
2802 (*FoundP)->getType())) {
2803 Importer.FromDiag((*P)->getLocation(),
2804 diag::err_odr_objc_method_param_type_inconsistent)
2806 << (*P)->getType() << (*FoundP)->getType();
2807 Importer.ToDiag((*FoundP)->getLocation(), diag::note_odr_value_here)
2808 << (*FoundP)->getType();
2815 if (D->
isVariadic() != FoundMethod->isVariadic()) {
2816 Importer.ToDiag(Loc, diag::err_odr_objc_method_variadic_inconsistent)
2818 Importer.ToDiag(FoundMethod->getLocation(),
2819 diag::note_odr_objc_method_here)
2825 return Importer.Imported(D, FoundMethod);
2837 Importer.getToContext(), Loc, Importer.Import(D->
getLocEnd()),
2848 ParmVarDecl *ToP = cast_or_null<ParmVarDecl>(Importer.Import(FromP));
2852 ToParams.push_back(ToP);
2856 for (
unsigned I = 0, N = ToParams.size(); I != N; ++I) {
2862 ToMethod->
setMethodParams(Importer.getToContext(), ToParams, SelLocs);
2865 Importer.Imported(D, ToMethod);
2886 Importer.getToContext(), DC,
2894 Importer.Imported(D, Result);
2931 Importer.Imported(D, ToCategory);
2944 FromProto != FromProtoEnd;
2945 ++FromProto, ++FromProtoLoc) {
2947 = cast_or_null<ObjCProtocolDecl>(Importer.Import(*FromProto));
2950 Protocols.push_back(ToProto);
2951 ProtocolLocs.push_back(Importer.Import(*FromProtoLoc));
2956 ProtocolLocs.data(), Importer.getToContext());
2959 Importer.Imported(D, ToCategory);
2968 = cast_or_null<ObjCCategoryImplDecl>(
2998 FromProto != FromProtoEnd;
2999 ++FromProto, ++FromProtoLoc) {
3001 = cast_or_null<ObjCProtocolDecl>(Importer.Import(*FromProto));
3004 Protocols.push_back(ToProto);
3005 ProtocolLocs.push_back(Importer.Import(*FromProtoLoc));
3010 ProtocolLocs.data(), Importer.getToContext());
3024 if (Definition && Definition != D) {
3025 Decl *ImportedDef = Importer.Import(Definition);
3029 return Importer.Imported(D, ImportedDef);
3045 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
3049 if ((MergeWithProtocol = dyn_cast<ObjCProtocolDecl>(FoundDecls[I])))
3063 Importer.Imported(D, ToProto);
3096 Importer.Imported(D, ToLinkageSpec);
3098 return ToLinkageSpec;
3121 Importer.Imported(D, ToUsing);
3124 Importer.getFromContext().getInstantiatedFromUsingDecl(D)) {
3126 dyn_cast_or_null<NamedDecl>(Importer.Import(FromPattern)))
3127 Importer.getToContext().setInstantiatedFromUsingDecl(ToUsing, ToPattern);
3134 dyn_cast_or_null<UsingShadowDecl>(Importer.Import(FromShadow)))
3135 ToUsing->addShadowDecl(ToShadow);
3154 UsingDecl *ToUsing = dyn_cast_or_null<UsingDecl>(
3159 NamedDecl *ToTarget = dyn_cast_or_null<NamedDecl>(
3165 Importer.getToContext(), DC, Loc, ToUsing, ToTarget);
3169 Importer.Imported(D, ToShadow);
3172 Importer.getFromContext().getInstantiatedFromUsingShadowDecl(D)) {
3174 dyn_cast_or_null<UsingShadowDecl>(Importer.Import(FromPattern)))
3175 Importer.getToContext().setInstantiatedFromUsingShadowDecl(ToShadow,
3209 Importer.getToContext(), DC, Importer.Import(D->
getUsingLoc()),
3215 Importer.Imported(D, ToUsingDir);
3235 Importer.getToContext(), DC, Importer.Import(D->
getUsingLoc()),
3239 Importer.Imported(D, ToUsingValue);
3240 ToUsingValue->setAccess(D->
getAccess());
3241 ToUsingValue->setLexicalDeclContext(LexicalDC);
3244 return ToUsingValue;
3259 Importer.getToContext(), DC, Importer.Import(D->
getUsingLoc()),
3264 Importer.Imported(D, ToUsing);
3280 FromSuper = cast_or_null<ObjCInterfaceDecl>(Importer.Import(FromSuper));
3286 if ((
bool)FromSuper != (
bool)ToSuper ||
3289 diag::err_odr_objc_superclass_inconsistent)
3296 diag::note_odr_objc_missing_superclass);
3299 diag::note_odr_objc_superclass)
3303 diag::note_odr_objc_missing_superclass);
3331 FromProto != FromProtoEnd;
3332 ++FromProto, ++FromProtoLoc) {
3334 = cast_or_null<ObjCProtocolDecl>(Importer.Import(*FromProto));
3337 Protocols.push_back(ToProto);
3338 ProtocolLocs.push_back(Importer.Import(*FromProtoLoc));
3343 ProtocolLocs.data(), Importer.getToContext());
3348 Importer.Import(Cat);
3373 for (
auto fromTypeParam : *list) {
3374 auto toTypeParam = cast_or_null<ObjCTypeParamDecl>(
3375 Importer.Import(fromTypeParam));
3379 toTypeParams.push_back(toTypeParam);
3383 Importer.Import(list->getLAngleLoc()),
3385 Importer.Import(list->getRAngleLoc()));
3393 if (Definition && Definition != D) {
3394 Decl *ImportedDef = Importer.Import(Definition);
3398 return Importer.Imported(D, ImportedDef);
3415 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
3419 if ((MergeWithIface = dyn_cast<ObjCInterfaceDecl>(FoundDecls[I])))
3435 Importer.Imported(D, ToIface);
3480 Importer.Imported(D, ToImpl);
3495 Super = cast_or_null<ObjCInterfaceDecl>(
3535 diag::err_odr_objc_superclass_inconsistent)
3541 diag::note_odr_objc_superclass)
3545 diag::note_odr_objc_missing_superclass);
3548 diag::note_odr_objc_superclass)
3552 diag::note_odr_objc_missing_superclass);
3577 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
3579 = dyn_cast<ObjCPropertyDecl>(FoundDecls[I])) {
3581 if (!Importer.IsStructurallyEquivalent(D->
getType(),
3582 FoundProp->getType())) {
3583 Importer.ToDiag(Loc, diag::err_odr_objc_property_type_inconsistent)
3584 << Name << D->
getType() << FoundProp->getType();
3585 Importer.ToDiag(FoundProp->getLocation(), diag::note_odr_value_here)
3586 << FoundProp->getType();
3593 Importer.Imported(D, FoundProp);
3609 Importer.Import(D->
getType()),
3612 Importer.Imported(D, ToProperty);
3657 Ivar = cast_or_null<ObjCIvarDecl>(
3675 Importer.Imported(D, ToImpl);
3682 diag::err_odr_objc_property_impl_kind_inconsistent)
3687 diag::note_odr_objc_property_impl_kind)
3697 diag::err_odr_objc_synthesize_ivar_inconsistent)
3702 diag::note_odr_objc_synthesize_ivar_here)
3708 Importer.Imported(D, ToImpl);
3721 Importer.getToContext().getTranslationUnitDecl(),
3754 Importer.getToContext().getTranslationUnitDecl(),
3774 if (!TemplateParams)
3780 Importer.getToContext().getTranslationUnitDecl(),
3799 return Importer.Imported(D, ImportedDef);
3817 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
3821 Decl *Found = FoundDecls[I];
3823 = dyn_cast<ClassTemplateDecl>(Found)) {
3829 FoundTemplate->getTemplatedDecl());
3830 return Importer.Imported(D, FoundTemplate);
3834 ConflictingDecls.push_back(FoundDecls[I]);
3837 if (!ConflictingDecls.empty()) {
3839 ConflictingDecls.data(),
3840 ConflictingDecls.size());
3851 Importer.Import(DTemplated));
3856 if (
Decl *AlreadyImported = Importer.GetAlreadyImportedOrNull(D))
3857 return AlreadyImported;
3862 if (!TemplateParams)
3866 Loc, Name, TemplateParams,
3875 Importer.Imported(D, D2);
3876 Importer.Imported(DTemplated, D2Templated);
3892 if (Definition && Definition != D) {
3893 Decl *ImportedDef = Importer.Import(Definition);
3897 return Importer.Imported(D, ImportedDef);
3901 = cast_or_null<ClassTemplateDecl>(Importer.Import(
3930 void *InsertPos =
nullptr;
3944 return Importer.Imported(D, FoundDef);
3950 dyn_cast<ClassTemplatePartialSpecializationDecl>(D)) {
3954 auto &ASTTemplateArgs = *PartialSpec->getTemplateArgsAsWritten();
3955 for (
unsigned I = 0, E = ASTTemplateArgs.NumTemplateArgs; I < E; ++I) {
3962 QualType CanonInjType = Importer.Import(
3963 PartialSpec->getInjectedSpecializationType());
3964 if (CanonInjType.
isNull())
3969 PartialSpec->getTemplateParameters());
3970 if (!ToTPList && PartialSpec->getTemplateParameters())
3974 Importer.getToContext(), D->
getTagKind(), DC, StartLoc, IdLoc,
3975 ToTPList, ClassTemplate,
3976 llvm::makeArrayRef(TemplateArgs.data(), TemplateArgs.size()),
3977 ToTAInfo, CanonInjType,
nullptr);
3996 Importer.Imported(D, D2);
4019 Importer.Imported(D, D2);
4038 return Importer.Imported(D, ImportedDef);
4053 "Variable templates cannot be declared at function scope");
4057 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
4061 Decl *Found = FoundDecls[I];
4062 if (
VarTemplateDecl *FoundTemplate = dyn_cast<VarTemplateDecl>(Found)) {
4066 FoundTemplate->getTemplatedDecl());
4067 return Importer.Imported(D, FoundTemplate);
4071 ConflictingDecls.push_back(FoundDecls[I]);
4074 if (!ConflictingDecls.empty()) {
4076 ConflictingDecls.data(),
4077 ConflictingDecls.size());
4111 if (!TemplateParams)
4115 Importer.getToContext(), DC, Loc, Name, TemplateParams, D2Templated);
4123 Importer.Imported(D, D2);
4124 Importer.Imported(DTemplated, D2Templated);
4140 if (Definition && Definition != D) {
4141 Decl *ImportedDef = Importer.Import(Definition);
4145 return Importer.Imported(D, ImportedDef);
4176 void *InsertPos =
nullptr;
4178 TemplateArgs, InsertPos);
4191 return Importer.Imported(D, FoundDef);
4204 Importer.getToContext(), DC, StartLoc, IdLoc, VarTemplate,
T, TInfo,
4210 VarTemplate->AddSpecialization(D2, InsertPos);
4219 Importer.Imported(D, D2);
4245 for (
unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
4246 if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
4250 dyn_cast<FunctionTemplateDecl>(FoundDecls[I])) {
4251 if (FoundFunction->hasExternalFormalLinkage() &&
4254 Importer.Imported(D, FoundFunction);
4256 return FoundFunction;
4274 Importer.getToContext(), DC, Loc, Name, Params, TemplatedFD);
4279 Importer.Imported(D, ToFunc);
4292 size_t NumDecls = DG.
end() - DG.
begin();
4294 auto &_Importer = this->Importer;
4295 std::transform(DG.
begin(), DG.
end(), ToDecls.begin(),
4297 return _Importer.Import(D);
4305 Importer.FromDiag(S->
getLocStart(), diag::err_unsupported_ast_node)
4319 Names.push_back(ToII);
4321 for (
unsigned I = 0, E = S->
getNumInputs(); I != E; I++) {
4327 Names.push_back(ToII);
4336 Clobbers.push_back(Clobber);
4345 Constraints.push_back(Output);
4348 for (
unsigned I = 0, E = S->
getNumInputs(); I != E; I++) {
4353 Constraints.push_back(Input);
4368 return new (Importer.getToContext())
GCCAsmStmt(
4369 Importer.getToContext(),
4386 for (
Decl *ToD : ToDG) {
4392 return new (Importer.getToContext())
DeclStmt(ToDG, ToStartLoc, ToEndLoc);
4397 return new (Importer.getToContext())
NullStmt(ToSemiLoc,
4418 if (!ToRHS && S->
getRHS())
4426 CaseStmt *ToStmt =
new (Importer.getToContext())
4427 CaseStmt(ToLHS, ToRHS, ToCaseLoc, ToEllipsisLoc, ToColonLoc);
4438 return new (Importer.getToContext())
DefaultStmt(ToDefaultLoc, ToColonLoc,
4445 cast_or_null<LabelDecl>(Importer.Import(S->
getDecl()));
4446 if (!ToLabelDecl && S->
getDecl())
4451 return new (Importer.getToContext())
LabelStmt(ToIdentLoc, ToLabelDecl,
4459 ASTContext &_ToContext = Importer.getToContext();
4460 std::transform(FromAttrs.begin(), FromAttrs.end(), ToAttrs.begin(),
4461 [&_ToContext](
const Attr *A) ->
const Attr * {
4462 return A->
clone(_ToContext);
4464 for (
const Attr *ToA : ToAttrs) {
4472 ToAttrs, ToSubStmt);
4480 VarDecl *ToConditionVariable =
nullptr;
4482 ToConditionVariable =
4483 dyn_cast_or_null<VarDecl>(Importer.Import(FromConditionVariable));
4484 if (!ToConditionVariable)
4487 Expr *ToCondition = Importer.Import(S->
getCond());
4488 if (!ToCondition && S->
getCond())
4491 if (!ToThenStmt && S->
getThen())
4495 if (!ToElseStmt && S->
getElse())
4497 return new (Importer.getToContext())
IfStmt(Importer.getToContext(),
4500 ToConditionVariable,
4501 ToCondition, ToThenStmt,
4502 ToElseLoc, ToElseStmt);
4509 VarDecl *ToConditionVariable =
nullptr;
4511 ToConditionVariable =
4512 dyn_cast_or_null<VarDecl>(Importer.Import(FromConditionVariable));
4513 if (!ToConditionVariable)
4516 Expr *ToCondition = Importer.Import(S->
getCond());
4517 if (!ToCondition && S->
getCond())
4520 Importer.getToContext(), ToInit,
4521 ToConditionVariable, ToCondition);
4531 SwitchCase *ToSC = dyn_cast_or_null<SwitchCase>(Importer.Import(SC));
4534 if (LastChainedSwitchCase)
4538 LastChainedSwitchCase = ToSC;
4544 VarDecl *ToConditionVariable =
nullptr;
4546 ToConditionVariable =
4547 dyn_cast_or_null<VarDecl>(Importer.Import(FromConditionVariable));
4548 if (!ToConditionVariable)
4551 Expr *ToCondition = Importer.Import(S->
getCond());
4552 if (!ToCondition && S->
getCond())
4558 return new (Importer.getToContext())
WhileStmt(Importer.getToContext(),
4559 ToConditionVariable,
4560 ToCondition, ToBody,
4568 Expr *ToCondition = Importer.Import(S->
getCond());
4569 if (!ToCondition && S->
getCond())
4574 return new (Importer.getToContext())
DoStmt(ToBody, ToCondition,
4575 ToDoLoc, ToWhileLoc,
4583 Expr *ToCondition = Importer.Import(S->
getCond());
4584 if (!ToCondition && S->
getCond())
4586 VarDecl *ToConditionVariable =
nullptr;
4588 ToConditionVariable =
4589 dyn_cast_or_null<VarDecl>(Importer.Import(FromConditionVariable));
4590 if (!ToConditionVariable)
4594 if (!ToInc && S->
getInc())
4602 return new (Importer.getToContext())
ForStmt(Importer.getToContext(),
4603 ToInit, ToCondition,
4604 ToConditionVariable,
4606 ToForLoc, ToLParenLoc,
4613 ToLabel = dyn_cast_or_null<LabelDecl>(Importer.Import(FromLabel));
4619 return new (Importer.getToContext())
GotoStmt(ToLabel,
4620 ToGotoLoc, ToLabelLoc);
4629 return new (Importer.getToContext())
IndirectGotoStmt(ToGotoLoc, ToStarLoc,
4635 return new (Importer.getToContext())
ContinueStmt(ToContinueLoc);
4640 return new (Importer.getToContext())
BreakStmt(ToBreakLoc);
4649 VarDecl *ToNRVOCandidate = cast_or_null<VarDecl>(Importer.Import(NRVOCandidate));
4650 if (!ToNRVOCandidate && NRVOCandidate)
4652 return new (Importer.getToContext())
ReturnStmt(ToRetLoc, ToRetExpr,
4658 VarDecl *ToExceptionDecl =
nullptr;
4661 dyn_cast_or_null<VarDecl>(Importer.Import(FromExceptionDecl));
4662 if (!ToExceptionDecl)
4668 return new (Importer.getToContext())
CXXCatchStmt(ToCatchLoc,
4679 for (
unsigned HI = 0, HE = S->
getNumHandlers(); HI != HE; ++HI) {
4681 if (
Stmt *ToHandler = Importer.Import(FromHandler))
4682 ToHandlers[HI] = ToHandler;
4692 dyn_cast_or_null<DeclStmt>(Importer.Import(S->
getRangeStmt()));
4696 dyn_cast_or_null<DeclStmt>(Importer.Import(S->
getBeginStmt()));
4700 dyn_cast_or_null<DeclStmt>(Importer.Import(S->
getEndStmt()));
4707 if (!ToInc && S->
getInc())
4710 dyn_cast_or_null<DeclStmt>(Importer.Import(S->
getLoopVarStmt()));
4720 return new (Importer.getToContext())
CXXForRangeStmt(ToRange, ToBegin, ToEnd,
4723 ToForLoc, ToCoawaitLoc,
4724 ToColonLoc, ToRParenLoc);
4748 VarDecl *ToExceptionDecl =
nullptr;
4751 dyn_cast_or_null<VarDecl>(Importer.Import(FromExceptionDecl));
4752 if (!ToExceptionDecl)
4781 if (
Stmt *ToCatchStmt = Importer.Import(FromCatchStmt))
4782 ToCatchStmts[CI] = ToCatchStmt;
4790 ToAtTryLoc, ToAtTryStmt,
4791 ToCatchStmts.begin(), ToCatchStmts.size(),
4806 ToAtSynchronizedLoc, ToSynchExpr, ToSynchBody);
4814 return new (Importer.getToContext())
ObjCAtThrowStmt(ToAtThrowLoc, ToThrow);
4831 Importer.FromDiag(E->
getLocStart(), diag::err_unsupported_ast_node)
4849 return new (Importer.getToContext())
VAArgExpr(
4885 FoundD = cast_or_null<NamedDecl>(Importer.Import(E->
getFoundDecl()));
4904 ResInfo = &ToTAInfo;
4950 Expr *Init = cast_or_null<Expr>(Importer.Import(DIE->
getInit()));
4957 if (
Expr *Arg = cast_or_null<Expr>(Importer.Import(DIE->
getSubExpr(I))))
4958 IndexExprs[I - 1] = Arg;
4964 llvm::transform(DIE->
designators(), Designators.begin(),
4970 if (D.isFieldDesignator() && !D.getFieldName())
4974 Importer.getToContext(), Designators,
4984 return new (Importer.getToContext())
5028 Locations.data(), Locations.size());
5060 return new (Importer.getToContext())
AtomicExpr(
5084 return new (Importer.getToContext())
5096 Importer.getToContext(), Importer.Import(E->
getLParenLoc()),
5110 return new (Importer.getToContext())
StmtExpr(ToSubStmt, T,
5149 SubExpr, ResultType,
5225 Common, OpaqueValue, Cond, TrueExpr, FalseExpr,
5300 if (CompLHSType.
isNull())
5304 if (CompResultType.
isNull())
5315 return new (Importer.getToContext())
5319 CompLHSType, CompResultType,
5327 Path.push_back(Spec);
5369 case Stmt::CStyleCastExprClass: {
5373 SubExpr, &BasePath, TInfo,
5378 case Stmt::CXXFunctionalCastExprClass: {
5387 case Stmt::ObjCBridgedCastExprClass: {
5404 case Stmt::CXXStaticCastExprClass:
5407 SubExpr, &BasePath, TInfo,
5408 ExprLoc, RParenLoc, Brackets);
5410 case Stmt::CXXDynamicCastExprClass:
5413 SubExpr, &BasePath, TInfo,
5414 ExprLoc, RParenLoc, Brackets);
5416 case Stmt::CXXReinterpretCastExprClass:
5419 SubExpr, &BasePath, TInfo,
5420 ExprLoc, RParenLoc, Brackets);
5422 case Stmt::CXXConstCastExprClass:
5425 RParenLoc, Brackets);
5427 llvm_unreachable(
"Cast expression of unsupported type!");
5479 Exprs[I] = ToIndexExpr;
5488 TInfo, Nodes, Exprs,
5508 T, Operand, CanThrow,
5533 Importer.getToContext(), Importer.Import(E->
getUsedLocation()), Param);
5554 auto *Dtor = cast_or_null<CXXDestructorDecl>(
5555 Importer.Import(const_cast<CXXDestructorDecl *>(
5574 auto *Ctor = cast_or_null<CXXConstructorDecl>(
5580 Importer.getToContext(),
T,
5603 ValueDecl *ExtendedBy = cast_or_null<ValueDecl>(
5639 FunctionDecl *OperatorNewDecl = cast_or_null<FunctionDecl>(
5644 FunctionDecl *OperatorDeleteDecl = cast_or_null<FunctionDecl>(
5661 return new (Importer.getToContext())
CXXNewExpr(
5662 Importer.getToContext(),
5664 OperatorNewDecl, OperatorDeleteDecl,
5679 FunctionDecl *OperatorDeleteDecl = cast_or_null<FunctionDecl>(
5704 dyn_cast_or_null<CXXConstructorDecl>(Importer.Import(E->
getConstructor()));
5731 cast_or_null<BlockDecl>(Importer.Import(EWC->
getObject(I))))
5755 Importer.getToContext(), ToFn, ToArgs,
T, E->
getValueKind(),
5764 return new (Importer.getToContext())
5773 return new (Importer.getToContext())
5808 ToMember, ToFoundDecl, ToMemberNameInfo,
5839 Importer.getToContext(), BaseE, E->
isArrow(),
5850 Base = Importer.Import(E->
getBase());
5865 ResInfo = &ToTAInfo;
5880 Importer.getToContext(), Base, BaseType, E->
isArrow(),
5884 cast_or_null<NamedDecl>(ToFQ), MemberNameInfo, ResInfo);
5900 for (
unsigned ai = 0, ae = NumArgs; ai != ae; ++ai) {
5902 Expr *ToArg = Importer.Import(FromArg);
5908 Expr **ToArgs_Copied =
new (Importer.getToContext())
5911 for (
unsigned ai = 0, ae = NumArgs; ai != ae; ++ai)
5912 ToArgs_Copied[ai] = ToArgs[ai];
5914 return new (Importer.getToContext())
5915 CallExpr(Importer.getToContext(), ToCallee,
5916 llvm::makeArrayRef(ToArgs_Copied, NumArgs),
T, E->
getValueKind(),
5943 FieldDecl *ToFD = cast_or_null<FieldDecl>(Importer.Import(FromFD));
5951 Importer.Import(SyntForm));
5977 return new (Importer.getToContext())
5989 FieldDecl *ToField = llvm::dyn_cast_or_null<FieldDecl>(
5995 Importer.getToContext(), Importer.Import(DIE->
getLocStart()), ToField);
6015 if (isa<CXXStaticCastExpr>(E)) {
6017 Importer.getToContext(), ToType, VK, CK, ToOp, &BasePath,
6018 ToWritten, ToOperatorLoc, ToRParenLoc, ToAngleBrackets);
6019 }
else if (isa<CXXDynamicCastExpr>(E)) {
6021 Importer.getToContext(), ToType, VK, CK, ToOp, &BasePath,
6022 ToWritten, ToOperatorLoc, ToRParenLoc, ToAngleBrackets);
6023 }
else if (isa<CXXReinterpretCastExpr>(E)) {
6025 Importer.getToContext(), ToType, VK, CK, ToOp, &BasePath,
6026 ToWritten, ToOperatorLoc, ToRParenLoc, ToAngleBrackets);
6064 bool ToValue =
false;
6069 Importer.getToContext(), ToType, Importer.Import(E->
getLocStart()),
6077 cast<CXXMethodDecl>(Importer.Import(const_cast<CXXMethodDecl*>(
6078 FromOverriddenMethod))));
6084 : ToContext(ToContext), FromContext(FromContext),
6085 ToFileManager(ToFileManager), FromFileManager(FromFileManager),
6086 Minimal(MinimalImport), LastDiagFromFrom(
false)
6101 llvm::DenseMap<const Type *, const Type *>::iterator Pos
6102 = ImportedTypes.find(fromTy);
6103 if (Pos != ImportedTypes.end())
6133 llvm::DenseMap<Decl *, Decl *>::iterator Pos = ImportedDecls.find(FromD);
6134 if (Pos != ImportedDecls.end()) {
6135 Decl *ToD = Pos->second;
6150 llvm::DenseMap<Decl *, Decl *>::iterator Pos = ImportedDecls.find(FromD);
6151 if (Pos != ImportedDecls.end()) {
6152 Decl *ToD = Pos->second;
6163 ImportedDecls[FromD] = ToD;
6165 if (
TagDecl *FromTag = dyn_cast<TagDecl>(FromD)) {
6167 if (FromTag->getTypedefNameForAnonDecl())
6168 AnonTagsWithPendingTypedefs.push_back(FromTag);
6169 }
else if (
TypedefNameDecl *FromTypedef = dyn_cast<TypedefNameDecl>(FromD)) {
6173 FromTag = AnonTagsWithPendingTypedefs.begin(),
6174 FromTagEnd = AnonTagsWithPendingTypedefs.end();
6175 FromTag != FromTagEnd; ++FromTag) {
6176 if ((*FromTag)->getTypedefNameForAnonDecl() == FromTypedef) {
6177 if (
TagDecl *ToTag = cast_or_null<TagDecl>(
Import(*FromTag))) {
6179 ToTag->setTypedefNameForAnonDecl(cast<TypedefNameDecl>(ToD));
6180 AnonTagsWithPendingTypedefs.erase(FromTag);
6200 if (
RecordDecl *ToRecord = dyn_cast<RecordDecl>(ToDC)) {
6201 RecordDecl *FromRecord = cast<RecordDecl>(FromDC);
6202 if (ToRecord->isCompleteDefinition()) {
6210 }
else if (
EnumDecl *ToEnum = dyn_cast<EnumDecl>(ToDC)) {
6211 EnumDecl *FromEnum = cast<EnumDecl>(FromDC);
6212 if (ToEnum->isCompleteDefinition()) {
6222 if (ToClass->getDefinition()) {
6232 if (ToProto->getDefinition()) {
6249 return cast_or_null<Expr>(
Import(cast<Stmt>(FromE)));
6257 llvm::DenseMap<Stmt *, Stmt *>::iterator Pos = ImportedStmts.find(FromS);
6258 if (Pos != ImportedStmts.end())
6263 Stmt *ToS = Importer.Visit(FromS);
6268 ImportedStmts[FromS] = ToS;
6313 bool bTemplate = FromNNS->
getKind() ==
6322 llvm_unreachable(
"Invalid nested name specifier kind");
6333 NestedNames.push_back(NNS);
6339 while (!NestedNames.empty()) {
6340 NNS = NestedNames.pop_back_val();
6409 E = FromStorage->
end();
6467 = cast_or_null<TemplateTemplateParmDecl>(
6482 llvm_unreachable(
"Invalid template name kind");
6510 llvm::DenseMap<FileID, FileID>::iterator Pos
6511 = ImportedFileIDs.find(FromID);
6512 if (Pos != ImportedFileIDs.end())
6518 assert(FromSLoc.
isFile() &&
"Cannot handle macro expansions yet");
6538 const llvm::MemoryBuffer *
6540 std::unique_ptr<llvm::MemoryBuffer> ToBuf
6541 = llvm::MemoryBuffer::getMemBufferCopy(FromBuf->getBuffer(),
6542 FromBuf->getBufferIdentifier());
6548 ImportedFileIDs[FromID] = ToID;
6554 if (!ToExpr && From->
getInit())
6590 return new (ToContext)
6600 auto Pos = ImportedCXXBaseSpecifiers.find(BaseSpec);
6601 if (Pos != ImportedCXXBaseSpecifiers.end())
6610 ImportedCXXBaseSpecifiers[BaseSpec] =
Imported;
6619 if (
DeclContext *FromDC = cast<DeclContext>(From)) {
6622 if (
RecordDecl *ToRecord = dyn_cast<RecordDecl>(To)) {
6623 if (!ToRecord->getDefinition()) {
6630 if (
EnumDecl *ToEnum = dyn_cast<EnumDecl>(To)) {
6631 if (!ToEnum->getDefinition()) {
6639 if (!ToIFace->getDefinition()) {
6647 if (!ToProto->getDefinition()) {
6719 llvm_unreachable(
"Invalid DeclarationName Kind!");
6740 for (
unsigned I = 1, N = FromSel.
getNumArgs(); I < N; ++I)
6749 unsigned NumDecls) {
6754 if (LastDiagFromFrom)
6757 LastDiagFromFrom =
false;
6762 if (!LastDiagFromFrom)
6765 LastDiagFromFrom =
true;
6771 if (!
ID->getDefinition())
6772 ID->startDefinition();
6775 if (!PD->getDefinition())
6776 PD->startDefinition();
6778 else if (
TagDecl *TD = dyn_cast<TagDecl>(D)) {
6779 if (!TD->getDefinition() && !TD->isBeingDefined()) {
6780 TD->startDefinition();
6781 TD->setCompleteDefinition(
true);
6785 assert (0 &&
"CompleteDecl called on a Decl that can't be completed");
6800 ImportedDecls[From] = To;
6806 llvm::DenseMap<const Type *, const Type *>::iterator Pos
SourceLocation getRParenLoc() const
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
SourceLocation getLocForStartOfFile(FileID FID) const
Return the source location corresponding to the first byte of the specified file. ...
bool hasArrayFiller() const
Return true if this is an array initializer and its array "filler" has been set.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
Represents a single C99 designator.
static NamespaceDecl * Create(ASTContext &C, DeclContext *DC, bool Inline, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, NamespaceDecl *PrevDecl)
SourceLocation getStartLoc() const
SourceLocation getGetterNameLoc() const
TemplateTemplateParmDecl * getParameterPack() const
Retrieve the template template parameter pack being substituted.
void setValueDependent(bool VD)
Set whether this expression is value-dependent or not.
QualType getPattern() const
Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
SourceLocation getRBracLoc() const
Defines the clang::ASTContext interface.
QualType getDeducedType() const
Get the type deduced for this placeholder type, or null if it's either not been deduced or was deduce...
IdentifierInfo * getInputIdentifier(unsigned i) const
Decl * VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
ObjCPropertyQueryKind getQueryKind() const
const FileEntry * OrigEntry
Reference to the file entry representing this ContentCache.
void setOwningFunction(DeclContext *FD)
setOwningFunction - Sets the function declaration that owns this ParmVarDecl.
TemplateParameterList * ImportTemplateParameterList(TemplateParameterList *Params)
Stmt * VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S)
Expr * VisitCXXMemberCallExpr(CXXMemberCallExpr *E)
SourceLocation getRParenLoc() const
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
The null pointer literal (C++11 [lex.nullptr])
const CXXDestructorDecl * getDestructor() const
Expr * VisitConditionalOperator(ConditionalOperator *E)
static unsigned getFieldIndex(Decl *F)
This represents a GCC inline-assembly statement extension.
void setImplicit(bool I=true)
Decl * VisitCXXMethodDecl(CXXMethodDecl *D)
An instance of this class is created to represent a function declaration or definition.
SourceLocation getForLoc() const
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
QualType VisitVectorType(const VectorType *T)
Decl * VisitEnumDecl(EnumDecl *D)
void localUncachedLookup(DeclarationName Name, SmallVectorImpl< NamedDecl *> &Results)
A simplistic name lookup mechanism that performs name lookup into this declaration context without co...
Expr * getInit() const
Get the initializer.
bool isKindOfTypeAsWritten() const
Whether this is a "__kindof" type as written.
const Stmt * getElse() const
unsigned getNumInputs() const
SourceLocation getRParenLoc() const
void setArrayFiller(Expr *filler)
Stmt * VisitDoStmt(DoStmt *S)
SourceLocation getLocWithOffset(int Offset) const
Return a source location with the specified offset from this SourceLocation.
Smart pointer class that efficiently represents Objective-C method names.
This is a discriminated union of FileInfo and ExpansionInfo.
SourceLocation getForLoc() const
void setAnonymousStructOrUnion(bool Anon)
PointerType - C99 6.7.5.1 - Pointer Declarators.
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
QualType getPointeeType() const
llvm::iterator_range< arg_iterator > placement_arguments()
SourceLocation getUsedLocation() const
Retrieve the location where this default argument was actually used.
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
Stores the type being destroyed by a pseudo-destructor expression.
A (possibly-)qualified type.
uint64_t getValue() const
QualType VisitDecltypeType(const DecltypeType *T)
Decl * VisitUsingShadowDecl(UsingShadowDecl *D)
const char * getDeclKindName() const
StringKind getKind() const
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
void setTemplateKeywordLoc(SourceLocation Loc)
Sets the location of the template keyword.
unsigned param_size() const
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
Stmt * VisitCaseStmt(CaseStmt *S)
ObjCInterfaceDecl * getClassInterface()
QualType getInjectedSpecializationType() const
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
Implements support for file system lookup, file system caching, and directory search management...
SourceRange getCXXOperatorNameRange() const
getCXXOperatorNameRange - Gets the range of the operator name (without the operator keyword)...
void startDefinition()
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...
SourceLocation getEllipsisLoc() const
SourceLocation getLParen() const
Get the location of the left parentheses '('.
ObjCTypeParamList * ImportObjCTypeParamList(ObjCTypeParamList *list)
const Expr * getSubExpr() const
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
SourceLocation getLParenLoc() const
QualType VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T)
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
Defines the clang::FileManager interface and associated types.
ObjCIvarDecl * getPropertyIvarDecl() const
static TypeAliasTemplateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl)
Create a function template node.
static CXXDependentScopeMemberExpr * Create(const ASTContext &C, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Stmt * VisitObjCAtCatchStmt(ObjCAtCatchStmt *S)
CompoundStmt * getSubStmt()
Decl * VisitDecl(Decl *D)
InClassInitStyle getInClassInitStyle() const
Get the kind of (C++11) default member initializer that this field has.
Expr * getUnderlyingExpr() const
Stmt * VisitContinueStmt(ContinueStmt *S)
SourceLocation getRParenLoc() const
static IndirectFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, llvm::MutableArrayRef< NamedDecl *> CH)
bool isThrownVariableInScope() const
Determines whether the variable thrown by this expression (if any!) is within the innermost try block...
Stmt - This represents one statement.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Expr * getDimensionExpression() const
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
SourceLocation getLocStart() const LLVM_READONLY
Expr * getBitWidth() const
void setPreviousDecl(decl_type *PrevDecl)
Set the previous declaration.
CXXCatchStmt * getHandler(unsigned i)
bool IsICE
Whether this statement is an integral constant expression, or in C++11, whether the statement is a co...
bool isArrayFormAsWritten() const
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...
VarDecl * getTemplatedDecl() const
Get the underlying variable declarations of the template.
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
SourceLocation getLocation() const
Expr * VisitImplicitCastExpr(ImplicitCastExpr *E)
Expr * VisitExpressionTraitExpr(ExpressionTraitExpr *E)
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
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)
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
Expr * VisitCXXConstructExpr(CXXConstructExpr *E)
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Decl * VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
unsigned getNumOutputs() const
Defines the SourceManager interface.
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Expr * VisitBinaryOperator(BinaryOperator *E)
SourceLocation getRBracketLoc() const
The template argument is an expression, and we've not resolved it to one of the other forms yet...
unsigned size() const
Retrieve the number of template arguments in this template argument list.
static TemplateTemplateParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D, unsigned P, bool ParameterPack, IdentifierInfo *Id, TemplateParameterList *Params)
const StringLiteral * getAsmString() const
TypeSourceInfo * getTypeSourceInfo() const
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
Decl - This represents one declaration (or definition), e.g.
SourceLocation getLocStart() const LLVM_READONLY
bool hasLeadingEmptyMacro() const
Stmt * getHandlerBlock() const
DeclGroupRef ImportDeclGroup(DeclGroupRef DG)
Expr * VisitPackExpansionExpr(PackExpansionExpr *E)
llvm::APFloat getValue() const
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
FunctionDecl * getOperatorNew() const
VarDecl * getDefinition(ASTContext &)
Get the real (not just tentative) definition for this declaration.
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
Selector getObjCSelector() const
getObjCSelector - Get the Objective-C selector stored in this declaration name.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
const Expr * getSubExpr() const
Represents a C++11 auto or C++14 decltype(auto) type.
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.
SourceLocation getIdentLoc() const
void setPure(bool P=true)
Represents an attribute applied to a statement.
bool hasWrittenPrototype() const
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
ParenExpr - This represents a parethesized expression, e.g.
known_categories_range known_categories() const
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
NamedDecl * getDecl() const
static ObjCPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
SourceLocation getLocStart() const LLVM_READONLY
The base class of the type hierarchy.
Represents an empty-declaration.
Represents Objective-C's @throw statement.
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
DiagnosticsEngine & getDiagnostics() const
QualType VisitTemplateSpecializationType(const TemplateSpecializationType *T)
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
bool hasExplicitTemplateArgs() const
Determines whether this declaration reference was followed by an explicit template argument list...
SourceLocation getLocation() const
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Declaration of a variable template.
SourceLocation getRParenLoc() const
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.
Expr * VisitOffsetOfExpr(OffsetOfExpr *OE)
Represents a call to a C++ constructor.
RetTy Visit(const Type *T)
Performs the operation associated with this visitor object.
TypeSourceInfo * getTypeInfoAsWritten() const
getTypeInfoAsWritten - Returns the type source info for the type that this expression is casting to...
protocol_iterator protocol_begin() const
FPOptions getFPFeatures() const
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent...
void setSpecializationKind(TemplateSpecializationKind TSK)
virtual void completeDefinition()
completeDefinition - Notes that the definition of this type is now complete.
SourceLocation getLParenLoc() const
Decl * VisitFieldDecl(FieldDecl *D)
A container of type source information.
RefQualifierKind RefQualifier
void setSwitchCaseList(SwitchCase *SC)
Set the case list for this switch statement.
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
bool isEmpty() const
Evaluates true when this declaration name is empty.
Decl * VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
static AttributedStmt * Create(const ASTContext &C, SourceLocation Loc, ArrayRef< const Attr *> Attrs, Stmt *SubStmt)
Expr * VisitTypeTraitExpr(TypeTraitExpr *E)
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...
bool ImportTemplateArgumentListInfo(const InContainerTy &Container, TemplateArgumentListInfo &ToTAInfo)
QualType VisitInjectedClassNameType(const InjectedClassNameType *T)
SourceLocation getGotoLoc() const
void setTemplateArgsInfo(const TemplateArgumentListInfo &ArgsInfo)
static CXXFunctionalCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, TypeSourceInfo *Written, CastKind Kind, Expr *Op, const CXXCastPath *Path, SourceLocation LPLoc, SourceLocation RPLoc)
SourceLocation getLocEnd() const LLVM_READONLY
SourceLocation getRParenLoc() const
const Expr * getAnyInitializer() const
getAnyInitializer - Get the initializer for this variable, no matter which declaration it is attached...
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
Decl * VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
param_const_iterator param_end() const
TemplateTypeParmDecl * getDecl() const
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
A template template parameter that has been substituted for some other template name.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
bool isPackExpansion() const
Determine whether this initializer is a pack expansion.
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
QualType getElementType() const
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "while" statement, if any.
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
SourceLocation getCoawaitLoc() const
Expr * getIndexExpr(unsigned Idx)
bool isIndirectMemberInitializer() const
An identifier, stored as an IdentifierInfo*.
Expr * VisitStringLiteral(StringLiteral *E)
SourceRange getSourceRange() const LLVM_READONLY
unsigned getDepth() const
Get the nesting depth of the template parameter.
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
QualType VisitPointerType(const PointerType *T)
VarDecl - An instance of this class is created to represent a variable declaration or definition...
void setImplementation(ObjCCategoryImplDecl *ImplD)
static CXXConversionDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isExplicit, bool isConstexpr, SourceLocation EndLocation)
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization. ...
SourceLocation getLParenLoc() const
static NestedNameSpecifier * Create(const ASTContext &Context, NestedNameSpecifier *Prefix, IdentifierInfo *II)
Builds a specifier combining a prefix and an identifier.
QualType getBaseType() const
CompoundLiteralExpr - [C99 6.5.2.5].
void setCXXLiteralOperatorNameLoc(SourceLocation Loc)
setCXXLiteralOperatorNameLoc - Sets the location of the literal operator name (not the operator keywo...
SourceLocation getOperatorLoc() const
Retrieve the location of the '.' or '->' operator.
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.
Stmt * VisitLabelStmt(LabelStmt *S)
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
const T * getAs() const
Member-template getAs<specific type>'.
bool hasDefaultArg() const
hasDefaultArg - Determines whether this parameter has a default argument, either parsed or not...
ObjCCategoryImplDecl * getImplementation() const
Expr * VisitIntegerLiteral(IntegerLiteral *E)
unsigned getNumArgs() const
Determine the number of arguments to this type trait.
Represents an empty template argument, e.g., one that has not been deduced.
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
Extra information about a function prototype.
bool hasInheritedDefaultArg() const
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
SourceLocation getColonLoc() const
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
Represents a variable template specialization, which refers to a variable template with a given set o...
SourceLocation getLocStart() const LLVM_READONLY
ObjCMethodDecl - Represents an instance or class method declaration.
SourceLocation getLAngleLoc() const
Decl * VisitVarDecl(VarDecl *D)
A namespace, stored as a NamespaceDecl*.
DiagnosticBuilder ToDiag(SourceLocation Loc, unsigned DiagID)
Report a diagnostic in the "to" context.
llvm::PointerUnion< NamedDecl *, TypeSourceInfo * > FriendUnion
SourceLocation getIfLoc() const
Expr * VisitUnaryOperator(UnaryOperator *E)
Stores a list of template parameters for a TemplateDecl and its derived classes.
unsigned getNumPlacementArgs() const
Expr * VisitAtomicExpr(AtomicExpr *E)
TypeSourceInfo * getArgumentTypeInfo() const
bool isMemberInitializer() const
Determine whether this initializer is initializing a non-static data member.
TemplateName getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param, TemplateName replacement) const
SourceLocation getEllipsisLoc() const
unsigned getNumExpressions() const
SourceLocation getLocation() const
Retrieve the location of the literal.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
QualType Import(QualType FromT)
Import the given type from the "from" context into the "to" context.
A C++ throw-expression (C++ [except.throw]).
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
static AccessSpecDecl * Create(ASTContext &C, AccessSpecifier AS, DeclContext *DC, SourceLocation ASLoc, SourceLocation ColonLoc)
ParmVarDecl - Represents a parameter to a function.
bool ImportTemplateArguments(const TemplateArgument *FromArgs, unsigned NumFromArgs, SmallVectorImpl< TemplateArgument > &ToArgs)
Represents the result of substituting a type for a template type parameter.
DeclarationNameInfo getNameInfo() const
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "switch" statement, if any.
SourceLocation getRParenLoc() const
QualType getIntegralType() const
Retrieve the type of the integral value.
BoundNodesTreeBuilder Nodes
const ObjCInterfaceDecl * getSuperClass() const
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
Decl * VisitStaticAssertDecl(StaticAssertDecl *D)
const Stmt * getSubStmt() const
void setTemplateSpecializationKind(TemplateSpecializationKind TSK)
Set the kind of specialization or template instantiation this is.
const char * getStmtClassName() const
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
SourceLocation getRParenLoc() const
Retrieve the location of the closing parenthesis.
LabelStmt - Represents a label, which has a substatement.
SourceLocation getDotLoc() const
RecordDecl - Represents a struct/union/class.
Represents a C99 designated initializer expression.
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
Decl * VisitObjCCategoryDecl(ObjCCategoryDecl *D)
QualType VisitBlockPointerType(const BlockPointerType *T)
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
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.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
QualType getOriginalType() const
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
FunctionType::ExtInfo ExtInfo
SourceLocation getColonLoc() const
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.
Expr * GetTemporaryExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue...
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
unsigned getDepth() const
Retrieve the depth of the template parameter.
SourceLocation getTildeLoc() const
Retrieve the location of the '~'.
Decl * VisitTypedefDecl(TypedefDecl *D)
FieldDecl * getField() const
For a field offsetof node, returns the field.
DiagnosticBuilder FromDiag(SourceLocation Loc, unsigned DiagID)
Report a diagnostic in the "from" context.
SourceLocation getRParenLoc() const
StringLiteral * getMessage()
bool cleanupsHaveSideEffects() const
Designator ImportDesignator(const Designator &D)
QualType getComputationResultType() const
Decl * VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
bool isArrayRangeDesignator() const
Expr * VisitCompoundAssignOperator(CompoundAssignOperator *E)
SourceLocation getIvarLBraceLoc() const
Represents a class type in Objective C.
SourceLocation getRParen() const
Get the location of the right parentheses ')'.
static RecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, RecordDecl *PrevDecl=nullptr)
QualType getPointeeType() const
Expr * getAsExpr() const
Retrieve the template argument as an expression.
void setUninstantiatedDefaultArg(Expr *arg)
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.
Expr * getInit() const
Retrieve the initializer value.
bool isInline() const
Returns true if this is an inline namespace declaration.
Represents a dependent template name that cannot be resolved prior to template instantiation.
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
bool CheckedICE
Whether we already checked whether this statement was an integral constant expression.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
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)
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)
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
RecordDecl * getDefinition() const
getDefinition - Returns the RecordDecl that actually defines this struct/union/class.
QualType VisitDecayedType(const DecayedType *T)
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getAmpAmpLoc() const
SourceLocation getEndLoc() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this class.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
QualType VisitParenType(const ParenType *T)
protocol_iterator protocol_begin() const
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
const llvm::APSInt & getInitVal() const
NonTypeTemplateParmDecl * getParameter() const
static DesignatedInitExpr * Create(const ASTContext &C, llvm::ArrayRef< Designator > Designators, ArrayRef< Expr *> IndexExprs, SourceLocation EqualOrColonLoc, bool GNUSyntax, Expr *Init)
bool isArrayDesignator() const
One instance of this struct is kept for every file loaded or used.
unsigned getArrayExprIndex() const
For an array element node, returns the index into the array of expressions.
const Expr * getRetValue() const
SourceLocation getLabelLoc() const
void startDefinition()
Starts the definition of this tag declaration.
bool hasExplicitTemplateArgs() const
Determines whether the member name was followed by an explicit template argument list.
void setSuperClass(TypeSourceInfo *superClass)
SourceLocation getOperatorLoc() const
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Optional< unsigned > getNumTemplateExpansions() const
Retrieve the number of expansions that a template template argument expansion will produce...
SourceLocation getRParenLoc() const
ObjCMethodDecl * getSetterMethodDecl() const
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
static UnresolvedUsingTypenameDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation TypenameLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TargetNameLoc, DeclarationName TargetName, SourceLocation EllipsisLoc)
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class. ...
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
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)
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
Retrieve the template name that corresponds to a non-empty lookup.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
protocol_iterator protocol_end() const
const DeclGroupRef getDeclGroup() const
Expr * VisitExpr(Expr *E)
Decl * VisitObjCImplementationDecl(ObjCImplementationDecl *D)
Represents an access specifier followed by colon ':'.
void startDefinition()
Starts the definition of this Objective-C protocol.
SourceLocation getQuestionLoc() const
static CXXRecordDecl * CreateLambda(const ASTContext &C, DeclContext *DC, TypeSourceInfo *Info, SourceLocation Loc, bool DependentLambda, bool IsGeneric, LambdaCaptureDefault CaptureDefault)
SourceLocation getTemplateLoc() const
TemplateName getReplacement() const
QualType VisitObjCInterfaceType(const ObjCInterfaceType *T)
unsigned getIndex() const
Retrieve the index into its type parameter list.
QualType getParamTypeForDecl() const
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name...
QualType VisitComplexType(const ComplexType *T)
Qualifiers getLocalQualifiers() const
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifie...
bool hadArrayRangeDesignator() const
Decl * VisitFriendDecl(FriendDecl *D)
SourceLocation getCatchLoc() const
ArrayRef< ParmVarDecl * > parameters() const
Represents Objective-C's @catch statement.
TypeAliasDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
IndirectGotoStmt - This represents an indirect goto.
SourceLocation getMemberLoc() const
Describes an C or C++ initializer list.
Represents a C++ using-declaration.
QualType VisitVariableArrayType(const VariableArrayType *T)
Stmt * VisitBreakStmt(BreakStmt *S)
bool ImportArrayChecked(const InContainerTy &InContainer, OIter Obegin)
Decl * VisitCXXConstructorDecl(CXXConstructorDecl *D)
SourceLocation getIvarRBraceLoc() const
An rvalue reference type, per C++11 [dcl.ref].
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
UnresolvedUsingTypenameDecl * getDecl() const
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
Decl * VisitUsingDecl(UsingDecl *D)
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...
unsigned getFirstExprIndex() const
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)
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
FunctionDecl * getOperatorDelete() const
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
bool isElidable() const
Whether this construction is elidable.
Expr * getOperand() const
const Expr * getThrowExpr() const
Stmt * VisitAttributedStmt(AttributedStmt *S)
bool isBaseVirtual() const
Returns whether the base is virtual or not.
TagKind getTagKind() const
Namespaces, declared with 'namespace foo {}'.
void setCXXOperatorNameRange(SourceRange R)
setCXXOperatorNameRange - Sets the range of the operator name (without the operator keyword)...
A convenient class for passing around template argument information.
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion: ...
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())
const FileInfo & getFile() const
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
LabelDecl * getDecl() const
static ObjCPropertyImplDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, Kind PK, ObjCIvarDecl *ivarDecl, SourceLocation ivarLoc)
SourceLocation getLBracLoc() const
static EnumConstantDecl * Create(ASTContext &C, EnumDecl *DC, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *E, const llvm::APSInt &V)
ArrayRef< NamedDecl * > chain() const
SourceLocation getRParenLoc() const
QualType getNullPtrType() const
Retrieve the type for null non-type template argument.
Expr * getInitializer()
The initializer of this new-expression.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
path_iterator path_begin()
PropertyAttributeKind getPropertyAttributes() const
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
QualType VisitTemplateTypeParmType(const TemplateTypeParmType *T)
Decl * VisitObjCPropertyDecl(ObjCPropertyDecl *D)
Represents a typeof (or typeof) expression (a GCC extension).
Expr * VisitCharacterLiteral(CharacterLiteral *E)
static TemplateTypeParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation KeyLoc, SourceLocation NameLoc, unsigned D, unsigned P, IdentifierInfo *Id, bool Typename, bool ParameterPack)
A builtin binary operation expression such as "x + y" or "x <= y".
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum...
void setLambdaMangling(unsigned ManglingNumber, Decl *ContextDecl)
Set the mangling number and context declaration for a lambda class.
tokloc_iterator tokloc_end() const
static CompoundStmt * Create(const ASTContext &C, ArrayRef< Stmt *> Stmts, SourceLocation LB, SourceLocation RB)
Decl * VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
SourceLocation getThrowLoc() const
const StringLiteral * getInputConstraintLiteral(unsigned i) const
const Type * getClass() const
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Stmt * VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S)
CXXRecordDecl * getDecl() const
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
SourceLocation getEqualOrColonLoc() const
Retrieve the location of the '=' that precedes the initializer value itself, if present.
SourceLocation getRAngleLoc() const
Retrieve the location of the right angle bracket ending the explicit template argument list following...
SourceLocation getLocStart() const LLVM_READONLY
void setSpecializationKind(TemplateSpecializationKind TSK)
Expr * getSizeExpr() const
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
const TemplateArgument * getArgs() const
Retrieve the template arguments.
SourceLocation getLocalEndLoc() const
Retrieve the location of the end of this component of the nested-name-specifier.
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
bool hasUnparsedDefaultArg() const
hasUnparsedDefaultArg - Determines whether this parameter has a default argument that has not yet bee...
Decl * VisitObjCProtocolDecl(ObjCProtocolDecl *D)
SourceLocation getContinueLoc() const
const Expr * getInitExpr() const
SourceLocation getPropertyIvarDeclLoc() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
FieldDecl * getField()
Get the field whose initializer will be used.
Helper class for OffsetOfExpr.
SourceLocation getExternLoc() const
Represents an Objective-C protocol declaration.
Represents binding an expression to a temporary.
bool IsStructurallyEquivalent(QualType From, QualType To, bool Complain=true)
Determine whether the given types are structurally equivalent.
StringLiteral * getClobberStringLiteral(unsigned i)
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
TemplateTemplateParmDecl * getParameter() const
SourceLocation getBuiltinLoc() const
CXXTemporary * getTemporary()
static VarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S)
static NamespaceAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation NamespaceLoc, SourceLocation AliasLoc, IdentifierInfo *Alias, NestedNameSpecifierLoc QualifierLoc, SourceLocation IdentLoc, NamedDecl *Namespace)
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'.
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name, with source-location information.
Stmt * VisitNullStmt(NullStmt *S)
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
PropertyControl getPropertyImplementation() const
Stmt * VisitCXXCatchStmt(CXXCatchStmt *S)
const TemplateArgument * data() const
Retrieve a pointer to the template argument list.
Represents a C++ member access expression where the actual member referenced could not be resolved be...
SourceLocation getLocStart() const LLVM_READONLY
Represents an ObjC class declaration.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "for" statement, if any.
SourceLocation getLocEnd() const LLVM_READONLY
FieldDecl * getMember() const
If this is a member initializer, returns the declaration of the non-static data member being initiali...
Represents a linkage specification.
static FunctionTemplateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl)
Create a function template node.
SourceLocation getOperatorLoc() const
getOperatorLoc - Return the location of the operator.
QualType getReturnType() const
SourceLocation getIncludeLoc() const
NamedDecl *const * iterator
Stmt * VisitCXXTryStmt(CXXTryStmt *S)
CXXRecordDecl * getTemplatedDecl() const
Get the underlying class declarations of the template.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
bool ImportDefinition(RecordDecl *From, RecordDecl *To, ImportDefinitionKind Kind=IDK_Default)
ASTImporter(ASTContext &ToContext, FileManager &ToFileManager, ASTContext &FromContext, FileManager &FromFileManager, bool MinimalImport)
Create a new AST importer.
TypeSourceInfo * getTypeSourceInfo() const
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
A default argument (C++ [dcl.fct.default]).
Expr * VisitGNUNullExpr(GNUNullExpr *E)
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl *> Params, ArrayRef< SourceLocation > SelLocs=llvm::None)
Sets the method's parameters and selector source locations.
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)
QualType getPointeeTypeAsWritten() const
Expr * VisitSubstNonTypeTemplateParmExpr(SubstNonTypeTemplateParmExpr *E)
SourceLocation getAtStartLoc() const
Import the default subset of the definition, which might be nothing (if minimal import is set) or mig...
QualType VisitUnresolvedUsingType(const UnresolvedUsingType *T)
void addDeclInternal(Decl *D)
Add the declaration D into this context, but suppress searches for external declarations with the sam...
Stmt * VisitDeclStmt(DeclStmt *S)
ASTContext & getToContext() const
Retrieve the context that AST nodes are being imported into.
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Whether this is an anonymous struct or union.
NamedDecl * getFirstQualifierFoundInScope() const
Retrieve the first part of the nested-name-specifier that was found in the scope of the member access...
Represents the this expression in C++.
TypeSourceInfo * getAllocatedTypeSourceInfo() const
NestedNameSpecifierLoc getQualifierLoc() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name...
Class that aids in the construction of nested-name-specifiers along with source-location information ...
SourceLocation getRParenLoc() const
TypeSourceInfo * getQueriedTypeSourceInfo() const
bool IsStructurallyEquivalent(Decl *D1, Decl *D2)
Determine whether the two declarations are structurally equivalent.
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, ImplicitParamKind ParamKind)
Create implicit parameter.
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
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
SourceLocation getEllipsisLoc() const
Decl * VisitTypedefNameDecl(TypedefNameDecl *D, bool IsAlias)
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
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...
Decl * VisitCXXDestructorDecl(CXXDestructorDecl *D)
ConditionalOperator - The ?: ternary operator.
QualType getBaseType() const
Gets the base type of this object type.
SourceLocation getLocStart() const LLVM_READONLY
QualType VisitObjCObjectType(const ObjCObjectType *T)
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
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 }.
Represents a prototype with parameter type info, e.g.
bool isFileVarDecl() const
isFileVarDecl - Returns true for file scoped variable declaration.
Decl * VisitRecordDecl(RecordDecl *D)
bool isMicrosoftABI() const
Returns whether this is really a Win64 ABI va_arg expression.
SourceLocation getLocStart() const LLVM_READONLY
Decl * VisitCXXConversionDecl(CXXConversionDecl *D)
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
QualType getComputationLHSType() const
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
CastKind
CastKind - The kind of operation required for a conversion.
QualType getPromotionType() const
getPromotionType - Return the integer type that enumerators should promote to.
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
static ImplicitCastExpr * Create(const ASTContext &Context, QualType T, CastKind Kind, Expr *Operand, const CXXCastPath *BasePath, ExprValueKind Cat)
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
DeclarationNameTable DeclarationNames
A dependent template name that has not been resolved to a template (or set of templates).
OverloadedOperatorKind getCXXOverloadedOperator() const
getCXXOverloadedOperator - If this name is the name of an overloadable operator in C++ (e...
Expr * VisitArrayInitLoopExpr(ArrayInitLoopExpr *E)
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
SourceLocation getTryLoc() const
Stmt * VisitObjCForCollectionStmt(ObjCForCollectionStmt *S)
SourceLocation getLocation() const
SourceLocation getLocation() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
const FunctionType * getFunctionType(bool BlocksToo=true) const
Looks through the Decl's underlying type to extract a FunctionType when possible. ...
static EmptyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L)
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
ImportDefinitionKind
What we should import from the definition.
static CXXDefaultArgExpr * Create(const ASTContext &C, SourceLocation Loc, ParmVarDecl *Param)
Represents a call to the builtin function __builtin_va_arg.
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.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
static StaticAssertDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StaticAssertLoc, Expr *AssertExpr, StringLiteral *Message, SourceLocation RParenLoc, bool Failed)
TypeSourceInfo * getTypeSourceInfo() const
SourceLocation getLabelLoc() const
void setInClassInitializer(Expr *Init)
setInClassInitializer - Set the C++11 in-class initializer for this member.
SourceLocation getThrowLoc() const LLVM_READONLY
CharacteristicKind getFileCharacteristic() const
Return whether this is a system header or not.
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
unsigned getValue() const
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)
Expr * VisitParenExpr(ParenExpr *E)
SourceLocation getDestroyedTypeLoc() const
Retrieve the starting location of the type being destroyed.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type...
QualType getElementType() const
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
llvm::MutableArrayRef< Designator > designators()
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
llvm::MemoryBuffer * getBuffer(DiagnosticsEngine &Diag, const SourceManager &SM, SourceLocation Loc=SourceLocation(), bool *Invalid=nullptr) const
Returns the memory buffer for the associated content.
DeclAccessPair getFoundDecl() const
Retrieves the declaration found by lookup.
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Stmt * VisitGotoStmt(GotoStmt *S)
SourceLocation getElseLoc() const
Decl * VisitEnumConstantDecl(EnumConstantDecl *D)
static TypeTraitExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, TypeTrait Kind, ArrayRef< TypeSourceInfo *> Args, SourceLocation RParenLoc, bool Value)
Create a new type trait expression.
unsigned getChainingSize() const
SourceLocation getAliasLoc() const
Returns the location of the alias name, i.e.
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.
static ClassTemplatePartialSpecializationDecl * Create(ASTContext &Context, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, TemplateParameterList *Params, ClassTemplateDecl *SpecializedTemplate, ArrayRef< TemplateArgument > Args, const TemplateArgumentListInfo &ArgInfos, QualType CanonInjectedType, ClassTemplatePartialSpecializationDecl *PrevDecl)
Selector getSetterName() const
Stmt * VisitCXXForRangeStmt(CXXForRangeStmt *S)
IdentifierInfo * getFieldName() const
For a field or identifier offsetof node, returns the name of the field.
CXXBaseSpecifier * getBase() const
For a base class node, returns the base specifier.
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Decl * VisitEmptyDecl(EmptyDecl *D)
const FunctionProtoType * T
TypeSourceInfo * getSuperClassTInfo() const
SourceLocation getLocStart() const LLVM_READONLY
Declaration of a template type parameter.
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
SourceLocation getDefaultLoc() const
unsigned getIndex() const
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...
SourceLocation getWhileLoc() const
TypeSourceInfo * getTypeSourceInfo() const
DeclarationNameInfo getNameInfo() const
Expr * VisitDeclRefExpr(DeclRefExpr *E)
void setSyntacticForm(InitListExpr *Init)
Represents a C++ functional cast expression that builds a temporary object.
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
const Stmt * getThen() const
bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord, bool Complain=true)
static UnresolvedUsingValueDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, SourceLocation EllipsisLoc)
SourceLocation getLocation() const
Represents a C++ destructor within a class.
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type...
VarDecl * getExceptionDecl() const
IdentifierInfo * getDestroyedTypeIdentifier() const
In a dependent pseudo-destructor expression for which we do not have full type information on the des...
bool isFieldDesignator() const
unsigned getNumInits() const
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
bool isImplicitAccess() const
True if this is an implicit access, i.e.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Expr * getSubExpr() const
Get the initializer to use for each array element.
const Expr * getCallee() const
void setRBraceLoc(SourceLocation L)
const char * getTypeClassName() const
Stmt * VisitIfStmt(IfStmt *S)
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)
Decl * VisitLinkageSpecDecl(LinkageSpecDecl *D)
bool isArrow() const
Determine whether this pseudo-destructor expression was written using an '->' (otherwise, it used a '.
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
Expr * VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E)
overridden_method_range overridden_methods() const
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)
const CompoundStmt * getSynchBody() const
Expr * VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E)
DeclContext * getDeclContext()
SourceLocation getLParenLoc() const
Decl * VisitAccessSpecDecl(AccessSpecDecl *D)
A structure for storing the information associated with a substituted template template parameter...
CXXRecordDecl * getDefinition() const
QualType VisitFunctionNoProtoType(const FunctionNoProtoType *T)
Represents Objective-C's @synchronized statement.
ObjCInterfaceDecl * getSuperClass() const
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
TypeSourceInfo * getTypeSourceInfo() const
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl *> typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
unsigned size() const
Returns the number of designators in this initializer.
CXXTryStmt - A C++ try block, including all handlers.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Expr * VisitPredefinedExpr(PredefinedExpr *E)
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
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)
ArrayTypeTrait getTrait() const
EnumDecl * getDefinition() const
bool isIdentifier() const
Determine whether this template name refers to an identifier.
A namespace alias, stored as a NamespaceAliasDecl*.
ParmVarDecl *const * param_iterator
protocol_loc_iterator protocol_loc_begin() const
ArrayRef< Expr * > inits()
IdentifierInfo * getAsIdentifierInfo() const
getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in this declaration name, or NULL if this declaration name isn't a simple identifier.
void setImplementation(ObjCImplementationDecl *ImplD)
void setConstexpr(bool IC)
Expr * VisitCXXDeleteExpr(CXXDeleteExpr *E)
SourceRange getAngleBrackets() const LLVM_READONLY
Kind getKind() const
Determine what kind of offsetof node this is.
Stmt * VisitObjCAtTryStmt(ObjCAtTryStmt *S)
bool hasBody(const FunctionDecl *&Definition) const
Returns true if the function has a body (definition).
bool isFunctionOrMethod() const
Expr * VisitCXXThisExpr(CXXThisExpr *E)
Optional< TemplateArgumentLoc > ImportTemplateArgumentLoc(const TemplateArgumentLoc &TALoc)
SourceLocation getSwitchLoc() const
Declaration of an alias template.
void ImportDeclarationNameLoc(const DeclarationNameInfo &From, DeclarationNameInfo &To)
LabelDecl * getLabel() const
const Stmt * getTryBody() const
Retrieve the @try body.
Decl * GetAlreadyImportedOrNull(Decl *FromD)
Return the copy of the given declaration in the "to" context if it has already been imported from the...
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
SourceLocation getDoLoc() const
Expr * VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E)
SourceLocation getAtLoc() const
SourceLocation getLBracketLoc() const
SourceLocation getRBracketLoc() const
SourceLocation getEnd() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
bool isInstanceMethod() const
Represents a GCC generic vector type.
ArraySizeModifier getSizeModifier() const
bool usesGNUSyntax() const
Determines whether this designated initializer used the deprecated GNU syntax for designated initiali...
static bool CanThrow(Expr *E, ASTContext &Ctx)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
An lvalue reference type, per C++11 [dcl.ref].
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Stmt * VisitReturnStmt(ReturnStmt *S)
Represents a reference to a non-type template parameter that has been substituted with a template arg...
bool isBaseOfClass() const
Determine whether this base class is a base of a class declared with the 'class' keyword (vs...
const OffsetOfNode & getComponent(unsigned Idx) const
unsigned getNumArgs() const
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression which will be evaluated if the condition evaluates to true; th...
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
void setDescribedClassTemplate(ClassTemplateDecl *Template)
SourceLocation getRParenLoc() const
Represents a C++ conversion function within a class.
The result type of a method or function.
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
SourceLocation getForLoc() const
const Expr * getSubExpr() const
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
const Expr * getSubExpr() const
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.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
A type, stored as a Type*.
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
bool hadMultipleCandidates() const
Returns true if this expression refers to a function that was resolved from an overloaded set having ...
static TemplateParameterList * Create(const ASTContext &C, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef< NamedDecl *> Params, SourceLocation RAngleLoc, Expr *RequiresClause)
Expr * getUnderlyingExpr() const
Decl * VisitObjCMethodDecl(ObjCMethodDecl *D)
ObjCProtocolList::iterator protocol_iterator
static CXXRecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl=nullptr, bool DelayTypeCreation=false)
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
DoStmt - This represents a 'do/while' stmt.
SourceLocation getOperatorLoc() const
Retrieve the location of the '->' or '.' operator.
unsigned getBuiltinID() const
Return a value indicating whether this is a builtin function.
QualType VisitEnumType(const EnumType *T)
TypeSourceInfo * getReturnTypeSourceInfo() const
RecordDecl * getDecl() const
const DirectoryEntry * getDir() const
Return the directory the file lives in.
SpecifierKind
The kind of specifier that completes this nested name specifier.
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getUsingLoc() const
Return the location of the using keyword.
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
Expr * VisitParenListExpr(ParenListExpr *E)
A template template parameter pack that has been substituted for a template template argument pack...
CanThrowResult
Possible results from evaluation of a noexcept expression.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
IdentifierInfo * getCXXLiteralIdentifier() const
getCXXLiteralIdentifier - If this name is the name of a literal operator, retrieve the identifier ass...
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class...
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template.
SourceLocation getLocEnd() const LLVM_READONLY
TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template apply...
SourceLocation getLParenLoc() const
SelectorTable & Selectors
static CXXConstCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, Expr *Op, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets)
static CXXBindTemporaryExpr * Create(const ASTContext &C, CXXTemporary *Temp, Expr *SubExpr)
A field in a dependent type, known only by its name.
QualType getCanonicalType() const
Decl * VisitIndirectFieldDecl(IndirectFieldDecl *D)
ExpressionTrait getTrait() const
ExceptionSpecificationType Type
The kind of exception specification this is.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on a template...
param_type_range param_types() const
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
ElaboratedTypeKeyword getKeyword() const
ExtProtoInfo getExtProtoInfo() const
const ContentCache * getContentCache() const
static ClassTemplateSpecializationDecl * Create(ASTContext &Context, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, ClassTemplateDecl *SpecializedTemplate, ArrayRef< TemplateArgument > Args, ClassTemplateSpecializationDecl *PrevDecl)
void setKNRPromoted(bool promoted)
Decl * VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
SourceLocation getLocStart() const LLVM_READONLY
static FriendDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, FriendUnion Friend_, SourceLocation FriendL, ArrayRef< TemplateParameterList *> FriendTypeTPLists=None)
unsigned getNumExprs() const
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
bool isParameterPack() const
Returns whether this is a parameter pack.
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Encodes a location in the source.
bool getSynthesize() const
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Sugar for parentheses used when specifying types.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
QualType getReturnType() const
bool isPure() const
Whether this virtual function is pure, i.e.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
SourceLocation getOperatorLoc() const
QualType VisitFunctionProtoType(const FunctionProtoType *T)
StringRef getName() const
ObjCProtocolList::iterator protocol_iterator
const Stmt * getCatchBody() const
unsigned getNumHandlers() const
Expr * getSubExpr() const
SourceLocation getSuperClassLoc() const
Represents a C++ temporary.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Represents typeof(type), a GCC extension.
Interfaces are the core concept in Objective-C for object oriented design.
Attr * clone(ASTContext &C) const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieves the nested-name-specifier that qualifies the type name, with source-location information...
QualType VisitBuiltinType(const BuiltinType *T)
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
CastKind getCastKind() const
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
SourceLocation getLocStart() const LLVM_READONLY
Expr * getSubExpr(unsigned Idx) const
A structure for storing an already-substituted template template parameter pack.
const SwitchCase * getSwitchCaseList() const
SourceLocation getOperatorLoc() const
Retrieve the location of the cast operator keyword, e.g., static_cast.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
void setExternLoc(SourceLocation Loc)
Sets the location of the extern keyword.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
DeclarationName getName() const
getName - Returns the embedded declaration name.
ArrayRef< const Attr * > getAttrs() const
TagDecl - Represents the declaration of a struct/union/class/enum.
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
SourceLocation getEllipsisLoc() const
Retrieve the location of the ellipsis that describes this pack expansion.
SourceLocation getCategoryNameLoc() const
Represents a call to a member function that may be written either with member call syntax (e...
ASTContext & getASTContext() const LLVM_READONLY
ObjCCategoryDecl * getCategoryDecl() const
QualType getElementType() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Decl * VisitTranslationUnitDecl(TranslationUnitDecl *D)
LabelDecl - Represents the declaration of a label.
void setPropertyAttributesAsWritten(PropertyAttributeKind PRVal)
Represents a dependent using declaration which was not marked with typename.
Cached information about one file (either on disk or in the virtual file system). ...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set...
Decl * VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
Expr * VisitMemberExpr(MemberExpr *E)
void setCtorInitializers(CXXCtorInitializer **Initializers)
static OffsetOfExpr * Create(const ASTContext &C, QualType type, SourceLocation OperatorLoc, TypeSourceInfo *tsi, ArrayRef< OffsetOfNode > comps, ArrayRef< Expr *> exprs, SourceLocation RParenLoc)
SourceLocation getLocStart() const LLVM_READONLY
Represents a static or instance method of a struct/union/class.
static ExprWithCleanups * Create(const ASTContext &C, EmptyShell empty, unsigned numObjects)
SourceLocation getFriendLoc() const
Retrieves the location of the 'friend' keyword.
bool shouldForceImportDeclContext(ImportDefinitionKind IDK)
SourceLocation getFileLoc(SourceLocation Loc) const
Given Loc, if it is a macro location return the expansion location or the spelling location...
StmtVisitor - This class implements a simple visitor for Stmt subclasses.
SourceLocation getRParenLoc() const
Expr * getRequiresClause()
The constraint-expression of the associated requires-clause.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void addOverriddenMethod(const CXXMethodDecl *MD)
SourceLocation getIdentLocation() const
Returns the location of this using declaration's identifier.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference.
bool isParameterPack() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Decl * VisitFunctionDecl(FunctionDecl *D)
ObjCCategoryDecl - Represents a category declaration.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
QualType getEquivalentType() 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>, and corresponding __opencl_atomic_* for OpenCL 2.0.
UnaryExprOrTypeTrait getKind() const
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
void addDecl(NamedDecl *D)
QualType VisitTypedefType(const TypedefType *T)
Expr * VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E)
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
const TemplateArgumentListInfo & getTemplateArgsInfo() const
QualType getInnerType() const
SourceLocation getLParenLoc() const
SourceLocation getGotoLoc() const
SourceLocation getAtFinallyLoc() const
AccessSpecifier getAccess() const
void setPointOfInstantiation(SourceLocation Loc)
StringLiteral * getFunctionName()
bool isMinimalImport() const
Whether the importer will perform a minimal import, creating to-be-completed forward declarations whe...
const StringLiteral * getOutputConstraintLiteral(unsigned i) const
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.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
SourceLocation getLocEnd() const LLVM_READONLY
ASTNodeImporter(ASTImporter &Importer)
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Stmt * VisitForStmt(ForStmt *S)
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
SourceLocation getAtCatchLoc() const
A simple visitor class that helps create declaration visitors.
CharacterKind getKind() const
bool hasUninstantiatedDefaultArg() const
AutoTypeKeyword getKeyword() const
QualType VisitRecordType(const RecordType *T)
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required...
Decl * VisitVarTemplateDecl(VarTemplateDecl *D)
IdentType getIdentType() const
Stmt * VisitCompoundStmt(CompoundStmt *S)
Stmt * VisitIndirectGotoStmt(IndirectGotoStmt *S)
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
An expression trait intrinsic.
Decl * VisitImplicitParamDecl(ImplicitParamDecl *D)
SourceLocation getRAngleLoc() const
SourceLocation getMemberLocation() const
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node...
EnumDecl * getDecl() const
Expr * VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E)
ArrayRef< Expr * > exprs()
DeclarationNameInfo getNameInfo() const
Represents a C++11 static_assert declaration.
Stmt * VisitWhileStmt(WhileStmt *S)
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
bool isArgumentType() const
ArrayRef< TemplateArgumentLoc > template_arguments() const
ObjCImplementationDecl * getImplementation() const
SourceLocation getRBraceLoc() const
Optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
Expr * VisitCallExpr(CallExpr *E)
Expr * getArrayFiller()
If this initializer list initializes an array with more elements than there are initializers in the l...
Decl * VisitLabelDecl(LabelDecl *D)
TypeSourceInfo * getTypeSourceInfo() const
Retrieves the type and source location of the base class.
SourceLocation getStarLoc() const
QualType VisitObjCObjectPointerType(const ObjCObjectPointerType *T)
void setHasInheritedDefaultArg(bool I=true)
bool passAlignment() const
Indicates whether the required alignment should be implicitly passed to the allocation function...
void sawArrayRangeDesignator(bool ARD=true)
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
void addArgument(const TemplateArgumentLoc &Loc)
FunctionDecl * getOperatorDelete() const
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)
static ClassTemplateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl, Expr *AssociatedConstraints=nullptr)
Create a class template node.
SourceLocation getIvarLBraceLoc() const
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)
Represents a pointer type decayed from an array or function type.
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.
void setVirtualAsWritten(bool V)
const Expr * getInitializer() const
Represents a pack expansion of types.
InitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
static TypeAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
CompoundAssignOperator - For compound assignments (e.g.
A POD class for pairing a NamedDecl* with an access specifier.
StringRef getName() const
Return the actual identifier string.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
AddrLabelExpr - The GNU address of label extension, representing &&label.
An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers...
Base class for declarations which introduce a typedef-name.
ast_type_traits::DynTypedNode Node
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a template argument.
OpaqueValueExpr * getOpaqueValue() const
getOpaqueValue - Return the opaque value placeholder.
LabelStmt * getStmt() const
unsigned getManglingNumber() const
bool ImportDeclParts(NamedDecl *D, DeclContext *&DC, DeclContext *&LexicalDC, DeclarationName &Name, NamedDecl *&ToD, SourceLocation &Loc)
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
VarDecl * getConditionVariable() const
Retrieve the variable declared in this "if" statement, if any.
static DeclGroupRef Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
Represents a template name that was expressed as a qualified name.
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
protocol_iterator protocol_end() const
NullStmt - This is the null statement ";": C99 6.8.3p3.
const ObjCInterfaceDecl * getClassInterface() const
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
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.
SourceLocation getLocation() const
bool isNull() const
Determine whether this template name is NULL.
Dataflow Directional Tag Classes.
void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber)
TemplateName getSubstTemplateTemplateParmPack(TemplateTemplateParmDecl *Param, const TemplateArgument &ArgPack) const
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool isValid() const
Return true if this is a valid SourceLocation object.
tokloc_iterator tokloc_begin() const
void ImportDeclContext(DeclContext *FromDC, bool ForceImport=false)
ExtInfo getExtInfo() const
const TemplateArgument & getArgument() const
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.
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
IdentifierInfo * getOutputIdentifier(unsigned i) const
PropertyAttributeKind getPropertyAttributesAsWritten() const
The base class of all kinds of template declarations (e.g., class, function, etc.).
TemplateArgument ImportTemplateArgument(const TemplateArgument &From)
Kind getPropertyImplementation() const
QualType VisitIncompleteArrayType(const IncompleteArrayType *T)
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 Stmt * getFinallyBody() const
SourceLocation getLocStart() const LLVM_READONLY
The template argument is a pack expansion of a template name that was provided for a template templat...
SourceLocation getAtLoc() const
QualType VisitAttributedType(const AttributedType *T)
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
QualType getUnderlyingType() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
AccessSpecifier getAccess() const
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
QualType getUnderlyingType() const
unsigned getIndex() const
Retrieve the index of the template parameter.
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
SourceLocation getLBraceLoc() const
Represents a dependent using declaration which was marked with typename.
SourceLocation getSemiLoc() const
static UsingDirectiveDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation NamespaceLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation IdentLoc, NamedDecl *Nominated, DeclContext *CommonAncestor)
DeclarationName - The name of a declaration.
StmtClass getStmtClass() const
VectorKind getVectorKind() const
Represents the declaration of an Objective-C type parameter.
ArrayRef< QualType > exceptions() const
Expr * VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Expr * VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E)
Represents a C++11 pack expansion that produces a sequence of expressions.
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
static ObjCImplementationDecl * Create(ASTContext &C, DeclContext *DC, ObjCInterfaceDecl *classInterface, ObjCInterfaceDecl *superDecl, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation superLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
Decl * VisitClassTemplateDecl(ClassTemplateDecl *D)
A set of unresolved declarations.
void setInstantiationDependent(bool ID)
Set whether this expression is instantiation-dependent or not.
SourceLocation getLocStart() const LLVM_READONLY
EnumDecl - Represents an enum.
const Expr * getSynchExpr() const
void ImportArray(IIter Ibegin, IIter Iend, OIter Obegin)
A pointer to member type per C++ 8.3.3 - Pointers to members.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
Expr * VisitExplicitCastExpr(ExplicitCastExpr *E)
Expr * VisitImplicitValueInitExpr(ImplicitValueInitExpr *ILE)
ExplicitCastExpr - An explicit cast written in the source code.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Tags, declared with 'struct foo;' and referenced with 'struct foo'.
void setInitializedFieldInUnion(FieldDecl *FD)
Decl * VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
A type that was preceded by the 'template' keyword, stored as a Type*.
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
static EnumDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, EnumDecl *PrevDecl, bool IsScoped, bool IsScopedUsingClassTag, bool IsFixed)
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
SourceLocation getSetterNameLoc() const
Decl * VisitObjCIvarDecl(ObjCIvarDecl *D)
bool isNull() const
Determine whether this template argument has no value.
Expr * VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *CE)
SourceLocation getLParenLoc() const
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)
const Stmt * getBody() const
Decl * VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
llvm::APInt getValue() const
QualType getModifiedType() const
LabelDecl * getLabel() const
QualType VisitLValueReferenceType(const LValueReferenceType *T)
Represents a pointer to an Objective C object.
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
SwitchStmt - This represents a 'switch' stmt.
UsingDecl * getUsingDecl() const
Gets the using declaration to which this declaration is tied.
SourceLocation getColonColonLoc() const
Retrieve the location of the '::' in a qualified pseudo-destructor expression.
SourceLocation getFieldLoc() 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)
void ImportOverrides(CXXMethodDecl *ToMethod, CXXMethodDecl *FromMethod)
Expr * VisitFloatingLiteral(FloatingLiteral *E)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
SourceLocation getRParenLoc() 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.
Location wrapper for a TemplateArgument.
void setIsUsed()
Set whether the declaration is used, in the sense of odr-use.
unsigned getIndexTypeCVRQualifiers() const
unsigned getNumArgs() const
Retrieve the number of template arguments.
void setUnparsedDefaultArg()
setUnparsedDefaultArg - Specify that this parameter has an unparsed default argument.
Expr * getUninstantiatedDefaultArg()
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
SourceLocation getLocEnd() const LLVM_READONLY
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Represents Objective-C's collection statement.
Represents a C++ base or member initializer.
Expr * VisitCXXNoexceptExpr(CXXNoexceptExpr *E)
Expr * VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E)
unsigned getNumObjects() const
IndirectFieldDecl * getIndirectMember() const
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
SourceLocation getLocation() const
Retrieve the location of this expression.
Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV)
Can create any sort of selector.
static CStyleCastExpr * Create(const ASTContext &Context, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *BasePath, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation R)
An implicit indirection through a C++ base class, when the field found is in a base class...
const llvm::APInt & getSize() const
Expr * getCond() const
getCond - Return the condition expression; this is defined in terms of the opaque value...
protocol_iterator protocol_begin() const
Expr * getReplacement() const
void setBuiltinID(unsigned ID)
void setSwitchLoc(SourceLocation L)
TypeSourceInfo * getTypeSourceInfo() const
static llvm::Optional< unsigned > findUntaggedStructOrUnionIndex(RecordDecl *Anon)
Find the index of the given anonymous struct/union within its context.
bool doesUsualArrayDeleteWantSize() const
Answers whether the usual array deallocation function for the allocated type expects the size of the ...
ExtVectorType - Extended vector type.
SourceRange getDirectInitRange() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the member name, with source location information...
virtual void CompleteType(TagDecl *Tag)
Gives the external AST source an opportunity to complete an incomplete type.
param_const_iterator param_begin() const
SourceRange getBracketsRange() const
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
static UsingShadowDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, UsingDecl *Using, NamedDecl *Target)
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
StringRef getBytes() const
Allow access to clients that need the byte representation, such as ASTWriterStmt::VisitStringLiteral(...
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.
QualType getUnderlyingType() const
void setInstantiationOfMemberClass(CXXRecordDecl *RD, TemplateSpecializationKind TSK)
Specify that this record is an instantiation of the member class RD.
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
bool ImportContainerChecked(const InContainerTy &InContainer, OutContainerTy &OutContainer)
The template argument is actually a parameter pack.
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
Represents a base class of a C++ class.
Decl * VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
QualType VisitUnaryTransformType(const UnaryTransformType *T)
bool hasTypename() const
Return true if the using declaration has 'typename'.
void setNamedTypeInfo(TypeSourceInfo *TInfo)
setNamedTypeInfo - Sets the source type info associated to the name.
unsigned getNumClobbers() const
Decl * VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
SourceLocation getRParenLoc() const
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
SourceManager & getSourceManager()
Expr * VisitCXXNewExpr(CXXNewExpr *CE)
DeclStmt * getRangeStmt()
Stmt * VisitObjCAtThrowStmt(ObjCAtThrowStmt *S)
ImplementationControl getImplementationControl() const
SourceLocation getLocEnd() const LLVM_READONLY
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
SourceLocation getAsmLoc() const
GotoStmt - This represents a direct goto.
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...
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
SourceLocation getLAngleLoc() const
Retrieve the location of the left angle bracket starting the explicit template argument list followin...
SourceLocation getCXXLiteralOperatorNameLoc() const
getCXXLiteralOperatorNameLoc - Returns the location of the literal operator name (not the operator ke...
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
TypedefNameDecl * getDecl() const
const SwitchCase * getNextSwitchCase() const
Decl * VisitTypeAliasDecl(TypeAliasDecl *D)
Expr * NoexceptExpr
Noexcept expression, if this is EST_ComputedNoexcept.
ArrayRef< TemplateArgumentLoc > template_arguments() const
Expr * VisitInitListExpr(InitListExpr *E)
ArgKind getKind() const
Return the kind of stored template argument.
shadow_range shadows() const
unsigned getDepth() const
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).
TranslationUnitDecl * getTranslationUnitDecl() const
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Decl * VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
SourceLocation getWhileLoc() const
void AddSpecialization(ClassTemplateSpecializationDecl *D, void *InsertPos)
Insert the specified specialization knowing that it is not already in.
SourceLocation getCategoryNameLoc() const
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
TypedefNameDecl * getTypedefNameForAnonDecl() const
void setDefaultArg(Expr *defarg)
bool isMutable() const
isMutable - Determines whether this field is mutable (C++ only).
Represents a C++ struct/union/class.
ContinueStmt - This represents a continue.
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
Expr * VisitDesignatedInitExpr(DesignatedInitExpr *E)
Represents a loop initializing the elements of an array.
The template argument is a template name that was provided for a template template parameter...
void setDescribedVarTemplate(VarTemplateDecl *Template)
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef< Stmt *> handlers)
SourceLocation getColonLoc() const
Represents a C array with an unspecified size.
TemplateArgumentLocInfo getLocInfo() const
SourceLocation getEllipsisLoc() const
For a pack expansion, determine the location of the ellipsis.
SourceLocation getAttrLoc() const
static CXXTemporary * Create(const ASTContext &C, const CXXDestructorDecl *Destructor)
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
CXXCatchStmt - This represents a C++ catch block.
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr.type.conv]).
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
ObjCIvarDecl - Represents an ObjC instance variable.
ObjCIvarDecl * getPropertyIvarDecl() const
static TypedefDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
Provides information a specialization of a member of a class template, which may be a member function...
QualType getNamedType() const
Retrieve the type named by the qualified-id.
WhileStmt - This represents a 'while' stmt.
A structure for storing the information associated with an overloaded template name.
SourceRange getParenOrBraceRange() const
CleanupObject getObject(unsigned i) const
unsigned getNumConcatenated() const
getNumConcatenated - Get the number of string literal tokens that were concatenated in translation ph...
bool isNull() const
Determine whether this is the empty selector.
QualType getReplacementType() const
Gets the type that was substituted for the template parameter.
Location information for a TemplateArgument.
SourceLocation getLParenLoc() const
static UsingDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool HasTypenameKeyword)
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.
SourceLocation getAtSynchronizedLoc() const
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'.
Optional< unsigned > getNumExpansions() const
Determine the number of expansions that will be produced when this pack expansion is instantiated...
CompoundStmt * getTryBlock()
bool ImportCastPath(CastExpr *E, CXXCastPath &Path)
SourceLocation getBreakLoc() const
SourceLocation getCaseLoc() const
void setPropertyAttributes(PropertyAttributeKind PRVal)
Expr * VisitArraySubscriptExpr(ArraySubscriptExpr *E)
Represents Objective-C's @try ... @catch ... @finally statement.
protocol_iterator protocol_end() const
bool isGlobalDelete() const
Expr * VisitVAArgExpr(VAArgExpr *E)
const internal::VariadicDynCastAllOfMatcher< Decl, AccessSpecDecl > accessSpecDecl
Matches C++ access specifier declarations.
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Expr * VisitCXXDefaultInitExpr(CXXDefaultInitExpr *E)
Expr * VisitArrayInitIndexExpr(ArrayInitIndexExpr *E)
SourceRange getTypeIdParens() const
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Expr * VisitOpaqueValueExpr(OpaqueValueExpr *E)
void setDescribedFunctionTemplate(FunctionTemplateDecl *Template)
Stmt * VisitDefaultStmt(DefaultStmt *S)
Import only the bare bones needed to establish a valid DeclContext.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
Abstract class common to all of the C++ "named"/"keyword" casts.
unsigned getNumElements() const
QualType VisitExtVectorType(const ExtVectorType *T)
void setNextSwitchCase(SwitchCase *SC)
decl_type * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
TranslationUnitDecl - The top declaration context.
void ImportDefinitionIfNeeded(Decl *FromD, Decl *ToD=nullptr)
unsigned getNumComponents() const
const ParmVarDecl * getParam() const
QualType getAsType() const
Retrieve the type for a type template argument.
QualType VisitTypeOfExprType(const TypeOfExprType *T)
A reference to a declared variable, function, enum, etc.
Expr * VisitBinaryConditionalOperator(BinaryConditionalOperator *E)
Represents a type template specialization; the template must be a class template, a type alias templa...
ObjCPropertyDecl * getPropertyDecl() const
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
SourceLocation getColonLoc() const
BreakStmt - This represents a break.
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type...
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
const VarDecl * getCatchParamDecl() const
SourceLocation getLocation() const
Expr * VisitExprWithCleanups(ExprWithCleanups *EWC)
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
Expr * VisitCompoundLiteralExpr(CompoundLiteralExpr *E)
DefinitionKind isThisDeclarationADefinition(ASTContext &) const
Check whether this declaration is a definition.
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
Expr * VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E)
DeclStmt * getLoopVarStmt()
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
unsigned getNumArgs() const
protocol_loc_iterator protocol_loc_begin() const
A set of overloaded template declarations.
const Expr * getCond() 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)
void setLexicalDeclContext(DeclContext *DC)
ObjCMethodDecl * getGetterMethodDecl() const
NamedDecl - This represents a decl with a name.
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding the member name, if any.
A boolean literal, per ([C++ lex.bool] Boolean literals).
Expr * VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E)
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.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
protocol_loc_iterator protocol_loc_begin() const
void setAccess(AccessSpecifier AS)
SourceLocation getLocEnd() const LLVM_READONLY
Represents a C array with a specified size that is not an integer-constant-expression.
Expr * getQueriedExpression() const
Decl * VisitNamespaceDecl(NamespaceDecl *D)
Represents a C++ namespace alias.
Decl * VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
SourceLocation getBuiltinLoc() const
Stmt * VisitObjCAutoreleasePoolStmt(ObjCAutoreleasePoolStmt *S)
SourceLocation getRParenLoc() const
QualType VisitAtomicType(const AtomicType *T)
SourceRange getSourceRange() const LLVM_READONLY
Retrieves the source range that contains the entire base specifier.
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
AccessControl getAccessControl() const
SourceLocation getIvarRBraceLoc() const
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
bool isPropertyAccessor() const
TypeSourceInfo * getWrittenTypeInfo() const
Selector getGetterName() const
ImplicitParamKind getParameterKind() const
Returns the implicit parameter kind.
Represents C++ using-directive.
DeclStmt * getBeginStmt()
SourceLocation getLParenLoc() const
const Expr * getCond() const
void setTypeAsWritten(TypeSourceInfo *T)
Sets the type of this specialization as it was written by the user.
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
static FieldDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
void setPointOfInstantiation(SourceLocation POI)
Set the first point of instantiation.
The global specifier '::'. There is no stored value.
ObjCProtocolList::iterator protocol_iterator
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.
SourceLocation getLocStart() const LLVM_READONLY
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 getBegin() const
TranslationUnitDecl * getTranslationUnitDecl()
SourceLocation ColonLoc
Location of ':'.
SourceLocation getRParenLoc() const
Return the location of the right parentheses.
Decl * VisitParmVarDecl(ParmVarDecl *D)
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
QualType VisitRValueReferenceType(const RValueReferenceType *T)
Represents Objective-C's @autoreleasepool Statement.
Stmt * VisitGCCAsmStmt(GCCAsmStmt *S)
QualType VisitAutoType(const AutoType *T)
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
IdentifierInfo * getFieldName() const
This class handles loading and caching of source files into memory.
Represents the canonical version of C arrays with a specified constant size.
ExceptionSpecInfo ExceptionSpec
QualType VisitType(const Type *T)
DeclContext * ImportContext(DeclContext *FromDC)
Import the given declaration context from the "from" AST context into the "to" AST context...
InitListExpr * getSyntacticForm() const
Declaration of a template function.
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)
SourceLocation getReturnLoc() const
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
Expr * VisitCXXThrowExpr(CXXThrowExpr *E)
Stmt * VisitStmt(Stmt *S)
Attr - This represents one attribute.
SourceLocation getLocation() const
QualType VisitTypeOfType(const TypeOfType *T)
QualType getPointeeType() const
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
QualType getType() const
Return the type wrapped by this type source info.
TypeTrait getTrait() const
Determine which type trait this expression uses.
A single template declaration.
bool isBeingDefined() const
isBeingDefined - Return true if this decl is currently being defined.
std::pair< FileID, unsigned > getDecomposedLoc(SourceLocation Loc) const
Decompose the specified location into a raw FileID + Offset pair.
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
ArrayRef< ParmVarDecl * > parameters() const
Expr * VisitStmtExpr(StmtExpr *E)
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.
bool hasExternalFormalLinkage() const
True if this decl has external linkage.
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
ObjCCategoryDecl * FindCategoryDeclaration(IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
Structure used to store a statement, the constant value to which it was evaluated (if any)...
QualType VisitPackExpansionType(const PackExpansionType *T)
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
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...