#include "TypeLocBuilder.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/CommentDiagnostic.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/EvaluatedExprVisitor.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/NonTrivialTypeVisitor.h"
#include "clang/AST/MangleNumberingContext.h"
#include "clang/AST/Randstruct.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/Type.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/HLSLRuntime.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/ModuleLoader.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/CXXFieldCollector.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/DelayedDiagnostic.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaCUDA.h"
#include "clang/Sema/SemaHLSL.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Sema/SemaOpenMP.h"
#include "clang/Sema/SemaPPC.h"
#include "clang/Sema/SemaRISCV.h"
#include "clang/Sema/SemaSwift.h"
#include "clang/Sema/SemaWasm.h"
#include "clang/Sema/Template.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cstring>
#include <functional>
#include <optional>
#include <unordered_map>
usingnamespaceclang;
usingnamespacesema;
Sema::DeclGroupPtrTy Sema::ConvertDeclToDeclGroup(Decl *Ptr, Decl *OwnedType) { … }
namespace {
class TypeNameValidatorCCC final : public CorrectionCandidateCallback { … };
}
namespace {
enum class UnqualifiedTypeNameLookupResult { … };
}
static UnqualifiedTypeNameLookupResult
lookupUnqualifiedTypeNameInBase(Sema &S, const IdentifierInfo &II,
SourceLocation NameLoc,
const CXXRecordDecl *RD) { … }
static ParsedType recoverFromTypeInKnownDependentBase(Sema &S,
const IdentifierInfo &II,
SourceLocation NameLoc) { … }
static ParsedType buildNamedType(Sema &S, const CXXScopeSpec *SS, QualType T,
SourceLocation NameLoc,
bool WantNontrivialTypeSourceInfo = true) { … }
ParsedType Sema::getTypeName(const IdentifierInfo &II, SourceLocation NameLoc,
Scope *S, CXXScopeSpec *SS, bool isClassName,
bool HasTrailingDot, ParsedType ObjectTypePtr,
bool IsCtorOrDtorName,
bool WantNontrivialTypeSourceInfo,
bool IsClassTemplateDeductionContext,
ImplicitTypenameContext AllowImplicitTypename,
IdentifierInfo **CorrectedII) { … }
static NestedNameSpecifier *
synthesizeCurrentNestedNameSpecifier(ASTContext &Context, DeclContext *DC) { … }
static const CXXRecordDecl *
findRecordWithDependentBasesOfEnclosingMethod(const DeclContext *DC) { … }
ParsedType Sema::ActOnMSVCUnknownTypeName(const IdentifierInfo &II,
SourceLocation NameLoc,
bool IsTemplateTypeArg) { … }
DeclSpec::TST Sema::isTagName(IdentifierInfo &II, Scope *S) { … }
bool Sema::isMicrosoftMissingTypename(const CXXScopeSpec *SS, Scope *S) { … }
void Sema::DiagnoseUnknownTypeName(IdentifierInfo *&II,
SourceLocation IILoc,
Scope *S,
CXXScopeSpec *SS,
ParsedType &SuggestedType,
bool IsTemplateName) { … }
static bool isResultTypeOrTemplate(LookupResult &R, const Token &NextToken) { … }
static bool isTagTypeWithMissingTag(Sema &SemaRef, LookupResult &Result,
Scope *S, CXXScopeSpec &SS,
IdentifierInfo *&Name,
SourceLocation NameLoc) { … }
Sema::NameClassification Sema::ClassifyName(Scope *S, CXXScopeSpec &SS,
IdentifierInfo *&Name,
SourceLocation NameLoc,
const Token &NextToken,
CorrectionCandidateCallback *CCC) { … }
ExprResult
Sema::ActOnNameClassifiedAsUndeclaredNonType(IdentifierInfo *Name,
SourceLocation NameLoc) { … }
ExprResult
Sema::ActOnNameClassifiedAsDependentNonType(const CXXScopeSpec &SS,
IdentifierInfo *Name,
SourceLocation NameLoc,
bool IsAddressOfOperand) { … }
ExprResult Sema::ActOnNameClassifiedAsNonType(Scope *S, const CXXScopeSpec &SS,
NamedDecl *Found,
SourceLocation NameLoc,
const Token &NextToken) { … }
ExprResult Sema::ActOnNameClassifiedAsOverloadSet(Scope *S, Expr *E) { … }
Sema::TemplateNameKindForDiagnostics
Sema::getTemplateNameKindForDiagnostics(TemplateName Name) { … }
void Sema::PushDeclContext(Scope *S, DeclContext *DC) { … }
void Sema::PopDeclContext() { … }
Sema::SkippedDefinitionContext Sema::ActOnTagStartSkippedDefinition(Scope *S,
Decl *D) { … }
void Sema::ActOnTagFinishSkippedDefinition(SkippedDefinitionContext Context) { … }
void Sema::EnterDeclaratorContext(Scope *S, DeclContext *DC) { … }
void Sema::ExitDeclaratorContext(Scope *S) { … }
void Sema::EnterTemplatedContext(Scope *S, DeclContext *DC) { … }
void Sema::ActOnReenterFunctionContext(Scope* S, Decl *D) { … }
void Sema::ActOnExitFunctionContext() { … }
static bool AllowOverloadingOfFunction(const LookupResult &Previous,
ASTContext &Context,
const FunctionDecl *New) { … }
void Sema::PushOnScopeChains(NamedDecl *D, Scope *S, bool AddToContext) { … }
bool Sema::isDeclInScope(NamedDecl *D, DeclContext *Ctx, Scope *S,
bool AllowInlineNamespace) const { … }
Scope *Sema::getScopeForDeclContext(Scope *S, DeclContext *DC) { … }
static bool isOutOfScopePreviousDeclaration(NamedDecl *,
DeclContext*,
ASTContext&);
void Sema::FilterLookupForScope(LookupResult &R, DeclContext *Ctx, Scope *S,
bool ConsiderLinkage,
bool AllowInlineNamespace) { … }
bool Sema::CheckRedeclarationModuleOwnership(NamedDecl *New, NamedDecl *Old) { … }
bool Sema::CheckRedeclarationExported(NamedDecl *New, NamedDecl *Old) { … }
bool Sema::CheckRedeclarationInModule(NamedDecl *New, NamedDecl *Old) { … }
bool Sema::IsRedefinitionInModule(const NamedDecl *New,
const NamedDecl *Old) const { … }
static bool isUsingDeclNotAtClassScope(NamedDecl *D) { … }
static void RemoveUsingDecls(LookupResult &R) { … }
static bool IsDisallowedCopyOrAssign(const CXXMethodDecl *D) { … }
bool Sema::mightHaveNonExternalLinkage(const DeclaratorDecl *D) { … }
static bool isMainFileLoc(const Sema &S, SourceLocation Loc) { … }
bool Sema::ShouldWarnIfUnusedFileScopedDecl(const DeclaratorDecl *D) const { … }
void Sema::MarkUnusedFileScopedDecl(const DeclaratorDecl *D) { … }
static bool ShouldDiagnoseUnusedDecl(const LangOptions &LangOpts,
const NamedDecl *D) { … }
static void GenerateFixForUnusedDecl(const NamedDecl *D, ASTContext &Ctx,
FixItHint &Hint) { … }
void Sema::DiagnoseUnusedNestedTypedefs(const RecordDecl *D) { … }
void Sema::DiagnoseUnusedNestedTypedefs(const RecordDecl *D,
DiagReceiverTy DiagReceiver) { … }
void Sema::DiagnoseUnusedDecl(const NamedDecl *D) { … }
void Sema::DiagnoseUnusedDecl(const NamedDecl *D, DiagReceiverTy DiagReceiver) { … }
void Sema::DiagnoseUnusedButSetDecl(const VarDecl *VD,
DiagReceiverTy DiagReceiver) { … }
static void CheckPoppedLabel(LabelDecl *L, Sema &S,
Sema::DiagReceiverTy DiagReceiver) { … }
void Sema::ActOnPopScope(SourceLocation Loc, Scope *S) { … }
Scope *Sema::getNonFieldDeclScope(Scope *S) { … }
static StringRef getHeaderName(Builtin::Context &BuiltinInfo, unsigned ID,
ASTContext::GetBuiltinTypeError Error) { … }
FunctionDecl *Sema::CreateBuiltin(IdentifierInfo *II, QualType Type,
unsigned ID, SourceLocation Loc) { … }
NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID,
Scope *S, bool ForRedeclaration,
SourceLocation Loc) { … }
static void
filterNonConflictingPreviousTypedefDecls(Sema &S, const TypedefNameDecl *Decl,
LookupResult &Previous) { … }
bool Sema::isIncompatibleTypedef(const TypeDecl *Old, TypedefNameDecl *New) { … }
void Sema::MergeTypedefNameDecl(Scope *S, TypedefNameDecl *New,
LookupResult &OldDecls) { … }
static bool DeclHasAttr(const Decl *D, const Attr *A) { … }
static bool isAttributeTargetADefinition(Decl *D) { … }
static bool mergeAlignedAttrs(Sema &S, NamedDecl *New, Decl *Old) { … }
#define WANT_DECL_MERGE_LOGIC
#include "clang/Sema/AttrParsedAttrImpl.inc"
#undef WANT_DECL_MERGE_LOGIC
static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
const InheritableAttr *Attr,
Sema::AvailabilityMergeKind AMK) { … }
static const NamedDecl *getDefinition(const Decl *D) { … }
static bool hasAttribute(const Decl *D, attr::Kind Kind) { … }
static void checkNewAttributesAfterDef(Sema &S, Decl *New, const Decl *Old) { … }
static void diagnoseMissingConstinit(Sema &S, const VarDecl *InitDecl,
const ConstInitAttr *CIAttr,
bool AttrBeforeInit) { … }
void Sema::mergeDeclAttributes(NamedDecl *New, Decl *Old,
AvailabilityMergeKind AMK) { … }
static void mergeParamDeclAttributes(ParmVarDecl *newDecl,
const ParmVarDecl *oldDecl,
Sema &S) { … }
static bool EquivalentArrayTypes(QualType Old, QualType New,
const ASTContext &Ctx) { … }
static void mergeParamDeclTypes(ParmVarDecl *NewParam,
const ParmVarDecl *OldParam,
Sema &S) { … }
namespace {
struct GNUCompatibleParamWarning { … };
}
template <typename T>
static std::pair<diag::kind, SourceLocation>
getNoteDiagForInvalidRedeclaration(const T *Old, const T *New) { … }
static bool canRedefineFunction(const FunctionDecl *FD,
const LangOptions& LangOpts) { … }
const AttributedType *Sema::getCallingConvAttributedType(QualType T) const { … }
template <typename T>
static bool haveIncompatibleLanguageLinkages(const T *Old, const T *New) { … }
template<typename T> static bool isExternC(T *D) { … }
static bool isExternC(VarTemplateDecl *) { … }
static bool isExternC(FunctionTemplateDecl *) { … }
template<typename ExpectedDecl>
static bool checkUsingShadowRedecl(Sema &S, UsingShadowDecl *OldS,
ExpectedDecl *New) { … }
static bool hasIdenticalPassObjectSizeAttrs(const FunctionDecl *A,
const FunctionDecl *B) { … }
static void adjustDeclContextForDeclaratorDecl(DeclaratorDecl *NewD,
DeclaratorDecl *OldD) { … }
bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD, Scope *S,
bool MergeTypeWithOld, bool NewDeclIsDefn) { … }
bool Sema::MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old,
Scope *S, bool MergeTypeWithOld) { … }
void Sema::mergeObjCMethodDecls(ObjCMethodDecl *newMethod,
ObjCMethodDecl *oldMethod) { … }
static void diagnoseVarDeclTypeMismatch(Sema &S, VarDecl *New, VarDecl* Old) { … }
void Sema::MergeVarDeclTypes(VarDecl *New, VarDecl *Old,
bool MergeTypeWithOld) { … }
static bool mergeTypeWithPrevious(Sema &S, VarDecl *NewVD, VarDecl *OldVD,
LookupResult &Previous) { … }
void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) { … }
void Sema::notePreviousDefinition(const NamedDecl *Old, SourceLocation New) { … }
bool Sema::checkVarDeclRedefinition(VarDecl *Old, VarDecl *New) { … }
Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
DeclSpec &DS,
const ParsedAttributesView &DeclAttrs,
RecordDecl *&AnonRecord) { … }
static unsigned getMSManglingNumber(const LangOptions &LO, Scope *S) { … }
void Sema::handleTagNumbering(const TagDecl *Tag, Scope *TagScope) { … }
namespace {
struct NonCLikeKind { … };
}
static NonCLikeKind getNonCLikeKindForAnonymousStruct(const CXXRecordDecl *RD) { … }
void Sema::setTagNameForLinkagePurposes(TagDecl *TagFromDeclSpec,
TypedefNameDecl *NewTD) { … }
static unsigned GetDiagnosticTypeSpecifierID(const DeclSpec &DS) { … }
Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
DeclSpec &DS,
const ParsedAttributesView &DeclAttrs,
MultiTemplateParamsArg TemplateParams,
bool IsExplicitInstantiation,
RecordDecl *&AnonRecord,
SourceLocation EllipsisLoc) { … }
static bool CheckAnonMemberRedeclaration(Sema &SemaRef, Scope *S,
DeclContext *Owner,
DeclarationName Name,
SourceLocation NameLoc, bool IsUnion,
StorageClass SC) { … }
void Sema::ActOnDefinedDeclarationSpecifier(Decl *D) { … }
void Sema::DiagPlaceholderFieldDeclDefinitions(RecordDecl *Record) { … }
static bool
InjectAnonymousStructOrUnionMembers(Sema &SemaRef, Scope *S, DeclContext *Owner,
RecordDecl *AnonRecord, AccessSpecifier AS,
StorageClass SC,
SmallVectorImpl<NamedDecl *> &Chaining) { … }
static StorageClass
StorageClassSpecToVarDeclStorageClass(const DeclSpec &DS) { … }
static SourceLocation findDefaultInitializer(const CXXRecordDecl *Record) { … }
static void checkDuplicateDefaultInit(Sema &S, CXXRecordDecl *Parent,
SourceLocation DefaultInitLoc) { … }
static void checkDuplicateDefaultInit(Sema &S, CXXRecordDecl *Parent,
CXXRecordDecl *AnonUnion) { … }
Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
AccessSpecifier AS,
RecordDecl *Record,
const PrintingPolicy &Policy) { … }
Decl *Sema::BuildMicrosoftCAnonymousStruct(Scope *S, DeclSpec &DS,
RecordDecl *Record) { … }
DeclarationNameInfo Sema::GetNameForDeclarator(Declarator &D) { … }
DeclarationNameInfo
Sema::GetNameFromUnqualifiedId(const UnqualifiedId &Name) { … }
static QualType getCoreType(QualType Ty) { … }
static bool hasSimilarParameters(ASTContext &Context,
FunctionDecl *Declaration,
FunctionDecl *Definition,
SmallVectorImpl<unsigned> &Params) { … }
static bool RebuildDeclaratorInCurrentInstantiation(Sema &S, Declarator &D,
DeclarationName Name) { … }
static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { … }
void Sema::warnOnReservedIdentifier(const NamedDecl *D) { … }
Decl *Sema::ActOnDeclarator(Scope *S, Declarator &D) { … }
bool Sema::DiagnoseClassNameShadow(DeclContext *DC,
DeclarationNameInfo NameInfo) { … }
bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec &SS, DeclContext *DC,
DeclarationName Name,
SourceLocation Loc,
TemplateIdAnnotation *TemplateId,
bool IsMemberSpecialization) { … }
NamedDecl *Sema::HandleDeclarator(Scope *S, Declarator &D,
MultiTemplateParamsArg TemplateParamLists) { … }
static QualType TryToFixInvalidVariablyModifiedType(QualType T,
ASTContext &Context,
bool &SizeIsNegative,
llvm::APSInt &Oversized) { … }
static void
FixInvalidVariablyModifiedTypeLoc(TypeLoc SrcTL, TypeLoc DstTL) { … }
static TypeSourceInfo*
TryToFixInvalidVariablyModifiedTypeSourceInfo(TypeSourceInfo *TInfo,
ASTContext &Context,
bool &SizeIsNegative,
llvm::APSInt &Oversized) { … }
bool Sema::tryToFixVariablyModifiedVarType(TypeSourceInfo *&TInfo,
QualType &T, SourceLocation Loc,
unsigned FailedFoldDiagID) { … }
void
Sema::RegisterLocallyScopedExternCDecl(NamedDecl *ND, Scope *S) { … }
NamedDecl *Sema::findLocallyScopedExternCDecl(DeclarationName Name) { … }
void Sema::DiagnoseFunctionSpecifiers(const DeclSpec &DS) { … }
NamedDecl*
Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
TypeSourceInfo *TInfo, LookupResult &Previous) { … }
void
Sema::CheckTypedefForVariablyModifiedType(Scope *S, TypedefNameDecl *NewTD) { … }
NamedDecl*
Sema::ActOnTypedefNameDecl(Scope *S, DeclContext *DC, TypedefNameDecl *NewTD,
LookupResult &Previous, bool &Redeclaration) { … }
static bool
isOutOfScopePreviousDeclaration(NamedDecl *PrevDecl, DeclContext *DC,
ASTContext &Context) { … }
static void SetNestedNameSpecifier(Sema &S, DeclaratorDecl *DD, Declarator &D) { … }
void Sema::deduceOpenCLAddressSpace(ValueDecl *Decl) { … }
static void checkAttributesAfterMerging(Sema &S, NamedDecl &ND) { … }
static void checkDLLAttributeRedeclaration(Sema &S, NamedDecl *OldDecl,
NamedDecl *NewDecl,
bool IsSpecialization,
bool IsDefinition) { … }
static bool isFunctionDefinitionDiscarded(Sema &S, FunctionDecl *FD) { … }
template<typename T>
static bool isIncompleteDeclExternC(Sema &S, const T *D) { … }
static bool shouldConsiderLinkage(const VarDecl *VD) { … }
static bool shouldConsiderLinkage(const FunctionDecl *FD) { … }
static bool hasParsedAttr(Scope *S, const Declarator &PD,
ParsedAttr::Kind Kind) { … }
bool Sema::adjustContextForLocalExternDecl(DeclContext *&DC) { … }
static bool isDeclExternC(const Decl *D) { … }
static bool diagnoseOpenCLTypes(Sema &Se, VarDecl *NewVD) { … }
template <typename AttrTy>
static void copyAttrFromTypedefToDecl(Sema &S, Decl *D, const TypedefType *TT) { … }
static void emitReadOnlyPlacementAttrWarning(Sema &S, const VarDecl *VD) { … }
static bool isMainVar(DeclarationName Name, VarDecl *VD) { … }
NamedDecl *Sema::ActOnVariableDeclarator(
Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo,
LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists,
bool &AddToScope, ArrayRef<BindingDecl *> Bindings) { … }
enum ShadowedDeclKind { … };
static ShadowedDeclKind computeShadowedDeclKind(const NamedDecl *ShadowedDecl,
const DeclContext *OldDC) { … }
static SourceLocation getCaptureLocation(const LambdaScopeInfo *LSI,
const VarDecl *VD) { … }
static bool shouldWarnIfShadowedDecl(const DiagnosticsEngine &Diags,
const LookupResult &R) { … }
NamedDecl *Sema::getShadowedDeclaration(const VarDecl *D,
const LookupResult &R) { … }
NamedDecl *Sema::getShadowedDeclaration(const TypedefNameDecl *D,
const LookupResult &R) { … }
NamedDecl *Sema::getShadowedDeclaration(const BindingDecl *D,
const LookupResult &R) { … }
void Sema::CheckShadow(NamedDecl *D, NamedDecl *ShadowedDecl,
const LookupResult &R) { … }
void Sema::DiagnoseShadowingLambdaDecls(const LambdaScopeInfo *LSI) { … }
void Sema::CheckShadow(Scope *S, VarDecl *D) { … }
void Sema::CheckShadowingDeclModification(Expr *E, SourceLocation Loc) { … }
template<typename T>
static bool checkGlobalOrExternCConflict(
Sema &S, const T *ND, bool IsGlobal, LookupResult &Previous) { … }
template<typename T>
static bool checkForConflictWithNonVisibleExternC(Sema &S, const T *ND,
LookupResult &Previous) { … }
static bool CheckC23ConstexprVarType(Sema &SemaRef, SourceLocation VarLoc,
QualType T) { … }
void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { … }
bool Sema::CheckVariableDeclaration(VarDecl *NewVD, LookupResult &Previous) { … }
bool Sema::AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD) { … }
namespace {
struct ActOnFDArgs { … };
}
namespace {
class DifferentNameValidatorCCC final : public CorrectionCandidateCallback { … };
}
void Sema::MarkTypoCorrectedFunctionDefinition(const NamedDecl *F) { … }
static NamedDecl *DiagnoseInvalidRedeclaration(
Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD,
ActOnFDArgs &ExtraArgs, bool IsLocalFriend, Scope *S) { … }
static StorageClass getFunctionStorageClass(Sema &SemaRef, Declarator &D) { … }
static FunctionDecl *CreateNewFunctionDecl(Sema &SemaRef, Declarator &D,
DeclContext *DC, QualType &R,
TypeSourceInfo *TInfo,
StorageClass SC,
bool &IsVirtualOkay) { … }
enum OpenCLParamType { … };
static bool isOpenCLSizeDependentType(ASTContext &C, QualType Ty) { … }
static OpenCLParamType getOpenCLKernelParameterType(Sema &S, QualType PT) { … }
static void checkIsValidOpenCLKernelParameter(
Sema &S,
Declarator &D,
ParmVarDecl *Param,
llvm::SmallPtrSetImpl<const Type *> &ValidTypes) { … }
static DeclContext *getTagInjectionContext(DeclContext *DC) { … }
static Scope *getTagInjectionScope(Scope *S, const LangOptions &LangOpts) { … }
static bool isStdBuiltin(ASTContext &Ctx, FunctionDecl *FD,
unsigned BuiltinID) { … }
NamedDecl*
Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
TypeSourceInfo *TInfo, LookupResult &Previous,
MultiTemplateParamsArg TemplateParamListsRef,
bool &AddToScope) { … }
static Attr *getImplicitCodeSegAttrFromClass(Sema &S, const FunctionDecl *FD) { … }
Attr *Sema::getImplicitCodeSegOrSectionAttrForFunction(const FunctionDecl *FD,
bool IsDefinition) { … }
bool Sema::canFullyTypeCheckRedeclaration(ValueDecl *NewD, ValueDecl *OldD,
QualType NewT, QualType OldT) { … }
bool Sema::shouldLinkDependentDeclWithPrevious(Decl *D, Decl *PrevDecl) { … }
static bool CheckMultiVersionValue(Sema &S, const FunctionDecl *FD) { … }
static bool AttrCompatibleWithMultiVersion(attr::Kind Kind,
MultiVersionKind MVKind) { … }
static bool checkNonMultiVersionCompatAttributes(Sema &S,
const FunctionDecl *FD,
const FunctionDecl *CausedFD,
MultiVersionKind MVKind) { … }
bool Sema::areMultiversionVariantFunctionsCompatible(
const FunctionDecl *OldFD, const FunctionDecl *NewFD,
const PartialDiagnostic &NoProtoDiagID,
const PartialDiagnosticAt &NoteCausedDiagIDAt,
const PartialDiagnosticAt &NoSupportDiagIDAt,
const PartialDiagnosticAt &DiffDiagIDAt, bool TemplatesSupported,
bool ConstexprSupported, bool CLinkageMayDiffer) { … }
static bool CheckMultiVersionAdditionalRules(Sema &S, const FunctionDecl *OldFD,
const FunctionDecl *NewFD,
bool CausesMV,
MultiVersionKind MVKind) { … }
static bool CheckMultiVersionFirstFunction(Sema &S, FunctionDecl *FD) { … }
static bool PreviousDeclsHaveMultiVersionAttribute(const FunctionDecl *FD) { … }
static void patchDefaultTargetVersion(FunctionDecl *From, FunctionDecl *To) { … }
static bool CheckDeclarationCausesMultiVersioning(Sema &S, FunctionDecl *OldFD,
FunctionDecl *NewFD,
bool &Redeclaration,
NamedDecl *&OldDecl,
LookupResult &Previous) { … }
static bool MultiVersionTypesCompatible(FunctionDecl *Old, FunctionDecl *New) { … }
static bool CheckMultiVersionAdditionalDecl(
Sema &S, FunctionDecl *OldFD, FunctionDecl *NewFD,
const CPUDispatchAttr *NewCPUDisp, const CPUSpecificAttr *NewCPUSpec,
const TargetClonesAttr *NewClones, bool &Redeclaration, NamedDecl *&OldDecl,
LookupResult &Previous) { … }
static bool CheckMultiVersionFunction(Sema &S, FunctionDecl *NewFD,
bool &Redeclaration, NamedDecl *&OldDecl,
LookupResult &Previous) { … }
static void CheckConstPureAttributesUsage(Sema &S, FunctionDecl *NewFD) { … }
bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
LookupResult &Previous,
bool IsMemberSpecialization,
bool DeclIsDefn) { … }
void Sema::CheckMain(FunctionDecl *FD, const DeclSpec &DS) { … }
static bool isDefaultStdCall(FunctionDecl *FD, Sema &S) { … }
void Sema::CheckMSVCRTEntryPoint(FunctionDecl *FD) { … }
bool Sema::CheckForConstantInitializer(Expr *Init, unsigned DiagID) { … }
namespace {
class SelfReferenceChecker
: public EvaluatedExprVisitor<SelfReferenceChecker> { … };
static void CheckSelfReference(Sema &S, Decl* OrigDecl, Expr *E,
bool DirectInit) { … }
}
namespace {
struct VarDeclOrName { … };
}
QualType Sema::deduceVarTypeFromInitializer(VarDecl *VDecl,
DeclarationName Name, QualType Type,
TypeSourceInfo *TSI,
SourceRange Range, bool DirectInit,
Expr *Init) { … }
bool Sema::DeduceVariableDeclarationType(VarDecl *VDecl, bool DirectInit,
Expr *Init) { … }
void Sema::checkNonTrivialCUnionInInitializer(const Expr *Init,
SourceLocation Loc) { … }
namespace {
bool shouldIgnoreForRecordTriviality(const FieldDecl *FD) { … }
struct DiagNonTrivalCUnionDefaultInitializeVisitor
: DefaultInitializedTypeVisitor<DiagNonTrivalCUnionDefaultInitializeVisitor,
void> { … };
struct DiagNonTrivalCUnionDestructedTypeVisitor
: DestructedTypeVisitor<DiagNonTrivalCUnionDestructedTypeVisitor, void> { … };
struct DiagNonTrivalCUnionCopyVisitor
: CopiedTypeVisitor<DiagNonTrivalCUnionCopyVisitor, false, void> { … };
}
void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc,
NonTrivialCUnionContext UseContext,
unsigned NonTrivialKind) { … }
void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { … }
void Sema::ActOnInitializerError(Decl *D) { … }
void Sema::ActOnUninitializedDecl(Decl *RealDecl) { … }
void Sema::ActOnCXXForRangeDecl(Decl *D) { … }
StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc,
IdentifierInfo *Ident,
ParsedAttributes &Attrs) { … }
void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { … }
void Sema::CheckStaticLocalForDllExport(VarDecl *VD) { … }
void Sema::CheckThreadLocalForLargeAlignment(VarDecl *VD) { … }
void Sema::FinalizeDeclaration(Decl *ThisDecl) { … }
static bool hasDeducedAuto(DeclaratorDecl *DD) { … }
Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS,
ArrayRef<Decl *> Group) { … }
Sema::DeclGroupPtrTy
Sema::BuildDeclaratorGroup(MutableArrayRef<Decl *> Group) { … }
void Sema::ActOnDocumentableDecl(Decl *D) { … }
void Sema::ActOnDocumentableDecls(ArrayRef<Decl *> Group) { … }
void Sema::CheckFunctionOrTemplateParamDeclarator(Scope *S, Declarator &D) { … }
static void CheckExplicitObjectParameter(Sema &S, ParmVarDecl *P,
SourceLocation ExplicitThisLoc) { … }
Decl *Sema::ActOnParamDeclarator(Scope *S, Declarator &D,
SourceLocation ExplicitThisLoc) { … }
ParmVarDecl *Sema::BuildParmVarDeclForTypedef(DeclContext *DC,
SourceLocation Loc,
QualType T) { … }
void Sema::DiagnoseUnusedParameters(ArrayRef<ParmVarDecl *> Parameters) { … }
void Sema::DiagnoseSizeOfParametersAndReturnValue(
ArrayRef<ParmVarDecl *> Parameters, QualType ReturnTy, NamedDecl *D) { … }
ParmVarDecl *Sema::CheckParameter(DeclContext *DC, SourceLocation StartLoc,
SourceLocation NameLoc,
const IdentifierInfo *Name, QualType T,
TypeSourceInfo *TSInfo, StorageClass SC) { … }
void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
SourceLocation LocAfterDecls) { … }
Decl *
Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D,
MultiTemplateParamsArg TemplateParameterLists,
SkipBodyInfo *SkipBody, FnBodyKind BodyKind) { … }
void Sema::ActOnFinishInlineFunctionDef(FunctionDecl *D) { … }
static bool FindPossiblePrototype(const FunctionDecl *FD,
const FunctionDecl *&PossiblePrototype) { … }
static bool
ShouldWarnAboutMissingPrototype(const FunctionDecl *FD,
const FunctionDecl *&PossiblePrototype) { … }
void
Sema::CheckForFunctionRedefinition(FunctionDecl *FD,
const FunctionDecl *EffectiveDefinition,
SkipBodyInfo *SkipBody) { … }
LambdaScopeInfo *Sema::RebuildLambdaScopeInfo(CXXMethodDecl *CallOperator) { … }
Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D,
SkipBodyInfo *SkipBody,
FnBodyKind BodyKind) { … }
void Sema::applyFunctionAttributesBeforeParsingBody(Decl *FD) { … }
void Sema::computeNRVO(Stmt *Body, FunctionScopeInfo *Scope) { … }
bool Sema::canDelayFunctionBody(const Declarator &D) { … }
bool Sema::canSkipFunctionBody(Decl *D) { … }
Decl *Sema::ActOnSkippedFunctionBody(Decl *Decl) { … }
Decl *Sema::ActOnFinishFunctionBody(Decl *D, Stmt *BodyArg) { … }
class ExitFunctionBodyRAII { … };
static void diagnoseImplicitlyRetainedSelf(Sema &S) { … }
static bool methodHasName(const FunctionDecl *FD, StringRef Name) { … }
bool Sema::CanBeGetReturnObject(const FunctionDecl *FD) { … }
bool Sema::CanBeGetReturnTypeOnAllocFailure(const FunctionDecl *FD) { … }
void Sema::CheckCoroutineWrapper(FunctionDecl *FD) { … }
Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
bool IsInstantiation) { … }
void Sema::ActOnFinishDelayedAttribute(Scope *S, Decl *D,
ParsedAttributes &Attrs) { … }
NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc,
IdentifierInfo &II, Scope *S) { … }
void Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(
FunctionDecl *FD) { … }
void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) { … }
TypedefDecl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, QualType T,
TypeSourceInfo *TInfo) { … }
bool Sema::CheckEnumUnderlyingType(TypeSourceInfo *TI) { … }
bool Sema::CheckEnumRedeclaration(SourceLocation EnumLoc, bool IsScoped,
QualType EnumUnderlyingTy, bool IsFixed,
const EnumDecl *Prev) { … }
static unsigned getRedeclDiagFromTagKind(TagTypeKind Tag) { … }
static bool isClassCompatTagKind(TagTypeKind Tag)
{ … }
Sema::NonTagKind Sema::getNonTagTypeDeclKind(const Decl *PrevDecl,
TagTypeKind TTK) { … }
bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous,
TagTypeKind NewTag, bool isDefinition,
SourceLocation NewTagLoc,
const IdentifierInfo *Name) { … }
static FixItHint createFriendTagNNSFixIt(Sema &SemaRef, NamedDecl *ND, Scope *S,
SourceLocation NameLoc) { … }
static bool isAcceptableTagRedeclContext(Sema &S, DeclContext *OldDC,
DeclContext *NewDC) { … }
DeclResult
Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc,
CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc,
const ParsedAttributesView &Attrs, AccessSpecifier AS,
SourceLocation ModulePrivateLoc,
MultiTemplateParamsArg TemplateParameterLists, bool &OwnedDecl,
bool &IsDependent, SourceLocation ScopedEnumKWLoc,
bool ScopedEnumUsesClassTag, TypeResult UnderlyingType,
bool IsTypeSpecifier, bool IsTemplateParamOrArg,
OffsetOfKind OOK, SkipBodyInfo *SkipBody) { … }
void Sema::ActOnTagStartDefinition(Scope *S, Decl *TagD) { … }
bool Sema::ActOnDuplicateDefinition(Decl *Prev, SkipBodyInfo &SkipBody) { … }
void Sema::ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagD,
SourceLocation FinalLoc,
bool IsFinalSpelledSealed,
bool IsAbstract,
SourceLocation LBraceLoc) { … }
void Sema::ActOnTagFinishDefinition(Scope *S, Decl *TagD,
SourceRange BraceRange) { … }
void Sema::ActOnTagDefinitionError(Scope *S, Decl *TagD) { … }
ExprResult Sema::VerifyBitField(SourceLocation FieldLoc,
const IdentifierInfo *FieldName,
QualType FieldTy, bool IsMsStruct,
Expr *BitWidth) { … }Decl *Sema::ActOnField(Scope *S, Decl *TagD, SourceLocation DeclStart,
Declarator &D, Expr *BitfieldWidth) { … }FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
SourceLocation DeclStart,
Declarator &D, Expr *BitWidth,
InClassInitStyle InitStyle,
AccessSpecifier AS) { … }FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
TypeSourceInfo *TInfo,
RecordDecl *Record, SourceLocation Loc,
bool Mutable, Expr *BitWidth,
InClassInitStyle InitStyle,
SourceLocation TSSL,
AccessSpecifier AS, NamedDecl *PrevDecl,
Declarator *D) { … }bool Sema::CheckNontrivialField(FieldDecl *FD) { … }void Sema::ActOnLastBitfield(SourceLocation DeclLoc,
SmallVectorImpl<Decl *> &AllIvarDecls) { … }static void ComputeSelectedDestructor(Sema &S, CXXRecordDecl *Record) { … }static bool AreSpecialMemberFunctionsSameKind(ASTContext &Context,
CXXMethodDecl *M1,
CXXMethodDecl *M2,
CXXSpecialMemberKind CSM) { … }static void SetEligibleMethods(Sema &S, CXXRecordDecl *Record,
ArrayRef<CXXMethodDecl *> Methods,
CXXSpecialMemberKind CSM) { … }static void ComputeSpecialMemberFunctionsEligiblity(Sema &S,
CXXRecordDecl *Record) { … }void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl,
ArrayRef<Decl *> Fields, SourceLocation LBrac,
SourceLocation RBrac,
const ParsedAttributesView &Attrs) { … }static bool isRepresentableIntegerValue(ASTContext &Context,
llvm::APSInt &Value,
QualType T) { … }static QualType getNextLargerIntegralType(ASTContext &Context, QualType T) { … }EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum,
EnumConstantDecl *LastEnumConst,
SourceLocation IdLoc,
IdentifierInfo *Id,
Expr *Val) { … }SkipBodyInfo Sema::shouldSkipAnonEnumBody(Scope *S, IdentifierInfo *II,
SourceLocation IILoc) { … }Decl *Sema::ActOnEnumConstant(Scope *S, Decl *theEnumDecl, Decl *lastEnumConst,
SourceLocation IdLoc, IdentifierInfo *Id,
const ParsedAttributesView &Attrs,
SourceLocation EqualLoc, Expr *Val) { … }static bool ValidDuplicateEnum(EnumConstantDecl *ECD, EnumDecl *Enum) { … }static void CheckForDuplicateEnumValues(Sema &S, ArrayRef<Decl *> Elements,
EnumDecl *Enum, QualType EnumType) { … }bool Sema::IsValueInFlagEnum(const EnumDecl *ED, const llvm::APInt &Val,
bool AllowMask) const { … }void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceRange BraceRange,
Decl *EnumDeclX, ArrayRef<Decl *> Elements, Scope *S,
const ParsedAttributesView &Attrs) { … }Decl *Sema::ActOnFileScopeAsmDecl(Expr *expr,
SourceLocation StartLoc,
SourceLocation EndLoc) { … }TopLevelStmtDecl *Sema::ActOnStartTopLevelStmtDecl(Scope *S) { … }void Sema::ActOnFinishTopLevelStmtDecl(TopLevelStmtDecl *D, Stmt *Statement) { … }void Sema::ActOnPragmaRedefineExtname(IdentifierInfo* Name,
IdentifierInfo* AliasName,
SourceLocation PragmaLoc,
SourceLocation NameLoc,
SourceLocation AliasNameLoc) { … }void Sema::ActOnPragmaWeakID(IdentifierInfo* Name,
SourceLocation PragmaLoc,
SourceLocation NameLoc) { … }void Sema::ActOnPragmaWeakAlias(IdentifierInfo* Name,
IdentifierInfo* AliasName,
SourceLocation PragmaLoc,
SourceLocation NameLoc,
SourceLocation AliasNameLoc) { … }Sema::FunctionEmissionStatus Sema::getEmissionStatus(const FunctionDecl *FD,
bool Final) { … }bool Sema::shouldIgnoreInHostDeviceCheck(FunctionDecl *Callee) { … }void Sema::diagnoseFunctionEffectMergeConflicts(
const FunctionEffectSet::Conflicts &Errs, SourceLocation NewLoc,
SourceLocation OldLoc) { … }bool Sema::diagnoseConflictingFunctionEffect(
const FunctionEffectsRef &FX, const FunctionEffectWithCondition &NewEC,
SourceLocation NewAttrLoc) { … }