15 #ifndef LLVM_CLANG_SEMA_SEMA_H 16 #define LLVM_CLANG_SEMA_SEMA_H 51 #include "llvm/ADT/ArrayRef.h" 52 #include "llvm/ADT/Optional.h" 53 #include "llvm/ADT/SetVector.h" 54 #include "llvm/ADT/SmallBitVector.h" 55 #include "llvm/ADT/SmallPtrSet.h" 56 #include "llvm/ADT/SmallVector.h" 57 #include "llvm/ADT/TinyPtrVector.h" 65 template <
typename ValueT>
struct DenseMapInfo;
66 template <
typename ValueT,
typename ValueInfoT>
class DenseSet;
68 struct InlineAsmIdentifierInfo;
75 class ASTMutationListener;
85 class CXXBindTemporaryExpr;
87 class CXXConstructorDecl;
88 class CXXConversionDecl;
90 class CXXDestructorDecl;
91 class CXXFieldCollector;
92 class CXXMemberCallExpr;
98 class ClassTemplateDecl;
99 class ClassTemplatePartialSpecializationDecl;
100 class ClassTemplateSpecializationDecl;
101 class VarTemplatePartialSpecializationDecl;
102 class CodeCompleteConsumer;
103 class CodeCompletionAllocator;
104 class CodeCompletionTUInfo;
105 class CodeCompletionResult;
106 class CoroutineBodyStmt;
108 class DeclAccessPair;
111 class DeclaratorDecl;
112 class DeducedTemplateArgument;
113 class DependentDiagnostic;
114 class DesignatedInitExpr;
117 class EnumConstantDecl;
123 class FunctionProtoType;
124 class FunctionTemplateDecl;
125 class ImplicitConversionSequence;
128 class InitializationKind;
129 class InitializationSequence;
130 class InitializedEntity;
131 class IntegerLiteral;
135 class LocalInstantiationScope;
140 class MultiLevelTemplateArgumentList;
142 class ObjCCategoryDecl;
143 class ObjCCategoryImplDecl;
144 class ObjCCompatibleAliasDecl;
145 class ObjCContainerDecl;
147 class ObjCImplementationDecl;
148 class ObjCInterfaceDecl;
150 template <
class T>
class ObjCList;
151 class ObjCMessageExpr;
152 class ObjCMethodDecl;
153 class ObjCPropertyDecl;
154 class ObjCProtocolDecl;
155 class OMPThreadPrivateDecl;
156 class OMPRequiresDecl;
157 class OMPDeclareReductionDecl;
158 class OMPDeclareSimdDecl;
160 struct OverloadCandidate;
161 class OverloadCandidateSet;
166 class PseudoDestructorTypeStorage;
167 class PseudoObjectExpr;
169 class StandardConversionSequence;
173 class TemplateArgument;
174 class TemplateArgumentList;
175 class TemplateArgumentLoc;
177 class TemplateInstantiationCallback;
178 class TemplateParameterList;
179 class TemplatePartialOrderingContext;
180 class TemplateTemplateParmDecl;
184 class TypedefNameDecl;
186 class TypoCorrectionConsumer;
188 class UnresolvedLookupExpr;
189 class UnresolvedMemberExpr;
190 class UnresolvedSetImpl;
191 class UnresolvedSetIterator;
193 class UsingShadowDecl;
196 class VarTemplateSpecializationDecl;
197 class VisibilityAttr;
198 class VisibleDeclConsumer;
199 class IndirectFieldDecl;
200 struct DeductionFailureInfo;
201 class TemplateSpecCandidateSet;
204 class AccessedEntity;
205 class BlockScopeInfo;
207 class CapturedRegionScopeInfo;
208 class CapturingScopeInfo;
209 class CompoundScopeInfo;
210 class DelayedDiagnostic;
211 class DelayedDiagnosticPool;
212 class FunctionScopeInfo;
213 class LambdaScopeInfo;
214 class PossiblyUnreachableDiag;
215 class SemaPPCallbacks;
216 class TemplateDeductionInfo;
219 namespace threadSafety {
226 typedef std::pair<llvm::PointerUnion<const TemplateTypeParmType*, NamedDecl*>,
244 bool SawTypeNullability =
false;
251 llvm::DenseMap<FileID, FileNullability> Map;
262 if (file ==
Cache.File)
263 return Cache.Nullability;
266 if (!
Cache.File.isInvalid()) {
272 Cache.Nullability = Map[file];
273 return Cache.Nullability;
280 void operator=(
const Sema &) =
delete;
286 bool isMultiplexExternalSource;
288 static bool mightHaveNonExternalLinkage(
const DeclaratorDecl *FD);
295 bool shouldLinkPossiblyHiddenDecl(
const NamedDecl *Old,
303 "should not have found a non-externally-declarable previous decl");
310 void setupImplicitSpecialMemberType(
CXXMethodDecl *SpecialMem,
393 PSK_Push_Set = PSK_Push | PSK_Set,
394 PSK_Pop_Set = PSK_Pop | PSK_Set,
397 template<
typename ValueType>
404 Slot(llvm::StringRef StackSlotLabel, ValueType Value,
406 : StackSlotLabel(StackSlotLabel), Value(Value),
407 PragmaLocation(PragmaLocation),
408 PragmaPushLocation(PragmaPushLocation) {}
412 llvm::StringRef StackSlotLabel,
430 assert((Action == PSK_Push || Action == PSK_Pop) &&
431 "Can only push / pop #pragma stack sentinels!");
432 Act(CurrentPragmaLocation, Action, Label, CurrentValue);
437 : DefaultValue(Default), CurrentValue(Default) {}
439 bool hasValue()
const {
return CurrentValue != DefaultValue; }
460 static const unsigned kMac68kAlignmentSentinel = ~0U;
555 &ExternalSemaSource::ReadExtVectorDecls, 2, 2>
599 &ExternalSemaSource::ReadTentativeDefinitions, 2, 2>
606 &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2>
614 &ExternalSemaSource::ReadDelegatingConstructors, 2, 2>
646 std::unique_ptr<LateParsedTemplate>>
658 LateTemplateParserCleanupCB *LTPCleanup,
660 LateTemplateParser = LTP;
661 LateTemplateParserCleanup = LTPCleanup;
699 state.SavedPool = CurPool;
708 CurPool = state.SavedPool;
715 state.SavedPool = CurPool;
722 assert(CurPool ==
nullptr);
723 CurPool = state.SavedPool;
732 ProcessingContextState SavedContextState;
737 : S(S), SavedContext(S.CurContext),
739 SavedCXXThisTypeOverride(S.CXXThisTypeOverride)
741 assert(ContextToPush &&
"pushing null context");
748 if (!SavedContext)
return;
752 SavedContext =
nullptr;
765 bool PushedCodeSynthesisContext =
false;
769 : S(S), SavedContext(S, DC) {
772 Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
773 if (
auto *FD = dyn_cast<FunctionDecl>(DC))
774 FD->setWillHaveBody(
true);
776 assert(isa<ObjCMethodDecl>(DC));
780 assert(!PushedCodeSynthesisContext);
783 Ctx.
Kind = Sema::CodeSynthesisContext::DefiningSynthesizedFunction;
788 PushedCodeSynthesisContext =
true;
792 if (PushedCodeSynthesisContext)
794 if (
auto *FD = dyn_cast<FunctionDecl>(S.
CurContext))
795 FD->setWillHaveBody(
false);
814 void LoadExternalWeakUndeclaredIdentifiers();
949 PotentiallyEvaluated,
959 PotentiallyEvaluatedIfUsed
1017 unsigned NumCleanupObjects,
1019 Decl *ManglingContextDecl,
1021 : Context(Context), ParentCleanup(ParentCleanup),
1022 NumCleanupObjects(NumCleanupObjects), NumTypos(0),
1023 ManglingContextDecl(ManglingContextDecl), MangleNumbering(),
1024 ExprContext(ExprContext) {}
1031 return Context == ExpressionEvaluationContext::Unevaluated ||
1032 Context == ExpressionEvaluationContext::UnevaluatedAbstract ||
1033 Context == ExpressionEvaluationContext::UnevaluatedList;
1036 return Context == ExpressionEvaluationContext::ConstantEvaluated;
1055 Decl *&ManglingContextDecl);
1072 llvm::PointerIntPair<CXXMethodDecl*, 2> Pair;
1077 : Pair(MD, MD->isDeleted() ? NoMemberOrDeleted : Success) {}
1087 :
public llvm::FastFoldingSetNode,
1091 : FastFoldingSetNode(ID)
1117 typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *>>
1140 bool isExternalWithNoLinkageType(
ValueDecl *VD);
1143 void getUndefinedButUsed(
1148 const llvm::MapVector<FieldDecl *, DeleteLocs> &
1149 getMismatchingDeleteExpressions()
const;
1177 typedef llvm::PointerIntPair<CXXRecordDecl *, 3, CXXSpecialMember>
1196 void updateOutOfDateSelector(
Selector Sel);
1199 bool isSelfExpr(
Expr *RExpr);
1205 void EmitCurrentDiagnostic(
unsigned DiagID);
1219 void addImplicitTypedef(StringRef Name,
QualType T);
1248 void addExternalSource(ExternalSemaSource *E);
1250 void PrintStats()
const;
1279 if (!isActive())
return;
1298 template<
typename T>
1332 void emitAndClearUnusedLocalTypedefWarnings();
1334 void ActOnStartOfTranslationUnit();
1335 void ActOnEndOfTranslationUnit();
1337 void CheckDelegatingCtorCycles();
1341 void PushFunctionScope();
1348 void RecordParsingTemplateParameterDepth(
unsigned Depth);
1355 const Decl *D =
nullptr,
1359 return FunctionScopes.empty() ? nullptr : FunctionScopes.back();
1364 void setFunctionHasBranchIntoScope();
1365 void setFunctionHasBranchProtectedScope();
1366 void setFunctionHasIndirectGoto();
1368 void PushCompoundScope(
bool IsStmtExpr);
1369 void PopCompoundScope();
1373 bool hasAnyUnrecoverableErrorsInThisFunction()
const;
1383 getCurLambda(
bool IgnoreNonLambdaCapturingScope =
false);
1409 Expr *ArraySize,
unsigned Quals,
1475 void UpdateExceptionSpec(FunctionDecl *FD,
1478 bool CheckDistantExceptionSpec(
QualType T);
1479 bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New);
1480 bool CheckEquivalentExceptionSpec(
1483 bool CheckEquivalentExceptionSpec(
1534 std::tuple<
const Ts &...> Args;
1538 llvm::index_sequence<Is...>)
const {
1540 bool Dummy[] = {
false, (DB << getPrintable(std::get<Is>(Args)))...};
1547 assert(DiagID != 0 &&
"no diagnostic for type diagnoser");
1552 emit(DB, llvm::index_sequence_for<Ts...>());
1566 void CheckAddressOfNoDeref(
const Expr *E);
1567 void CheckMemberAccessOfNoDeref(
const MemberExpr *E);
1572 struct ModuleScope {
1574 bool ModuleInterface =
false;
1581 Module *getCurrentModule()
const {
1582 return ModuleScopes.empty() ? nullptr : ModuleScopes.back().Module;
1593 void makeMergedDefinitionVisible(
NamedDecl *ND);
1595 bool isModuleVisible(
const Module *M,
bool ModulePrivate =
false);
1599 return !D->
isHidden() || isVisibleSlow(D);
1606 return isVisible(D) || hasVisibleDeclarationSlow(D, Modules);
1608 bool hasVisibleDeclarationSlow(
const NamedDecl *D,
1611 bool hasVisibleMergedDefinition(
NamedDecl *Def);
1612 bool hasMergedDefinitionInCurrentModule(
NamedDecl *Def);
1616 bool hasStructuralCompatLayout(
Decl *D,
Decl *Suggested);
1621 bool OnlyNeedComplete =
false);
1624 return hasVisibleDefinition(const_cast<NamedDecl*>(D), &Hidden);
1635 bool hasVisibleExplicitSpecialization(
1640 bool hasVisibleMemberSpecialization(
1646 bool isEquivalentInternalLinkageDeclaration(
const NamedDecl *A,
1648 void diagnoseEquivalentInternalLinkageDeclarations(
1655 return !RequireCompleteTypeImpl(Loc, T,
nullptr);
1662 template <
typename... Ts>
1664 const Ts &...Args) {
1666 return RequireCompleteType(Loc, T, Diagnoser);
1669 void completeExprArrayBound(
Expr *E);
1671 bool RequireCompleteExprType(
Expr *E,
unsigned DiagID);
1673 template <
typename... Ts>
1676 return RequireCompleteExprType(E, Diagnoser);
1683 template <
typename... Ts>
1685 const Ts &...Args) {
1687 return RequireLiteralType(Loc, T, Diagnoser);
1692 TagDecl *OwnedTagDecl =
nullptr);
1698 bool AsUnevaluated =
true);
1717 DeclGroupPtrTy ConvertDeclToDeclGroup(
Decl *Ptr,
Decl *OwnedType =
nullptr);
1719 void DiagnoseUseOfUnimplementedSelectors();
1725 bool isClassName =
false,
bool HasTrailingDot =
false,
1727 bool IsCtorOrDtorName =
false,
1728 bool WantNontrivialTypeSourceInfo =
false,
1729 bool IsClassTemplateDeductionContext =
true,
1738 bool IsTemplateName =
false);
1746 bool IsTemplateTypeArg);
1791 Result.Template = Name;
1797 Result.Template = Name;
1803 Result.Template = Name;
1810 assert(Kind == NC_Type);
1815 assert(Kind == NC_Expression);
1820 assert(Kind == NC_TypeTemplate || Kind == NC_FunctionTemplate ||
1821 Kind == NC_VarTemplate);
1827 case NC_TypeTemplate:
1829 case NC_FunctionTemplate:
1831 case NC_VarTemplate:
1834 llvm_unreachable(
"unsupported name classification.");
1866 bool IsAddressOfOperand,
1867 std::unique_ptr<CorrectionCandidateCallback> CCC =
nullptr);
1875 TemplateTemplateParam,
1887 if (
auto *DRE = dyn_cast<DeclRefExpr>(E.
get()))
1888 return !DRE->hasExplicitTemplateArgs();
1889 if (
auto *ME = dyn_cast<MemberExpr>(E.
get()))
1890 return !ME->hasExplicitTemplateArgs();
1892 if (
auto *DSDRE = dyn_cast<DependentScopeDeclRefExpr>(E.
get()))
1893 return !DSDRE->hasExplicitTemplateArgs();
1894 if (
auto *DSME = dyn_cast<CXXDependentScopeMemberExpr>(E.
get()))
1895 return !DSME->hasExplicitTemplateArgs();
1914 diagnoseIgnoredQualifiers(
unsigned DiagID,
unsigned Quals,
1922 static bool adjustContextForLocalExternDecl(
DeclContext *&DC);
1923 void DiagnoseFunctionSpecifiers(
const DeclSpec &DS);
1924 NamedDecl *getShadowedDeclaration(
const TypedefNameDecl *D,
1929 void CheckShadow(
Scope *S, VarDecl *D);
1940 llvm::DenseMap<const NamedDecl *, const NamedDecl *> ShadowingDecls;
1944 void handleTagNumbering(
const TagDecl *Tag,
Scope *TagScope);
1945 void setTagNameForLinkagePurposes(
TagDecl *TagFromDeclSpec,
1946 TypedefNameDecl *NewTD);
1947 void CheckTypedefForVariablyModifiedType(
Scope *S, TypedefNameDecl *D);
1963 bool CheckVariableDeclaration(VarDecl *NewVD,
LookupResult &Previous);
1964 void CheckVariableDeclarationType(VarDecl *NewVD);
1965 bool DeduceVariableDeclarationType(VarDecl *VDecl,
bool DirectInit,
1967 void CheckCompleteVariableDeclaration(VarDecl *VD);
1969 void MaybeSuggestAddingStaticToDecl(
const FunctionDecl *D);
1978 bool CheckConstexprFunctionDecl(
const FunctionDecl *FD);
1979 bool CheckConstexprFunctionBody(
const FunctionDecl *FD,
Stmt *Body);
1987 bool CheckFunctionDeclaration(
Scope *S,
1989 bool IsMemberSpecialization);
1990 bool shouldLinkDependentDeclWithPrevious(
Decl *D,
Decl *OldDecl);
1993 void CheckMain(FunctionDecl *FD,
const DeclSpec &D);
1994 void CheckMSVCRTEntryPoint(FunctionDecl *FD);
1995 Attr *getImplicitCodeSegOrSectionAttrForFunction(
const FunctionDecl *FD,
bool IsDefinition);
2004 void ActOnParamDefaultArgument(
Decl *param,
2007 void ActOnParamUnparsedDefaultArgument(
Decl *param,
2014 void AddInitializerToDecl(
Decl *dcl,
Expr *init,
bool DirectInit);
2015 void ActOnUninitializedDecl(
Decl *dcl);
2016 void ActOnInitializerError(
Decl *Dcl);
2019 void ActOnCXXForRangeDecl(
Decl *D);
2026 void CheckStaticLocalForDllExport(VarDecl *VD);
2027 void FinalizeDeclaration(
Decl *D);
2028 DeclGroupPtrTy FinalizeDeclaratorGroup(
Scope *S,
const DeclSpec &DS,
2034 void ActOnDocumentableDecl(
Decl *D);
2039 void CheckForFunctionRedefinition(
2040 FunctionDecl *FD,
const FunctionDecl *EffectiveDefinition =
nullptr,
2047 void ActOnStartOfObjCMethodDef(
Scope *S,
Decl *D);
2049 return D && isa<ObjCMethodDecl>(D);
2060 bool canDelayFunctionBody(
const Declarator &D);
2069 bool canSkipFunctionBody(
Decl *D);
2073 Decl *ActOnFinishFunctionBody(Decl *Decl,
Stmt *Body,
bool IsInstantiation);
2074 Decl *ActOnSkippedFunctionBody(Decl *Decl);
2075 void ActOnFinishInlineFunctionDef(FunctionDecl *D);
2079 void ActOnFinishDelayedAttribute(Scope *S, Decl *D,
ParsedAttributes &Attrs);
2092 void DiagnoseInvalidJumps(
Stmt *Body);
2093 Decl *ActOnFileScopeAsmDecl(
Expr *
expr,
2139 void createImplicitModuleImportForErrorRecovery(
SourceLocation Loc,
2148 ExplicitSpecialization,
2149 PartialSpecialization
2162 Decl *ActOnFinishExportDecl(Scope *S, Decl *
ExportDecl,
2178 return getPrintingPolicy(Context, PP);
2187 void ActOnTranslationUnitScope(Scope *S);
2193 bool IsExplicitInstantiation,
2196 Decl *BuildAnonymousStructOrUnion(Scope *S,
DeclSpec &DS,
2201 Decl *BuildMicrosoftCAnonymousStruct(Scope *S,
DeclSpec &DS,
2222 bool isAcceptableTagRedeclaration(
const TagDecl *Previous,
2234 Decl *ActOnTag(Scope *S,
unsigned TagSpec,
TagUseKind TUK,
2240 bool ScopedEnumUsesClassTag,
TypeResult UnderlyingType,
2241 bool IsTypeSpecifier,
bool IsTemplateParamOrArg,
2244 Decl *ActOnTemplatedFriendTag(Scope *S,
SourceLocation FriendLoc,
2271 Expr *BitfieldWidth,
2279 bool Mutable,
Expr *BitfieldWidth,
2285 bool CheckNontrivialField(
FieldDecl *FD);
2293 TAH_ConsiderTrivialABI
2298 bool Diagnose =
false);
2314 void ActOnTagStartDefinition(Scope *S, Decl *
TagDecl);
2319 bool ActOnDuplicateDefinition(
DeclSpec &DS, Decl *Prev,
2325 SkippedDefinitionContext ActOnTagStartSkippedDefinition(Scope *S, Decl *TD);
2327 Decl *ActOnObjCContainerStartDefinition(Decl *IDecl);
2332 void ActOnStartCXXMemberDeclarations(Scope *S, Decl *
TagDecl,
2334 bool IsFinalSpelledSealed,
2339 void ActOnTagFinishDefinition(Scope *S, Decl *
TagDecl,
2342 void ActOnTagFinishSkippedDefinition(SkippedDefinitionContext Context);
2344 void ActOnObjCContainerFinishDefinition();
2350 void ActOnObjCTemporaryExitContainerContext(
DeclContext *DC);
2351 void ActOnObjCReenterContainerContext(
DeclContext *DC);
2355 void ActOnTagDefinitionError(Scope *S, Decl *
TagDecl);
2363 bool CheckEnumRedeclaration(
SourceLocation EnumLoc,
bool IsScoped,
2364 QualType EnumUnderlyingTy,
bool IsFixed,
2372 Decl *ActOnEnumConstant(Scope *S, Decl *
EnumDecl, Decl *LastEnumConstant,
2384 void PopDeclContext();
2388 void EnterDeclaratorContext(Scope *S,
DeclContext *DC);
2389 void ExitDeclaratorContext(Scope *S);
2392 void ActOnReenterFunctionContext(Scope* S, Decl* D);
2393 void ActOnExitFunctionContext();
2400 FunctionDecl *getCurFunctionDecl();
2410 NamedDecl *getCurFunctionOrMethodDecl();
2413 void PushOnScopeChains(
NamedDecl *D, Scope *S,
bool AddToContext =
true);
2431 bool AllowInlineNamespace =
false);
2435 static Scope *getScopeForDeclContext(Scope *S,
DeclContext *DC);
2440 bool isIncompatibleTypedef(
TypeDecl *Old, TypedefNameDecl *New);
2462 VersionTuple Introduced,
2463 VersionTuple Deprecated,
2464 VersionTuple Obsoleted,
2467 bool IsStrict, StringRef Replacement,
2469 unsigned AttrSpellingListIndex);
2470 TypeVisibilityAttr *mergeTypeVisibilityAttr(Decl *D,
SourceRange Range,
2471 TypeVisibilityAttr::VisibilityType Vis,
2472 unsigned AttrSpellingListIndex);
2473 VisibilityAttr *mergeVisibilityAttr(Decl *D,
SourceRange Range,
2474 VisibilityAttr::VisibilityType Vis,
2475 unsigned AttrSpellingListIndex);
2476 UuidAttr *mergeUuidAttr(Decl *D,
SourceRange Range,
2477 unsigned AttrSpellingListIndex, StringRef Uuid);
2478 DLLImportAttr *mergeDLLImportAttr(Decl *D,
SourceRange Range,
2479 unsigned AttrSpellingListIndex);
2480 DLLExportAttr *mergeDLLExportAttr(Decl *D,
SourceRange Range,
2481 unsigned AttrSpellingListIndex);
2483 mergeMSInheritanceAttr(Decl *D,
SourceRange Range,
bool BestCase,
2484 unsigned AttrSpellingListIndex,
2485 MSInheritanceAttr::Spelling SemanticSpelling);
2486 FormatAttr *mergeFormatAttr(Decl *D,
SourceRange Range,
2488 int FirstArg,
unsigned AttrSpellingListIndex);
2489 SectionAttr *mergeSectionAttr(Decl *D,
SourceRange Range, StringRef Name,
2490 unsigned AttrSpellingListIndex);
2491 CodeSegAttr *mergeCodeSegAttr(Decl *D,
SourceRange Range, StringRef Name,
2492 unsigned AttrSpellingListIndex);
2493 AlwaysInlineAttr *mergeAlwaysInlineAttr(Decl *D,
SourceRange Range,
2495 unsigned AttrSpellingListIndex);
2496 MinSizeAttr *mergeMinSizeAttr(Decl *D,
SourceRange Range,
2497 unsigned AttrSpellingListIndex);
2498 OptimizeNoneAttr *mergeOptimizeNoneAttr(Decl *D,
SourceRange Range,
2499 unsigned AttrSpellingListIndex);
2500 InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D,
const ParsedAttr &AL);
2501 InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D,
2502 const InternalLinkageAttr &AL);
2503 CommonAttr *mergeCommonAttr(Decl *D,
const ParsedAttr &AL);
2504 CommonAttr *mergeCommonAttr(Decl *D,
const CommonAttr &AL);
2506 void mergeDeclAttributes(
NamedDecl *New, Decl *Old,
2508 void MergeTypedefNameDecl(Scope *S, TypedefNameDecl *New,
2510 bool MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&Old, Scope *S,
2511 bool MergeTypeWithOld);
2512 bool MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old,
2513 Scope *S,
bool MergeTypeWithOld);
2515 void MergeVarDecl(VarDecl *New,
LookupResult &Previous);
2516 void MergeVarDeclTypes(VarDecl *New, VarDecl *Old,
bool MergeTypeWithOld);
2517 void MergeVarDeclExceptionSpecs(VarDecl *New, VarDecl *Old);
2518 bool checkVarDeclRedefinition(VarDecl *OldDefn, VarDecl *NewDefn);
2520 bool MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old, Scope *S);
2532 AA_Passing_CFAudited
2553 bool IsForUsingDecl);
2554 bool IsOverload(FunctionDecl *New, FunctionDecl *Old,
bool IsForUsingDecl,
2555 bool ConsiderCudaAttrs =
true);
2562 bool isFunctionConsideredUnavailable(FunctionDecl *FD);
2566 bool SuppressUserConversions,
2568 bool InOverloadResolution,
2570 bool AllowObjCWritebackConversion);
2576 bool InOverloadResolution,
2577 QualType& ConvertedType,
bool &IncompatibleObjC);
2579 QualType& ConvertedType,
bool &IncompatibleObjC);
2586 unsigned *ArgPos =
nullptr);
2592 bool CheckPointerConversion(
Expr *From,
QualType ToType,
2594 CXXCastPath& BasePath,
2595 bool IgnoreBaseAccess,
2596 bool Diagnose =
true);
2598 bool InOverloadResolution,
2600 bool CheckMemberPointerConversion(
Expr *From,
QualType ToType,
2602 CXXCastPath &BasePath,
2603 bool IgnoreBaseAccess);
2605 bool CStyle,
bool &ObjCLifetimeConversion);
2608 bool DiagnoseMultipleUserDefinedConversion(
Expr *From,
QualType ToType);
2612 const VarDecl *NRVOCandidate,
2615 bool AllowNRVO =
true);
2622 bool TopLevelOfInitList =
false,
2623 bool AllowExplicit =
false);
2658 bool SuppressConversion =
false)
2659 : Suppress(Suppress), SuppressConversion(SuppressConversion) {}
2701 bool AllowScopedEnumerations;
2705 bool Suppress,
bool SuppressConversion)
2707 AllowScopedEnumerations(AllowScopedEnumerations) {}
2714 return diagnoseNotInt(S, Loc, T);
2724 ExprResult PerformContextualImplicitConversion(
2760 void AddOverloadCandidate(FunctionDecl *Function,
DeclAccessPair FoundDecl,
2763 bool SuppressUserConversions =
false,
2764 bool PartialOverloading =
false,
2765 bool AllowExplicit =
false,
2767 ConversionSequenceList EarlyConversions = None);
2772 bool SuppressUserConversions =
false,
2773 bool PartialOverloading =
false,
2774 bool FirstArgumentIsBase =
false);
2780 bool SuppressUserConversion =
false);
2787 bool SuppressUserConversions =
false,
2788 bool PartialOverloading =
false,
2789 ConversionSequenceList EarlyConversions = None);
2798 bool SuppressUserConversions =
false,
2799 bool PartialOverloading =
false);
2800 void AddTemplateOverloadCandidate(
2804 bool PartialOverloading =
false,
2805 ADLCallKind IsADLCandidate = ADLCallKind::NotADL);
2810 ConversionSequenceList &Conversions,
2811 bool SuppressUserConversions,
2815 ObjectClassification = {});
2821 bool AllowObjCConversionOnExplicit,
2822 bool AllowResultConversion =
true);
2828 bool AllowObjCConversionOnExplicit,
2829 bool AllowResultConversion =
true);
2842 bool IsAssignmentOperator =
false,
2843 unsigned NumContextualBoolArguments = 0);
2852 bool PartialOverloading =
false);
2855 void NoteOverloadCandidate(
NamedDecl *Found, FunctionDecl *Fn,
2857 bool TakingAddress =
false);
2862 bool TakingAddress =
false);
2867 bool MissingImplicitThis =
false);
2871 std::pair<Expr *, std::string> findFailedBooleanCondition(
Expr *Cond);
2880 bool diagnoseArgDependentDiagnoseIfAttrs(
const FunctionDecl *Function,
2881 const Expr *ThisArg,
2892 bool diagnoseArgIndependentDiagnoseIfAttrs(
const NamedDecl *ND,
2900 bool Complain =
false,
2912 ResolveAddressOfOverloadedFunction(
Expr *AddressOfExpr,
2916 bool *pHadMultipleCandidates =
nullptr);
2919 resolveAddressOfOnlyViableOverloadCandidate(
Expr *E,
2922 bool resolveAndFixAddressOfOnlyViableOverloadCandidate(
2923 ExprResult &SrcExpr,
bool DoFunctionPointerConversion =
false);
2926 ResolveSingleFunctionTemplateSpecialization(
OverloadExpr *ovl,
2927 bool Complain =
false,
2930 bool ResolveAndFixSingleFunctionTemplateSpecialization(
2932 bool DoFunctionPointerConverion =
false,
2933 bool Complain =
false,
2936 unsigned DiagIDForComplaining = 0);
2939 Expr *FixOverloadedFunctionReference(
Expr *E,
2949 bool PartialOverloading =
false);
2956 FRS_DiagnosticIssued
2972 bool AllowTypoCorrection=
true,
2973 bool CalleesAddressIsTaken=
false);
2983 Expr *input,
bool RequiresADL =
true);
2989 bool RequiresADL =
true);
2996 BuildCallToMemberFunction(Scope *S,
Expr *MemExpr,
3007 bool *NoArrowOperatorFound =
nullptr);
3017 bool CheckParameterNames);
3018 void CheckCXXDefaultArguments(FunctionDecl *FD);
3019 void CheckExtraCXXDefaultArguments(
Declarator &D);
3020 Scope *getNonFieldDeclScope(Scope *S);
3054 LookupOrdinaryName = 0,
3102 NotForRedeclaration = 0,
3109 ForExternalRedeclaration
3117 if (cast<Decl>(CurContext)
3118 ->getOwningModuleForLinkage(
true))
3119 return ForVisibleRedeclaration;
3120 return ForExternalRedeclaration;
3154 typedef std::function<ExprResult(Sema &, TypoExpr *, TypoCorrection)>
3160 struct TypoExprState {
3161 std::unique_ptr<TypoCorrectionConsumer> Consumer;
3162 TypoDiagnosticGenerator DiagHandler;
3165 TypoExprState(TypoExprState &&other) noexcept;
3166 TypoExprState &operator=(TypoExprState &&other) noexcept;
3170 llvm::MapVector<TypoExpr *, TypoExprState> DelayedTypos;
3173 TypoExpr *createDelayedTypo(std::unique_ptr<TypoCorrectionConsumer> TCC,
3174 TypoDiagnosticGenerator TDG,
3181 llvm::MapVector<NamespaceDecl*, bool> KnownNamespaces;
3185 bool LoadedExternalKnownNamespaces;
3190 std::unique_ptr<TypoCorrectionConsumer>
3194 std::unique_ptr<CorrectionCandidateCallback> CCC,
3197 bool ErrorRecovery);
3200 const TypoExprState &getTypoExprState(
TypoExpr *TE)
const;
3203 void clearDelayedTypo(
TypoExpr *TE);
3214 = NotForRedeclaration);
3216 bool AllowBuiltinCreation =
false);
3218 bool InUnqualifiedLookup =
false);
3222 bool AllowBuiltinCreation =
false,
3223 bool EnteringContext =
false);
3226 = NotForRedeclaration);
3237 CXXConstructorDecl *LookupDefaultConstructor(
CXXRecordDecl *Class);
3238 CXXConstructorDecl *LookupCopyingConstructor(
CXXRecordDecl *Class,
3241 bool RValueThis,
unsigned ThisQuals);
3242 CXXConstructorDecl *LookupMovingConstructor(
CXXRecordDecl *Class,
3245 bool RValueThis,
unsigned ThisQuals);
3253 bool AllowStringTemplate,
3254 bool DiagnoseMissing);
3255 bool isKnownName(StringRef name);
3262 bool IncludeGlobalScope =
true,
3263 bool LoadExternal =
true);
3266 bool IncludeGlobalScope =
true,
3267 bool IncludeDependentBases =
false,
3268 bool LoadExternal =
true);
3278 std::unique_ptr<CorrectionCandidateCallback> CCC,
3281 bool EnteringContext =
false,
3283 bool RecordFailure =
true);
3288 std::unique_ptr<CorrectionCandidateCallback> CCC,
3289 TypoDiagnosticGenerator TDG,
3292 bool EnteringContext =
false,
3310 CorrectDelayedTyposInExpr(
Expr *E, VarDecl *InitDecl =
nullptr,
3317 return CorrectDelayedTyposInExpr(E,
nullptr,
Filter);
3330 return CorrectDelayedTyposInExpr(ER,
nullptr,
Filter);
3335 bool ErrorRecovery =
true);
3340 bool ErrorRecovery =
true);
3342 void MarkTypoCorrectedFunctionDefinition(
const NamedDecl *F);
3344 void FindAssociatedClassesAndNamespaces(
SourceLocation InstantiationLoc,
3346 AssociatedNamespaceSet &AssociatedNamespaces,
3347 AssociatedClassSet &AssociatedClasses);
3350 bool ConsiderLinkage,
bool AllowInlineNamespace);
3361 Scope *S,
bool ForRedeclaration,
3365 void AddKnownFunctionAttributes(FunctionDecl *FD);
3369 void ProcessPragmaWeak(Scope *S, Decl *D);
3371 void ProcessDeclAttributes(Scope *S, Decl *D,
const Declarator &PD);
3373 void ProcessDeclAttributeDelayed(Decl *D,
3376 bool IncludeCXX11Attributes =
true);
3380 void checkUnusedDeclAttributes(
Declarator &D);
3386 bool isValidPointerAttrType(
QualType T,
bool RefOkay =
false);
3388 bool CheckRegparmAttr(
const ParsedAttr &attr,
unsigned &value);
3390 const FunctionDecl *FD =
nullptr);
3391 bool CheckAttrTarget(
const ParsedAttr &CurrAttr);
3392 bool CheckAttrNoArgs(
const ParsedAttr &CurrAttr);
3393 bool checkStringLiteralArgumentAttr(
const ParsedAttr &
Attr,
unsigned ArgNum,
3398 bool checkMSInheritanceAttrOnDefinition(
3400 MSInheritanceAttr::Spelling SemanticSpelling);
3402 void CheckAlignasUnderalignment(Decl *D);
3413 bool hasExplicitCallingConv(
QualType &T);
3426 bool IsProtocolMethodDecl);
3430 bool IsProtocolMethodDecl);
3436 bool IsProtocolMethodDecl);
3448 void ImplMethodsVsClassMethods(Scope *S,
ObjCImplDecl* IMPDecl,
3450 bool IncompleteImpl =
false);
3454 void DiagnoseUnimplementedProperties(Scope *S,
ObjCImplDecl* IMPDecl,
3456 bool SynthesizeProperties);
3459 void diagnoseNullResettableSynthesizedSetters(
const ObjCImplDecl *impDecl);
3463 void DefaultSynthesizeProperties(Scope *S,
ObjCImplDecl *IMPDecl,
3466 void DefaultSynthesizeProperties(Scope *S, Decl *D,
SourceLocation AtEnd);
3476 void DiagnoseUnusedBackingIvarInAccessor(Scope *S,
3495 const bool isReadWrite,
3496 unsigned &Attributes,
3497 const unsigned AttributesAsWritten,
3513 const bool isReadWrite,
3514 const unsigned Attributes,
3515 const unsigned AttributesAsWritten,
3524 void AtomicPropertySetterGetterRules(
ObjCImplDecl* IMPDecl,
3529 void DiagnoseMissingDesignatedInitOverrides(
3548 void MatchAllMethodDeclarations(
const SelectorSet &InsMap,
3549 const SelectorSet &ClsMap,
3550 SelectorSet &InsMapSeen,
3551 SelectorSet &ClsMapSeen,
3554 bool &IncompleteImpl,
3555 bool ImmediateClass,
3556 bool WarnCategoryMethodImpl=
false);
3569 void AddMethodToGlobalPool(
ObjCMethodDecl *Method,
bool impl,
bool instance);
3574 bool receiverIdOrClass,
3584 CollectMultipleMethodsInGlobalPool(
Selector Sel,
3586 bool InstanceFirst,
bool CheckTheOther,
3597 bool receiverIdOrClass);
3609 bool RecordFailure =
true) {
3611 TypoCorrectionFailures[Typo].insert(TypoLoc);
3621 AddMethodToGlobalPool(Method, impl,
true);
3626 AddMethodToGlobalPool(Method, impl,
false);
3631 void AddAnyMethodToGlobalPool(Decl *D);
3636 bool receiverIdOrClass=
false) {
3637 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
3644 bool receiverIdOrClass=
false) {
3645 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
3692 return FullExprArg(ActOnFinishFullExpr(Arg, CC).
get());
3705 bool HasLeadingEmptyMacro =
false);
3707 void ActOnStartOfCompoundStmt(
bool IsStmtExpr);
3708 void ActOnFinishOfCompoundStmt();
3720 S.ActOnFinishOfCompoundStmt();
3739 StmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
3742 void ActOnForEachDeclStmt(DeclGroupPtrTy Decl);
3748 void ActOnCaseStmtBody(Stmt *
CaseStmt, Stmt *SubStmt);
3752 Stmt *SubStmt, Scope *CurScope);
3773 Stmt *Switch, Stmt *Body);
3790 Stmt *First,
Expr *collection,
3792 StmtResult FinishObjCForCollectionStmt(Stmt *ForCollection, Stmt *Body);
3816 Stmt *RangeDecl, Stmt *
Begin, Stmt *
End,
3821 StmtResult FinishCXXForRangeStmt(Stmt *ForRange, Stmt *Body);
3832 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
3835 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
3839 void ActOnCapturedRegionError();
3842 unsigned NumParams);
3846 CES_AllowParameters = 1,
3847 CES_AllowDifferentTypes = 2,
3848 CES_AllowExceptionVariables = 4,
3849 CES_FormerDefault = (CES_AllowParameters),
3850 CES_Default = (CES_AllowParameters | CES_AllowDifferentTypes),
3851 CES_AsIfByStdMove = (CES_AllowParameters | CES_AllowDifferentTypes |
3852 CES_AllowExceptionVariables),
3855 VarDecl *getCopyElisionCandidate(
QualType ReturnType,
Expr *E,
3857 bool isCopyElisionCandidate(
QualType ReturnType,
const VarDecl *VD,
3866 bool IsVolatile,
unsigned NumOutputs,
3872 void FillInlineAsmIdentifierInfo(
Expr *Res,
3873 llvm::InlineAsmIdentifierInfo &Info);
3877 bool IsUnevaluatedContext);
3878 bool LookupInlineAsmField(StringRef
Base, StringRef Member,
3880 ExprResult LookupInlineAsmVarDeclField(
Expr *RefExpr, StringRef Member,
3884 StringRef AsmString,
3885 unsigned NumOutputs,
unsigned NumInputs,
3890 LabelDecl *GetOrCreateMSAsmLabel(StringRef ExternalLabelName,
3897 bool Invalid =
false);
3899 Decl *ActOnObjCExceptionDecl(Scope *S,
Declarator &D);
3902 Decl *Parm, Stmt *Body);
3920 VarDecl *BuildExceptionDeclaration(Scope *S,
TypeSourceInfo *TInfo,
3925 Decl *ActOnExceptionDeclarator(Scope *S,
Declarator &D);
3928 Decl *ExDecl, Stmt *HandlerBlock);
3938 void ActOnStartSEHFinallyBlock();
3939 void ActOnAbortSEHFinallyBlock();
3943 void DiagnoseReturnInConstructorExceptionHandler(
CXXTryStmt *TryBlock);
3945 bool ShouldWarnIfUnusedFileScopedDecl(
const DeclaratorDecl *D)
const;
3949 void MarkUnusedFileScopedDecl(
const DeclaratorDecl *D);
3953 void DiagnoseUnusedExprResult(
const Stmt *S);
3954 void DiagnoseUnusedNestedTypedefs(
const RecordDecl *D);
3955 void DiagnoseUnusedDecl(
const NamedDecl *ND);
3969 void DiagnoseEmptyLoopBody(
const Stmt *S,
3970 const Stmt *PossibleBody);
3973 void DiagnoseSelfMove(
const Expr *LHSExpr,
const Expr *RHSExpr,
3978 void diagnoseNullableToNonnullConversion(
QualType DstType,
QualType SrcType,
3987 void PopParsingDeclaration(ParsingDeclState
state, Decl *
decl);
4001 bool ObjCPropertyAccess,
4002 bool AvoidPartialAvailabilityChecks =
false,
4006 UnavailableAttr::ImplicitReason reason);
4009 void DiagnoseUnguardedAvailabilityViolations(Decl *FD);
4014 bool CanUseDecl(
NamedDecl *D,
bool TreatUnavailableAsInvalid);
4017 bool ObjCPropertyAccess =
false,
4018 bool AvoidPartialAvailabilityChecks =
false,
4020 void NoteDeletedFunction(FunctionDecl *FD);
4021 void NoteDeletedInheritingConstructor(CXXConstructorDecl *CD);
4022 std::string getDeletedOrUnavailableSuffix(
const FunctionDecl *FD);
4029 void PushExpressionEvaluationContext(
4032 ExpressionEvaluationContextRecord::EK_Other);
4034 void PushExpressionEvaluationContext(
4037 ExpressionEvaluationContextRecord::EK_Other);
4038 void PopExpressionEvaluationContext();
4040 void DiscardCleanupsInEvaluationContext();
4059 void MarkAnyDeclReferenced(
SourceLocation Loc, Decl *D,
bool MightBeOdrUse);
4060 void MarkFunctionReferenced(
SourceLocation Loc, FunctionDecl *Func,
4061 bool MightBeOdrUse =
true);
4066 void UpdateMarkingForLValueToRValue(
Expr *E);
4067 void CleanupVarDeclMarking();
4110 const unsigned *
const FunctionScopeIndexToStopAt);
4128 void MarkDeclarationsReferencedInExpr(
Expr *E,
4129 bool SkipLocalVariables =
false);
4135 bool ForceComplain =
false,
4136 bool (*IsPlausibleResult)(
QualType) =
nullptr);
4139 bool tryExprAsCall(
Expr &E,
QualType &ZeroArgCallReturnTy,
4149 bool DiagRuntimeBehavior(
SourceLocation Loc,
const Stmt *Statement,
4157 UnqualifiedId &Id,
bool HasTrailingLParen,
bool IsAddressOfOperand,
4158 std::unique_ptr<CorrectionCandidateCallback> CCC =
nullptr,
4159 bool IsInlineAsmIdentifier =
false,
Token *KeywordReplacement =
nullptr);
4168 std::unique_ptr<CorrectionCandidateCallback> CCC,
4174 bool AllowBuiltinCreation=
false);
4179 bool isAddressOfOperand,
4193 BuildAnonymousStructUnionMemberReference(
4198 Expr *baseObjectExpr =
nullptr,
4210 bool IsDefiniteInstance,
4212 bool UseArgumentDependentLookup(
const CXXScopeSpec &SS,
4214 bool HasTrailingLParen);
4219 bool IsAddressOfOperand,
const Scope *S,
4230 bool AcceptInvalidDecl =
false);
4235 bool AcceptInvalidDecl =
false);
4252 Scope *UDLScope =
nullptr);
4261 Scope *UDLScope =
nullptr);
4266 Expr *ControllingExpr,
4272 Expr *ControllingExpr,
4284 bool isQualifiedMemberAccess(
Expr *E);
4296 bool IsType,
void *TyOrEx,
4300 bool CheckVecStepExpr(
Expr *E);
4306 ExprResult ActOnSizeofParameterPackExpr(Scope *S,
4348 bool SuppressQualifierCheck =
false,
4359 bool CheckQualifiedMemberReference(
Expr *BaseExpr,
QualType BaseType,
4379 void ActOnDefaultCtorInitializers(Decl *CDtorDecl);
4381 FunctionDecl *FDecl,
4385 bool ExecConfig =
false);
4388 const Expr *ArgExpr);
4395 Expr *ExecConfig =
nullptr,
4396 bool IsExecConfig =
false);
4400 Expr *Config =
nullptr,
bool IsExecConfig =
false,
4421 ExprResult MaybeConvertParenListExprToParenExpr(Scope *S,
Expr *ME);
4465 void ActOnStartStmtExpr();
4468 void ActOnStmtExprError();
4506 bool CheckCaseExpression(
Expr *E);
4525 CheckMicrosoftIfExistsSymbol(Scope *S,
CXXScopeSpec &SS,
4529 CheckMicrosoftIfExistsSymbol(Scope *S,
SourceLocation KeywordLoc,
4600 llvm::SmallBitVector FullyCheckedComparisonCategories;
4629 bool isInitListConstructor(
const FunctionDecl *Ctor);
4631 Decl *ActOnUsingDirective(Scope *CurScope,
SourceLocation UsingLoc,
4639 Decl *ActOnNamespaceAliasDef(Scope *CurScope,
4656 bool HasTypenameKeyword,
4674 bool CheckInheritingConstructorUsingDecl(
UsingDecl *UD);
4679 CXXConstructorDecl *
4680 findInheritingConstructor(
SourceLocation Loc, CXXConstructorDecl *BaseCtor,
4702 bool HadMultipleCandidates,
bool IsListInitialization,
4703 bool IsStdInitListInitialization,
4704 bool RequiresZeroInit,
unsigned ConstructKind,
4711 CXXConstructorDecl *Constructor,
bool Elidable,
4713 bool HadMultipleCandidates,
bool IsListInitialization,
4714 bool IsStdInitListInitialization,
4715 bool RequiresZeroInit,
unsigned ConstructKind,
4723 CXXConstructorDecl *Constructor,
bool Elidable,
4725 bool IsListInitialization,
4726 bool IsStdInitListInitialization,
bool RequiresZeroInit,
4734 bool CheckCXXDefaultArgExpr(
SourceLocation CallLoc, FunctionDecl *FD,
4745 void FinalizeVarWithDestructor(VarDecl *VD,
const RecordType *DeclInitType);
4759 llvm::SmallPtrSet<CanQualType, 4> ExceptionsSeen;
4762 void ClearExceptions() {
4763 ExceptionsSeen.clear();
4777 "noexcept(expr) should not be a possible result");
4782 unsigned size()
const {
return Exceptions.size(); }
4791 void CalledExpr(
Expr *E);
4797 ESI.
Type = getExceptionSpecType();
4806 tok::kw_false).
get();
4828 ComputeDefaultedCopyAssignmentExceptionSpec(
CXXMethodDecl *MD);
4838 ComputeDefaultedMoveAssignmentExceptionSpec(
CXXMethodDecl *MD);
4849 CXXConstructorDecl *CD);
4862 void checkExceptionSpecification(
bool IsTopLevel,
4872 bool isLibstdcxxEagerExceptionSpecHack(
const Declarator &D);
4877 void actOnDelayedExceptionSpecification(Decl *Method,
4882 Expr *NoexceptExpr);
4890 bool Diagnose =
false);
4898 CXXConstructorDecl *DeclareImplicitDefaultConstructor(
4903 void DefineImplicitDefaultConstructor(
SourceLocation CurrentLocation,
4904 CXXConstructorDecl *Constructor);
4927 CXXConstructorDecl *Constructor);
4935 CXXConstructorDecl *DeclareImplicitCopyConstructor(
CXXRecordDecl *ClassDecl);
4939 void DefineImplicitCopyConstructor(
SourceLocation CurrentLocation,
4940 CXXConstructorDecl *Constructor);
4949 CXXConstructorDecl *DeclareImplicitMoveConstructor(
CXXRecordDecl *ClassDecl);
4953 void DefineImplicitMoveConstructor(
SourceLocation CurrentLocation,
4954 CXXConstructorDecl *Constructor);
4965 void DefineImplicitCopyAssignment(
SourceLocation CurrentLocation,
4978 void DefineImplicitMoveAssignment(
SourceLocation CurrentLocation,
4983 void ForceDeclarationOfImplicitMembers(
CXXRecordDecl *Class);
4986 void CheckImplicitSpecialMemberDeclaration(Scope *S, FunctionDecl *FD);
4990 bool isImplicitlyDeleted(FunctionDecl *FD);
4996 bool checkThisInStaticMemberFunctionType(
CXXMethodDecl *Method);
5000 bool checkThisInStaticMemberFunctionExceptionSpec(
CXXMethodDecl *Method);
5006 bool checkThisInStaticMemberFunctionAttributes(
CXXMethodDecl *Method);
5013 bool CompleteConstructorCall(CXXConstructorDecl *Constructor,
5017 bool AllowExplicit =
false,
5018 bool IsListInitialization =
false);
5026 bool EnteringContext);
5031 bool EnteringContext);
5125 bool Enabled =
true);
5145 bool CheckCXXThisCapture(
SourceLocation Loc,
bool Explicit =
false,
5146 bool BuildAndDiagnose =
true,
5147 const unsigned *
const FunctionScopeIndexToStopAt =
nullptr,
5148 bool ByCopy =
false);
5153 bool isThisOutsideMemberFunctionBody(
QualType BaseType);
5172 bool IsThrownVarInScope);
5183 bool ListInitialization);
5189 bool ListInitialization);
5211 bool isUnavailableAlignedAllocationFunction(
const FunctionDecl &FD)
const;
5215 void diagnoseUnavailableAlignedAllocation(
const FunctionDecl &FD,
5240 FunctionDecl *&OperatorNew,
5241 FunctionDecl *&OperatorDelete,
5242 bool Diagnose =
true);
5243 void DeclareGlobalNewDelete();
5249 bool Diagnose =
true);
5250 FunctionDecl *FindUsualDeallocationFunction(
SourceLocation StartLoc,
5251 bool CanProvideSize,
5254 FunctionDecl *FindDeallocationFunctionForDestructor(
SourceLocation StartLoc,
5259 bool UseGlobal,
bool ArrayForm,
5262 bool IsDelete,
bool CallCanBeVirtual,
5263 bool WarnOnNonAbstractTypes,
5305 ExprResult ActOnStartCXXMemberReference(Scope *S,
5310 bool &MayBePseudoDestructor);
5339 Expr *MaybeCreateExprWithCleanups(
Expr *SubExpr);
5340 Stmt *MaybeCreateStmtWithCleanups(Stmt *SubStmt);
5344 CreateMaterializeTemporaryExpr(
QualType T,
Expr *Temporary,
5345 bool BoundToLvalueReference);
5348 return ActOnFinishFullExpr(Expr, Expr ? Expr->
getExprLoc()
5352 bool DiscardedValue =
false,
5353 bool IsConstexpr =
false);
5361 bool EnteringContext =
false);
5362 bool isDependentScopeSpecifier(
const CXXScopeSpec &SS);
5388 bool isAcceptableNestedNameSpecifier(
const NamedDecl *SD,
5389 bool *CanCorrect =
nullptr);
5411 : ObjectType(ObjectType), Identifier(II), IdentifierLoc(IdLoc),
5412 CCLoc(ColonColonLoc) {
5417 : ObjectType(
ParsedType::make(ObjectType)), Identifier(II),
5418 IdentifierLoc(IdLoc), CCLoc(ColonColonLoc) {
5422 bool isNonTypeNestedNameSpecifier(Scope *S,
CXXScopeSpec &SS,
5425 bool BuildCXXNestedNameSpecifier(Scope *S,
5427 bool EnteringContext,
5430 bool ErrorRecoveryLookup,
5431 bool *IsCorrectedToColon =
nullptr,
5432 bool OnlyNamespace =
false);
5459 bool ActOnCXXNestedNameSpecifier(Scope *S,
5461 bool EnteringContext,
5463 bool ErrorRecoveryLookup =
false,
5464 bool *IsCorrectedToColon =
nullptr,
5465 bool OnlyNamespace =
false);
5469 bool ActOnCXXNestedNameSpecifierDecltype(
CXXScopeSpec &SS,
5473 bool IsInvalidUnlessNestedName(Scope *S,
CXXScopeSpec &SS,
5475 bool EnteringContext);
5500 bool ActOnCXXNestedNameSpecifier(Scope *S,
5503 TemplateTy TemplateName,
5509 bool EnteringContext);
5519 void *SaveNestedNameSpecifierAnnotation(
CXXScopeSpec &SS);
5531 void RestoreNestedNameSpecifierAnnotation(
void *Annotation,
5535 bool ShouldEnterDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
5543 bool ActOnCXXEnterDeclaratorScope(Scope *S,
CXXScopeSpec &SS);
5550 void ActOnCXXExitDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
5557 void ActOnCXXEnterDeclInitializer(Scope *S, Decl *Dcl);
5561 void ActOnCXXExitDeclInitializer(Scope *S, Decl *Dcl);
5566 bool KnownDependent,
5575 bool IsConstexprSpecified);
5583 bool ExplicitParams,
5584 bool ExplicitResultType,
5593 return ParsedType::make(buildLambdaInitCaptureInitialization(
5594 Loc, ByRef, Id, InitKind != LambdaCaptureInitKind::CopyInit, Init));
5598 bool DirectInit, Expr *&Init);
5608 unsigned InitStyle, Expr *Init);
5618 void addLambdaParameters(
5636 bool IsInstantiation =
false);
5648 bool DiagnoseUnusedLambdaCapture(
SourceRange CaptureRange,
5668 void DefineImplicitLambdaToFunctionPointerConversion(
5678 void DefineImplicitLambdaToBlockPointerConversion(
SourceLocation CurrentLoc,
5720 bool HadMultipleCandidates);
5734 bool WarnMultipleSelectors);
5747 Decl *ActOnStartLinkageSpecification(Scope *S,
5751 Decl *ActOnFinishLinkageSpecification(Scope *S,
5774 void ActOnStartCXXInClassMemberInitializer();
5775 void ActOnFinishCXXInClassMemberInitializer(Decl *VarDecl,
5825 bool SetDelegatingInitializer(CXXConstructorDecl *Constructor,
5828 bool SetCtorInitializers(CXXConstructorDecl *Constructor,
bool AnyErrors,
5843 typedef std::pair<CXXRecordDecl*, SourceLocation>
VTableUse;
5856 void LoadExternalVTableUses();
5861 bool DefinitionRequired =
false);
5878 bool DefineUsedVTables();
5880 void AddImplicitlyDeclaredMembersToClass(
CXXRecordDecl *ClassDecl);
5882 void ActOnMemInitializers(Decl *ConstructorDecl,
5893 void referenceDLLExportedClassMethods();
5895 void propagateDLLAttrToBaseClassTemplate(
5906 void ActOnFinishCXXMemberSpecification(Scope *S,
SourceLocation RLoc,
5910 void ActOnFinishCXXMemberDecls();
5911 void ActOnFinishCXXNonNestedClass(Decl *D);
5913 void ActOnReenterCXXMethodParameter(Scope *S,
ParmVarDecl *Param);
5914 unsigned ActOnReenterTemplateScope(Scope *S, Decl *Template);
5915 void ActOnStartDelayedMemberDeclarations(Scope *S, Decl *Record);
5916 void ActOnStartDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
5917 void ActOnDelayedCXXMethodParameter(Scope *S, Decl *Param);
5918 void ActOnFinishDelayedMemberDeclarations(Scope *S, Decl *Record);
5919 void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
5920 void ActOnFinishDelayedMemberInitializers(Decl *Record);
5921 void MarkAsLateParsedTemplate(FunctionDecl *FD, Decl *FnD,
5923 void UnmarkAsLateParsedTemplate(FunctionDecl *FD);
5924 bool IsInsideALocalClassWithinATemplateFunction();
5926 Decl *ActOnStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
5928 Expr *AssertMessageExpr,
5930 Decl *BuildStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
5939 Decl *ActOnFriendTypeDecl(Scope *S,
const DeclSpec &DS,
5946 void CheckConstructor(CXXConstructorDecl *Constructor);
5957 void CheckExplicitlyDefaultedSpecialMember(
CXXMethodDecl *MD);
5958 void CheckExplicitlyDefaultedMemberExceptionSpec(
CXXMethodDecl *MD,
5960 void CheckDelayedMemberExceptionSpecs();
5973 BaseResult ActOnBaseSpecifier(Decl *classdecl,
5983 void ActOnBaseSpecifiers(Decl *ClassDecl,
5995 CXXCastPath *BasePath =
nullptr,
5996 bool IgnoreAccess =
false);
5998 unsigned InaccessibleBaseID,
5999 unsigned AmbigiousBaseConvID,
6002 CXXCastPath *BasePath,
6003 bool IgnoreAccess =
false);
6005 std::string getAmbiguousPathsDisplayString(
CXXBasePaths &Paths);
6007 bool CheckOverridingFunctionAttributes(
const CXXMethodDecl *New,
6012 bool CheckOverridingFunctionReturnType(
const CXXMethodDecl *New,
6017 bool CheckOverridingFunctionExceptionSpec(
const CXXMethodDecl *New,
6023 void CheckOverrideControl(
NamedDecl *D);
6027 void DiagnoseAbsenceOfOverrideControl(
NamedDecl *D);
6032 bool CheckIfOverriddenFunctionIsMarkedFinal(
const CXXMethodDecl *New,
6047 bool SetMemberAccessSpecifier(
NamedDecl *MemberDecl,
6059 bool Diagnose =
true);
6061 CXXConstructorDecl *D,
6064 bool IsCopyBindingRefToTemp =
false);
6066 CXXConstructorDecl *D,
6092 bool ForceCheck =
false,
6093 bool ForceUnprivileged =
false);
6097 bool isSpecialMemberAccessibleForDeletion(
CXXMethodDecl *decl,
6103 void PerformDependentDiagnostics(
const DeclContext *Pattern,
6126 template <
typename... Ts>
6128 const Ts &...Args) {
6130 return RequireNonAbstractType(Loc, T, Diagnoser);
6139 bool CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl);
6141 bool CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl);
6147 bool AllowFunctionTemplates =
true);
6149 bool AllowFunctionTemplates =
true);
6152 QualType ObjectType,
bool EnteringContext,
6153 bool &MemberOfUnknownSpecialization,
6158 bool hasTemplateKeyword,
6161 bool EnteringContext,
6162 TemplateTy &Template,
6163 bool &MemberOfUnknownSpecialization);
6175 TemplateTy &SuggestedTemplate,
6178 bool DiagnoseUninstantiableTemplate(
SourceLocation PointOfInstantiation,
6180 bool InstantiatedFromMember,
6184 bool Complain =
true);
6186 void DiagnoseTemplateParameterShadow(
SourceLocation Loc, Decl *PrevDecl);
6189 NamedDecl *ActOnTypeParameter(Scope *S,
bool Typename,
6194 unsigned Depth,
unsigned Position,
6207 NamedDecl *ActOnTemplateTemplateParameter(Scope *S,
6219 ActOnTemplateParameterList(
unsigned Depth,
6225 Expr *RequiresClause);
6236 TPC_TypeAliasTemplate
6247 bool IsFriend,
bool &IsMemberSpecialization,
bool &Invalid);
6267 void NoteAllFoundTemplates(TemplateName Name);
6269 QualType CheckTemplateIdType(TemplateName Template,
6280 bool IsCtorOrDtorName =
false,
6281 bool IsClassName =
false);
6290 TemplateTy TemplateD,
6312 void diagnoseMissingTemplateArguments(TemplateName Name,
SourceLocation Loc);
6328 TemplateTy &Template,
bool AllowInjectedClassName =
false);
6339 unsigned NumExplicitArgs,
6341 void CheckTemplatePartialSpecialization(
6343 void CheckTemplatePartialSpecialization(
6346 Decl *ActOnTemplateDeclarator(Scope *S,
6358 bool CheckDependentFunctionTemplateSpecialization(FunctionDecl *FD,
6362 bool CheckFunctionTemplateSpecialization(
6382 DeclResult ActOnExplicitInstantiation(Scope *S,
6388 SubstDefaultTemplateArgumentIfAvailable(
TemplateDecl *Template,
6394 bool &HasDefaultArg);
6409 CTAK_DeducedFromArrayBound
6412 bool CheckTemplateArgument(
NamedDecl *Param,
6417 unsigned ArgumentPackIndex,
6449 bool PartialTemplateArgs,
6451 bool UpdateArgsWithConversions =
true);
6460 QualType InstantiatedParamType, Expr *Arg,
6505 TPL_TemplateTemplateArgumentMatch
6548 TemplateTy TemplateName,
6564 bool RebuildNestedNameSpecifierInCurrentInstantiation(
CXXScopeSpec &SS);
6566 ExprResult RebuildExprInCurrentInstantiation(Expr *E);
6567 bool RebuildTemplateParamsInCurrentInstantiation(
6585 bool isUnexpandedParameterPackPermitted();
6594 UPPC_Expression = 0,
6687 bool DiagnoseUnexpandedParameterPack(Expr *E,
6697 bool DiagnoseUnexpandedParameterPack(
const CXXScopeSpec &SS,
6720 TemplateName Template,
6871 bool &RetainExpansion,
6899 bool containsUnexpandedParameterPacks(
Declarator &D);
6931 bool AdjustExceptionSpec =
false);
6991 TDK_CUDATargetMismatch
7015 unsigned ArgIdx,
QualType OriginalArgType)
7016 : OriginalParamType(OriginalParamType),
7017 DecomposedParam(DecomposedParam), ArgIdx(ArgIdx),
7018 OriginalArgType(OriginalArgType) {}
7029 unsigned NumExplicitlySpecified, FunctionDecl *&Specialization,
7032 bool PartialOverloading =
false,
7033 llvm::function_ref<
bool()> CheckNonDependent = []{
return false; });
7039 bool PartialOverloading,
7046 FunctionDecl *&Specialization,
7048 bool IsAddressOfFunction =
false);
7059 FunctionDecl *&Specialization,
7061 bool IsAddressOfFunction =
false);
7076 DAR_FailedAlreadyDiagnosed
7085 void DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init);
7087 bool Diagnose =
true);
7091 void DeclareImplicitDeductionGuides(
TemplateDecl *Template,
7094 QualType DeduceTemplateSpecializationFromInitializer(
7103 TypeLoc getReturnTypeLoc(FunctionDecl *FD)
const;
7105 bool DeduceFunctionTypeFromReturnExpr(FunctionDecl *FD,
7113 unsigned NumCallArguments1,
7114 unsigned NumCallArguments2);
7125 getMoreSpecializedPartialSpecialization(
7140 bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
7146 llvm::SmallBitVector &
Used);
7149 llvm::SmallBitVector &Deduced) {
7150 return MarkDeducedTemplateParameters(Context, FunctionTemplate, Deduced);
7152 static void MarkDeducedTemplateParameters(
ASTContext &Ctx,
7154 llvm::SmallBitVector &Deduced);
7161 getTemplateInstantiationArgs(
NamedDecl *D,
7163 bool RelativeToPrimary =
false,
7164 const FunctionDecl *Pattern =
nullptr);
7259 assert(Kind != DeclaringSpecialMember);
7260 return {TemplateArgs, NumTemplateArgs};
7273 : Kind(TemplateInstantiation), Entity(nullptr), Template(nullptr),
7274 TemplateArgs(nullptr), NumTemplateArgs(0), DeductionInfo(nullptr) {}
7278 bool isInstantiationRecord()
const;
7334 unsigned LastEmittedCodeSynthesisContextDepth = 0;
7341 std::vector<std::unique_ptr<TemplateInstantiationCallback>>
7358 int OldSubstitutionIndex;
7362 : Self(Self), OldSubstitutionIndex(Self.ArgumentPackSubstitutionIndex) {
7371 friend class ArgumentPackSubstitutionRAII;
7378 typedef llvm::DenseMap<Decl *, SmallVector<PartialDiagnosticAt, 1> >
7498 bool AlreadyInstantiating;
7499 bool CheckInstantiationDepth(
SourceLocation PointOfInstantiation,
7505 Decl *Entity,
NamedDecl *Template =
nullptr,
7516 void popCodeSynthesisContext();
7520 return CodeSynthesisContexts.size() > NonInstantiationEntries;
7524 if (!CodeSynthesisContexts.empty() &&
7525 CodeSynthesisContexts.size() != LastEmittedCodeSynthesisContextDepth) {
7526 PrintInstantiationStack();
7527 LastEmittedCodeSynthesisContextDepth = CodeSynthesisContexts.size();
7529 if (PragmaAttributeCurrentTargetDecl)
7530 PrintPragmaAttributeInstantiationPoint();
7532 void PrintInstantiationStack();
7534 void PrintPragmaAttributeInstantiationPoint();
7549 assert(!ExprEvalContexts.empty() &&
7550 "Must be in an expression evaluation context");
7551 return ExprEvalContexts.back().isUnevaluated();
7559 unsigned PrevSFINAEErrors;
7560 bool PrevInNonInstantiationSFINAEContext;
7561 bool PrevAccessCheckingSFINAE;
7562 bool PrevLastDiagnosticIgnored;
7566 : SemaRef(SemaRef), PrevSFINAEErrors(SemaRef.NumSFINAEErrors),
7567 PrevInNonInstantiationSFINAEContext(
7568 SemaRef.InNonInstantiationSFINAEContext),
7569 PrevAccessCheckingSFINAE(SemaRef.AccessCheckingSFINAE),
7570 PrevLastDiagnosticIgnored(
7571 SemaRef.getDiagnostics().isLastDiagnosticIgnored())
7581 = PrevInNonInstantiationSFINAEContext;
7584 PrevLastDiagnosticIgnored);
7601 bool PrevDisableTypoCorrection;
7604 : SemaRef(SemaRef), Trap(SemaRef,
true),
7605 PrevDisableTypoCorrection(SemaRef.DisableTypoCorrection) {
7657 : S(S), Enabled(Enabled) {
7658 if (!Enabled)
return;
7666 S.DefineUsedVTables();
7667 S.PerformPendingInstantiations();
7672 if (!Enabled)
return;
7675 assert(S.VTableUses.empty() &&
7676 "VTableUses should be empty before it is discarded.");
7677 S.VTableUses.swap(SavedVTableUses);
7680 assert(S.PendingInstantiations.empty() &&
7681 "PendingInstantiations should be empty before it is discarded.");
7682 S.PendingInstantiations.swap(SavedPendingInstantiations);
7688 std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
7704 SavedPendingLocalImplicitInstantiations.swap(
7708 void perform() { S.PerformPendingInstantiations(
true); }
7711 assert(S.PendingLocalImplicitInstantiations.empty() &&
7712 "there shouldn't be any pending local implicit instantiations");
7713 SavedPendingLocalImplicitInstantiations.swap(
7714 S.PendingLocalImplicitInstantiations);
7719 std::deque<PendingImplicitInstantiation>
7720 SavedPendingLocalImplicitInstantiations;
7726 bool HasInteresting =
false;
7732 assert(Infos.size() <= index);
7733 Infos.resize(index);
7734 Infos.push_back(info);
7736 if (!HasInteresting)
7744 if (!HasInteresting)
return nullptr;
7745 Infos.resize(numParams);
7746 return Infos.data();
7750 void PerformPendingInstantiations(
bool LocalOnly =
false);
7755 bool AllowDeducedTST =
false);
7779 int indexAdjustment,
7781 bool ExpectParameterPack);
7820 bool CXXDirectInit);
7832 bool Complain =
true);
7839 bool InstantiateInClassInitializer(
7850 : TmplAttr(A), Scope(S), NewDecl(D)
7856 const Decl *Pattern, Decl *Inst,
7857 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7862 const Decl *Pattern, Decl *Inst,
7863 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7866 bool usesPartialOrExplicitSpecialization(
7870 InstantiateClassTemplateSpecialization(
SourceLocation PointOfInstantiation,
7873 bool Complain =
true);
7875 void InstantiateClassMembers(
SourceLocation PointOfInstantiation,
7880 void InstantiateClassTemplateSpecializationMembers(
7900 void InstantiateExceptionSpec(
SourceLocation PointOfInstantiation,
7901 FunctionDecl *Function);
7905 void InstantiateFunctionDefinition(
SourceLocation PointOfInstantiation,
7906 FunctionDecl *Function,
7907 bool Recursive =
false,
7908 bool DefinitionRequired =
false,
7909 bool AtEndOfTU =
false);
7916 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7922 BuildVariableInstantiation(VarDecl *NewVar, VarDecl *OldVar,
7924 LateInstantiatedAttrVec *LateAttrs,
7927 bool InstantiatingVarTemplate =
false);
7928 void InstantiateVariableInitializer(
7929 VarDecl *Var, VarDecl *OldVar,
7931 void InstantiateVariableDefinition(
SourceLocation PointOfInstantiation,
7932 VarDecl *Var,
bool Recursive =
false,
7933 bool DefinitionRequired =
false,
7934 bool AtEndOfTU =
false);
7936 void InstantiateMemInitializers(CXXConstructorDecl *New,
7937 const CXXConstructorDecl *Tmpl,
7942 bool FindingInstantiatedContext =
false);
7954 OCK_CategoryImplementation
7972 Decl *ActOnStartClassInterface(
7977 Decl *
const *ProtoRefs,
unsigned NumProtoRefs,
7981 void ActOnSuperClassOfClassInterface(Scope *S,
7996 Decl *ActOnCompatibilityAlias(
8001 bool CheckForwardProtocolDeclarationForCircularDependency(
8006 Decl *ActOnStartProtocolInterface(
8012 Decl *ActOnStartCategoryInterface(
8016 Decl *
const *ProtoRefs,
unsigned NumProtoRefs,
8020 Decl *ActOnStartClassImplementation(
8026 Decl *ActOnStartCategoryImplementation(
SourceLocation AtCatImplLoc,
8032 DeclGroupPtrTy ActOnFinishObjCImplementation(Decl *ObjCImpDecl,
8046 void FindProtocolDeclaration(
bool WarnOnDeclarations,
bool ForObjCContainer,
8054 bool SelectProtocolFirst =
false);
8059 void actOnObjCTypeArgsOrProtocolQualifiers(
8072 bool warnOnIncompleteProtocols);
8083 TypeResult actOnObjCTypeArgsAndProtocolQualifiers(
8101 bool FailOnError =
false);
8113 bool FailOnError =
false);
8118 void CheckObjCPropertyAttributes(Decl *PropertyPtrTy,
8120 unsigned &Attributes,
8121 bool propertyInPrimaryClass);
8132 bool OverridingProtocolProperty);
8148 Decl *ActOnPropertyImplDecl(Scope *S,
8163 OSMK_NonRetainingInit
8178 Decl *ActOnMethodDeclaration(
8189 bool isVariadic,
bool MethodDefinition);
8198 bool inferObjCARCLifetime(
ValueDecl *decl);
8233 bool HasTrailingDot,
8252 bool isImplicit =
false);
8255 bool isSuperReceiver,
8269 ExprResult BuildInstanceMessage(Expr *Receiver,
8278 bool isImplicit =
false);
8280 ExprResult BuildInstanceMessageImplicit(Expr *Receiver,
8321 TypedefNameDecl *&TDNDecl,
8322 bool CfToNs,
bool Diagnose =
true);
8326 Expr *&SrcExpr,
bool Diagnose =
true);
8328 bool ConversionToObjCStringLiteralCheck(
QualType DstType, Expr *&SrcExpr,
8329 bool Diagnose =
true);
8369 StringRef SlotLabel, Expr *Alignment);
8372 NonDefaultStateAtInclude,
8378 void DiagnoseUnterminatedPragmaPack();
8391 void ActOnPragmaMSPointersToMembers(
8398 MSVtorDispAttr::Mode Value);
8407 bool UnifySection(StringRef SectionName,
8409 DeclaratorDecl *TheDecl);
8410 bool UnifySection(StringRef SectionName,
8417 llvm::StringRef StackSlotLabel,
8419 llvm::StringRef PragmaName);
8433 void ActOnPragmaDetectMismatch(
SourceLocation Loc, StringRef Name,
8437 void ActOnPragmaUnused(
const Token &Identifier,
8480 void AddAlignmentAttributesForRecord(
RecordDecl *RD);
8483 void AddMsStructLayoutForRecord(
RecordDecl *RD);
8486 void FreePackedContext();
8490 void PushNamespaceVisibilityAttr(
const VisibilityAttr *Attr,
8495 void AddPushedVisibilityAttribute(Decl *RD);
8499 void PopPragmaVisibility(
bool IsNamespaceEnd,
SourceLocation EndLoc);
8502 void FreeVisContext();
8507 void AddCFAuditedAttribute(Decl *D);
8509 void ActOnPragmaAttributeAttribute(
ParsedAttr &Attribute,
8521 void AddPragmaAttributes(Scope *S, Decl *D);
8523 void DiagnoseUnterminatedPragmaAttribute();
8531 return OptimizeOffPragmaLocation;
8537 void AddRangeBasedOptnone(FunctionDecl *FD);
8542 void AddOptnoneAttributeIfNoConflicts(FunctionDecl *FD,
SourceLocation Loc);
8545 void AddAlignedAttr(
SourceRange AttrRange, Decl *D, Expr *E,
8546 unsigned SpellingListIndex,
bool IsPackExpansion);
8548 unsigned SpellingListIndex,
bool IsPackExpansion);
8552 void AddAssumeAlignedAttr(
SourceRange AttrRange, Decl *D, Expr *E, Expr *OE,
8553 unsigned SpellingListIndex);
8557 void AddAllocAlignAttr(
SourceRange AttrRange, Decl *D, Expr *ParamExpr,
8558 unsigned SpellingListIndex);
8562 void AddAlignValueAttr(
SourceRange AttrRange, Decl *D, Expr *E,
8563 unsigned SpellingListIndex);
8567 void AddLaunchBoundsAttr(
SourceRange AttrRange, Decl *D, Expr *MaxThreads,
8568 Expr *MinBlocks,
unsigned SpellingListIndex);
8572 unsigned SpellingListIndex,
bool InInstantiation =
false);
8574 void AddParameterABIAttr(
SourceRange AttrRange, Decl *D,
8578 void AddXConsumedAttr(Decl *D,
SourceRange SR,
unsigned SpellingIndex,
8593 bool IsImplicit =
false);
8598 bool IsImplicit =
false);
8602 void CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body);
8610 std::string CurrOpenCLExtension;
8612 llvm::DenseMap<const Type*, std::set<std::string>> OpenCLTypeExtMap;
8614 llvm::DenseMap<const Decl*, std::set<std::string>> OpenCLDeclExtMap;
8617 return CurrOpenCLExtension;
8623 std::string getOpenCLExtensionsFromDeclExtMap(FunctionDecl *FD);
8628 std::string getOpenCLExtensionsFromTypeExtMap(
FunctionType *FT);
8631 template<
typename T,
typename MapT>
8632 std::string getOpenCLExtensionsFromExtMap(T* FT, MapT &Map);
8635 CurrOpenCLExtension = Ext;
8641 void setOpenCLExtensionForType(
QualType T, llvm::StringRef Exts);
8647 void setOpenCLExtensionForDecl(Decl *FD, llvm::StringRef Exts);
8652 void setCurrentOpenCLExtensionForType(
QualType T);
8657 void setCurrentOpenCLExtensionForDecl(Decl *FD);
8659 bool isOpenCLDisabledDecl(Decl *FD);
8671 bool checkOpenCLDisabledDecl(
const NamedDecl &D,
const Expr &E);
8677 void *VarDataSharingAttributesStack;
8679 unsigned DeclareTargetNestingLevel = 0;
8681 void InitDataSharingAttributesStack();
8682 void DestroyDataSharingAttributesStack();
8685 bool StrictlyPositive =
true);
8687 unsigned getOpenMPNestingLevel()
const;
8690 void adjustOpenMPTargetScopeIndex(
unsigned &FunctionScopesIndex,
8691 unsigned Level)
const;
8694 void pushOpenMPFunctionRegion();
8709 template <
typename T,
typename DiagLocT,
typename DiagInfoT,
typename MapT>
8710 bool checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc, DiagInfoT DiagInfo,
8719 bool isOpenMPCapturedByRef(
const ValueDecl *D,
unsigned Level)
const;
8724 VarDecl *isOpenMPCapturedDecl(
ValueDecl *D);
8730 void startOpenMPLoop();
8735 bool isOpenMPPrivateDecl(
const ValueDecl *D,
unsigned Level)
const;
8745 bool isOpenMPTargetCapturedDecl(
const ValueDecl *D,
unsigned Level)
const;
8756 void EndOpenMPClause();
8758 void EndOpenMPDSABlock(Stmt *CurDirective);
8764 void ActOnOpenMPLoopInitialization(
SourceLocation ForLoc, Stmt *Init);
8769 ExprResult ActOnOpenMPIdExpression(Scope *CurScope,
8773 DeclGroupPtrTy ActOnOpenMPThreadprivateDirective(
8790 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveStart(
8792 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
8795 void ActOnOpenMPDeclareReductionCombinerStart(Scope *S, Decl *D);
8797 void ActOnOpenMPDeclareReductionCombinerEnd(Decl *D, Expr *Combiner);
8800 VarDecl *ActOnOpenMPDeclareReductionInitializerStart(Scope *S, Decl *D);
8802 void ActOnOpenMPDeclareReductionInitializerEnd(Decl *D, Expr *Initializer,
8803 VarDecl *OmpPrivParm);
8805 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveEnd(
8806 Scope *S, DeclGroupPtrTy DeclReductions,
bool IsValid);
8811 void ActOnFinishOpenMPDeclareTargetDirective();
8813 void ActOnOpenMPDeclareTargetName(Scope *CurScope,
CXXScopeSpec &ScopeSpec,
8815 OMPDeclareTargetDeclAttr::MapTypeTy MT,
8816 NamedDeclSetType &SameDirectiveDecls);
8819 checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D,
8823 return DeclareTargetNestingLevel > 0;
8826 bool isInOpenMPTargetExecutionDirective()
const;
8830 return !getLangOpts().OpenMPIsDevice || isInOpenMPDeclareTargetContext() ||
8831 isInOpenMPTargetExecutionDirective();
8857 llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
8907 StmtResult ActOnOpenMPParallelForSimdDirective(
8978 StmtResult ActOnOpenMPTargetParallelForDirective(
9020 StmtResult ActOnOpenMPDistributeParallelForDirective(
9025 StmtResult ActOnOpenMPDistributeParallelForSimdDirective(
9030 StmtResult ActOnOpenMPDistributeSimdDirective(
9035 StmtResult ActOnOpenMPTargetParallelForSimdDirective(
9046 StmtResult ActOnOpenMPTeamsDistributeDirective(
9051 StmtResult ActOnOpenMPTeamsDistributeSimdDirective(
9056 StmtResult ActOnOpenMPTeamsDistributeParallelForSimdDirective(
9061 StmtResult ActOnOpenMPTeamsDistributeParallelForDirective(
9072 StmtResult ActOnOpenMPTargetTeamsDistributeDirective(
9077 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(
9082 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(
9087 StmtResult ActOnOpenMPTargetTeamsDistributeSimdDirective(
9101 DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(
9102 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
9124 OMPClause *ActOnOpenMPNumThreadsClause(Expr *NumThreads,
9129 OMPClause *ActOnOpenMPSafelenClause(Expr *Length,
9138 OMPClause *ActOnOpenMPCollapseClause(Expr *NumForLoops,
9146 Expr *NumForLoops =
nullptr);
9179 OMPClause *ActOnOpenMPSingleExprWithArgClause(
9243 OMPClause *ActOnOpenMPAtomicDefaultMemOrderClause(
9286 OMPClause *ActOnOpenMPTaskReductionClause(
9293 OMPClause *ActOnOpenMPInReductionClause(
9350 OMPClause *ActOnOpenMPThreadLimitClause(Expr *ThreadLimit,
9359 OMPClause *ActOnOpenMPDistScheduleClause(
9400 CCK_ForBuiltinOverloadedOp
9404 return CCK == CCK_CStyleCast || CCK == CCK_FunctionalCast ||
9405 CCK == CCK_OtherCast;
9413 const CXXCastPath *BasePath =
nullptr,
9415 = CCK_ImplicitConversion);
9432 ExprResult CallExprUnaryConversions(Expr *E);
9436 ExprResult DefaultFunctionArrayConversion(Expr *E,
bool Diagnose =
true);
9441 ExprResult DefaultFunctionArrayLvalueConversion(Expr *E,
9442 bool Diagnose =
true);
9453 ExprResult DefaultArgumentPromotion(Expr *E);
9458 ExprResult TemporaryMaterializationConversion(Expr *E);
9466 VariadicDoesNotApply
9491 bool hasCStrMethod(
const Expr *E);
9495 bool GatherArgumentsForCall(
SourceLocation CallLoc, FunctionDecl *FDecl,
9500 bool AllowExplicit =
false,
9501 bool IsListInitialization =
false);
9506 FunctionDecl *FDecl);
9514 bool IsCompAssign =
false);
9595 bool *Complained =
nullptr);
9600 bool IsValueInFlagEnum(
const EnumDecl *ED,
const llvm::APInt &Val,
9601 bool AllowMask)
const;
9621 bool ConvertRHS =
true);
9639 bool DiagnoseCFAudited =
false,
bool ConvertRHS =
true);
9646 bool IsStringLiteralToNonConstPointerConversion(Expr *From,
QualType ToType);
9648 bool CheckExceptionSpecCompatibility(Expr *From,
QualType ToType);
9652 bool AllowExplicit =
false);
9661 = CCK_ImplicitConversion);
9679 QualType CheckPointerToMemberOperands(
9682 QualType CheckMultiplyDivideOperands(
9687 bool IsCompAssign =
false);
9716 Expr *LHS, Expr *RHS);
9723 QualType CXXCheckConditionalOperands(
9727 bool ConvertArgs =
true);
9730 bool ConvertArgs =
true) {
9731 Expr *E1Tmp = E1.
get(), *E2Tmp = E2.
get();
9733 FindCompositePointerType(Loc, E1Tmp, E2Tmp, ConvertArgs);
9742 bool DiagnoseConditionalForNull(Expr *LHSExpr, Expr *RHSExpr,
9745 void DiagnoseAlwaysNonNullPointer(Expr *E,
9752 bool AllowBothBool,
bool AllowBoolConversion);
9764 bool CheckForConstantInitializer(Expr *e,
QualType t);
9774 Ref_Incompatible = 0,
9785 bool &DerivedToBase,
9786 bool &ObjCConversion,
9787 bool &ObjCLifetimeConversion);
9800 Expr *result,
QualType ¶mType);
9833 bool Diagnose =
true,
9834 bool DiagnoseCFAudited =
false,
9838 Expr *stripARCUnbridgedCast(Expr *e);
9839 void diagnoseARCUnbridgedCast(Expr *e);
9841 bool CheckObjCARCUnavailableWeakConversion(
QualType castType,
9847 void checkRetainCycles(Expr *receiver, Expr *argument);
9848 void checkRetainCycles(VarDecl *Var, Expr *Init);
9856 void checkUnsafeExprAssigns(
SourceLocation Loc, Expr *LHS, Expr *RHS);
9862 bool CheckMessageArgumentTypes(
const Expr *Receiver,
QualType ReceiverType,
9873 QualType getMessageSendResultType(
const Expr *Receiver,
QualType ReceiverType,
9875 bool isSuperMessage);
9879 void EmitRelatedResultTypeNote(
const Expr *E);
9884 void EmitRelatedResultTypeNoteForReturn(
QualType destType);
9896 : ConditionVar(ConditionVar), Condition(Condition), Invalid(
false),
9897 HasKnownValue(IsConstexpr && Condition.get() &&
9898 !Condition.get()->isValueDependent()),
9899 KnownValue(HasKnownValue &&
9900 !!Condition.get()->EvaluateKnownConstInt(S.Context)) {}
9902 : ConditionVar(nullptr), Condition(nullptr), Invalid(Invalid),
9908 std::pair<VarDecl *, Expr *>
get()
const {
9909 return std::make_pair(cast_or_null<VarDecl>(ConditionVar),
9935 ExprResult CheckConditionVariable(VarDecl *ConditionVar,
9949 bool IsConstexpr =
false);
9953 void DiagnoseAssignmentAsCondition(Expr *E);
9957 void DiagnoseEqualityWithExtraParens(
ParenExpr *ParenE);
9960 ExprResult CheckCXXBooleanCondition(Expr *CondExpr,
bool IsConstexpr =
false);
9965 void ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &OldVal,
9966 unsigned NewWidth,
bool NewSign,
9972 bool CheckObjCDeclScope(Decl *D);
9990 ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
9992 bool AllowFold =
true);
9993 ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
9995 bool AllowFold =
true);
9996 ExprResult VerifyIntegerConstantExpression(Expr *E,
9997 llvm::APSInt *Result =
nullptr);
10004 QualType FieldTy,
bool IsMsStruct,
10005 Expr *BitWidth,
bool *ZeroWidth =
nullptr);
10008 unsigned ForceCUDAHostDeviceDepth = 0;
10014 void PushForceCUDAHostDevice();
10019 bool PopForceCUDAHostDevice();
10024 llvm::DenseMap<CanonicalDeclPtr<FunctionDecl>,
10025 std::vector<PartialDiagnosticAt>>
10056 llvm::DenseMap< CanonicalDeclPtr<FunctionDecl>,
10057 llvm::MapVector<CanonicalDeclPtr<FunctionDecl>,
10093 FunctionDecl *Fn,
Sema &S);
10106 operator bool()
const {
return ImmediateDiag.hasValue(); }
10108 template <
typename T>
10111 if (Diag.ImmediateDiag.hasValue())
10112 *Diag.ImmediateDiag << Value;
10113 else if (Diag.PartialDiag.hasValue())
10114 *Diag.PartialDiag << Value;
10123 bool ShowCallStack;
10169 bool IgnoreImplicitHDAttr =
false);
10174 return IdentifyCUDATarget(dyn_cast<FunctionDecl>(CurContext));
10198 const FunctionDecl *Callee);
10206 const FunctionDecl *Callee) {
10207 return IdentifyCUDAPreference(Caller, Callee) != CFP_Never;
10212 void maybeAddCUDAHostDeviceAttrs(FunctionDecl *FD,
10243 void EraseUnwantedCUDAMatches(
10244 const FunctionDecl *Caller,
10245 SmallVectorImpl<std::pair<DeclAccessPair, FunctionDecl *>> &Matches);
10258 bool inferCUDATargetForImplicitSpecialMember(
CXXRecordDecl *ClassDecl,
10266 bool isEmptyCudaConstructor(
SourceLocation Loc, CXXConstructorDecl *CD);
10277 void checkAllowedCUDAInitializer(VarDecl *VD);
10281 void checkCUDATargetOverload(FunctionDecl *NewFD,
10331 PCC_LocalDeclarationSpecifiers
10334 void CodeCompleteModuleImport(
SourceLocation ImportLoc, ModuleIdPath Path);
10335 void CodeCompleteOrdinaryName(Scope *S,
10337 void CodeCompleteDeclSpec(Scope *S,
DeclSpec &DS,
10338 bool AllowNonIdentifiers,
10339 bool AllowNestedNameSpecifiers);
10342 void CodeCompleteExpression(Scope *S,
10344 void CodeCompleteExpression(Scope *S,
QualType PreferredType);
10345 void CodeCompleteMemberReferenceExpr(Scope *S, Expr *
Base, Expr *OtherOpBase,
10347 bool IsBaseExprStatement);
10348 void CodeCompletePostfixExpression(Scope *S,
ExprResult LHS);
10349 void CodeCompleteTag(Scope *S,
unsigned TagSpec);
10350 void CodeCompleteTypeQualifiers(
DeclSpec &DS);
10353 void CodeCompleteBracketDeclarator(Scope *S);
10354 void CodeCompleteCase(Scope *S);
10363 QualType ProduceCtorInitMemberSignatureHelp(Scope *S, Decl *ConstructorDecl,
10365 ParsedType TemplateTypeTy,
10369 void CodeCompleteInitializer(Scope *S, Decl *D);
10370 void CodeCompleteReturn(Scope *S);
10371 void CodeCompleteAfterIf(Scope *S);
10372 void CodeCompleteBinaryRHS(Scope *S, Expr *LHS,
tok::TokenKind Op);
10374 void CodeCompleteQualifiedId(Scope *S,
CXXScopeSpec &SS,
10375 bool EnteringContext,
QualType BaseType);
10376 void CodeCompleteUsing(Scope *S);
10377 void CodeCompleteUsingDirective(Scope *S);
10378 void CodeCompleteNamespaceDecl(Scope *S);
10379 void CodeCompleteNamespaceAliasDecl(Scope *S);
10380 void CodeCompleteOperatorName(Scope *S);
10381 void CodeCompleteConstructorInitializer(
10386 bool AfterAmpersand);
10388 void CodeCompleteObjCAtDirective(Scope *S);
10389 void CodeCompleteObjCAtVisibility(Scope *S);
10390 void CodeCompleteObjCAtStatement(Scope *S);
10391 void CodeCompleteObjCAtExpression(Scope *S);
10392 void CodeCompleteObjCPropertyFlags(Scope *S,
ObjCDeclSpec &ODS);
10393 void CodeCompleteObjCPropertyGetter(Scope *S);
10394 void CodeCompleteObjCPropertySetter(Scope *S);
10395 void CodeCompleteObjCPassingType(Scope *S,
ObjCDeclSpec &DS,
10397 void CodeCompleteObjCMessageReceiver(Scope *S);
10398 void CodeCompleteObjCSuperMessage(Scope *S,
SourceLocation SuperLoc,
10400 bool AtArgumentExpression);
10401 void CodeCompleteObjCClassMessage(Scope *S, ParsedType Receiver,
10403 bool AtArgumentExpression,
10404 bool IsSuper =
false);
10405 void CodeCompleteObjCInstanceMessage(Scope *S, Expr *Receiver,
10407 bool AtArgumentExpression,
10409 void CodeCompleteObjCForCollection(Scope *S,
10410 DeclGroupPtrTy IterationVar);
10411 void CodeCompleteObjCSelector(Scope *S,
10413 void CodeCompleteObjCProtocolReferences(
10415 void CodeCompleteObjCProtocolDecl(Scope *S);
10416 void CodeCompleteObjCInterfaceDecl(Scope *S);
10417 void CodeCompleteObjCSuperclass(Scope *S,
10420 void CodeCompleteObjCImplementationDecl(Scope *S);
10421 void CodeCompleteObjCInterfaceCategory(Scope *S,
10424 void CodeCompleteObjCImplementationCategory(Scope *S,
10427 void CodeCompleteObjCPropertyDefinition(Scope *S);
10428 void CodeCompleteObjCPropertySynthesizeIvar(Scope *S,
10430 void CodeCompleteObjCMethodDecl(Scope *S,
Optional<bool> IsInstanceMethod,
10431 ParsedType ReturnType);
10432 void CodeCompleteObjCMethodDeclSelector(Scope *S,
10433 bool IsInstanceMethod,
10434 bool AtParameterName,
10435 ParsedType ReturnType,
10437 void CodeCompleteObjCClassPropertyRefExpr(Scope *S,
IdentifierInfo &ClassName,
10439 bool IsBaseExprStatement);
10440 void CodeCompletePreprocessorDirective(
bool InConditional);
10441 void CodeCompleteInPreprocessorConditionalExclusion(Scope *S);
10442 void CodeCompletePreprocessorMacroName(
bool IsDefinition);
10443 void CodeCompletePreprocessorExpression();
10444 void CodeCompletePreprocessorMacroArgument(Scope *S,
10447 unsigned Argument);
10448 void CodeCompleteIncludedFile(llvm::StringRef Dir,
bool IsAngled);
10449 void CodeCompleteNaturalLanguage();
10450 void CodeCompleteAvailabilityPlatformName();
10461 unsigned ByteNo)
const;
10464 void CheckArrayAccess(
const Expr *BaseExpr,
const Expr *IndexExpr,
10466 bool AllowOnePastEnd=
true,
bool IndexNegated=
false);
10467 void CheckArrayAccess(
const Expr *E);
10470 struct FormatStringInfo {
10471 unsigned FormatIdx;
10472 unsigned FirstDataArg;
10476 static bool getFormatStringInfo(
const FormatAttr *Format,
bool IsCXXMember,
10477 FormatStringInfo *FSI);
10478 bool CheckFunctionCall(FunctionDecl *FDecl,
CallExpr *TheCall,
10485 void CheckConstructorCall(FunctionDecl *FDecl,
10495 bool CheckObjCString(Expr *Arg);
10496 ExprResult CheckOSLogFormatStringArg(Expr *Arg);
10498 ExprResult CheckBuiltinFunctionCall(FunctionDecl *FDecl,
10499 unsigned BuiltinID,
CallExpr *TheCall);
10501 bool CheckARMBuiltinExclusiveCall(
unsigned BuiltinID,
CallExpr *TheCall,
10502 unsigned MaxWidth);
10503 bool CheckNeonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10504 bool CheckARMBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10506 bool CheckAArch64BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10507 bool CheckHexagonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10508 bool CheckHexagonBuiltinCpu(
unsigned BuiltinID,
CallExpr *TheCall);
10509 bool CheckHexagonBuiltinArgument(
unsigned BuiltinID,
CallExpr *TheCall);
10510 bool CheckMipsBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10511 bool CheckSystemZBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10512 bool CheckX86BuiltinRoundingOrSAE(
unsigned BuiltinID,
CallExpr *TheCall);
10513 bool CheckX86BuiltinGatherScatterScale(
unsigned BuiltinID,
CallExpr *TheCall);
10514 bool CheckX86BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10515 bool CheckPPCBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10517 bool SemaBuiltinVAStart(
unsigned BuiltinID,
CallExpr *TheCall);
10518 bool SemaBuiltinVAStartARMMicrosoft(
CallExpr *Call);
10519 bool SemaBuiltinUnorderedCompare(
CallExpr *TheCall);
10520 bool SemaBuiltinFPClassification(
CallExpr *TheCall,
unsigned NumArgs);
10521 bool SemaBuiltinVSX(
CallExpr *TheCall);
10522 bool SemaBuiltinOSLogFormat(
CallExpr *TheCall);
10532 bool SemaBuiltinPrefetch(
CallExpr *TheCall);
10533 bool SemaBuiltinAllocaWithAlign(
CallExpr *TheCall);
10534 bool SemaBuiltinAssume(
CallExpr *TheCall);
10535 bool SemaBuiltinAssumeAligned(
CallExpr *TheCall);
10536 bool SemaBuiltinLongjmp(
CallExpr *TheCall);
10537 bool SemaBuiltinSetjmp(
CallExpr *TheCall);
10544 bool SemaBuiltinConstantArg(
CallExpr *TheCall,
int ArgNum,
10545 llvm::APSInt &Result);
10546 bool SemaBuiltinConstantArgRange(
CallExpr *TheCall,
int ArgNum,
int Low,
10547 int High,
bool RangeIsError =
true);
10548 bool SemaBuiltinConstantArgMultiple(
CallExpr *TheCall,
int ArgNum,
10549 unsigned Multiple);
10550 bool SemaBuiltinARMSpecialReg(
unsigned BuiltinID,
CallExpr *TheCall,
10551 int ArgNum,
unsigned ExpectedFieldNum,
10570 static bool GetFormatNSStringIdx(
const FormatAttr *Format,
unsigned &Idx);
10573 bool CheckFormatArguments(
const FormatAttr *Format,
10578 llvm::SmallBitVector &CheckedVarArgs);
10580 bool HasVAListArg,
unsigned format_idx,
10584 llvm::SmallBitVector &CheckedVarArgs);
10586 void CheckAbsoluteValueFunction(
const CallExpr *Call,
10587 const FunctionDecl *FDecl);
10589 void CheckMaxUnsignedZero(
const CallExpr *Call,
const FunctionDecl *FDecl);
10591 void CheckMemaccessArguments(
const CallExpr *Call,
10595 void CheckStrlcpycatArguments(
const CallExpr *Call,
10598 void CheckStrncatArguments(
const CallExpr *Call,
10601 void CheckReturnValExpr(Expr *RetValExp,
QualType lhsType,
10603 bool isObjCMethod =
false,
10604 const AttrVec *Attrs =
nullptr,
10605 const FunctionDecl *FD =
nullptr);
10608 void CheckFloatComparison(
SourceLocation Loc, Expr *LHS, Expr *RHS);
10613 void CheckForIntOverflow(Expr *E);
10614 void CheckUnsequencedOperations(Expr *E);
10619 bool IsConstexpr =
false);
10628 bool DeclIsField =
true);
10632 void CheckBreakContinueBinding(Expr *E);
10640 bool DeleteWasArrayForm);
10643 void RegisterTypeTagForDatatype(
const IdentifierInfo *ArgumentKind,
10644 uint64_t MagicValue,
QualType Type,
10645 bool LayoutCompatible,
bool MustBeNull);
10651 Type(Type), LayoutCompatible(LayoutCompatible),
10652 MustBeNull(MustBeNull)
10669 std::unique_ptr<llvm::DenseMap<TypeTagMagicValue, TypeTagData>>
10670 TypeTagForDatatypeMagicValues;
10674 void CheckArgumentWithTypeTag(
const ArgumentWithTypeTagAttr *Attr,
10680 void CheckAddressOfPackedMember(Expr *rhs);
10737 Decl *getObjCDeclContext()
const;
10740 return OriginalLexicalContext ? OriginalLexicalContext : CurContext;
10747 DC = CatD->getClassInterface();
10754 bool PartialOverloading =
false) {
10756 if (NumArgs > 0 && PartialOverloading)
10757 return NumArgs + 1 > NumParams;
10758 return NumArgs > NumParams;
10766 class SavePendingParsedClassStateRAII {
10768 SavePendingParsedClassStateRAII(
Sema &S) : S(S) { swapSavedState(); }
10770 ~SavePendingParsedClassStateRAII() {
10772 "there shouldn't be any pending delayed exception spec checks");
10774 "there shouldn't be any pending delayed exception spec checks");
10776 "there shouldn't be any pending delayed defaulted member " 10777 "exception specs");
10779 "there shouldn't be any pending delayed DLL export classes");
10785 decltype(DelayedOverridingExceptionSpecChecks)
10786 SavedOverridingExceptionSpecChecks;
10787 decltype(DelayedEquivalentExceptionSpecChecks)
10788 SavedEquivalentExceptionSpecChecks;
10789 decltype(DelayedDefaultedMemberExceptionSpecs)
10790 SavedDefaultedMemberExceptionSpecs;
10791 decltype(DelayedDllExportClasses) SavedDllExportClasses;
10793 void swapSavedState() {
10794 SavedOverridingExceptionSpecChecks.swap(
10796 SavedEquivalentExceptionSpecChecks.swap(
10798 SavedDefaultedMemberExceptionSpecs.swap(
10806 struct MisalignedMember {
10812 MisalignedMember() : E(), RD(), MD(), Alignment() {}
10815 : E(E), RD(RD), MD(MD), Alignment(Alignment) {}
10816 explicit MisalignedMember(Expr *E)
10817 : MisalignedMember(E,
nullptr,
nullptr,
CharUnits()) {}
10819 bool operator==(
const MisalignedMember &m) {
return this->E == m.E; }
10833 void DiagnoseMisalignedMembers();
10840 void DiscardMisalignedMemberAddress(
const Type *T, Expr *E);
10845 void RefersToMemberWithReducedAlignment(
10854 bool Entered =
true;
10859 Decl *LambdaContextDecl =
nullptr,
10861 Sema::ExpressionEvaluationContextRecord::EK_Other,
10862 bool ShouldEnter =
true)
10863 : Actions(Actions), Entered(ShouldEnter) {
10872 Sema::ExpressionEvaluationContextRecord::EK_Other)
10873 : Actions(Actions) {
10875 NewContext, Sema::ReuseLambdaContextDecl, ExprContext);
10880 bool ShouldEnter =
true)
10881 : Actions(Actions), Entered(
false) {
10889 Sema::ExpressionEvaluationContext::UnevaluatedList);
10935 return LHS.
FD == RHS.
FD && LHS.
Loc == RHS.
Loc;
FileNullabilityMap NullabilityMap
A mapping that describes the nullability we've seen in each header file.
Abstract class used to diagnose incomplete types.
ObjCInterfaceDecl * NSStringDecl
The declaration of the Objective-C NSString class.
PragmaStack< StringLiteral * > CodeSegStack
UnusedFileScopedDeclsType UnusedFileScopedDecls
The set of file scoped decls seen so far that have not been used and must warn if not used...
We are defining a synthesized function (such as a defaulted special member).
static void collectUnexpandedParameterPacks(Sema &S, TemplateParameterList *Params, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
The lookup results will be used for redeclaration of a name, if an entity by that name already exists...
Represents a function declaration or definition.
bool RequireCompleteExprType(Expr *E, unsigned DiagID, const Ts &...Args)
llvm::SmallSetVector< const TypedefNameDecl *, 4 > UnusedLocalTypedefNameCandidates
Set containing all typedefs that are likely unused.
A set of visible modules.
UnexpandedParameterPackContext
The context in which an unexpanded parameter pack is being diagnosed.
std::pair< llvm::PointerUnion< const TemplateTypeParmType *, NamedDecl * >, SourceLocation > UnexpandedParameterPack
SourceLocation getOptimizeOffPragmaLocation() const
Get the location for the currently active "\#pragma clang optimize off". If this location is invalid...
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
ExtVectorDeclsType ExtVectorDecls
ExtVectorDecls - This is a list all the extended vector types.
NestedNameSpecInfo(IdentifierInfo *II, SourceLocation IdLoc, SourceLocation ColonColonLoc, ParsedType ObjectType=ParsedType())
Creates info object for the most typical case.
ExternalSemaSource * getExternalSource() const
SuppressedDiagnosticsMap SuppressedDiagnostics
CXXMethodDecl * getMethod() const
no exception specification
~GlobalEagerInstantiationScope()
Smart pointer class that efficiently represents Objective-C method names.
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
void PushExpressionEvaluationContext(ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, ExpressionEvaluationContextRecord::ExpressionKind Type=ExpressionEvaluationContextRecord::EK_Other)
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, llvm::MapVector< CanonicalDeclPtr< FunctionDecl >, SourceLocation > > CUDACallGraph
A partial call graph maintained during CUDA compilation to support deferred diagnostics.
PointerToInt - The assignment converts a pointer to an int, which we accept as an extension...
Stores the type being destroyed by a pseudo-destructor expression.
A (possibly-)qualified type.
Keeps information about an identifier in a nested-name-spec.
GlobalEagerInstantiationScope(Sema &S, bool Enabled)
Simple class containing the result of Sema::CorrectTypo.
TemplateDeductionResult
Describes the result of template argument deduction.
LateTemplateParserCB * LateTemplateParser
SmallVectorImpl< Decl * > & WeakTopLevelDecls()
WeakTopLevelDeclDecls - access to #pragma weak-generated Decls.
Instantiation or recovery rebuild of a for-range statement.
NameClassification(const IdentifierInfo *Keyword)
llvm::PointerUnion3< TemplateTypeParmDecl *, NonTypeTemplateParmDecl *, TemplateTemplateParmDecl * > TemplateParameter
Stores a template parameter of any kind.
void SentinelAction(PragmaMsStackAction Action, StringRef Label)
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs...
~EnterExpressionEvaluationContext()
Defines enumerations for the type traits support.
A cast other than a C-style cast.
LateParsedTemplateMapT LateParsedTemplateMap
SmallVector< PackIncludeState, 8 > PackIncludeStack
A stack-allocated class that identifies which local variable declaration instantiations are present i...
llvm::MutableArrayRef< ImplicitConversionSequence > ConversionSequenceList
A list of implicit conversion sequences for the arguments of an OverloadCandidate.
static bool getPrintable(bool B)
bool operator==(CanQual< T > x, CanQual< U > y)
static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result, bool QualifiedNameLookup, bool InBaseClass, VisibleDeclConsumer &Consumer, VisibleDeclsRecord &Visited, bool IncludeDependentBases, bool LoadExternal)
Code completion occurs within a class, struct, or union.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
RecordDecl * MSVCGuidDecl
The MSVC "_GUID" struct, which is defined in MSVC header files.
std::vector< std::unique_ptr< TemplateInstantiationCallback > > TemplateInstCallbacks
The template instantiation callbacks to trace or track instantiations (objects can be chained)...
OpenCL supported extensions and optional core features.
PragmaStack< StringLiteral * > DataSegStack
Represents a lazily-loaded vector of data.
ObjCBridgeCastKind
The kind of bridging performed by the Objective-C bridge cast.
std::unique_ptr< RecordDeclSetTy > PureVirtualClassDiagSet
PureVirtualClassDiagSet - a set of class declarations which we have emitted a list of pure virtual fu...
A class which encapsulates the logic for delaying diagnostics during parsing and other processing...
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Emit the diagnostic immediately (i.e., behave like Sema::Diag()).
A structure used to record information about a failed template argument deduction, for diagnosis.
static ConditionResult ConditionError()
Checking non-dependent argument conversions failed.
TypePropertyCache< Private > Cache
ObjCMessageKind
Describes the kind of message expression indicated by a message send that starts with an identifier...
Look up the name of an Objective-C protocol.
Decl * Entity
The entity that is being synthesized.
QualType CXXThisTypeOverride
When non-NULL, the C++ 'this' expression is allowed despite the current context not being a non-stati...
OpenCLOptions OpenCLFeatures
Stmt - This represents one statement.
NullabilityKind
Describes the nullability of a particular type.
We are matching the template parameter lists of two templates that might be redeclarations.
FunctionType - C99 6.7.5.3 - Function Declarators.
FullExprArg MakeFullExpr(Expr *Arg)
Provides information about an attempted template argument deduction, whose success or failure was des...
Merge availability attributes for an override, which requires an exact match or a weakening of constr...
Microsoft __if_not_exists.
An instance of this object exists for each enum constant that is defined.
LazyVector< CXXConstructorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadDelegatingConstructors, 2, 2 > DelegatingCtorDeclsType
The name refers to a function template or a set of overloaded functions that includes at least one fu...
Represents the declaration of a typedef-name via the 'typedef' type specifier.
SmallVector< std::pair< const CXXMethodDecl *, const CXXMethodDecl * >, 2 > DelayedOverridingExceptionSpecChecks
All the overriding functions seen during a class definition that had their exception spec checks dela...
llvm::StringRef StackSlotLabel
SmallVector< Scope *, 2 > CurrentSEHFinally
Stack of active SEH __finally scopes. Can be empty.
void setCurrentOpenCLExtension(llvm::StringRef Ext)
Defines the clang::Module class, which describes a module in the source code.
OriginalCallArg(QualType OriginalParamType, bool DecomposedParam, unsigned ArgIdx, QualType OriginalArgType)
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
Captures information about "declaration specifiers" specific to Objective-C.
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
std::deque< PendingImplicitInstantiation > PendingInstantiations
The queue of implicit template instantiations that are required but have not yet been performed...
AssignConvertType
AssignConvertType - All of the 'assignment' semantic checks return this enum to indicate whether the ...
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Defines the C++ template declaration subclasses.
Scope * TUScope
Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in...
Represents a C++11 auto or C++14 decltype(auto) type.
DeclContext * OriginalLexicalContext
Generally null except when we temporarily switch decl contexts, like in.
friend const CUDADiagBuilder & operator<<(const CUDADiagBuilder &Diag, const T &Value)
ParenExpr - This represents a parethesized expression, e.g.
SmallVector< CodeSynthesisContext, 16 > CodeSynthesisContexts
List of active code synthesis contexts.
SmallVector< Module *, 16 > CodeSynthesisContextLookupModules
Extra modules inspected when performing a lookup during a template instantiation. ...
The base class of the type hierarchy.
std::deque< PendingImplicitInstantiation > PendingLocalImplicitInstantiations
The queue of implicit template instantiations that are required and must be performed within the curr...
void AddFactoryMethodToGlobalPool(ObjCMethodDecl *Method, bool impl=false)
AddFactoryMethodToGlobalPool - Same as above, but for factory methods.
SmallVector< PragmaAttributeEntry, 2 > Entries
llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > LateParsedTemplateMapT
~SynthesizedFunctionScope()
MissingImportKind
Kinds of missing import.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Declaration of a variable template.
TemplateParamListContext
The context in which we are checking a template parameter list.
Represent a C++ namespace.
Template argument deduction produced inconsistent deduced values for the given template parameter...
RedeclarationKind
Specifies whether (or how) name lookup is being performed for a redeclaration (vs.
static FunctionDeclAndLoc getEmptyKey()
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
LazyVector< const DeclaratorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2 > UnusedFileScopedDeclsType
A container of type source information.
static const IdentifierInfo * getPrintable(const IdentifierInfo *II)
Wrapper for void* pointer.
Parser - This implements a parser for the C family of languages.
Look up of a name that precedes the '::' scope resolution operator in C++.
std::pair< ValueDecl *, SourceLocation > PendingImplicitInstantiation
An entity for which implicit template instantiation is required.
bool hasVisibleDeclaration(const NamedDecl *D, llvm::SmallVectorImpl< Module *> *Modules=nullptr)
Determine whether any declaration of an entity is visible.
Floating point control options.
We are instantiating a default argument for a template parameter.
DelayedDiagnosticsState pushUndelayed()
Enter a new scope where access and deprecation diagnostics are not delayed.
Abstract base class used for diagnosing integer constant expression violations.
FileNullability Nullability
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
LiteralOperatorLookupResult
The possible outcomes of name lookup for a literal operator.
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
SpecialMemberOverloadResultEntry(const llvm::FoldingSetNodeID &ID)
unsigned NonInstantiationEntries
The number of CodeSynthesisContexts that are not template instantiations and, therefore, should not be counted as part of the instantiation depth.
NameClassificationKind getKind() const
static void MarkUsedTemplateParameters(ASTContext &Ctx, const TemplateArgument &TemplateArg, bool OnlyDeduced, unsigned Depth, llvm::SmallBitVector &Used)
Mark the template parameters that are used by this template argument.
VerifyICEDiagnoser(bool Suppress=false)
EnterExpressionEvaluationContext(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, Sema::ReuseLambdaContextDecl_t, Sema::ExpressionEvaluationContextRecord::ExpressionKind ExprContext=Sema::ExpressionEvaluationContextRecord::EK_Other)
RAII object to handle the state changes required to synthesize a function body.
Look up a namespace name within a C++ using directive or namespace alias definition, ignoring non-namespace names (C++ [basic.lookup.udir]p1).
Consumes visible declarations found when searching for all visible names within a given scope or cont...
bool DisableTypoCorrection
Tracks whether we are in a context where typo correction is disabled.
Retains information about a function, method, or block that is currently being parsed.
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
RAII object that enters a new expression evaluation context.
Represents a variable declaration or definition.
IfExistsResult
Describes the result of an "if-exists" condition check.
ExpressionKind
Describes whether we are in an expression constext which we have to handle differently.
CleanupInfo Cleanup
Used to control the generation of ExprWithCleanups.
Information about one declarator, including the parsed type information and the identifier.
DiagnosticsEngine & Diags
llvm::SmallSetVector< DeclContext *, 16 > AssociatedNamespaceSet
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
PrintingPolicy getPrintingPolicy() const
Retrieve a suitable printing policy for diagnostics.
llvm::SmallPtrSet< const NamedDecl *, 4 > TypoCorrectedFunctionDefinitions
The function definitions which were renamed as part of typo-correction to match their respective decl...
Records and restores the FP_CONTRACT state on entry/exit of compound statements.
Extra information about a function prototype.
ExpressionEvaluationContextRecord(ExpressionEvaluationContext Context, unsigned NumCleanupObjects, CleanupInfo ParentCleanup, Decl *ManglingContextDecl, ExpressionKind ExprContext)
TypeSpecifierType
Specifies the kind of type.
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
SmallVector< CXXRecordDecl *, 4 > DelayedDllExportClasses
void diagnose(Sema &S, SourceLocation Loc, QualType T) override
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
llvm::MapVector< NamedDecl *, SourceLocation > UndefinedButUsed
UndefinedInternals - all the used, undefined objects which require a definition in this translation u...
The lookup found a single 'cooked' literal operator, which expects a normal literal to be built and p...
PragmaClangSection PragmaClangBSSSection
BoundTypeDiagnoser(unsigned DiagID, const Ts &...Args)
Stores a list of template parameters for a TemplateDecl and its derived classes.
Describes how types, statements, expressions, and declarations should be printed. ...
A context in which code is being synthesized (where a source location alone is not sufficient to iden...
Code completion occurs within an Objective-C implementation or category implementation.
ObjCMethodDecl * ValueWithBytesObjCTypeMethod
The declaration of the valueWithBytes:objCType: method.
llvm::MapVector< Selector, SourceLocation > ReferencedSelectors
Method selectors used in a @selector expression.
bool IsDecltype
Whether we are in a decltype expression.
NestedNameSpecInfo(IdentifierInfo *II, SourceLocation IdLoc, SourceLocation ColonColonLoc, QualType ObjectType)
static NameClassification NestedNameSpecifier()
SourceLocation PragmaLocation
Look up an ordinary name that is going to be redeclared as a name with linkage.
FunctionProtoType::ExceptionSpecInfo getExceptionSpec() const
Overwrite an EPI's exception specification with this computed exception specification.
Represents a parameter to a function.
OpenCLOptions & getOpenCLOptions()
Defines the clang::Expr interface and subclasses for C++ expressions.
ObjCInterfaceDecl * NSDictionaryDecl
The declaration of the Objective-C NSDictionary class.
FPOptions & getFPOptions()
const TemplateArgument * TemplateArgs
The list of template arguments we are substituting, if they are not part of the entity.
The collection of all-type qualifiers we support.
Information about a template-id annotation token.
static SourceRange getPrintable(TypeLoc TL)
void setMethod(CXXMethodDecl *MD)
void threadSafetyCleanup(BeforeSet *Cache)
Base wrapper for a particular "section" of type source info.
Represents a struct/union/class.
enum clang::Sema::CodeSynthesisContext::SynthesisKind Kind
friend const SemaDiagnosticBuilder & operator<<(const SemaDiagnosticBuilder &Diag, const T &Value)
Teach operator<< to produce an object of the correct type.
ContextualImplicitConverter(bool Suppress=false, bool SuppressConversion=false)
Represents a class template specialization, which refers to a class template with a given set of temp...
One of these records is kept for each identifier that is lexed.
std::unique_ptr< NSAPI > NSAPIObj
Caches identifiers/selectors for NSFoundation APIs.
LocalInstantiationScope * CurrentInstantiationScope
The current instantiation scope used to store local variables.
The lookup found a single 'raw' literal operator, which expects a string literal containing the spell...
IntToPointer - The assignment converts an int to a pointer, which we accept as an extension...
CompoundScopeRAII(Sema &S, bool IsStmtExpr=false)
SmallVector< std::pair< FunctionDecl *, FunctionDecl * >, 2 > DelayedEquivalentExceptionSpecChecks
All the function redeclarations seen during a class definition that had their exception spec checks d...
IncompatibleObjCWeakRef - Assigning a weak-unavailable object to an object with __weak qualifier...
Enumerator value with fixed underlying type.
Value of a non-type template parameter.
Represents a class type in Objective C.
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.
bool inTemplateInstantiation() const
Determine whether we are currently performing template instantiation.
The results of name lookup within a DeclContext.
ImplicitExceptionSpecification(Sema &Self)
FunctionScopeRAII(Sema &S)
FileNullability & operator[](FileID file)
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Represents a member of a struct/union/class.
IdentifierSourceLocations TypoCorrectionFailures
A cache containing identifiers for which typo correction failed and their locations, so that repeated attempts to correct an identifier in a given location are ignored if typo correction already failed for it.
threadSafety::BeforeSet * ThreadSafetyDeclCache
ObjCInterfaceDecl * NSValueDecl
The declaration of the Objective-C NSValue class.
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
NamedDecl * Template
The template (or partial specialization) in which we are performing the instantiation, for substitutions of prior template arguments.
Code completion occurs following one or more template headers within a class.
This is not an overload because the signature exactly matches an existing declaration.
The iterator over UnresolvedSets.
Token - This structure provides full information about a lexed token.
CompatiblePointerDiscardsQualifiers - The assignment discards c/v/r qualifiers, which we accept as an...
ParsingDeclState PushParsingDeclaration(sema::DelayedDiagnosticPool &pool)
The fixed underlying type of an enumeration.
bool isExternallyDeclarable() const
Determine whether this declaration can be redeclared in a different translation unit.
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
TemplateName getTemplateName() const
LazyVector< VarDecl *, ExternalSemaSource, &ExternalSemaSource::ReadTentativeDefinitions, 2, 2 > TentativeDefinitionsType
Defines some OpenMP-specific enums and functions.
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
Represents an access specifier followed by colon ':'.
The type of a non-type template parameter.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Diagnostic builder for CUDA errors which may or may not be deferred.
ArrayRef< std::pair< IdentifierInfo *, SourceLocation > > ModuleIdPath
A sequence of identifier/location pairs used to describe a particular module or submodule, e.g., std.vector.
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * state
void PopExpressionEvaluationContext()
OverloadKind
C++ Overloading.
Code completion occurs where only a type is permitted.
Describes a module or submodule.
llvm::BumpPtrAllocator BumpAlloc
ObjCMethodDecl * LookupFactoryMethodInGlobalPool(Selector Sel, SourceRange R, bool receiverIdOrClass=false)
LookupFactoryMethodInGlobalPool - Returns the method and warns if there are multiple signatures...
This little struct is used to capture information about structure field declarators, which is basically just a bitfield size.
SpecialMemberOverloadResult - The overloading result for a special member function.
bool AccessCheckingSFINAE
When true, access checking violations are treated as SFINAE failures rather than hard errors...
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
The type of an exception.
Code completion occurs at top-level or namespace context.
A pair of a canonical FunctionDecl and a SourceLocation.
We are instantiating the exception specification for a function template which was deferred until it ...
SemaDiagnosticBuilder(DiagnosticBuilder &DB, Sema &SemaRef, unsigned DiagID)
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
An allocator used specifically for the purpose of code completion.
unsigned TyposCorrected
The number of typos corrected by CorrectTypo.
Represents a C++ using-declaration.
Code completion occurs within the body of a function on a recovery path, where we do not have a speci...
llvm::SmallVector< QualType, 4 > CurrentParameterCopyTypes
Stack of types that correspond to the parameter entities that are currently being copy-initialized...
Represents a C++ unqualified-id that has been parsed.
bool isCompleteType(SourceLocation Loc, QualType T)
ParsedAttributesView ArgAttrs
ArgAttrs - Attribute list for this argument.
static ExprResult CheckConvertedConstantExpression(Sema &S, Expr *From, QualType T, APValue &Value, Sema::CCEKind CCE, bool RequireInt)
CheckConvertedConstantExpression - Check that the expression From is a converted constant expression ...
Look up implicit 'self' parameter of an objective-c method.
Represents the results of name lookup.
static const std::string & getPrintable(const std::string &S)
RAII class used to indicate that we are performing provisional semantic analysis to determine the val...
ObjCContainerDecl - Represents a container for method declarations.
CharUnits - This is an opaque type for sizes expressed in character units.
TemplateSpecCandidateSet - A set of generalized overload candidates, used in template specializations...
A convenient class for passing around template argument information.
bool AllowAbstractFieldReference
A flag to indicate that we're in a context that permits abstract references to fields.
Module * getOwningModule(Decl *Entity)
Get the module owning an entity.
bool isObjCMethodDecl(Decl *D)
ICEConvertDiagnoser(bool AllowScopedEnumerations, bool Suppress, bool SuppressConversion)
Code completion occurs following one or more template headers.
The base type of a class type.
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
Look up all declarations in a scope with the given name, including resolved using declarations...
Code completion occurs within an expression.
PragmaStack(const ValueType &Default)
std::pair< SourceLocation, bool > DeleteExprLoc
Delete-expressions to be analyzed at the end of translation unit.
unsigned LayoutCompatible
If true, Type should be compared with other expression's types for layout-compatibility.
ExprResult getExpression() const
Concrete class used by the front-end to report problems and issues.
void incrementMSManglingNumber() const
llvm::DenseSet< Module * > LookupModulesCache
Cache of additional modules that should be used for name lookup within the current template instantia...
GlobalMethodPool MethodPool
Method Pool - allows efficient lookup when typechecking messages to "id".
Represents a declaration of a type.
Substitution of the deduced template argument values resulted in an error.
A set of unresolved declarations.
SourceLocation PointOfInstantiation
The point of instantiation or synthesis within the source code.
Look up the name of an OpenMP user-defined reduction operation.
Template argument deduction exceeded the maximum template instantiation depth (which has already been...
void MarkDeducedTemplateParameters(const FunctionTemplateDecl *FunctionTemplate, llvm::SmallBitVector &Deduced)
CheckedConversionKind
The kind of conversion being performed.
EnterExpressionEvaluationContext(Sema &Actions, InitListTag, bool ShouldEnter=true)
std::pair< StringRef, QualType > CapturedParamNameType
std::function< ExprResult(Sema &, TypoExpr *, TypoCorrection)> TypoRecoveryCallback
virtual ~VerifyICEDiagnoser()
LazyDeclPtr StdBadAlloc
The C++ "std::bad_alloc" class, which is defined by the C++ standard library.
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, std::vector< PartialDiagnosticAt > > CUDADeferredDiags
Diagnostics that are emitted only if we discover that the given function must be codegen'ed.
Scope - A scope is a transient data structure that is used while parsing the program.
The type of a data member.
CaseStmt - Represent a case statement.
NonTagKind
Common ways to introduce type names without a tag for use in diagnostics.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
void popUndelayed(DelayedDiagnosticsState state)
Undo a previous pushUndelayed().
SourceLocation Loc
The location of the push attribute.
Represents a C++ nested-name-specifier or a global scope specifier.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Represents an Objective-C protocol declaration.
llvm::DenseMap< Decl *, SmallVector< PartialDiagnosticAt, 1 > > SuppressedDiagnosticsMap
For each declaration that involved template argument deduction, the set of diagnostics that were supp...
ArrayTypeTrait
Names for the array type traits.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
static bool checkAddressOfFunctionIsAvailable(Sema &S, const FunctionDecl *FD, bool Complain, bool InOverloadResolution, SourceLocation Loc)
Returns true if we can take the address of the function.
void incrementMSManglingNumber()
ObjCInterfaceDecl * NSNumberDecl
The declaration of the Objective-C NSNumber class.
const LangOptions & getLangOpts() const
QualType OriginalParamType
sema::AnalysisBasedWarnings AnalysisWarnings
Worker object for performing CFG-based warnings.
SmallVector< BoundNodes, 1 > match(MatcherT Matcher, const NodeT &Node, ASTContext &Context)
Returns the results of matching Matcher on Node.
Represents the body of a CapturedStmt, and serves as its DeclContext.
bool isUnevaluatedContext() const
Determines whether we are currently in a context that is not evaluated as per C++ [expr] p5...
Represents an ObjC class declaration.
SmallVector< LambdaExpr *, 2 > Lambdas
The lambdas that are present within this context, if it is indeed an unevaluated context.
Member name lookup, which finds the names of class/struct/union members.
IncompatiblePointerSign - The assignment is between two pointers types which point to integers which ...
NamespaceDecl * StdExperimentalNamespaceCache
The C++ "std::experimental" namespace, where the experimental parts of the standard library resides...
llvm::DenseMap< IdentifierInfo *, AsmLabelAttr * > ExtnameUndeclaredIdentifiers
ExtnameUndeclaredIdentifiers - Identifiers contained in #pragma redefine_extname before declared...
bool mightBeIntendedToBeTemplateName(ExprResult E, bool &Dependent)
Determine whether it's plausible that E was intended to be a template-name.
FullExprArg(Sema &actions)
ObjCMethodDecl * StringWithUTF8StringMethod
The declaration of the stringWithUTF8String: method.
const LangOptions & LangOpts
static NameClassification TypeTemplate(TemplateName Name)
RAII object used to change the argument pack substitution index within a Sema object.
uint8_t PointerKind
Which kind of pointer declarator we saw.
Contains information about the compound statement currently being parsed.
TemplateNameKindForDiagnostics
Describes the detailed kind of a template name. Used in diagnostics.
ParsingClassState PushParsingClass()
unsigned NumCleanupObjects
The number of active cleanup objects when we entered this expression evaluation context.
llvm::SmallVector< DeleteExprLoc, 4 > DeleteLocs
A helper class for building up ExtParameterInfos.
void AddInstanceMethodToGlobalPool(ObjCMethodDecl *Method, bool impl=false)
AddInstanceMethodToGlobalPool - All instance methods in a translation unit are added to a global pool...
TypeTrait
Names for traits that operate specifically on types.
We are matching the template parameter lists of two template template parameters as part of matching ...
DiagnosticsEngine & getDiagnostics() const
RAII class used to determine whether SFINAE has trapped any errors that occur during template argumen...
Defines the clang::TemplateNameKind enum.
ArgumentPackSubstitutionIndexRAII(Sema &Self, int NewSubstitutionIndex)
CXXSpecialMember
Kinds of C++ special members.
static Sema::TemplateDeductionResult DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, const TemplateArgument &Param, TemplateArgument Arg, TemplateDeductionInfo &Info, SmallVectorImpl< DeducedTemplateArgument > &Deduced)
llvm::Optional< bool > getKnownValue() const
We are substituting explicit template arguments provided for a function template. ...
IdentifierInfo * IdentInfo
Sema - This implements semantic analysis and AST building for C.
Merge availability attributes for an implementation of a protocol requirement.
A little helper class used to produce diagnostics.
Represents a prototype with parameter type info, e.g.
SmallVector< CallExpr *, 8 > DelayedDecltypeCalls
If we are processing a decltype type, a set of call expressions for which we have deferred checking t...
TentativeDefinitionsType TentativeDefinitions
All the tentative definitions encountered in the TU.
ResultTypeCompatibilityKind
Describes the compatibility of a result type with its method.
llvm::DenseMap< Selector, GlobalMethods > GlobalMethodPool
static bool isEqual(const FunctionDeclAndLoc &LHS, const FunctionDeclAndLoc &RHS)
Retains information about a captured region.
llvm::SmallPtrSet< Selector, 8 > SelectorSet
A RAII object to enter scope of a compound statement.
Represents a ValueDecl that came out of a declarator.
CastKind
CastKind - The kind of operation required for a conversion.
The return type of classify().
Template argument deduction did not deduce a value for every template parameter.
static FunctionDeclAndLoc getTombstoneKey()
FunctionVoidPointer - The assignment is between a function pointer and void*, which the standard does...
llvm::FoldingSet< SpecialMemberOverloadResultEntry > SpecialMemberCache
A cache of special member function overload resolution results for C++ records.
ArraySizeModifier
Capture whether this is a normal array (e.g.
const Decl * PragmaAttributeCurrentTargetDecl
The declaration that is currently receiving an attribute from the #pragma attribute stack...
TemplateParameterListEqualKind
Enumeration describing how template parameter lists are compared for equality.
DelayedDiagnosticsState ParsingDeclState
We are instantiating a template declaration.
Captures information about a #pragma weak directive.
std::function< void(const TypoCorrection &)> TypoDiagnosticGenerator
This represents '#pragma omp requires...' directive.
Scope * getCurScope() const
Retrieve the parser's current scope.
llvm::PointerIntPair< CXXRecordDecl *, 3, CXXSpecialMember > SpecialMemberDecl
SourceLocation IdentifierLoc
The location of the identifier.
Allows QualTypes to be sorted and hence used in maps and sets.
NameClassification(ParsedType Type)
SmallVector< PendingImplicitInstantiation, 1 > LateParsedInstantiations
Queue of implicit template instantiations that cannot be performed eagerly.
Retains information about a block that is currently being parsed.
void popWithoutEmitting(DelayedDiagnosticsState state)
Leave a delayed-diagnostic state that was previously pushed.
const char * getTypeName(ID Id)
getTypeName - Return the name of the type for Id.
llvm::DenseSet< FunctionDeclAndLoc > LocsWithCUDACallDiags
FunctionDecls and SourceLocations for which CheckCUDACall has emitted a (maybe deferred) "bad call" d...
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
LookupNameKind
Describes the kind of name lookup to perform.
SmallVector< Decl *, 2 > WeakTopLevelDecl
WeakTopLevelDecl - Translation-unit scoped declarations generated by #pragma weak during processing o...
DelayedDiagnosticsState push(sema::DelayedDiagnosticPool &pool)
Enter a new scope.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Slot(llvm::StringRef StackSlotLabel, ValueType Value, SourceLocation PragmaLocation, SourceLocation PragmaPushLocation)
Helper class that collects exception specifications for implicitly-declared special member functions...
When performing template argument deduction for a function template, there were too many call argumen...
llvm::SmallPtrSet< const Decl *, 4 > ParsingInitForAutoVars
ParsingInitForAutoVars - a set of declarations with auto types for which we are currently parsing the...
Declaration of a template type parameter.
The message is an instance message.
This file defines the classes used to store parsed information about declaration-specifiers and decla...
bool isInvalid() const
Determines whether we have exceeded the maximum recursive template instantiations.
We are substituting template argument determined as part of template argument deduction for either a ...
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents a C++ destructor within a class.
LazyDeclPtr StdNamespace
The C++ "std" namespace, where the standard library resides.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
SpecialMemberOverloadResult()
Code completion occurs within an Objective-C interface, protocol, or category.
bool InNonInstantiationSFINAEContext
Whether we are in a SFINAE context that is not associated with template instantiation.
IncompatibleVectors - The assignment is between two vector types that have the same size...
llvm::MapVector< IdentifierInfo *, WeakInfo > WeakUndeclaredIdentifiers
WeakUndeclaredIdentifiers - Identifiers contained in #pragma weak before declared.
OpenMPClauseKind
OpenMP clauses.
QualType FindCompositePointerType(SourceLocation Loc, ExprResult &E1, ExprResult &E2, bool ConvertArgs=true)
void PopFunctionScopeInfo(const sema::AnalysisBasedWarnings::Policy *WP=nullptr, const Decl *D=nullptr, const BlockExpr *blkExpr=nullptr)
PragmaStack< StringLiteral * > BSSSegStack
Initial building of a for-range statement.
When performing template argument deduction for a function template, there were too few call argument...
IdentifierResolver - Keeps track of shadowed decls on enclosing scopes.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
CXXTryStmt - A C++ try block, including all handlers.
IncompatiblePointerDiscardsQualifiers - The assignment discards qualifiers that we don't permit to be...
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Ref_Related - The two types are reference-related, which means that their unqualified forms (T1 and T...
Represents a C++ template name within the type system.
QualType NSNumberPointer
Pointer to NSNumber type (NSNumber *).
ReferenceCompareResult
ReferenceCompareResult - Expresses the result of comparing two types (cv1 T1 and cv2 T2) to determine...
Defines the clang::TypeLoc interface and its subclasses.
bool isVisible(const NamedDecl *D)
Determine whether a declaration is visible to name lookup.
Code completion occurs within a statement, which may also be an expression or a declaration.
std::unique_ptr< MangleNumberingContext > MangleNumbering
The context information used to mangle lambda expressions and block literals within this context...
TemplateNameKind
Specifies the kind of template name that an identifier refers to.
SmallVector< LateInstantiatedAttribute, 16 > LateInstantiatedAttrVec
SmallVector< VTableUse, 16 > VTableUses
The list of vtables that are required but have not yet been materialized.
An RAII helper that pops function a function scope on exit.
StorageClass
Storage classes.
CleanupInfo ParentCleanup
Whether the enclosing context needed a cleanup.
static bool TooManyArguments(size_t NumParams, size_t NumArgs, bool PartialOverloading=false)
To be used for checking whether the arguments being passed to function exceeds the number of paramete...
SmallVector< sema::FunctionScopeInfo *, 4 > FunctionScopes
Stack containing information about each of the nested function, block, and method scopes that are cur...
InClassInitStyle
In-class initialization styles for non-static data members.
NameClassification(ExprResult Expr)
An expression that sends a message to the given Objective-C object or class.
A mapping from file IDs to a record of whether we've seen nullability information in that file...
Data structure that captures multiple levels of template argument lists for use in template instantia...
llvm::SmallPtrSet< const Expr *, 8 > PossibleDerefs
Preprocessor & getPreprocessor() const
IdentifierInfo * Identifier
The identifier preceding the '::'.
bool RequireCompleteType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ObjCMethodDecl * ArrayWithObjectsMethod
The declaration of the arrayWithObjects:count: method.
const FunctionProtoType::ExtParameterInfo * getPointerOrNull(unsigned numParams)
Return a pointer (suitable for setting in an ExtProtoInfo) to the ExtParameterInfo array we've built ...
void addContextNote(SourceLocation UseLoc)
SmallVector< attr::SubjectMatchRule, 4 > MatchRules
After substituting deduced template arguments, a dependent parameter type did not match the correspon...
Represents a C++ conversion function within a class.
Code completion occurs within the list of instance variables in an Objective-C interface, protocol, category, or implementation.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
PragmaClangSectionKind
pragma clang section kind
ObjCKeywordKind
Provides a namespace for Objective-C keywords which start with an '@'.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
SourceLocation PointerLoc
The first pointer declarator (of any pointer kind) in the file that does not have a corresponding nul...
unsigned NumSFINAEErrors
The number of SFINAE diagnostics that have been trapped.
This is a legitimate overload: the existing declarations are functions or function templates with dif...
ExprResult ActOnFinishFullExpr(Expr *Expr)
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, FunctionDeclAndLoc > CUDAKnownEmittedFns
An inverse call graph, mapping known-emitted functions to one of their known-emitted callers (plus th...
An abstract interface that should be implemented by external AST sources that also provide informatio...
~LocalEagerInstantiationScope()
ExprResult CorrectDelayedTyposInExpr(ExprResult ER, llvm::function_ref< ExprResult(Expr *)> Filter)
CanonicalDeclPtr< FunctionDecl > FD
static StringRef getPrintable(StringRef S)
DelegatingCtorDeclsType DelegatingCtorDecls
All the delegating constructors seen so far in the file, used for cycle detection at the end of the T...
std::pair< const IdentifierInfo *, uint64_t > TypeTagMagicValue
A pair of ArgumentKind identifier and magic value.
noexcept(expression), evals to 'false'
LazyVector< TypedefNameDecl *, ExternalSemaSource, &ExternalSemaSource::ReadExtVectorDecls, 2, 2 > ExtVectorDeclsType
bool hasVisibleDefinition(const NamedDecl *D)
StringLiteral * CurInitSeg
Last section used with #pragma init_seg.
CanThrowResult
Possible results from evaluation of a noexcept expression.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
static unsigned getPrintable(unsigned I)
static bool DiagnoseUnexpandedParameterPacks(Sema &S, TemplateTemplateParmDecl *TTP)
Check for unexpanded parameter packs within the template parameters of a template template parameter...
Represents a C++ Modules TS module export declaration.
NameClassificationKind
Describes the result of the name lookup and resolution performed by ClassifyName().
void pushCodeSynthesisContext(CodeSynthesisContext Ctx)
We are declaring an implicit special member function.
CXXSpecialMember SpecialMember
The special member being declared or defined.
Tag name lookup, which finds the names of enums, classes, structs, and unions.
RecordDecl * CXXTypeInfoDecl
The C++ "type_info" declaration, which is defined in <typeinfo>.
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
ImplicitConversionSequence - Represents an implicit conversion sequence, which may be a standard conv...
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
ExceptionSpecificationType Type
The kind of exception specification this is.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
Represents the parsed form of a C++ template argument.
A stack object to be created when performing template instantiation.
TypeTagData(QualType Type, bool LayoutCompatible, bool MustBeNull)
ASTContext & getASTContext() const
LazyDeclPtr StdAlignValT
The C++ "std::align_val_t" enum class, which is defined by the C++ standard library.
llvm::SmallDenseMap< const ValueDecl *, const Expr *, 4 > VarsWithInheritedDSAType
DeduceAutoResult
Result type of DeduceAutoType.
Encodes a location in the source.
llvm::SmallPtrSet< Expr *, 2 > MaybeODRUseExprs
Store a list of either DeclRefExprs or MemberExprs that contain a reference to a variable (constant) ...
We are computing the exception specification for a defaulted special member function.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Defines enumerations for expression traits intrinsics.
SourceLocation CurrentPragmaLocation
llvm::SmallPtrSet< Expr *, 2 > SavedMaybeODRUseExprs
static unsigned getHashValue(const FunctionDeclAndLoc &FDL)
static const char * getPrintable(const char *S)
sema::TemplateDeductionInfo * DeductionInfo
The template deduction info object associated with the substitution or checking of explicit or deduce...
static SourceRange getPrintable(const Expr *E)
Template argument deduction failed due to inconsistent cv-qualifiers on a template parameter type tha...
Represents the declaration of a struct/union/class/enum.
OpenMPDirectiveKind
OpenMP directives.
Represents the declaration of a label.
IncompatiblePointer - The assignment is between two pointers types that are not compatible, but we accept them as an extension.
ParsedAttr - Represents a syntactic attribute.
Template argument deduction did not deduce a value for every expansion of an expanded template parame...
SynthesisKind
The kind of template instantiation we are performing.
DelayedDiagnosticsState ProcessingContextState
Decl * ManglingContextDecl
The declaration that provides context for lambda expressions and block literals if the normal declara...
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
ClassTemplateDecl * StdInitializerList
The C++ "std::initializer_list" template, which is defined in <initializer_list>. ...
Represents a static or instance method of a struct/union/class.
ParsedType getType() const
SourceLocation CCLoc
The location of the '::'.
bool shouldDelayDiagnostics()
Determines whether diagnostics should be delayed.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Only look for allocation functions in the scope of the allocated class.
TemplateNameKind getTemplateNameKind() const
llvm::SmallPtrSet< const CXXRecordDecl *, 8 > RecordDeclSetTy
SFINAETrap(Sema &SemaRef, bool AccessCheckingSFINAE=false)
We are checking the validity of a default template argument that has been used when naming a template...
The declaration was invalid; do nothing.
static DeclarationName getPrintable(DeclarationName N)
ObjCCategoryDecl - Represents a category declaration.
This is a basic class for representing single OpenMP clause.
The message is sent to 'super'.
static bool hasVisibleDefaultArgument(Sema &S, const ParmDecl *D, llvm::SmallVectorImpl< Module *> *Modules)
static bool isCast(CheckedConversionKind CCK)
bool CollectStats
Flag indicating whether or not to collect detailed statistics.
static void CheckBoolLikeConversion(Sema &S, Expr *E, SourceLocation CC)
Check conversion of given expression to boolean.
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
SourceLocation PragmaLocation
bool RequireNonAbstractType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
Describes the kind of initialization being performed, along with location information for tokens rela...
PragmaStack< MSVtorDispAttr::Mode > VtorDispStack
Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI.
void EmitCurrentDiagnostic(unsigned DiagID)
Cause the active diagnostic on the DiagosticsEngine to be emitted.
SourceLocation OptimizeOffPragmaLocation
This represents the last location of a "#pragma clang optimize off" directive if such a directive has...
Represents a C++11 virt-specifier-seq.
CodeCompleteConsumer * CodeCompleter
Code-completion consumer.
unsigned NumTypos
The number of typos encountered during this expression evaluation context (i.e.
Represents one property declaration in an Objective-C interface.
void SetLateTemplateParser(LateTemplateParserCB *LTP, LateTemplateParserCleanupCB *LTPCleanup, void *P)
OpaquePtr< TemplateName > TemplateTy
llvm::DenseSet< std::pair< Decl *, unsigned > > InstantiatingSpecializations
Specializations whose definitions are currently being instantiated.
llvm::SmallSetVector< CXXRecordDecl *, 16 > AssociatedClassSet
const IdentifierInfo * Namespace
The namespace of this push group.
std::unique_ptr< CXXFieldCollector > FieldCollector
FieldCollector - Collects CXXFieldDecls during parsing of C++ classes.
static NameClassification FunctionTemplate(TemplateName Name)
PragmaMSPointersToMembersKind
The name is a dependent name, so the results will differ from one instantiation to the next...
bool IsBuildingRecoveryCallExpr
Flag indicating if Sema is building a recovery call expression.
DeductionFailureInfo MakeDeductionFailureInfo(ASTContext &Context, Sema::TemplateDeductionResult TDK, sema::TemplateDeductionInfo &Info)
Convert from Sema's representation of template deduction information to the form used in overload-can...
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13...
Constant expression in a noptr-new-declarator.
LocalEagerInstantiationScope(Sema &S)
ParameterABI
Kinds of parameter ABI.
llvm::DenseMap< ParmVarDecl *, llvm::TinyPtrVector< ParmVarDecl * > > UnparsedDefaultArgInstantiationsMap
TentativeAnalysisScope(Sema &SemaRef)
ASTConsumer & getASTConsumer() const
CUDAFunctionTarget CurrentCUDATarget()
Gets the CUDA target for the current context.
if(!SameAsAllPredecessors) State -> printDOT(Out, N->getLocationContext())
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
SynthesizedFunctionScope(Sema &S, DeclContext *DC)
void setLastDiagnosticIgnored(bool Ignored=true)
Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed...
QualType NSValuePointer
Pointer to NSValue type (NSValue *).
Defines various enumerations that describe declaration and type specifiers.
A POD class for pairing a NamedDecl* with an access specifier.
The expression in a static assertion.
Expression in a case label.
A class for storing results from argument-dependent lookup.
OpaquePtr< QualType > TypeTy
static std::enable_if< IsPartialSpecialization< T >::value, Sema::TemplateDeductionResult >::type FinishTemplateArgumentDeduction(Sema &S, T *Partial, bool IsPartialOrdering, const TemplateArgumentList &TemplateArgs, SmallVectorImpl< DeducedTemplateArgument > &Deduced, TemplateDeductionInfo &Info)
Complete template argument deduction for a partial specialization.
Base class for declarations which introduce a typedef-name.
Abstract interface for a consumer of code-completion information.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a template argument.
ParserCompletionContext
Describes the context in which code completion occurs.
TagTypeKind
The kind of a tag type.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
Abstract base class used to perform a contextual implicit conversion from an expression to any type p...
Dataflow Directional Tag Classes.
llvm::DenseMap< IdentifierInfo *, SrcLocSet > IdentifierSourceLocations
LateTemplateParserCleanupCB * LateTemplateParserCleanup
SmallVector< CXXBindTemporaryExpr *, 8 > DelayedDecltypeBinds
If we are processing a decltype type, a set of temporary binding expressions for which we have deferr...
SourceLocation ImplicitMSInheritanceAttrLoc
Source location for newly created implicit MSInheritanceAttrs.
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
Don't merge availability attributes at all.
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
const DeclContext * getCurObjCLexicalContext() const
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
static ImplicitConversionSequence TryImplicitConversion(Sema &S, Expr *From, QualType ToType, bool SuppressUserConversions, bool AllowExplicit, bool InOverloadResolution, bool CStyle, bool AllowObjCWritebackConversion, bool AllowObjCConversionOnExplicit)
TryImplicitConversion - Attempt to perform an implicit conversion from the given expression (Expr) to...
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
We are instantiating a default argument for a function.
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
bool RequireLiteralType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
Reads an AST files chain containing the contents of a translation unit.
Represents a field injected from an anonymous union/struct into the parent scope. ...
bool IsAllowedCUDACall(const FunctionDecl *Caller, const FunctionDecl *Callee)
Determines whether Caller may invoke Callee, based on their CUDA host/device attributes.
static NameClassification VarTemplate(TemplateName Name)
SourceLocation PointerEndLoc
The end location for the first pointer declarator in the file.
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
LateInstantiatedAttribute(const Attr *A, LocalInstantiationScope *S, Decl *D)
A decomposition declaration.
ClassTemplateDecl * StdCoroutineTraitsCache
The C++ "std::coroutine_traits" template, which is defined in <coroutine_traits>
llvm::SmallSet< SourceLocation, 2 > SrcLocSet
A non-depnedent component of the parameter did not match the corresponding component of the argument...
bool GlobalNewDeleteDeclared
A flag to remember whether the implicit forms of operator new and delete have been declared...
The name of a declaration.
Represents the declaration of an Objective-C type parameter.
unsigned size() const
The number of exceptions in the exception specification.
SourceRange InstantiationRange
The source range that covers the construct that cause the instantiation, e.g., the template-id that c...
bool shouldDiagnoseTargetSupportFromOpenMP() const
Return true if (un)supported features for the current target should be diagnosed if OpenMP (offloadin...
llvm::SmallPtrSet< SpecialMemberDecl, 4 > SpecialMembersBeingDeclared
The C++ special members which we are currently in the process of declaring.
PragmaClangSection PragmaClangRodataSection
std::pair< CXXRecordDecl *, SourceLocation > VTableUse
The list of classes whose vtables have been used within this translation unit, and the source locatio...
ExpressionEvaluationContext Context
The expression evaluation context.
bool isConstantEvaluated() const
AllocationFunctionScope
The scope in which to find allocation functions.
IncompatibleBlockPointer - The assignment is between two block pointers types that are not compatible...
The lookup found an overload set of literal operator templates, which expect the characters of the sp...
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
IdentifierResolver IdResolver
Optional< sema::TemplateDeductionInfo * > isSFINAEContext() const
Determines whether we are currently in a context where template argument substitution failures are no...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
SpecialMemberOverloadResult(CXXMethodDecl *MD)
Abstract interface for a module loader.
The name refers to a template whose specialization produces a type.
bool isHidden() const
Determine whether this declaration might be hidden from name lookup.
llvm::MapVector< FieldDecl *, DeleteLocs > DeleteExprs
A dependently-generated diagnostic.
Represents a pointer to an Objective C object.
AvailabilityMergeKind
Describes the kind of merge to perform for availability attributes (including "deprecated", "unavailable", and "availability").
PragmaClangSection PragmaClangDataSection
void LateTemplateParserCB(void *P, LateParsedTemplate &LPT)
Callback to the parser to parse templated functions when needed.
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Encapsulates the data about a macro definition (e.g.
ObjCMethodDecl * LookupInstanceMethodInGlobalPool(Selector Sel, SourceRange R, bool receiverIdOrClass=false)
LookupInstanceMethodInGlobalPool - Returns the method and warns if there are multiple signatures...
llvm::DenseSet< QualType > InstantiatedNonDependentTypes
Non-dependent types used in templates that have already been instantiated by some template instantiat...
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
DeclarationName VAListTagName
VAListTagName - The declaration name corresponding to __va_list_tag.
EnterExpressionEvaluationContext(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, Sema::ExpressionEvaluationContextRecord::ExpressionKind ExprContext=Sema::ExpressionEvaluationContextRecord::EK_Other, bool ShouldEnter=true)
Location wrapper for a TemplateArgument.
SmallVector< PragmaAttributeGroup, 2 > PragmaAttributeStack
The template argument was specified in the code or was instantiated with some deduced template argume...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
CheckTemplateArgumentKind
Specifies the context in which a particular template argument is being checked.
LocalInstantiationScope * Scope
IntToBlockPointer - The assignment converts an int to a block pointer.
Represents a C++ base or member initializer.
ExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind)
ActOnCXXBoolLiteral - Parse {true,false} literals.
const QualType * data() const
The set of exceptions in the exception specification.
DeclContext * getCurLexicalContext() const
UnparsedDefaultArgInstantiationsMap UnparsedDefaultArgInstantiations
A mapping from parameters with unparsed default arguments to the set of instantiations of each parame...
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
SmallVector< ExpressionEvaluationContextRecord, 8 > ExprEvalContexts
A stack of expression evaluation contexts.
llvm::StringRef getCurrentOpenCLExtension() const
bool isInOpenMPDeclareTargetContext() const
Return true inside OpenMP declare target region.
static NameClassification Error()
llvm::SmallSetVector< NamedDecl *, 16 > NamedDeclSetType
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
Holds information about the various types of exception specification.
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
ArrayRef< TemplateArgument > template_arguments() const
Deduction failed; that's all we know.
static NameClassification Unknown()
bool isUnevaluated() const
ObjCInterfaceDecl * NSArrayDecl
The declaration of the Objective-C NSArray class.
~ArgumentPackSubstitutionIndexRAII()
FPContractStateRAII(Sema &S)
SmallVector< BlockDecl *, 8 > ExprCleanupObjects
ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current f...
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
static SourceRange getPrintable(SourceLocation L)
Represents a base class of a C++ class.
std::unique_ptr< sema::FunctionScopeInfo > PreallocatedFunctionScope
bool SavedInNonInstantiationSFINAEContext
Was the enclosing context a non-instantiation SFINAE context?
void ActOnStartOfCompoundStmt(bool IsStmtExpr)
PragmaStack< StringLiteral * > ConstSegStack
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
ProcessingContextState ParsingClassState
PragmaClangSection PragmaClangTextSection
ParsedType ObjectType
The type of the object, if we're parsing nested-name-specifier in a member access expression...
void * SkippedDefinitionContext
Describes whether we've seen any nullability information for the given file.
QualType QIDNSCopying
id<NSCopying> type.
RedeclarationKind forRedeclarationInCurContext()
bool isAlreadyInstantiating() const
Determine whether we are already instantiating this specialization in some surrounding active instant...
A template argument list.
Merge availability attributes for a redeclaration, which requires an exact match. ...
SemaDiagnosticBuilder diagnoseNoMatch(Sema &S, SourceLocation Loc, QualType T) override
Emits a diagnostic complaining that the expression does not have integral or enumeration type...
Expr * NoexceptExpr
Noexcept expression, if this is a computed noexcept specification.
llvm::DenseMap< NamedDecl *, NamedDecl * > VisibleNamespaceCache
Map from the most recent declaration of a namespace to the most recent visible declaration of that na...
An attributed type is a type to which a type attribute has been applied.
CCEKind
Contexts in which a converted constant expression is required.
static void BuildBasePathArray(const CXXBasePath &Path, CXXCastPath &BasePathArray)
OpaquePtr< DeclGroupRef > DeclGroupPtrTy
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
ExprResult CorrectDelayedTyposInExpr(Expr *E, llvm::function_ref< ExprResult(Expr *)> Filter)
Data structure used to record current or nested expression evaluation contexts.
void * VisContext
VisContext - Manages the stack for #pragma GCC visibility.
Describes the sequence of initializations required to initialize a given object or reference with a s...
The lookup found no match but no diagnostic was issued.
Captures information about "declaration specifiers".
Code completion occurs at the beginning of the initialization statement (or expression) in a for loop...
void LateTemplateParserCleanupCB(void *P)
ActionResult< Expr * > ExprResult
Only look for allocation functions in the global scope.
SourceLocation PragmaPushLocation
sema::DelayedDiagnosticPool * getCurrentPool() const
Returns the current delayed-diagnostics pool.
Represents a C++ struct/union/class.
Compatible - the types are compatible according to the standard.
Decl * D
The template function declaration to be late parsed.
sema::FunctionScopeInfo * getCurFunction() const
Look up a friend of a local class.
void PopParsingClass(ParsingClassState state)
A diagnostic message which has been conditionally emitted pending the complete parsing of the current...
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
ObjCIvarDecl - Represents an ObjC instance variable.
void popCodeSynthesisContext()
LangOptions::PragmaMSPointersToMembersKind MSPointerToMemberRepresentationMethod
Controls member pointer representation format under the MS ABI.
llvm::DenseMap< int, SourceRange > ParsedSubjectMatchRuleSet
Selector RespondsToSelectorSel
will hold 'respondsToSelector:'
TPOC
The context in which partial ordering of function templates occurs.
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
TranslationUnitKind
Describes the kind of translation unit being processed.
Declaration of a class template.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
Writes an AST file containing the contents of a translation unit.
SourceManager & getSourceManager() const
After substituting deduced template arguments, an element of a dependent parameter type did not match...
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
TranslationUnitKind TUKind
The kind of translation unit we are processing.
ExpressionEvaluationContext
Describes how the expressions currently being parsed are evaluated at run-time, if at all...
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Represents a complete lambda introducer.
We are substituting prior template arguments into a new template parameter.
a linked list of methods with the same selector name but different signatures.
std::pair< ObjCMethodList, ObjCMethodList > GlobalMethods
The translation unit is a complete translation unit.
ExprResult CorrectDelayedTyposInExpr(ExprResult ER, VarDecl *InitDecl=nullptr, llvm::function_ref< ExprResult(Expr *)> Filter=[](Expr *E) -> ExprResult { return E;})
ExceptionSpecificationType getExceptionSpecType() const
Get the computed exception specification type.
Designation - Represent a full designation, which is a sequence of designators.
FullExprArg MakeFullExpr(Expr *Arg, SourceLocation CC)
The name refers to a variable template whose specialization produces a variable.
static CXXRecordDecl * getCurrentInstantiationOf(QualType T, DeclContext *CurContext)
Find the current instantiation that associated with the given type.
A reference to a declared variable, function, enum, etc.
static SourceRange getPrintable(SourceRange R)
Code completion occurs within the condition of an if, while, switch, or for statement.
virtual ~ContextualImplicitConverter()
llvm::DenseMap< CXXRecordDecl *, bool > VTablesUsed
The set of classes whose vtables have been used within this translation unit, and a bit that will be ...
SourceManager & SourceMgr
CapturedRegionKind
The different kinds of captured statement.
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
Contains a late templated function.
ParamInfo - An array of paraminfo objects is allocated whenever a function declarator is parsed...
A push'd group of PragmaAttributeEntries.
static int getPrintable(int I)
class clang::Sema::DelayedDiagnostics DelayedDiagnostics
PragmaStack< unsigned > PackStack
A collection of diagnostics which were delayed.
Emit the diagnostic immediately, and, if it's a warning or error, also emit a call stack showing how ...
An instance of this class represents the declaration of a property member.
A wrapper class around a pointer that always points to its canonical declaration. ...
A trivial tuple used to represent a source range.
IncompatibleObjCQualifiedId - The assignment is between a qualified id type and something else (that ...
This represents a decl that may have a name.
QualType NSStringPointer
Pointer to NSString type (NSString *).
FullExprArg MakeFullDiscardedValueExpr(Expr *Arg)
Represents C++ using-directive.
The template argument was deduced via template argument deduction.
SourceLocation CurrentPragmaLocation
Look up of an operator name (e.g., operator+) for use with operator overloading.
Describes an entity that is being initialized.
static QualType getPrintable(QualType T)
ComparisonCategoryType
An enumeration representing the different comparison categories types.
The type of an arbitrary declaration.
ParsedAttributes - A collection of parsed attributes.
SourceLocation ColonLoc
Location of ':'.
SmallVector< Slot, 2 > Stack
brief A function argument from which we performed template argument
This represents '#pragma omp threadprivate ...' directive.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
The explicitly-specified template arguments were not valid template arguments for the given template...
The lookup resulted in an error.
SmallVector< std::pair< CXXMethodDecl *, const FunctionProtoType * >, 2 > DelayedDefaultedMemberExceptionSpecs
All the members seen during a class definition which were both explicitly defaulted and had explicitl...
This class handles loading and caching of source files into memory.
IncompatibleNestedPointerQualifiers - The assignment is between two nested pointer types...
The symbol does not exist.
Declaration of a template function.
llvm::DenseMap< const EnumDecl *, llvm::APInt > FlagBitsCache
A cache of the flags available in enumerations with the flag_bits attribute.
Code completion occurs in a parenthesized expression, which might also be a type cast.
void PushFunctionScope()
Enter a new function scope.
NullPointerConstantKind
Enumeration used to describe the kind of Null pointer constant returned from isNullPointerConstant()...
NamedDeclSetType UnusedPrivateFields
Set containing all declared private fields that are not used.
Attr - This represents one attribute.
This an attribute introduced by #pragma clang attribute.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
ParsedType actOnLambdaInitCaptureInitialization(SourceLocation Loc, bool ByRef, IdentifierInfo *Id, LambdaCaptureInitKind InitKind, Expr *&Init)
Perform initialization analysis of the init-capture and perform any implicit conversions such as an l...
ObjCMethodDecl * DictionaryWithObjectsMethod
The declaration of the dictionaryWithObjects:forKeys:count: method.
Helper class that creates diagnostics with optional template instantiation stacks.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
~TentativeAnalysisScope()
The triviality of a method unaffected by "trivial_abi".
bool hasErrorOccurred() const
Determine whether any SFINAE errors have been trapped.
llvm::DenseMap< ParmVarDecl *, SourceLocation > UnparsedDefaultArgLocs
StandardConversionSequence - represents a standard conversion sequence (C++ 13.3.3.1.1).
SourceLocation CurInitSegLoc