34 #include "llvm/Support/ErrorHandling.h"
37 using namespace clang;
48 TranslationUnitDecl::TranslationUnitDecl(
ASTContext &ctx)
50 DeclContext(TranslationUnit), Ctx(ctx), AnonymousNamespace(nullptr) {}
157 "asking for explicit visibility when we shouldn't be");
164 return isa<TypeDecl>(D) ||
165 isa<ClassTemplateDecl>(D) ||
166 isa<ObjCInterfaceDecl>(D);
171 template <
class T>
static typename
172 std::enable_if<!std::is_base_of<RedeclarableTemplateDecl, T>::value,
bool>
::type
175 D->getMemberSpecializationInfo()) {
176 return member->isExplicitSpecialization();
192 switch (attr->getVisibility()) {
200 llvm_unreachable(
"bad visibility kind");
209 if (
const auto *A = D->
getAttr<TypeVisibilityAttr>()) {
215 if (
const auto *A = D->
getAttr<VisibilityAttr>()) {
223 if (A->getPlatform()->getName().equals(
"macos"))
247 if (isa<TemplateTypeParmDecl>(
P))
254 if (
const auto *NTTP = dyn_cast<NonTypeTemplateParmDecl>(
P)) {
256 if (!NTTP->isExpandedParameterPack()) {
257 if (!NTTP->getType()->isDependentType()) {
264 for (
unsigned i = 0, n = NTTP->getNumExpansionTypes(); i != n; ++i) {
274 const auto *TTP = cast<TemplateTemplateParmDecl>(
P);
277 if (!TTP->isExpandedParameterPack()) {
284 for (
unsigned i = 0, n = TTP->getNumExpansionTemplateParameters();
287 TTP->getExpansionTemplateParameters(i), computation));
299 const Decl *Ret =
nullptr;
301 while (DC->
getDeclKind() != Decl::TranslationUnit) {
302 if (isa<FunctionDecl>(DC) || isa<BlockDecl>(DC))
303 Ret = cast<Decl>(DC);
319 switch (Arg.getKind()) {
330 if (
const auto *ND = dyn_cast<NamedDecl>(Arg.getAsDecl())) {
337 LV.
merge(Arg.getNullPtrType()->getLinkageAndVisibility());
343 Arg.getAsTemplateOrTemplatePattern().getAsTemplateDecl())
351 llvm_unreachable(
"bad template argument kind");
372 return !fn->
hasAttr<VisibilityAttr>();
386 bool considerVisibility =
405 switch (computation) {
408 if (D->
hasAttr<TypeVisibilityAttr>())
413 if (D->
hasAttr<VisibilityAttr>())
419 llvm_unreachable(
"bad visibility computation kind");
479 if (considerVisibility)
531 if (considerVisibility)
539 if (!Opts.CPlusPlus || !Opts.InlineVisibilityHidden)
548 = FD->getTemplateSpecializationInfo()) {
549 TSK = spec->getTemplateSpecializationKind();
551 FD->getMemberSpecializationInfo()) {
552 TSK = MSI->getTemplateSpecializationKind();
565 const T *First = D->getFirstDecl();
566 return First->isInExternCContext();
570 if (
const auto *SD = dyn_cast<LinkageSpecDecl>(D.
getDeclContext()))
571 if (!SD->hasBraces())
586 llvm_unreachable(
"unexpected module ownership kind");
617 "Not a name having namespace scope");
626 if (
const auto *Var = dyn_cast<VarDecl>(D)) {
636 if (Context.getLangOpts().CPlusPlus &&
637 Var->getType().isConstQualified() &&
638 !Var->getType().isVolatileQualified() &&
645 if (Var->getStorageClass() !=
SC_Extern &&
654 Var->getStorageClass() ==
SC_None)
655 return PrevVar->getLinkageAndVisibility();
657 if (PrevVar->getStorageClass() ==
SC_Static)
666 if (Function->getCanonicalDecl()->getStorageClass() ==
SC_Static)
668 }
else if (
const auto *IFD = dyn_cast<IndirectFieldDecl>(D)) {
670 const VarDecl *VD = IFD->getVarDecl();
671 assert(VD &&
"Expected a VarDecl in this IndirectFieldDecl!");
674 assert(!isa<FieldDecl>(D) &&
"Didn't expect a FieldDecl!");
677 const auto *Var = dyn_cast<
VarDecl>(D);
706 !isa<TranslationUnitDecl>(DC);
722 globalVisibility = Context.getLangOpts().getValueVisibilityMode();
725 globalVisibility = Context.getLangOpts().getTypeVisibilityMode();
742 if (
const auto *Var = dyn_cast<VarDecl>(D)) {
783 if (
const auto *spec = dyn_cast<VarTemplateSpecializationDecl>(Var)) {
788 }
else if (
const auto *Function = dyn_cast<FunctionDecl>(D)) {
805 if (Context.getLangOpts().CPlusPlus &&
806 !Function->isInExternCContext()) {
814 QualType TypeAsWritten = Function->getType();
816 TypeAsWritten = TSI->getType();
825 = Function->getTemplateSpecializationInfo()) {
835 }
else if (
const auto *Tag = dyn_cast<TagDecl>(D)) {
837 if (!Tag->hasNameForLinkage())
843 if (
const auto *spec = dyn_cast<ClassTemplateSpecializationDecl>(Tag)) {
848 }
else if (isa<EnumConstantDecl>(D)) {
857 }
else if (
const auto *temp = dyn_cast<TemplateDecl>(D)) {
867 }
else if (isa<NamespaceDecl>(D)) {
872 }
else if (isa<ObjCInterfaceDecl>(D)) {
875 }
else if (
auto *TD = dyn_cast<TypedefNameDecl>(D)) {
878 if (!TD->getAnonDeclWithTypedefName(
true))
906 if (!(isa<CXXMethodDecl>(D) ||
909 isa<IndirectFieldDecl>(D) ||
911 isa<TemplateDecl>(D)))
950 const NamedDecl *explicitSpecSuppressor =
nullptr;
952 if (
const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
963 QualType TypeAsWritten = MD->getType();
965 TypeAsWritten = TSI->getType();
972 = MD->getTemplateSpecializationInfo()) {
974 if (spec->isExplicitSpecialization()) {
975 explicitSpecSuppressor = MD;
977 explicitSpecSuppressor = spec->getTemplate()->getTemplatedDecl();
980 explicitSpecSuppressor = MD;
983 }
else if (
const auto *RD = dyn_cast<CXXRecordDecl>(D)) {
984 if (
const auto *spec = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
986 if (spec->isExplicitSpecialization()) {
987 explicitSpecSuppressor = spec;
995 explicitSpecSuppressor = RD;
999 }
else if (
const auto *VD = dyn_cast<VarDecl>(D)) {
1000 if (
const auto *spec = dyn_cast<VarTemplateSpecializationDecl>(VD))
1011 explicitSpecSuppressor = VD;
1015 }
else if (
const auto *temp = dyn_cast<TemplateDecl>(D)) {
1016 bool considerVisibility =
1024 if (
const auto *redeclTemp = dyn_cast<RedeclarableTemplateDecl>(temp)) {
1026 explicitSpecSuppressor = temp->getTemplatedDecl();
1032 assert(!explicitSpecSuppressor || !isa<TemplateDecl>(explicitSpecSuppressor));
1036 bool considerClassVisibility =
true;
1037 if (explicitSpecSuppressor &&
1042 considerClassVisibility =
false;
1050 void NamedDecl::anchor() { }
1067 if (name.front() ==
'C')
1068 if (name ==
"CFStringCreateWithFormat" ||
1069 name ==
"CFStringCreateWithFormatAndArguments" ||
1070 name ==
"CFStringAppendFormat" ||
1071 name ==
"CFStringAppendFormatAndArguments")
1091 bool IsMostRecent) {
1100 if (
const auto *RD = dyn_cast<CXXRecordDecl>(ND)) {
1102 if (InstantiatedFrom)
1109 if (
const auto *spec = dyn_cast<ClassTemplateSpecializationDecl>(ND))
1110 return getVisibilityOf(spec->getSpecializedTemplate()->getTemplatedDecl(),
1114 if (!IsMostRecent && !isa<NamespaceDecl>(ND)) {
1116 if (MostRecent != ND)
1120 if (
const auto *Var = dyn_cast<VarDecl>(ND)) {
1121 if (Var->isStaticDataMember()) {
1123 if (InstantiatedFrom)
1127 if (
const auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(Var))
1128 return getVisibilityOf(VTSD->getSpecializedTemplate()->getTemplatedDecl(),
1134 if (
const auto *fn = dyn_cast<FunctionDecl>(ND)) {
1138 = fn->getTemplateSpecializationInfo())
1139 return getVisibilityOf(templateInfo->getTemplate()->getTemplatedDecl(),
1145 if (InstantiatedFrom)
1152 if (
const auto *TD = dyn_cast<TemplateDecl>(ND))
1158 Optional<Visibility>
1167 if (isa<ParmVarDecl>(ContextDecl))
1170 return getLVForDecl(cast<NamedDecl>(ContextDecl), computation);
1173 if (
const auto *ND = dyn_cast<NamedDecl>(DC))
1183 if (
const auto *Function = dyn_cast<FunctionDecl>(D)) {
1184 if (Function->isInAnonymousNamespace() &&
1185 !Function->isInExternCContext())
1189 if (Function->getCanonicalDecl()->getStorageClass() ==
SC_Static)
1194 if (Optional<Visibility> Vis =
1206 if (
const auto *Var = dyn_cast<VarDecl>(D)) {
1207 if (Var->hasExternalStorage()) {
1208 if (Var->isInAnonymousNamespace() && !Var->isInExternCContext())
1229 if (!Var->isStaticLocal())
1242 if (
const auto *BD = dyn_cast<BlockDecl>(OuterD)) {
1243 if (!BD->getBlockManglingNumber())
1247 BD->getBlockManglingContextDecl(), computation);
1249 const auto *FD = cast<FunctionDecl>(OuterD);
1250 if (!FD->isInlined() &&
1265 while (Record && Record->
isLambda()) {
1269 Record = dyn_cast_or_null<CXXRecordDecl>(
1278 if (D->
hasAttr<InternalLinkageAttr>())
1293 case Decl::ImplicitParam:
1295 case Decl::NamespaceAlias:
1298 case Decl::UsingShadow:
1299 case Decl::UsingDirective:
1302 case Decl::EnumConstant:
1309 case Decl::TypeAlias:
1312 if (!cast<TypedefNameDecl>(D)
1313 ->getAnonDeclWithTypedefName(
true))
1317 case Decl::TemplateTemplateParm:
1318 case Decl::NonTypeTemplateParm:
1319 case Decl::ObjCAtDefsField:
1320 case Decl::ObjCCategory:
1321 case Decl::ObjCCategoryImpl:
1322 case Decl::ObjCCompatibleAlias:
1323 case Decl::ObjCImplementation:
1324 case Decl::ObjCMethod:
1325 case Decl::ObjCProperty:
1326 case Decl::ObjCPropertyImpl:
1327 case Decl::ObjCProtocol:
1330 case Decl::CXXRecord: {
1331 const auto *Record = cast<CXXRecordDecl>(D);
1332 if (Record->isLambda()) {
1333 if (!Record->getLambdaManglingNumber()) {
1401 if (D->
hasAttr<InternalLinkageAttr>())
1418 if (!Opts.CPlusPlus || Opts.MicrosoftExt)
1426 auto *T = cast<NamedDecl>(
I);
1429 if (!T->isInvalidDecl() && T->hasCachedLinkage()) {
1452 std::string QualName;
1453 llvm::raw_string_ostream OS(QualName);
1467 if (
auto *MD = dyn_cast<ObjCMethodDecl>(
this))
1468 if (
auto *
ID = MD->getClassInterface())
1480 while (Ctx && isa<NamedDecl>(Ctx)) {
1481 Contexts.push_back(Ctx);
1486 if (
const auto *Spec = dyn_cast<ClassTemplateSpecializationDecl>(DC)) {
1487 OS << Spec->getName();
1491 }
else if (
const auto *ND = dyn_cast<NamespaceDecl>(DC)) {
1493 (ND->isAnonymousNamespace() || ND->isInline()))
1495 if (ND->isAnonymousNamespace()) {
1497 :
"(anonymous namespace)");
1501 }
else if (
const auto *RD = dyn_cast<RecordDecl>(DC)) {
1502 if (!RD->getIdentifier())
1503 OS <<
"(anonymous " << RD->getKindName() <<
')';
1506 }
else if (
const auto *FD = dyn_cast<FunctionDecl>(DC)) {
1508 if (FD->hasWrittenPrototype())
1509 FT = dyn_cast<FunctionProtoType>(FD->getType()->castAs<
FunctionType>());
1514 for (
unsigned i = 0; i < NumParams; ++i) {
1517 OS << FD->getParamDecl(i)->getType().stream(P);
1527 }
else if (
const auto *ED = dyn_cast<EnumDecl>(DC)) {
1532 if (ED->isScoped() || ED->getIdentifier())
1537 OS << *cast<NamedDecl>(DC);
1542 if (
getDeclName() || isa<DecompositionDecl>(
this))
1545 OS <<
"(anonymous)";
1550 bool Qualified)
const {
1563 #define DECL(Type, Base) \
1565 return isRedeclarableImpl((Type##Decl *)nullptr);
1566 #define ABSTRACT_DECL(DECL)
1567 #include "clang/AST/DeclNodes.inc"
1569 llvm_unreachable(
"unknown decl kind");
1585 if (isa<ObjCMethodDecl>(
this))
1590 if (isa<ParmVarDecl>(
this))
1602 if (
auto *UD = dyn_cast<UsingDecl>(
this)) {
1606 cast<UsingDecl>(OldD)->getQualifier());
1608 if (
auto *UUVD = dyn_cast<UnresolvedUsingValueDecl>(
this)) {
1612 cast<UnresolvedUsingValueDecl>(OldD)->getQualifier());
1618 if (
auto *UD = dyn_cast<UsingDirectiveDecl>(
this))
1619 return UD->getNominatedNamespace()->getOriginalNamespace() ==
1620 cast<UsingDirectiveDecl>(OldD)->getNominatedNamespace()
1621 ->getOriginalNamespace();
1641 if (D->isCanonicalDecl())
1660 NamedDecl *NamedDecl::getUnderlyingDeclImpl() {
1662 while (
auto *UD = dyn_cast<UsingShadowDecl>(ND))
1663 ND = UD->getTargetDecl();
1665 if (
auto *AD = dyn_cast<ObjCCompatibleAliasDecl>(ND))
1666 return AD->getClassInterface();
1668 if (
auto *AD = dyn_cast<NamespaceAliasDecl>(ND))
1669 return AD->getNamespace();
1679 if (isa<UsingShadowDecl>(D))
1680 D = cast<UsingShadowDecl>(D)->getTargetDecl();
1682 if (isa<FieldDecl>(D) || isa<IndirectFieldDecl>(D) || isa<MSPropertyDecl>(D))
1684 if (
const auto *MD = dyn_cast_or_null<CXXMethodDecl>(D->
getAsFunction()))
1685 return MD->isInstance();
1693 template <
typename DeclT>
1695 if (decl->getNumTemplateParameterLists() > 0)
1696 return decl->getTemplateParameterList(0)->getTemplateLoc();
1698 return decl->getInnerLocStart();
1710 if (!hasExtInfo()) {
1716 getExtInfo()->TInfo = savedTInfo;
1719 getExtInfo()->QualifierLoc = QualifierLoc;
1723 if (getExtInfo()->NumTemplParamLists == 0) {
1729 DeclInfo = savedTInfo;
1732 getExtInfo()->QualifierLoc = QualifierLoc;
1739 assert(!TPLists.empty());
1741 if (!hasExtInfo()) {
1747 getExtInfo()->TInfo = savedTInfo;
1750 getExtInfo()->setTemplateParameterListsInfo(Context, TPLists);
1768 QT = cast<PointerType>(T)->getPointeeType();
1770 case Type::BlockPointer:
1771 QT = cast<BlockPointerType>(T)->getPointeeType();
1773 case Type::MemberPointer:
1774 QT = cast<MemberPointerType>(T)->getPointeeType();
1776 case Type::LValueReference:
1777 case Type::RValueReference:
1778 QT = cast<ReferenceType>(T)->getPointeeType();
1780 case Type::PackExpansion:
1781 QT = cast<PackExpansionType>(T)->getPattern();
1784 case Type::ConstantArray:
1785 case Type::DependentSizedArray:
1786 case Type::IncompleteArray:
1787 case Type::VariableArray:
1788 case Type::FunctionProto:
1789 case Type::FunctionNoProto:
1802 if (!
getDeclName() || typeIsPostfix(TInfo->getType()))
1803 RangeEnd = TInfo->getTypeLoc().getSourceRange().getEnd();
1817 if (!TPLists.empty()) {
1838 llvm_unreachable(
"Invalid storage class");
1847 static_assert(
sizeof(VarDeclBitfields) <=
sizeof(
unsigned),
1848 "VarDeclBitfields too large!");
1850 "ParmVarDeclBitfields too large!");
1852 "NonParmVarDeclBitfields too large!");
1862 return new (C, DC)
VarDecl(Var, C, DC, StartL, IdL, Id, T, TInfo, S);
1879 if (!hasAttr<ThreadAttr>() &&
1882 hasAttr<OMPThreadPrivateDeclAttr>()))
1884 return ((
getASTContext().getLangOpts().isCompatibleWithMSVC(
1886 hasAttr<OMPThreadPrivateDeclAttr>())
1895 llvm_unreachable(
"Unknown thread storage class specifier!");
1909 template<
typename T>
1913 if (!D.hasExternalFormalLinkage())
1937 template<
typename T>
1943 assert(D.getASTContext().getLangOpts().CPlusPlus);
1998 isa<VarTemplatePartialSpecializationDecl>(
this)))
2018 if (
const auto *SAA = getAttr<SelectAnyAttr>())
2019 if (!SAA->isInherited())
2025 if (isa<VarTemplateSpecializationDecl>(
this) &&
2057 VarDecl *LastTentative =
nullptr;
2060 Kind =
I->isThisDeclarationADefinition();
2066 return LastTentative;
2072 if (
I->isThisDeclarationADefinition(C) ==
Definition)
2083 Kind =
std::max(Kind,
I->isThisDeclarationADefinition(C));
2093 if (
auto Expr =
I->getInit()) {
2102 if (
auto *
P = dyn_cast<ParmVarDecl>(
this))
2103 if (
P->hasUnparsedDefaultArg() ||
P->hasUninstantiatedDefaultArg())
2106 return !
Init.isNull();
2114 return cast<Expr>(
S);
2123 return Init.getAddrOfPtr1();
2137 return VD->isOutOfLine();
2144 Eval->~EvaluatedStmt();
2154 if (!Lang.CPlusPlus)
2159 if (Lang.CPlusPlus11 &&
getType()->isReferenceType())
2165 if (!
getType().isConstQualified() ||
getType().isVolatileQualified())
2170 if (
getType()->isIntegralOrEnumerationType())
2210 const auto *
Init = cast<Expr>(Eval->
Value);
2211 assert(!
Init->isValueDependent());
2216 Eval->
IsICE =
false;
2240 Eval->
IsICE = Result && Notes.empty();
2243 return Result ? &Eval->
Evaluated :
nullptr;
2248 if (Eval->WasEvaluated)
2249 return &Eval->Evaluated;
2256 return Eval->CheckedICE;
2263 "Check whether we already know that the initializer is an ICE");
2278 const auto *
Init = cast<Expr>(Eval->
Value);
2279 assert(!
Init->isValueDependent());
2303 template<
typename DeclT>
2306 if (
auto *Def = D->getDefinition())
2314 if (
auto *VDTemplSpec = dyn_cast<VarTemplateSpecializationDecl>(
this)) {
2315 auto From = VDTemplSpec->getInstantiatedFrom();
2317 while (
auto *NewVTD = VTD->getInstantiatedFromMemberTemplate()) {
2318 if (NewVTD->isMemberSpecialization())
2326 while (
auto *NewVTPSD = VTPSD->getInstantiatedFromMember()) {
2327 if (NewVTPSD->isMemberSpecialization())
2331 return getDefinitionOrSelf<VarDecl>(VTPSD);
2345 while (VarTemplate->getInstantiatedFromMemberTemplate()) {
2346 if (VarTemplate->isMemberSpecialization())
2348 VarTemplate = VarTemplate->getInstantiatedFromMemberTemplate();
2358 return cast<VarDecl>(MSI->getInstantiatedFrom());
2364 if (
const auto *Spec = dyn_cast<VarTemplateSpecializationDecl>(
this))
2365 return Spec->getSpecializationKind();
2368 return MSI->getTemplateSpecializationKind();
2374 if (
const auto *Spec = dyn_cast<VarTemplateSpecializationDecl>(
this))
2375 return Spec->getPointOfInstantiation();
2378 return MSI->getPointOfInstantiation();
2403 assert((isa<VarTemplateSpecializationDecl>(
this) ||
2405 "not a variable or static data member template specialization");
2408 dyn_cast<VarTemplateSpecializationDecl>(
this)) {
2409 Spec->setSpecializationKind(TSK);
2411 Spec->getPointOfInstantiation().isInvalid())
2412 Spec->setPointOfInstantiation(PointOfInstantiation);
2416 MSI->setTemplateSpecializationKind(TSK);
2418 MSI->getPointOfInstantiation().isInvalid())
2419 MSI->setPointOfInstantiation(PointOfInstantiation);
2426 assert(
getASTContext().getTemplateOrSpecializationInfo(
this).isNull() &&
2427 "Previous template or instantiation?");
2440 return new (C, DC)
ParmVarDecl(ParmVar, C, DC, StartLoc, IdLoc, Id, T, TInfo,
2447 if (
const auto *DT = dyn_cast<DecayedType>(T))
2448 return DT->getOriginalType();
2476 "Default argument is not yet instantiated!");
2479 if (
auto *
E = dyn_cast_or_null<ExprWithCleanups>(Arg))
2480 return E->getSubExpr();
2502 return E->getSourceRange();
2507 llvm_unreachable(
"Invalid default argument kind.");
2517 "Wrong kind of initialization expression!");
2518 return cast_or_null<Expr>(
Init.get<
Stmt *>());
2530 return isa<PackExpansionType>(
getType());
2533 void ParmVarDecl::setParameterIndexLarge(
unsigned parameterIndex) {
2538 unsigned ParmVarDecl::getParameterIndexLarge()
const {
2547 raw_ostream &OS,
const PrintingPolicy &Policy,
bool Qualified)
const {
2552 OS, TemplateArgs->
asArray(), Policy);
2556 if (
const auto *FT =
getType()->getAs<FunctionProtoType>())
2557 return FT->isVariadic();
2563 if (
I->doesThisDeclarationHaveABody()) {
2581 if (isa<CompoundStmt>(S) && cast<CompoundStmt>(S)->body_empty())
2588 if (
I->isThisDeclarationADefinition()) {
2601 if (Definition->Body)
2617 Parent->markedVirtualFunctionPure();
2620 template<std::
size_t Len>
2623 return II && II->
isStr(Str);
2651 return llvm::StringSwitch<bool>(
getName())
2663 assert(
getDeclName().getCXXOverloadedOperator() == OO_New ||
2664 getDeclName().getCXXOverloadedOperator() == OO_Delete ||
2665 getDeclName().getCXXOverloadedOperator() == OO_Array_New ||
2666 getDeclName().getCXXOverloadedOperator() == OO_Array_Delete);
2672 if (proto->getNumParams() != 2 || proto->isVariadic())
2681 return (proto->getParamType(1).getCanonicalType() == Context.
VoidPtrTy);
2687 if (
getDeclName().getCXXOverloadedOperator() != OO_New &&
2688 getDeclName().getCXXOverloadedOperator() != OO_Delete &&
2689 getDeclName().getCXXOverloadedOperator() != OO_Array_New &&
2690 getDeclName().getCXXOverloadedOperator() != OO_Array_Delete)
2701 if (FPT->getNumParams() == 0 || FPT->getNumParams() > 3 || FPT->isVariadic())
2706 if (FPT->getNumParams() == 1)
2709 unsigned Params = 1;
2710 QualType Ty = FPT->getParamType(Params);
2713 auto Consume = [&] {
2715 Ty = Params < FPT->getNumParams() ? FPT->getParamType(Params) :
QualType();
2719 bool IsSizedDelete =
false;
2724 IsSizedDelete =
true;
2747 return Params == FPT->getNumParams();
2767 if (
const auto *Method = dyn_cast<CXXMethodDecl>(
this))
2768 return Method->isStatic();
2775 DC = DC->getParent()) {
2776 if (
const auto *Namespace = cast<NamespaceDecl>(DC)) {
2777 if (!Namespace->getDeclName())
2787 if (hasAttr<NoReturnAttr>() || hasAttr<CXX11NoReturnAttr>() ||
2788 hasAttr<C11NoReturnAttr>())
2791 if (
auto *FnTy =
getType()->getAs<FunctionType>())
2792 return FnTy->getNoReturnAttr();
2804 assert((!PrevDecl || PrevFunTmpl) &&
"Function/function template mismatch");
2805 FunTmpl->setPreviousDecl(PrevFunTmpl);
2808 if (PrevDecl && PrevDecl->IsInline)
2833 const auto *LinkageDecl =
2840 if (BuiltinID == Builtin::BI__GetExceptionInfo &&
2842 return Builtin::BI__GetExceptionInfo;
2851 if (hasAttr<OverloadableAttr>())
2885 assert(!ParamInfo &&
"Already has param info!");
2886 assert(NewParamInfo.size() ==
getNumParams() &&
"Parameter count mismatch!");
2889 if (!NewParamInfo.empty()) {
2890 ParamInfo =
new (C)
ParmVarDecl*[NewParamInfo.size()];
2891 std::copy(NewParamInfo.begin(), NewParamInfo.end(), ParamInfo);
2903 unsigned NumRequiredArgs = 0;
2905 if (!Param->isParameterPack() && !Param->hasDefaultArg())
2907 return NumRequiredArgs;
2916 assert(
isInlined() &&
"expected to get called on an inlined function!");
2920 !hasAttr<DLLExportAttr>())
2925 if (!FD->isImplicit() && FD->getStorageClass() ==
SC_Extern)
2937 if (!FD->isImplicit() && FD->getStorageClass() ==
SC_Extern)
2967 "Must have a declaration without a body.");
2978 if (Context.
getLangOpts().GNUInline || hasAttr<GNUInlineAttr>()) {
2988 bool FoundBody =
false;
2990 FoundBody |= Prev->Body.
isValid();
3016 bool FoundBody =
false;
3018 FoundBody |= Prev->Body.
isValid();
3061 if (
const auto *R = Ret->getAttr<WarnUnusedResultAttr>())
3065 if (
const EnumDecl *ED = ET->getDecl()) {
3066 if (
const auto *R = ED->getAttr<WarnUnusedResultAttr>())
3070 return getAttr<WarnUnusedResultAttr>();
3092 "Must be a function definition");
3093 assert(
isInlined() &&
"Function must be inline");
3096 if (Context.
getLangOpts().GNUInline || hasAttr<GNUInlineAttr>()) {
3108 for (
auto Redecl :
redecls()) {
3109 if (Redecl->isInlineSpecified() &&
3119 "should not use C inline rules in C++");
3125 for (
auto Redecl :
redecls()) {
3156 if (TemplateOrSpecialization.isNull())
3164 if (TemplateOrSpecialization.is
3168 llvm_unreachable(
"Did we miss a TemplateOrSpecialization type?");
3173 return cast<FunctionDecl>(Info->getInstantiatedFrom());
3183 FunctionDecl::setInstantiationOfMemberFunction(
ASTContext &C,
3186 assert(TemplateOrSpecialization.isNull() &&
3187 "Member function is already a specialization");
3190 TemplateOrSpecialization = Info;
3198 TemplateOrSpecialization = Template;
3226 bool HasPattern =
false;
3228 HasPattern = PatternDecl->
hasBody(PatternDecl);
3234 if (!HasPattern || !PatternDecl)
3250 llvm_unreachable(
"All TSK values handled.");
3271 dyn_cast<CXXMethodDecl>(
this))) {
3277 while (Primary->getInstantiatedFromMemberTemplate()) {
3280 if (Primary->isMemberSpecialization())
3282 Primary = Primary->getInstantiatedFromMemberTemplate();
3296 = TemplateOrSpecialization
3297 .dyn_cast<FunctionTemplateSpecializationInfo*>()) {
3298 return Info->Template.getPointer();
3309 return TemplateOrSpecialization
3316 = TemplateOrSpecialization
3317 .dyn_cast<FunctionTemplateSpecializationInfo*>()) {
3318 return Info->TemplateArguments;
3326 = TemplateOrSpecialization
3327 .dyn_cast<FunctionTemplateSpecializationInfo*>()) {
3328 return Info->TemplateArgumentsAsWritten;
3334 FunctionDecl::setFunctionTemplateSpecialization(
ASTContext &C,
3342 "Must specify the type of function template specialization");
3348 TemplateArgsAsWritten,
3349 PointOfInstantiation);
3350 TemplateOrSpecialization = Info;
3358 assert(TemplateOrSpecialization.isNull());
3362 TemplateOrSpecialization = Info;
3367 return TemplateOrSpecialization
3376 totalSizeToAlloc<TemplateArgumentLoc, FunctionTemplateDecl *>(
3381 DependentFunctionTemplateSpecializationInfo::
3384 : AngleLocs(TArgs.getLAngleLoc(), TArgs.getRAngleLoc()) {
3386 NumTemplates = Ts.
size();
3387 NumArgs = TArgs.
size();
3390 for (
unsigned I = 0,
E = Ts.
size();
I !=
E; ++
I)
3391 TsArray[
I] = cast<FunctionTemplateDecl>(Ts[
I]->getUnderlyingDecl());
3394 for (
unsigned I = 0,
E = TArgs.
size();
I !=
E; ++
I)
3418 = TemplateOrSpecialization.dyn_cast<
3420 FTSInfo->setTemplateSpecializationKind(TSK);
3422 PointOfInstantiation.
isValid() &&
3423 FTSInfo->getPointOfInstantiation().isInvalid())
3424 FTSInfo->setPointOfInstantiation(PointOfInstantiation);
3427 MSInfo->setTemplateSpecializationKind(TSK);
3429 PointOfInstantiation.
isValid() &&
3430 MSInfo->getPointOfInstantiation().isInvalid())
3431 MSInfo->setPointOfInstantiation(PointOfInstantiation);
3433 llvm_unreachable(
"Function cannot have a template specialization kind");
3438 = TemplateOrSpecialization.dyn_cast<
3440 return FTSInfo->getPointOfInstantiation();
3443 return MSInfo->getPointOfInstantiation();
3464 if (FunTmpl->getTemplatedDecl()->hasBody(Definition))
3483 case Builtin::BI__builtin_memset:
3484 case Builtin::BI__builtin___memset_chk:
3485 case Builtin::BImemset:
3486 return Builtin::BImemset;
3488 case Builtin::BI__builtin_memcpy:
3489 case Builtin::BI__builtin___memcpy_chk:
3490 case Builtin::BImemcpy:
3491 return Builtin::BImemcpy;
3493 case Builtin::BI__builtin_memmove:
3494 case Builtin::BI__builtin___memmove_chk:
3495 case Builtin::BImemmove:
3496 return Builtin::BImemmove;
3498 case Builtin::BIstrlcpy:
3499 case Builtin::BI__builtin___strlcpy_chk:
3500 return Builtin::BIstrlcpy;
3502 case Builtin::BIstrlcat:
3503 case Builtin::BI__builtin___strlcat_chk:
3504 return Builtin::BIstrlcat;
3506 case Builtin::BI__builtin_memcmp:
3507 case Builtin::BImemcmp:
3508 return Builtin::BImemcmp;
3510 case Builtin::BI__builtin_strncpy:
3511 case Builtin::BI__builtin___strncpy_chk:
3512 case Builtin::BIstrncpy:
3513 return Builtin::BIstrncpy;
3515 case Builtin::BI__builtin_strncmp:
3516 case Builtin::BIstrncmp:
3517 return Builtin::BIstrncmp;
3519 case Builtin::BI__builtin_strncasecmp:
3520 case Builtin::BIstrncasecmp:
3521 return Builtin::BIstrncasecmp;
3523 case Builtin::BI__builtin_strncat:
3524 case Builtin::BI__builtin___strncat_chk:
3525 case Builtin::BIstrncat:
3526 return Builtin::BIstrncat;
3528 case Builtin::BI__builtin_strndup:
3529 case Builtin::BIstrndup:
3530 return Builtin::BIstrndup;
3532 case Builtin::BI__builtin_strlen:
3533 case Builtin::BIstrlen:
3534 return Builtin::BIstrlen;
3536 case Builtin::BI__builtin_bzero:
3537 case Builtin::BIbzero:
3538 return Builtin::BIbzero;
3542 if (FnInfo->
isStr(
"memset"))
3543 return Builtin::BImemset;
3544 else if (FnInfo->
isStr(
"memcpy"))
3545 return Builtin::BImemcpy;
3546 else if (FnInfo->
isStr(
"memmove"))
3547 return Builtin::BImemmove;
3548 else if (FnInfo->
isStr(
"memcmp"))
3549 return Builtin::BImemcmp;
3550 else if (FnInfo->
isStr(
"strncpy"))
3551 return Builtin::BIstrncpy;
3552 else if (FnInfo->
isStr(
"strncmp"))
3553 return Builtin::BIstrncmp;
3554 else if (FnInfo->
isStr(
"strncasecmp"))
3555 return Builtin::BIstrncasecmp;
3556 else if (FnInfo->
isStr(
"strncat"))
3557 return Builtin::BIstrncat;
3558 else if (FnInfo->
isStr(
"strndup"))
3559 return Builtin::BIstrndup;
3560 else if (FnInfo->
isStr(
"strlen"))
3561 return Builtin::BIstrlen;
3562 else if (FnInfo->
isStr(
"bzero"))
3563 return Builtin::BIbzero;
3579 return new (C, DC)
FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo,
3580 BW, Mutable, InitStyle);
3593 if (
const auto *Record =
getType()->getAs<RecordType>())
3594 return Record->getDecl()->isAnonymousStructOrUnion();
3601 auto *BitWidth =
static_cast<Expr *
>(InitStorage.getPointer());
3607 if (Canonical !=
this)
3610 if (CachedFieldIndex)
return CachedFieldIndex - 1;
3615 for (
auto *Field : RD->
fields()) {
3616 Field->getCanonicalDecl()->CachedFieldIndex = Index + 1;
3620 assert(CachedFieldIndex &&
"failed to find field in parent");
3621 return CachedFieldIndex - 1;
3625 switch (InitStorage.getInt()) {
3627 case ISK_BitWidthOrNothing:
3628 case ISK_InClassCopyInit:
3629 case ISK_InClassListInit:
3630 if (
const auto *
E = static_cast<const Expr *>(InitStorage.getPointer()))
3634 case ISK_CapturedVLAType:
3637 llvm_unreachable(
"bad init storage kind");
3642 "capturing type in non-lambda or captured record.");
3643 assert(InitStorage.getInt() == ISK_BitWidthOrNothing &&
3644 InitStorage.getPointer() ==
nullptr &&
3645 "bit width, initializer or captured type already set");
3646 InitStorage.setPointerAndInt(const_cast<VariableArrayType *>(VLAType),
3647 ISK_CapturedVLAType);
3667 TypedefNameDeclOrQualifier = TDD;
3670 assert(T->isLinkageValid());
3678 if (
auto *D = dyn_cast<CXXRecordDecl>(
this)) {
3679 struct CXXRecordDecl::DefinitionData *Data =
3680 new (
getASTContext())
struct CXXRecordDecl::DefinitionData(D);
3682 cast<CXXRecordDecl>(
I)->DefinitionData = Data;
3687 assert((!isa<CXXRecordDecl>(
this) ||
3689 "definition completed but not started");
3691 IsCompleteDefinition =
true;
3695 L->CompletedTagDefinition(
this);
3700 return const_cast<TagDecl *
>(
this);
3705 if (II->isOutOfDate()) {
3711 if (
const auto *CXXRD = dyn_cast<CXXRecordDecl>(
this))
3712 return CXXRD->getDefinition();
3715 if (R->isCompleteDefinition())
3731 if (getExtInfo()->NumTemplParamLists == 0) {
3743 assert(!TPLists.empty());
3756 void EnumDecl::anchor() { }
3762 bool IsScopedUsingClassTag,
bool IsFixed) {
3763 auto *Enum =
new (
C, DC)
EnumDecl(C, DC, StartLoc, IdLoc, Id, PrevDecl,
3764 IsScoped, IsScopedUsingClassTag, IsFixed);
3765 Enum->MayHaveOutOfDateDef = C.
getLangOpts().Modules;
3773 nullptr,
nullptr,
false,
false,
false);
3780 return TI->getTypeLoc().getSourceRange();
3786 unsigned NumPositiveBits,
3787 unsigned NumNegativeBits) {
3791 PromotionType = NewPromotionType;
3798 if (
const auto *A = getAttr<EnumExtensibilityAttr>())
3799 return A->getExtensibility() == EnumExtensibilityAttr::Closed;
3804 return isClosed() && hasAttr<FlagEnumAttr>();
3808 return isClosed() && !hasAttr<FlagEnumAttr>();
3813 return MSI->getTemplateSpecializationKind();
3821 assert(MSI &&
"Not an instantiated member enumeration?");
3824 PointOfInstantiation.
isValid() &&
3840 "couldn't find pattern for enum instantiation");
3845 if (SpecializationInfo)
3853 assert(!SpecializationInfo &&
"Member enum is already a specialization");
3865 :
TagDecl(DK, TK, C, DC, IdLoc, Id, PrevDecl, StartLoc) {
3866 HasFlexibleArrayMember =
false;
3867 AnonymousStructOrUnion =
false;
3868 HasObjectMember =
false;
3869 HasVolatileMember =
false;
3870 LoadedFieldsFromExternalStorage =
false;
3871 assert(
classof(static_cast<Decl*>(
this)) &&
"Invalid Kind!");
3878 StartLoc, IdLoc, Id, PrevDecl);
3899 if (
auto RD = dyn_cast<CXXRecordDecl>(
this))
3900 return RD->isLambda();
3905 return hasAttr<CapturedRecordAttr>();
3914 LoadFieldsFromExternalStorage();
3930 return hasAttr<MSStructAttr>() || C.
getLangOpts().MSBitfields == 1;
3933 void RecordDecl::LoadFieldsFromExternalStorage()
const {
3941 LoadedFieldsFromExternalStorage =
true;
3948 for (
unsigned i=0, e=Decls.size(); i != e; ++i)
3949 assert(isa<FieldDecl>(Decls[i]) || isa<IndirectFieldDecl>(Decls[i]));
3962 SanitizerKind::Address | SanitizerKind::KernelAddress) ||
3963 !Context.
getLangOpts().SanitizeAddressFieldPadding)
3968 int ReasonToReject = -1;
3969 if (!CXXRD || CXXRD->isExternCContext())
3971 else if (CXXRD->hasAttr<PackedAttr>())
3973 else if (CXXRD->isUnion())
3975 else if (CXXRD->isTriviallyCopyable())
3977 else if (CXXRD->hasTrivialDestructor())
3979 else if (CXXRD->isStandardLayout())
3981 else if (Blacklist.isBlacklistedLocation(
getLocation(),
"field-padding"))
3988 if (ReasonToReject >= 0)
3991 diag::remark_sanitize_address_insert_extra_padding_rejected)
3996 diag::remark_sanitize_address_insert_extra_padding_accepted)
3999 return ReasonToReject < 0;
4003 for (
const auto *
I :
fields()) {
4004 if (
I->getIdentifier())
4007 if (
const auto *RT =
I->getType()->getAs<
RecordType>())
4009 RT->getDecl()->findFirstNamedDataMember())
4010 return NamedDataMember;
4023 assert(!ParamInfo &&
"Already has param info!");
4026 if (!NewParamInfo.empty()) {
4027 NumParams = NewParamInfo.size();
4029 std::copy(NewParamInfo.begin(), NewParamInfo.end(), ParamInfo);
4034 bool CapturesCXXThis) {
4035 this->CapturesCXXThis = CapturesCXXThis;
4036 this->NumCaptures = Captures.size();
4038 if (Captures.empty()) {
4039 this->Captures =
nullptr;
4043 this->Captures = Captures.copy(Context).data();
4049 if (
I.getVariable() == variable)
4063 void TranslationUnitDecl::anchor() { }
4069 void PragmaCommentDecl::anchor() { }
4077 new (
C, DC, additionalSizeToAlloc<char>(Arg.size() + 1))
4079 memcpy(PCD->getTrailingObjects<
char>(), Arg.data(), Arg.size());
4080 PCD->getTrailingObjects<
char>()[Arg.size()] =
'\0';
4087 return new (
C,
ID, additionalSizeToAlloc<char>(ArgSize + 1))
4091 void PragmaDetectMismatchDecl::anchor() { }
4097 size_t ValueStart = Name.size() + 1;
4099 new (
C, DC, additionalSizeToAlloc<char>(ValueStart + Value.size() + 1))
4101 memcpy(PDMD->getTrailingObjects<
char>(), Name.data(), Name.size());
4102 PDMD->getTrailingObjects<
char>()[Name.size()] =
'\0';
4103 memcpy(PDMD->getTrailingObjects<
char>() + ValueStart, Value.data(),
4105 PDMD->getTrailingObjects<
char>()[ValueStart + Value.size()] =
'\0';
4111 unsigned NameValueSize) {
4112 return new (
C,
ID, additionalSizeToAlloc<char>(NameValueSize + 1))
4116 void ExternCContextDecl::anchor() { }
4123 void LabelDecl::anchor() { }
4127 return new (
C, DC)
LabelDecl(DC, IdentL, II,
nullptr, IdentL);
4133 assert(GnuLabelL != IdentL &&
"Use this only for GNU local labels");
4134 return new (
C, DC)
LabelDecl(DC, IdentL, II,
nullptr, GnuLabelL);
4144 memcpy(Buffer, Name.data(), Name.size());
4145 Buffer[Name.size()] =
'\0';
4149 void ValueDecl::anchor() { }
4152 for (
const auto *
I :
attrs())
4153 if (isa<WeakAttr>(
I) || isa<WeakRefAttr>(
I))
4159 void ImplicitParamDecl::anchor() { }
4183 bool isInlineSpecified,
4184 bool hasWrittenPrototype,
4185 bool isConstexprSpecified) {
4187 new (
C, DC)
FunctionDecl(Function, C, DC, StartLoc, NameInfo, T, TInfo,
4188 SC, isInlineSpecified, isConstexprSpecified);
4207 CapturedDecl::CapturedDecl(
DeclContext *DC,
unsigned NumParams)
4209 NumParams(NumParams), ContextParam(0), BodyAndNothrow(nullptr,
false) {}
4212 unsigned NumParams) {
4213 return new (
C, DC, additionalSizeToAlloc<ImplicitParamDecl *>(NumParams))
4218 unsigned NumParams) {
4219 return new (
C,
ID, additionalSizeToAlloc<ImplicitParamDecl *>(NumParams))
4232 Expr *
E,
const llvm::APSInt &V) {
4239 QualType(),
nullptr, llvm::APSInt());
4242 void IndirectFieldDecl::anchor() { }
4248 :
ValueDecl(IndirectField, DC, L, N, T), Chaining(CH.data()),
4249 ChainingSize(CH.size()) {
4276 void TypeDecl::anchor() { }
4281 return new (
C, DC)
TypedefDecl(C, DC, StartLoc, IdLoc, Id, TInfo);
4284 void TypedefNameDecl::anchor() { }
4289 auto *ThisTypedef =
this;
4290 if (AnyRedecl && OwningTypedef) {
4294 if (OwningTypedef == ThisTypedef)
4295 return TT->getDecl();
4301 bool TypedefNameDecl::isTransparentTagSlow()
const {
4302 auto determineIsTransparent = [&]() {
4304 if (
auto *TD = TT->getDecl()) {
4305 if (TD->getName() !=
getName())
4318 bool isTransparent = determineIsTransparent();
4319 CacheIsTransparentTag = 1;
4321 CacheIsTransparentTag |= 0x2;
4322 return isTransparent;
4334 return new (
C, DC)
TypeAliasDecl(C, DC, StartLoc, IdLoc, Id, TInfo);
4345 if (typeIsPostfix(TInfo->getType()))
4346 RangeEnd = TInfo->getTypeLoc().getSourceRange().getEnd();
4354 RangeEnd = TInfo->getTypeLoc().getSourceRange().getEnd();
4358 void FileScopeAsmDecl::anchor() { }
4373 void EmptyDecl::anchor() {}
4401 :
Decl(Import, DC, StartLoc), ImportedAndComplete(Imported,
true),
4405 auto *StoredLocs = getTrailingObjects<SourceLocation>();
4406 std::uninitialized_copy(IdentifierLocs.begin(), IdentifierLocs.end(),
4412 :
Decl(Import, DC, StartLoc), ImportedAndComplete(Imported,
false),
4415 *getTrailingObjects<SourceLocation>() = EndLoc;
4422 additionalSizeToAlloc<SourceLocation>(IdentifierLocs.size()))
4423 ImportDecl(DC, StartLoc, Imported, IdentifierLocs);
4430 ImportDecl *Import =
new (
C, DC, additionalSizeToAlloc<SourceLocation>(1))
4437 unsigned NumLocations) {
4438 return new (
C,
ID, additionalSizeToAlloc<SourceLocation>(NumLocations))
4443 if (!ImportedAndComplete.getInt())
4446 const auto *StoredLocs = getTrailingObjects<SourceLocation>();
4447 return llvm::makeArrayRef(StoredLocs,
4452 if (!ImportedAndComplete.getInt())
4462 void ExportDecl::anchor() {}
virtual void FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Result)
Finds all declarations lexically contained within the given DeclContext, after applying an optional f...
void setLinkage(Linkage L)
bool isCapturedRecord() const
Determine whether this record is a record for captured variables in CapturedStmt construct.
Defines the clang::ASTContext interface.
void setTemplateOrSpecializationInfo(VarDecl *Inst, TemplateOrSpecializationInfo TSI)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static LinkageInfo computeLVForDecl(const NamedDecl *D, LVComputationKind computation)
SourceLocation getEnd() const
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
void setImplicit(bool I=true)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
bool isMSVCRTEntryPoint() const
Determines whether this function is a MSVCRT user defined entry point.
void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
Note that the static data member Inst is an instantiation of the static data member template Tmpl of ...
External linkage, which indicates that the entity can be referred to from other translation units...
void updateOutOfDate(IdentifierInfo &II) const
Update a potentially out-of-date declaration.
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
static ImportDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NumLocations)
Create a new, deserialized module import declaration.
APValue * evaluateValue() const
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes expl...
TemplateSpecializationKind getTemplateSpecializationKind() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
A (possibly-)qualified type.
ArrayRef< Capture > captures() const
const IdentifierInfo * getLiteralIdentifier() const
getLiteralIdentifier - The literal suffix identifier this function represents, if any...
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
bool isBitField() const
Determines whether this field is a bitfield.
Internal linkage according to the Modules TS, but can be referred to from other translation units ind...
RAII class for safely pairing a StartedDeserializing call with FinishedDeserializing.
static VarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
This declaration has an owning module, but is only visible to lookups that occur within that module...
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID. ...
bool hasDefaultArg() const
hasDefaultArg - Determines whether this parameter has a default argument, either parsed or not...
Stmt - This represents one statement.
bool isGenericLambdaCallOperatorSpecialization(const CXXMethodDecl *MD)
bool hasDefiningAttr() const
Return true if this declaration has an attribute which acts as definition of the entity, such as 'alias' or 'ifunc'.
bool isExternCContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
bool isInitICE() const
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
void setPreviousDecl(FunctionDecl *PrevDecl)
Set the previous declaration.
FunctionType - C99 6.7.5.3 - Function Declarators.
SanitizerSet Sanitize
Set of enabled sanitizers.
bool isMain() const
Determines whether this function is "main", which is the entry point into an executable program...
bool IsICE
Whether this statement is an integral constant expression, or in C++11, whether the statement is a co...
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
bool isOutOfLine() const override
Determine whether this is or was instantiated from an out-of-line definition of a member function...
IdentifierInfo * getCXXLiteralIdentifier() const
getCXXLiteralIdentifier - If this name is the name of a literal operator, retrieve the identifier ass...
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
No linkage, which means that the entity is unique and can only be referred to from within its scope...
void setTypedefNameForAnonDecl(TypedefNameDecl *TDD)
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
bool IsEvaluating
Whether this statement is being evaluated.
The template argument is an expression, and we've not resolved it to one of the other forms yet...
CXXRecordDecl * getTemplatedDecl() const
Get the underlying class declarations of the template.
bool isRecordType() const
QualType getUnderlyingType() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
Defines the clang::Module class, which describes a module in the source code.
Decl - This represents one declaration (or definition), e.g.
static LinkageInfo getExternalLinkageFor(const NamedDecl *D)
bool isNoReturn() const
Determines whether this function is known to be 'noreturn', through an attribute on its declaration o...
bool isPredefinedLibFunction(unsigned ID) const
Determines whether this builtin is a predefined libc/libm function, such as "malloc", where we know the signature a priori.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
unsigned getBuiltinID() const
Return a value indicating whether this is a builtin function.
Defines the C++ template declaration subclasses.
void setPure(bool P=true)
void setPreviousDeclaration(FunctionDecl *PrevDecl)
static Visibility getVisibilityFromAttr(const T *attr)
Given a visibility attribute, return the explicit visibility associated with it.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
ImplicitParamKind
Defines the kind of the implicit parameter: is this an implicit parameter with pointer to 'this'...
The base class of the type hierarchy.
Represents an empty-declaration.
void setParameterIndex(const ParmVarDecl *D, unsigned index)
Used by ParmVarDecl to store on the side the index of the parameter when it exceeds the size of the n...
bool doesDeclarationForceExternallyVisibleDefinition() const
For a function declaration in C or C++, determine whether this declaration causes the definition to b...
bool isInStdNamespace() const
bool hasLinkage() const
Determine whether this declaration has linkage.
void setTemplateParameterListsInfo(ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists)
unsigned getCVRQualifiers() const
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
bool capturesVariable(const VarDecl *var) const
std::unique_ptr< llvm::MemoryBuffer > Buffer
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Declaration of a variable template.
const Expr * getInit() 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.
static void PrintTemplateArgumentList(raw_ostream &OS, ArrayRef< TemplateArgument > Args, const PrintingPolicy &Policy, bool SkipBrackets=false)
Print a template argument list, including the '<' and '>' enclosing the template arguments...
static std::enable_if<!std::is_base_of< RedeclarableTemplateDecl, T >::value, bool >::type isExplicitMemberSpecialization(const T *D)
Does the given declaration have member specialization information, and if so, is it an explicit speci...
virtual void completeDefinition()
completeDefinition - Notes that the definition of this type is now complete.
bool isWeakImported() const
Determine whether this is a weak-imported symbol.
A container of type source information.
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists...
SourceRange getIntegerTypeRange() const LLVM_READONLY
Retrieve the source range that covers the underlying type if specified.
bool CheckingICE
Whether we are checking whether this statement is an integral constant expression.
void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const override
getNameForDiagnostic - Appends a human-readable name for this declaration into the given stream...
bool isLambda() const
Determine whether this record is a class describing a lambda function object.
static CapturedDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NumParams)
void setNothrow(bool Nothrow=true)
This file provides some common utility functions for processing Lambda related AST Constructs...
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
ExplicitVisibilityKind
Kinds of explicit visibility.
bool isUsableInConstantExpressions(ASTContext &C) const
Determine whether this variable's value can be used in a constant expression, according to the releva...
VarDecl - An instance of this class is created to represent a variable declaration or definition...
const unsigned IgnoreAllVisibilityBit
bool isFileVarDecl() const
isFileVarDecl - Returns true for file scoped variable declaration.
Objects with "hidden" visibility are not seen by the dynamic linker.
bool WasEvaluated
Whether this statement was already evaluated.
Declaration of a redeclarable template.
static LanguageLinkage getDeclLanguageLinkage(const T &D)
void mergeVisibility(Visibility newVis, bool newExplicit)
Merge in the visibility 'newVis'.
TLSKind getTLSKind() const
Represents an empty template argument, e.g., one that has not been deduced.
Declaration context for names declared as extern "C" in C++.
field_iterator field_begin() const
Represents a variable template specialization, which refers to a variable template with a given set o...
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Decl * FirstDecl
FirstDecl - The first declaration stored within this declaration context.
void setParams(ArrayRef< ParmVarDecl * > NewParamInfo)
Stores a list of template parameters for a TemplateDecl and its derived classes.
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
ModuleOwnershipKind getModuleOwnershipKind() const
Get the kind of module ownership for this declaration.
Describes how types, statements, expressions, and declarations should be printed. ...
ParmVarDecl - Represents a parameter to a function.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
Defines the clang::Expr interface and subclasses for C++ expressions.
Provides information about a dependent function-template specialization declaration.
bool isExplicitInstantiationOrSpecialization() const
True if this declaration is an explicit specialization, explicit instantiation declaration, or explicit instantiation definition.
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.
static LinkageInfo getLVForClosure(const DeclContext *DC, Decl *ContextDecl, LVComputationKind computation)
unsigned getNumParams() const
RecordDecl - Represents a struct/union/class.
Visibility getVisibility() const
ASTMutationListener * getASTMutationListener() const
bool hasBody(const FunctionDecl *&Definition) const
Returns true if the function has a body (definition).
bool hasUninstantiatedDefaultArg() const
bool isExternC() const
Determines whether this function is a function with external, C linkage.
Provides common interface for the Decls that can be redeclared.
bool isInlineDefinitionExternallyVisible() const
For an inline function definition in C, or for a gnu_inline function in C++, determine whether the de...
static bool isRedeclarable(Decl::Kind K)
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...
bool hasBody() const override
Returns true if this Decl represents a declaration for a body of code, such as a function or method d...
FieldDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
EnumDecl * getInstantiatedFromMemberEnum() const
Returns the enumeration (declared within the template) from which this enumeration type was instantia...
TagDecl * getAnonDeclWithTypedefName(bool AnyRedecl=false) const
Retrieves the tag declaration for which this is the typedef name for linkage purposes, if any.
static RecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, RecordDecl *PrevDecl=nullptr)
void setUninstantiatedDefaultArg(Expr *arg)
static IndirectFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static LinkageInfo getLVForDecl(const NamedDecl *D, LVComputationKind computation)
const TemplateArgumentList * getTemplateSpecializationArgs() const
Retrieve the template arguments used to produce this function template specialization from the primar...
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.
static bool redeclForcesDefMSVC(const FunctionDecl *Redecl)
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
bool CheckedICE
Whether we already checked whether this statement was an integral constant expression.
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
SourceLocation getPointOfInstantiation() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
static LinkageInfo internal()
static bool usesTypeVisibility(const NamedDecl *D)
Is the given declaration a "type" or a "value" for the purposes of visibility computation?
bool isReferenceType() const
QualType getReturnType() const
static unsigned getNumModuleIdentifiers(Module *Mod)
Retrieve the number of module identifiers needed to name the given module.
static const Decl * getOutermostFuncOrBlockContext(const Decl *D)
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
void completeDefinition()
Completes the definition of this tag declaration.
bool declarationReplaces(NamedDecl *OldD, bool IsKnownNewer=true) const
Determine whether this declaration, if known to be well-formed within its context, will replace the declaration OldD if introduced into scope.
void Deallocate(void *Ptr) const
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
void startDefinition()
Starts the definition of this tag declaration.
bool isTranslationUnit() const
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
LVComputationKind
Kinds of LV computation.
This declaration is definitely a definition.
static LinkageInfo getLVForClassMember(const NamedDecl *D, LVComputationKind computation)
static std::pair< Decl *, Decl * > BuildDeclChain(ArrayRef< Decl * > Decls, bool FieldsAlreadyLoaded)
Build up a chain of declarations.
void setNumPositiveBits(unsigned Num)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
Linkage getLinkage() const
Describes a module or submodule.
bool hasExternalStorage() const
Returns true if a variable has extern or private_extern storage.
Objects with "default" visibility are seen by the dynamic linker and act like normal objects...
virtual void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const
getNameForDiagnostic - Appends a human-readable name for this declaration into the given stream...
bool isLinkageValid() const
True if the computed linkage is valid.
Provides information about a function template specialization, which is a FunctionDecl that has been ...
TypedefNameDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this typedef-name.
SourceLocation getBeginLoc() const
Get the begin source location.
VarDecl * getActingDefinition()
Get the tentative definition that acts as the real definition in a TU.
const TemplateArgumentList * TemplateArguments
The template arguments used to produce the function template specialization from the function templat...
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
TemplateParameterList ** TemplParamLists
TemplParamLists - A new-allocated array of size NumTemplParamLists, containing pointers to the "outer...
unsigned getLambdaManglingNumber() const
If this is the closure type of a lambda expression, retrieve the number to be used for name mangling ...
const TargetInfo & getTargetInfo() const
QualType getOriginalType() const
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
For an enumeration member that was instantiated from a member enumeration of a templated class...
const LangOptions & getLangOpts() const
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
static ExternCContextDecl * Create(const ASTContext &C, TranslationUnitDecl *TU)
A convenient class for passing around template argument information.
LinkageInfo getLinkageAndVisibility() const
Determine the linkage and visibility of this type.
Wrapper for source info for functions.
static EnumConstantDecl * Create(ASTContext &C, EnumDecl *DC, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *E, const llvm::APSInt &V)
unsigned getMinRequiredArguments() const
getMinRequiredArguments - Returns the minimum number of arguments needed to call this function...
virtual void printName(raw_ostream &os) const
static void mergeTemplateLV(LinkageInfo &LV, const FunctionDecl *fn, const FunctionTemplateSpecializationInfo *specInfo, LVComputationKind computation)
Merge in template-related linkage and visibility for the given function template specialization.
bool isExternC() const
Determines whether this variable is a variable with external, C linkage.
Visibility
Describes the different kinds of visibility that a declaration may have.
field_range fields() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isInitKnownICE() const
Determines whether it is already known whether the initializer is an integral constant expression or ...
A set of unresolved declarations.
bool needsCleanup() const
Returns whether the object performed allocations.
FunctionDecl * getTemplateInstantiationPattern() const
Retrieve the function declaration from which this function could be instantiated, if it is an instant...
Module * Parent
The parent of this module.
SourceRange getExceptionSpecSourceRange() const
Attempt to compute an informative source range covering the function exception specification, if any.
const SanitizerBlacklist & getSanitizerBlacklist() const
bool isVariadic() const
Whether this function is variadic.
static LinkageInfo getLVForLocalDecl(const NamedDecl *D, LVComputationKind computation)
static FileScopeAsmDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isTemplateInstantiation() const
Determines if the given function was instantiated from a function template.
bool isWeak() const
Determine whether this symbol is weakly-imported, or declared with the weak or weak-ref attr...
static TypeAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
TypeClass getTypeClass() const
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
void setNumNegativeBits(unsigned Num)
static VarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S)
bool isThisDeclarationADemotedDefinition() const
If this definition should pretend to be a declaration.
void setTemplateParameterListsInfo(ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists)
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
static FunctionTemplateSpecializationInfo * Create(ASTContext &C, FunctionDecl *FD, FunctionTemplateDecl *Template, TemplateSpecializationKind TSK, const TemplateArgumentList *TemplateArgs, const TemplateArgumentListInfo *TemplateArgsAsWritten, SourceLocation POI)
This represents the body of a CapturedStmt, and serves as its DeclContext.
Represents a linkage specification.
static ParmVarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
detail::InMemoryDirectory::const_iterator I
Decl * getPrimaryMergedDecl(Decl *D)
static FunctionDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation NLoc, DeclarationName N, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInlineSpecified=false, bool hasWrittenPrototype=true, bool isConstexprSpecified=false)
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
DiagnosticsEngine & getDiagnostics() const
VarDecl * getTemplateInstantiationPattern() const
Retrieve the variable declaration from which this variable could be instantiated, if it is an instant...
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, ImplicitParamKind ParamKind)
Create implicit parameter.
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
bool isExternalFormalLinkage(Linkage L)
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
static bool isExportedFromModuleIntefaceUnit(const NamedDecl *D)
TypeAliasDecl - Represents the declaration of a typedef-name via a C++0x alias-declaration.
unsigned NumTemplParamLists
NumTemplParamLists - The number of "outer" template parameter lists.
Represents a prototype with parameter type info, e.g.
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getOuterLocStart() const
getOuterLocStart - Return SourceLocation representing start of source range taking into account any o...
bool isParameterPack() const
Determine whether this parameter is actually a function parameter pack.
Represents a ValueDecl that came out of a declarator.
bool isExplicitInstantiationOrSpecialization() const
True if this declaration is an explicit specialization, explicit instantiation declaration, or explicit instantiation definition.
SourceLocation getLocEnd() const LLVM_READONLY
const ASTTemplateArgumentListInfo * getTemplateSpecializationArgsAsWritten() const
Retrieve the template argument list as written in the sources, if any.
SourceLocation getTypeSpecStartLoc() const
Module linkage, which indicates that the entity can be referred to from other translation units withi...
static EmptyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization, retrieves the member specialization information.
bool isCXXInstanceMember() const
Determine whether the given declaration is an instance member of a C++ class.
ArrayRef< TemplateArgument > asArray() const
Produce this as an array ref.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
bool isCXXClassMember() const
Determine whether this declaration is a C++ class member.
FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
Stmt ** getInitAddress()
Retrieve the address of the initializer expression.
bool isGlobal() const
Determines whether this is a global function.
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
const Type * getTypeForDecl() const
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
bool isClosedNonFlag() const
Returns true if this enum is annotated with neither flag_enum nor enum_extensibility(open).
Expr - This represents one expression.
bool isExplicitSpecialization() const
static bool classofKind(Kind K)
void mergeExternalVisibility(Linkage L)
bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const
Determines the order of 2 source locations in the translation unit.
static bool hasExplicitVisibilityAlready(LVComputationKind computation)
Does this computation kind permit us to consider additional visibility settings from attributes and t...
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Decl * LastDecl
LastDecl - The last declaration stored within this declaration context.
unsigned getParameterIndex(const ParmVarDecl *D) const
Used by ParmVarDecl to retrieve on the side the index of the parameter when it exceeds the size of th...
bool isInAnonymousNamespace() const
static Optional< Visibility > getVisibilityOf(const NamedDecl *D, NamedDecl::ExplicitVisibilityKind kind)
Return the explicit visibility of the given declaration.
bool isImplicitlyInstantiable() const
Determines whether this function is a function template specialization or a member of a class templat...
DeclContext * getDeclContext()
This declaration is a tentative definition.
Decl * getPrimaryMergedDecl(Decl *D)
Get the primary declaration for a declaration from an AST file.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
bool isInExternCContext() const
Determines whether this variable's context is, or is nested within, a C++ extern "C" linkage spec...
Defines the clang::TypeLoc interface and its subclasses.
SourceRange getExceptionSpecRange() const
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
SourceRange getDefaultArgRange() const
Retrieve the source range that covers the entire default argument.
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
static bool RedeclForcesDefC99(const FunctionDecl *Redecl)
static const CXXRecordDecl * getOutermostEnclosingLambda(const CXXRecordDecl *Record)
bool isReplaceableGlobalAllocationFunction(bool *IsAligned=nullptr) const
Determines whether this function is one of the replaceable global allocation functions: void *operato...
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
StorageClass
Storage classes.
static Optional< Visibility > getExplicitVisibility(const NamedDecl *D, LVComputationKind kind)
Objects with "protected" visibility are seen by the dynamic linker but always dynamically resolve to ...
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isFunctionOrMethod() const
InClassInitStyle
In-class initialization styles for non-static data members.
static CapturedDecl * Create(ASTContext &C, DeclContext *DC, unsigned NumParams)
This declaration has an owning module, and is visible when that module is imported.
Do an LV computation for, ultimately, a non-type declaration that already has some sort of explicit v...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
bool isExternallyVisible(Linkage L)
static bool hasDefinition(const ObjCObjectPointerType *ObjPtr)
specific_decl_iterator< FieldDecl > field_iterator
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
TagDecl * getDefinition() const
getDefinition - Returns the TagDecl that actually defines this struct/union/class/enum.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Linkage getFormalLinkage() const
Get the linkage from a semantic point of view.
void setStorageClass(StorageClass SC)
ObjCStringFormatFamily getObjCFStringFormattingFamily() const
void addDestruction(T *Ptr)
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
The result type of a method or function.
This template specialization was implicitly instantiated from a template.
bool isInExternCContext() const
Determines whether this function's context is, or is nested within, a C++ extern "C" linkage spec...
FunctionTemplateDecl * getTemplate() const
Retrieve the template from which this function was specialized.
bool checkInitIsICE() const
Determine whether the value of the initializer attached to this declaration is an integral constant e...
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
static LinkageInfo visible_none()
TypeSourceInfo * getTypeSourceInfo() const
static bool isNamed(const NamedDecl *ND, const char(&Str)[Len])
TypedefNameDecl * getTypedefNameForAnonDecl() const
VarDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
static LinkageInfo external()
const Expr * getAnyInitializer() const
getAnyInitializer - Get the initializer for this variable, no matter which declaration it is attached...
Optional< Visibility > getExplicitVisibility(ExplicitVisibilityKind kind) const
If visibility was explicitly specified for this declaration, return that visibility.
VarDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Abstract interface for external sources of AST nodes.
BlockDecl(DeclContext *DC, SourceLocation CaretLoc)
static PragmaDetectMismatchDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned NameValueSize)
Represents a C++ Modules TS module export declaration.
bool doesThisDeclarationHaveABody() const
doesThisDeclarationHaveABody - Returns whether this specific declaration of the function has a body -...
QualifierInfo - A struct with extended info about a syntactic name qualifier, to be used for the case...
SourceRange getReturnTypeSourceRange() const
Attempt to compute an informative source range covering the function return type. ...
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
NamedDecl * getInstantiatedFrom() const
Retrieve the member declaration from which this member was instantiated.
This declaration has an owning module, but is globally visible (typically because its owning module i...
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
static bool classof(const Decl *D)
static EnumConstantDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool hasOneOf(SanitizerMask K) const
Check if one or more sanitizers are enabled.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
bool mayInsertExtraPadding(bool EmitRemark=false) const
Whether we are allowed to insert extra padding between fields.
bool isInjectedClassName() const
Determines whether this declaration represents the injected class name.
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
static SourceLocation getTemplateOrInnerLocStart(const DeclT *decl)
static LinkageInfo getLVForDecl(const NamedDecl *D, LVComputationKind computation)
getLVForDecl - Get the linkage and visibility for the given declaration.
SourceLocation getOuterLocStart() const
getOuterLocStart - Return SourceLocation representing start of source range taking into account any o...
Encodes a location in the source.
static EmptyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Determines whether this field is a representative for an anonymous struct ...
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
unsigned getNumParams() const
getNumParams - Return the number of parameters this function must have based on its FunctionType...
static ExportDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation ExportLoc)
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
static LVComputationKind withExplicitVisibilityAlready(LVComputationKind oldKind)
Given an LVComputationKind, return one of the same type/value sort that records that it already has e...
unsigned getBitWidthValue(const ASTContext &Ctx) const
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
bool isValid() const
Return true if this is a valid SourceLocation object.
OverloadedOperatorKind getCXXOverloadedOperator() const
getCXXOverloadedOperator - If this name is the name of an overloadable operator in C++ (e...
TagDecl - Represents the declaration of a struct/union/class/enum.
LanguageLinkage
Describes the different kinds of language linkage (C++ [dcl.link]) that an entity may have...
ASTContext & getASTContext() const LLVM_READONLY
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PL, ArrayRef< Expr * > IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
LabelDecl - Represents the declaration of a label.
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx, SmallVectorImpl< PartialDiagnosticAt > *Diag=nullptr) const
EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded integer.
bool isMSExternInline() const
The combination of the extern and inline keywords under MSVC forces the function to be required...
bool isLegalForVariable(StorageClass SC)
Checks whether the given storage class is legal for variables.
ArrayRef< ParmVarDecl * > parameters() const
This file defines OpenMP nodes for declarative directives.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
ASTContext & getASTContext() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
unsigned getMemoryFunctionKind() const
Identify a memory copying or setting function.
void setCachedLinkage(Linkage L) const
FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass S, bool isInlineSpecified, bool isConstexprSpecified)
Decl * getLambdaContextDecl() const
Retrieve the declaration that provides additional context for a lambda, when the normal declaration c...
This declaration is only a declaration.
LinkageInfo getLinkageAndVisibility() const
Determines the linkage and visibility of this entity.
static FunctionDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Linkage getCachedLinkage() const
const T * castAs() const
Member-template castAs<specific type>.
T * get(ExternalASTSource *Source) const
Retrieve the pointer to the AST node that this lazy pointer.
TypeLoc getReturnLoc() const
This template specialization was instantiated from a template due to an explicit instantiation defini...
This template specialization was formed from a template-id but has not yet been declared, defined, or instantiated.
bool isFileContext() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
unsigned getBuiltinID() const
Returns a value indicating whether this function corresponds to a builtin function.
VarDecl * getInstantiatedFromStaticDataMember() const
If this variable is an instantiated static data member of a class template specialization, returns the templated static data member from which it was instantiated.
static ImportDecl * CreateImplicit(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, Module *Imported, SourceLocation EndLoc)
Create a new module import declaration for an implicitly-generated import.
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
FunctionDecl * getClassScopeSpecializationPattern(const FunctionDecl *FD)
bool hasCachedLinkage() const
const Attr * getUnusedResultAttr() const
Returns the WarnUnusedResultAttr that is either declared on this function, or its return type declara...
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
void addSpecialization(FunctionTemplateSpecializationInfo *Info, void *InsertPos)
Add a specialization of this function template.
bool isExternCXXContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
QualType getType() const
Return the type wrapped by this type source info.
void printQualifiedName(raw_ostream &OS) const
printQualifiedName - Returns human-readable qualified name for declaration, like A::B::i, for i being member of namespace A::B.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
static bool isDeclExternC(const T &D)
void setTemplateSpecializationKind(TemplateSpecializationKind TSK)
Set the template specialization kind.
static TypeAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
Defines various enumerations that describe declaration and type specifiers.
static const char * getStorageClassSpecifierString(StorageClass SC)
getStorageClassSpecifierString - Return the string used to specify the storage class SC...
decl_iterator - Iterates through the declarations stored within this context.
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
For a static data member that was instantiated from a static data member of a class template...
static LinkageInfo getLVForType(const Type &T, LVComputationKind computation)
static TypedefDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
Base class for declarations which introduce a typedef-name.
TLS with a dynamic initializer.
Represents a template argument.
Do an LV computation for, ultimately, a non-type declaration.
void setCapturedRecord()
Mark the record as a record for captured variables in CapturedStmt construct.
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
TagTypeKind
The kind of a tag type.
FunctionTemplateDecl * getPrimaryTemplate() const
Retrieve the primary template that this function template specialization either specializes or was in...
RecordDecl(Kind DK, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, RecordDecl *PrevDecl)
static ParmVarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
External linkage within a unique namespace.
static LinkageInfo getLVForTemplateParameterList(const TemplateParameterList *Params, LVComputationKind computation)
Get the most restrictive linkage for the types in the given template parameter list.
SourceLocation getLocStart() const LLVM_READONLY
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
The base class of all kinds of template declarations (e.g., class, function, etc.).
bool hasUnparsedDefaultArg() const
hasUnparsedDefaultArg - Determines whether this parameter has a default argument that has not yet bee...
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
const unsigned IgnoreExplicitVisibilityBit
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
static PragmaDetectMismatchDecl * Create(const ASTContext &C, TranslationUnitDecl *DC, SourceLocation Loc, StringRef Name, StringRef Value)
Do an LV computation when we only care about the linkage.
The template argument is a pack expansion of a template name that was provided for a template templat...
TemplateSpecializationKind getTemplateSpecializationKind() const
If this enumeration is a member of a specialization of a templated class, determine what kind of temp...
InitType Init
The initializer for this variable or, for a ParmVarDecl, the C++ default argument.
bool isInvalidDecl() const
ParmVarDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
bool isValid() const
Whether this pointer is non-NULL.
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
TypeLoc IgnoreParens() const
static bool shouldConsiderTemplateVisibility(const FunctionDecl *fn, const FunctionTemplateSpecializationInfo *specInfo)
This template specialization was instantiated from a template due to an explicit instantiation declar...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
IdentifierNamespace
IdentifierNamespace - The different namespaces in which declarations may appear.
bool hasWrittenPrototype() const
TLSKind
Kinds of thread-local storage.
DeclarationName - The name of a declaration.
void setDependentTemplateSpecialization(ASTContext &Context, const UnresolvedSetImpl &Templates, const TemplateArgumentListInfo &TemplateArgs)
Specifies that this function declaration is actually a dependent function template specialization...
ParmVarDeclBitfields ParmVarDeclBits
SourceLocation getLocStart() const LLVM_READONLY
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
EnumDecl - Represents an enum.
static bool isSingleLineLanguageLinkage(const Decl &D)
detail::InMemoryDirectory::const_iterator E
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
bool isMsStruct(const ASTContext &C) const
isMsStrust - Get whether or not this is an ms_struct which can be turned on with an attribute...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Tags, declared with 'struct foo;' and referenced with 'struct foo'.
static EnumDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, EnumDecl *PrevDecl, bool IsScoped, bool IsScopedUsingClassTag, bool IsFixed)
SourceLocation getPointOfInstantiation() const
Retrieve the (first) point of instantiation of a function template specialization or a member of a cl...
DefinitionKind hasDefinition() const
static FileScopeAsmDecl * Create(ASTContext &C, DeclContext *DC, StringLiteral *Str, SourceLocation AsmLoc, SourceLocation RParenLoc)
static LabelDecl * CreateDeserialized(ASTContext &C, unsigned ID)
bool isLambda() const
Determine whether this class describes a lambda function object.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
This declaration is not owned by a module.
static LabelDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdentL, IdentifierInfo *II)
SmallVector< Context, 8 > Contexts
bool isVisibilityExplicit() const
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
bool hasInheritedDefaultArg() const
bool SuppressUnwrittenScope
Suppress printing parts of scope specifiers that don't need to be written, e.g., for inline or anonym...
unsigned MayHaveOutOfDateDef
Indicates whether it is possible for declarations of this kind to have an out-of-date definition...
Not an overloaded operator.
ImplicitParamDecl(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType Type, ImplicitParamKind ParamKind)
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
static ExportDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Location wrapper for a TemplateArgument.
Expr * getUninstantiatedDefaultArg()
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVComputationKind computation)
const T * getAs() const
Member-template getAs<specific type>'.
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
Determine what kind of template instantiation this function represents.
Decl::Kind getDeclKind() const
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
This template specialization was declared or defined by an explicit specialization (C++ [temp...
LanguageLinkage getLanguageLinkage() const
Compute the language linkage.
static ImplicitParamDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template instantiation this function represents.
static RecordDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
Module * getOwningModule() const
Get the module that owns this declaration.
void setInstantiationOfStaticDataMember(VarDecl *VD, TemplateSpecializationKind TSK)
Specify that this variable is an instantiation of the static data member VD.
bool isClosedFlag() const
Returns true if this enum is annotated with flag_enum and isn't annotated with enum_extensibility(ope...
LanguageLinkage getLanguageLinkage() const
Compute the language linkage.
bool isExplicitInstantiationOrSpecialization() const
True if this declaration is an explicit specialization, explicit instantiation declaration, or explicit instantiation definition.
static EnumDecl * CreateDeserialized(ASTContext &C, unsigned ID)
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
static LinkageInfo getInternalLinkageFor(const NamedDecl *D)
The template argument is a type.
static bool classofKind(Kind K)
The template argument is actually a parameter pack.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
bool isStaticDataMember() const
Determines whether this is a static data member.
unsigned IsBeingDefined
IsBeingDefined - True if this is currently being defined.
unsigned getFieldIndex() const
getFieldIndex - Returns the index of this field within its record, as appropriate for passing to ASTR...
char __ovld __cnfn max(char x, char y)
Returns y if x < y, otherwise it returns x.
void merge(LinkageInfo other)
Merge both linkage and visibility.
SourceManager & getSourceManager()
Linkage getLinkage() const
Determine the linkage of this type.
std::string getQualifiedNameAsString() const
bool isInExternCXXContext() const
Determines whether this function's context is, or is nested within, a C++ extern "C++" linkage spec...
virtual bool isDefined() const
A template argument list.
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
static bool isFirstInExternCContext(T *D)
bool willHaveBody() const
True if this function will eventually have a body, once it's fully parsed.
static BlockDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L)
NestedNameSpecifierLoc QualifierLoc
static FieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Do an LV computation for, ultimately, a type that already has some sort of explicit visibility...
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
const FieldDecl * findFirstNamedDataMember() const
Finds the first data member which has a name.
void setDefaultArg(Expr *defarg)
Represents a C++ struct/union/class.
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
static IndirectFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, llvm::MutableArrayRef< NamedDecl * > CH)
The template argument is a template name that was provided for a template template parameter...
void setDescribedVarTemplate(VarTemplateDecl *Template)
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
static LinkageInfo getLVForTemplateArgumentList(ArrayRef< TemplateArgument > Args, LVComputationKind computation)
Get the most restrictive linkage for the types and declarations in the given template argument list...
bool isOutOfLine() const override
Determine whether this is or was instantiated from an out-of-line definition of a static data member...
static TranslationUnitDecl * Create(ASTContext &C)
llvm::iterator_range< specific_attr_iterator< T > > specific_attrs() const
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
static TypedefDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
void * Allocate(size_t Size, unsigned Align=8) const
Provides information a specialization of a member of a class template, which may be a member function...
bool isReservedGlobalPlacementOperator() const
Determines whether this operator new or delete is one of the reserved global placement operators: voi...
bool isInline() const
Whether this variable is (C++1z) inline.
No linkage according to the standard, but is visible from other translation units because of types de...
void setMSAsmLabel(StringRef Name)
VarDecl * getDefinition()
Builtin::Context & BuiltinInfo
Declaration of a class template.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
APValue * getEvaluatedValue() const
Return the already-evaluated value of this variable's initializer, or NULL if the value is not yet kn...
unsigned kind
All of the diagnostics that can be emitted by the frontend.
static DeclT * getDefinitionOrSelf(DeclT *D)
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
void setCapturedVLAType(const VariableArrayType *VLAType)
Set the captured variable length array type for this field.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static BlockDecl * CreateDeserialized(ASTContext &C, unsigned ID)
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
StringLiteral - This represents a string literal expression, e.g.
Defines the clang::TargetInfo interface.
bool Equals(const DeclContext *DC) const
Determine whether this declaration context is equivalent to the declaration context DC...
TLS with a known-constant initializer.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Kind
Lists the kind of concrete classes of Decl.
void setDescribedFunctionTemplate(FunctionTemplateDecl *Template)
static bool isRedeclarableImpl(Redeclarable< T > *)
VarDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass SC)
VarDeclBitfields VarDeclBits
FunctionDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
TranslationUnitDecl - The top declaration context.
bool isInExternCXXContext() const
Determines whether this variable's context is, or is nested within, a C++ extern "C++" linkage spec...
NamedDecl * getMostRecentDecl()
DefinitionKind isThisDeclarationADefinition() const
bool MSVCFormatting
Use whitespace and punctuation like MSVC does.
EnumConstantDecl(DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *E, const llvm::APSInt &V)
static bool useInlineVisibilityHidden(const NamedDecl *D)
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
static DependentFunctionTemplateSpecializationInfo * Create(ASTContext &Context, const UnresolvedSetImpl &Templates, const TemplateArgumentListInfo &TemplateArgs)
Do an LV computation for, ultimately, a type.
void setCaptures(ASTContext &Context, ArrayRef< Capture > Captures, bool CapturesCXXThis)
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
FunctionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
NamedDecl - This represents a decl with a name.
DeclarationNameInfo getNameInfo() const
FunctionDecl * getInstantiatedFromMemberFunction() const
If this function is an instantiation of a member function of a class template specialization, retrieves the function from which it was instantiated.
void mergeMaybeWithVisibility(LinkageInfo other, bool withVis)
Merge linkage and conditionally merge visibility.
static LinkageInfo none()
Represents a C array with a specified size that is not an integer-constant-expression.
Represents a #pragma detect_mismatch line.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
TypeSourceInfo * getTypeSourceInfo() const
static FieldDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
void setPointOfInstantiation(SourceLocation POI)
Set the first point of instantiation.
static bool hasDirectVisibilityAttribute(const NamedDecl *D, LVComputationKind computation)
Does the given declaration have a direct visibility attribute that would match the given rules...
bool hasTrivialBody() const
hasTrivialBody - Returns whether the function has a trivial body that does not require any specific c...
bool isExplicitSpecialization() const
static LinkageInfo uniqueExternal()
static Optional< Visibility > getExplicitVisibilityAux(const NamedDecl *ND, NamedDecl::ExplicitVisibilityKind kind, bool IsMostRecent)
FunctionDecl * getClassScopeSpecializationPattern() const
Retrieve the class scope template pattern that this function template specialization is instantiated ...
This class handles loading and caching of source files into memory.
Defines enum values for all the target-independent builtin functions.
Declaration of a template function.
Attr - This represents one attribute.
bool isClosed() const
Returns true if this enum is either annotated with enum_extensibility(closed) or isn't annotated with...
const RecordDecl * getParent() const
getParent - Returns the parent of this field declaration, which is the struct in which this field is ...
This is a C++ Modules TS module interface unit.
void setTemplateParameterListsInfo(ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists)
setTemplateParameterListsInfo - Sets info about "outer" template parameter lists. ...
Structure used to store a statement, the constant value to which it was evaluated (if any)...
OverloadedOperatorKind getOverloadedOperator() const
getOverloadedOperator - Which C++ overloaded operator this function represents, if any...
TemplatedKind
The kind of templated function a FunctionDecl can be.