clang
19.0.0git
|
Sema - This implements semantic analysis and AST building for C. More...
#include "clang/Sema/Sema.h"
Classes | |
struct | ActOnMemberAccessExtraArgs |
struct | AlignPackIncludeState |
class | AlignPackInfo |
class | ArgumentPackSubstitutionIndexRAII |
RAII object used to change the argument pack substitution index within a Sema object. More... | |
class | BoundTypeDiagnoser |
struct | CodeSynthesisContext |
A context in which code is being synthesized (where a source location alone is not sufficient to identify the context). More... | |
class | CompoundScopeRAII |
A RAII object to enter scope of a compound statement. More... | |
class | ConditionResult |
struct | ConstraintEvalRAII |
class | ContextRAII |
A RAII object to temporarily push a declaration context. More... | |
class | ContextualImplicitConverter |
Abstract base class used to perform a contextual implicit conversion from an expression to any type passing a filter. More... | |
class | CXXThisScopeRAII |
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers on the current class type. More... | |
class | DefaultedFunctionKind |
For a defaulted function, the kind of defaulted function that it is. More... | |
class | DeferDiagsRAII |
RAII class to control scope of DeferDiags. More... | |
class | DelayedDiagnostics |
A class which encapsulates the logic for delaying diagnostics during parsing and other processing. More... | |
class | DelayedDiagnosticsState |
struct | ExpressionEvaluationContextRecord |
Data structure used to record current or nested expression evaluation contexts. More... | |
class | ExtParameterInfoBuilder |
A helper class for building up ExtParameterInfos. More... | |
struct | FormatStringInfo |
class | FPFeaturesStateRAII |
Records and restores the CurFPFeatures state on entry/exit of compound statements. More... | |
class | FpPragmaStackSaveRAII |
class | FullExprArg |
struct | FunctionScopeRAII |
An RAII helper that pops function a function scope on exit. More... | |
class | GlobalEagerInstantiationScope |
class | ICEConvertDiagnoser |
class | ImplicitExceptionSpecification |
Helper class that collects exception specifications for implicitly-declared special member functions. More... | |
class | InheritedConstructorInfo |
struct | InstantiatingTemplate |
A stack object to be created when performing template instantiation. More... | |
class | LambdaScopeForCallOperatorInstantiationRAII |
struct | LateInstantiatedAttribute |
class | LocalEagerInstantiationScope |
class | NameClassification |
struct | NamedReturnInfo |
struct | NestedNameSpecInfo |
Keeps information about an identifier in a nested-name-spec. More... | |
struct | OffsetOfComponent |
struct | OriginalCallArg |
brief A function argument from which we performed template argument More... | |
class | PoppedFunctionScopeDeleter |
Custom deleter to allow FunctionScopeInfos to be kept alive for a short time after they've been popped. More... | |
struct | PragmaAttributeEntry |
This an attribute introduced by #pragma clang attribute. More... | |
struct | PragmaAttributeGroup |
A push'd group of PragmaAttributeEntries. More... | |
struct | PragmaClangSection |
struct | PragmaPackInfo |
struct | PragmaStack |
class | PragmaStackSentinelRAII |
struct | ProcessDeclAttributeOptions |
struct | ReferenceConversionsScope |
class | RequiredTemplateKind |
Whether and why a template name is required in this lookup. More... | |
class | SatisfactionStackResetRAII |
class | SFINAETrap |
RAII class used to determine whether SFINAE has trapped any errors that occur during template argument deduction. More... | |
class | SizelessTypeDiagnoser |
A derivative of BoundTypeDiagnoser for which the diagnostic's type parameter is preceded by a 0/1 enum that is 1 if the type is sizeless. More... | |
class | SpecialMemberOverloadResult |
SpecialMemberOverloadResult - The overloading result for a special member function. More... | |
class | SpecialMemberOverloadResultEntry |
class | SynthesizedFunctionScope |
RAII object to handle the state changes required to synthesize a function body. More... | |
class | TemplateCompareNewDeclInfo |
class | TentativeAnalysisScope |
RAII class used to indicate that we are performing provisional semantic analysis to determine the validity of a construct, so typo-correction and diagnostics in the immediate context (not within implicitly-instantiated templates) should be suppressed. More... | |
struct | TypeDiagnoser |
Abstract class used to diagnose incomplete types. More... | |
struct | TypeTagData |
struct | TypoExprState |
class | VerifyICEDiagnoser |
Abstract base class used for diagnosing integer constant expression violations. More... | |
Semantic Analysis | |
Implementations are in Sema.cpp | |
enum | TUFragmentKind { Global , Normal , Private } |
typedef std::pair< SourceLocation, bool > | DeleteExprLoc |
typedef llvm::SmallVector< DeleteExprLoc, 4 > | DeleteLocs |
using | PoppedFunctionScopePtr = std::unique_ptr< sema::FunctionScopeInfo, PoppedFunctionScopeDeleter > |
typedef OpaquePtr< DeclGroupRef > | DeclGroupPtrTy |
typedef OpaquePtr< TemplateName > | TemplateTy |
typedef OpaquePtr< QualType > | TypeTy |
typedef void | LateTemplateParserCB(void *P, LateParsedTemplate &LPT) |
Callback to the parser to parse templated functions when needed. More... | |
typedef void | LateTemplateParserCleanupCB(void *P) |
typedef DelayedDiagnosticsState | ParsingDeclState |
typedef DelayedDiagnosticsState | ProcessingContextState |
static const unsigned | MaxAlignmentExponent = 32 |
The maximum alignment, same as in llvm::Value. More... | |
static const uint64_t | MaximumAlignment = 1ull << MaxAlignmentExponent |
bool | CollectStats |
Flag indicating whether or not to collect detailed statistics. More... | |
std::unique_ptr< sema::FunctionScopeInfo > | CachedFunctionScope |
SmallVector< sema::FunctionScopeInfo *, 4 > | FunctionScopes |
Stack containing information about each of the nested function, block, and method scopes that are currently active. More... | |
unsigned | FunctionScopesStart = 0 |
The index of the first FunctionScope that corresponds to the current context. More... | |
unsigned | CapturingFunctionScopes = 0 |
Track the number of currently active capturing scopes. More... | |
llvm::BumpPtrAllocator | BumpAlloc |
const TranslationUnitKind | TUKind |
The kind of translation unit we are processing. More... | |
Scope * | TUScope |
Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in the "ordinary" C decl namespace. More... | |
bool | WarnedStackExhausted = false |
OpenCLOptions | OpenCLFeatures |
FPOptions | CurFPFeatures |
const LangOptions & | LangOpts |
Preprocessor & | PP |
ASTContext & | Context |
ASTConsumer & | Consumer |
DiagnosticsEngine & | Diags |
SourceManager & | SourceMgr |
api_notes::APINotesManager | APINotes |
sema::AnalysisBasedWarnings | AnalysisWarnings |
Worker object for performing CFG-based warnings. More... | |
threadSafety::BeforeSet * | ThreadSafetyDeclCache |
LateTemplateParserCB * | LateTemplateParser |
LateTemplateParserCleanupCB * | LateTemplateParserCleanup |
void * | OpaqueParser |
std::function< TypeResult(StringRef, StringRef, SourceLocation)> | ParseTypeFromStringCallback |
Callback to the parser to parse a type expressed as a string. More... | |
DeclarationName | VAListTagName |
VAListTagName - The declaration name corresponding to __va_list_tag. More... | |
bool | IsLastErrorImmediate = true |
Is the last error level diagnostic immediate. More... | |
class clang::Sema::DelayedDiagnostics | DelayedDiagnostics |
SemaDiagnosticBuilder::DeferredDiagnosticsType | DeviceDeferredDiags |
Diagnostics that are emitted only if we discover that the given function must be codegen'ed. More... | |
DeclContext * | CurContext |
CurContext - This is the current declaration context of parsing. More... | |
IntrusiveRefCntPtr< ExternalSemaSource > | ExternalSource |
Source of additional semantic information. More... | |
class | Parser |
class | InitializationSequence |
class | ASTReader |
class | ASTDeclReader |
class | ASTWriter |
Sema (Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, TranslationUnitKind TUKind=TU_Complete, CodeCompleteConsumer *CompletionConsumer=nullptr) | |
~Sema () | |
void | Initialize () |
Perform initialization that occurs after the parser has been initialized but before it parses anything. More... | |
virtual void | anchor () |
This virtual key function only exists to limit the emission of debug info describing the Sema class. More... | |
const LangOptions & | getLangOpts () const |
OpenCLOptions & | getOpenCLOptions () |
FPOptions & | getCurFPFeatures () |
DiagnosticsEngine & | getDiagnostics () const |
SourceManager & | getSourceManager () const |
Preprocessor & | getPreprocessor () const |
ASTContext & | getASTContext () const |
ASTConsumer & | getASTConsumer () const |
ASTMutationListener * | getASTMutationListener () const |
ExternalSemaSource * | getExternalSource () const |
DarwinSDKInfo * | getDarwinSDKInfoForAvailabilityChecking (SourceLocation Loc, StringRef Platform) |
DarwinSDKInfo * | getDarwinSDKInfoForAvailabilityChecking () |
void | addExternalSource (ExternalSemaSource *E) |
Registers an external source. More... | |
void | PrintStats () const |
Print out statistics about the semantic analysis. More... | |
void | warnStackExhausted (SourceLocation Loc) |
Warn that the stack is nearly exhausted. More... | |
void | runWithSufficientStackSpace (SourceLocation Loc, llvm::function_ref< void()> Fn) |
Run some code with "sufficient" stack space. More... | |
LangAS | getDefaultCXXMethodAddrSpace () const |
Returns default addr space for method qualifiers. More... | |
void | LoadExternalWeakUndeclaredIdentifiers () |
Load weak undeclared identifiers from the external source. More... | |
bool | isExternalWithNoLinkageType (const ValueDecl *VD) const |
Determine if VD, which must be a variable or function, is an external symbol that nonetheless can't be referenced from outside this translation unit because its type has no linkage and it's not extern "C". More... | |
void | getUndefinedButUsed (SmallVectorImpl< std::pair< NamedDecl *, SourceLocation >> &Undefined) |
Obtain a sorted list of functions that are undefined but ODR-used. More... | |
const llvm::MapVector< FieldDecl *, DeleteLocs > & | getMismatchingDeleteExpressions () const |
Retrieves list of suspicious delete-expressions that will be checked at the end of translation unit. More... | |
void | EmitCurrentDiagnostic (unsigned DiagID) |
Cause the active diagnostic on the DiagosticsEngine to be emitted. More... | |
void | addImplicitTypedef (StringRef Name, QualType T) |
bool | hasUncompilableErrorOccurred () const |
Whether uncompilable error has occurred. More... | |
bool | findMacroSpelling (SourceLocation &loc, StringRef name) |
Looks through the macro-expansion chain for the given location, looking for a macro expansion with the given name. More... | |
SourceLocation | getLocForEndOfToken (SourceLocation Loc, unsigned Offset=0) |
Calls Lexer::getLocForEndOfToken() More... | |
ModuleLoader & | getModuleLoader () const |
Retrieve the module loader associated with the preprocessor. More... | |
IdentifierInfo * | InventAbbreviatedTemplateParameterTypeName (const IdentifierInfo *ParamName, unsigned Index) |
Invent a new identifier for parameters of abbreviated templates. More... | |
void | emitAndClearUnusedLocalTypedefWarnings () |
void | emitDeferredDiags () |
void | ActOnStartOfTranslationUnit () |
This is called before the very first declaration in the translation unit is parsed. More... | |
void | ActOnEndOfTranslationUnit () |
ActOnEndOfTranslationUnit - This is called at the very end of the translation unit when EOF is reached and all but the top-level scope is popped. More... | |
void | ActOnEndOfTranslationUnitFragment (TUFragmentKind Kind) |
Scope * | getScopeForContext (DeclContext *Ctx) |
Determines the active Scope associated with the given declaration context. More... | |
void | PushFunctionScope () |
Enter a new function scope. More... | |
void | PushBlockScope (Scope *BlockScope, BlockDecl *Block) |
sema::LambdaScopeInfo * | PushLambdaScope () |
void | RecordParsingTemplateParameterDepth (unsigned Depth) |
This is used to inform Sema what the current TemplateParameterDepth is during Parsing. More... | |
void | PushCapturedRegionScope (Scope *RegionScope, CapturedDecl *CD, RecordDecl *RD, CapturedRegionKind K, unsigned OpenMPCaptureLevel=0) |
PoppedFunctionScopePtr | PopFunctionScopeInfo (const sema::AnalysisBasedWarnings::Policy *WP=nullptr, const Decl *D=nullptr, QualType BlockType=QualType()) |
Pop a function (or block or lambda or captured region) scope from the stack. More... | |
sema::FunctionScopeInfo * | getEnclosingFunction () const |
void | setFunctionHasBranchIntoScope () |
void | setFunctionHasBranchProtectedScope () |
void | setFunctionHasIndirectGoto () |
void | setFunctionHasMustTail () |
void | PushCompoundScope (bool IsStmtExpr) |
void | PopCompoundScope () |
bool | hasAnyUnrecoverableErrorsInThisFunction () const |
Determine whether any errors occurred within this function/method/ block. More... | |
sema::BlockScopeInfo * | getCurBlock () |
Retrieve the current block, if any. More... | |
sema::LambdaScopeInfo * | getEnclosingLambda () const |
Get the innermost lambda enclosing the current location, if any. More... | |
sema::LambdaScopeInfo * | getCurLambda (bool IgnoreNonLambdaCapturingScope=false) |
Retrieve the current lambda scope info, if any. More... | |
sema::LambdaScopeInfo * | getCurGenericLambda () |
Retrieve the current generic lambda info, if any. More... | |
sema::CapturedRegionScopeInfo * | getCurCapturedRegion () |
Retrieve the current captured region, if any. More... | |
void | ActOnComment (SourceRange Comment) |
Scope * | getCurScope () const |
Retrieve the parser's current scope. More... | |
IdentifierInfo * | getSuperIdentifier () const |
DeclContext * | getCurLexicalContext () const |
SemaDiagnosticBuilder | targetDiag (SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD=nullptr) |
SemaDiagnosticBuilder | targetDiag (SourceLocation Loc, const PartialDiagnostic &PD, const FunctionDecl *FD=nullptr) |
void | checkTypeSupport (QualType Ty, SourceLocation Loc, ValueDecl *D=nullptr) |
Check if the type is allowed to be used for the current target. More... | |
ExprResult | ImpCastExprToType (Expr *E, QualType Type, CastKind CK, ExprValueKind VK=VK_PRValue, const CXXCastPath *BasePath=nullptr, CheckedConversionKind CCK=CheckedConversionKind::Implicit) |
ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast. More... | |
DeclContext * | getFunctionLevelDeclContext (bool AllowLambda=false) const |
If AllowLambda is true, treat lambda as function. More... | |
FunctionDecl * | getCurFunctionDecl (bool AllowLambda=false) const |
Returns a pointer to the innermost enclosing function, or nullptr if the current context is not inside a function. More... | |
ObjCMethodDecl * | getCurMethodDecl () |
getCurMethodDecl - If inside of a method body, this returns a pointer to the method decl for the method being parsed. More... | |
NamedDecl * | getCurFunctionOrMethodDecl () const |
getCurFunctionOrMethodDecl - Return the Decl for the current ObjC method or C function we're in, otherwise return null. More... | |
void | diagnoseNullableToNonnullConversion (QualType DstType, QualType SrcType, SourceLocation Loc) |
Warn if we're implicitly casting from a _Nullable pointer type to a _Nonnull one. More... | |
void | diagnoseZeroToNullptrConversion (CastKind Kind, const Expr *E) |
Warn when implicitly casting 0 to nullptr. More... | |
bool | makeUnavailableInSystemHeader (SourceLocation loc, UnavailableAttr::ImplicitReason reason) |
makeUnavailableInSystemHeader - There is an error in the current context. More... | |
PrintingPolicy | getPrintingPolicy () const |
Retrieve a suitable printing policy for diagnostics. More... | |
void | ActOnTranslationUnitScope (Scope *S) |
Scope actions. More... | |
bool | isDeclaratorFunctionLike (Declarator &D) |
Determine whether. More... | |
void | incrementMSManglingNumber () const |
bool | tryToRecoverWithCall (ExprResult &E, const PartialDiagnostic &PD, bool ForceComplain=false, bool(*IsPlausibleResult)(QualType)=nullptr) |
Try to recover by turning the given expression into a call. More... | |
bool | tryExprAsCall (Expr &E, QualType &ZeroArgCallReturnTy, UnresolvedSetImpl &NonTemplateOverloads) |
Figure out if an expression could be turned into a call. More... | |
PartialDiagnostic | PDiag (unsigned DiagID=0) |
Build a partial diagnostic. More... | |
sema::FunctionScopeInfo * | getCurFunction () const |
void | SetLateTemplateParser (LateTemplateParserCB *LTP, LateTemplateParserCleanupCB *LTPCleanup, void *P) |
ParsingDeclState | PushParsingDeclaration (sema::DelayedDiagnosticPool &pool) |
SemaCodeCompletion & | CodeCompletion () |
SemaCUDA & | CUDA () |
SemaHLSL & | HLSL () |
SemaObjC & | ObjC () |
SemaOpenACC & | OpenACC () |
SemaOpenMP & | OpenMP () |
SemaPseudoObject & | PseudoObject () |
SemaRISCV & | RISCV () |
SemaSYCL & | SYCL () |
SemaX86 & | X86 () |
static CastKind | ScalarTypeToBooleanCastKind (QualType ScalarTy) |
ScalarTypeToBooleanCastKind - Returns the cast kind corresponding to the conversion from scalar type ScalarTy to the Boolean type. More... | |
static PrintingPolicy | getPrintingPolicy (const ASTContext &Ctx, const Preprocessor &PP) |
Retrieve a suitable printing policy for diagnostics. More... | |
Attributes | |
Implementations are in SemaAttr.cpp | |
enum | PragmaClangSectionKind { PCSK_Invalid = 0 , PCSK_BSS = 1 , PCSK_Data = 2 , PCSK_Rodata = 3 , PCSK_Text = 4 , PCSK_Relro = 5 } |
pragma clang section kind More... | |
enum | PragmaClangSectionAction { PCSA_Set = 0 , PCSA_Clear = 1 } |
enum | PragmaMsStackAction { PSK_Reset = 0x0 , PSK_Set = 0x1 , PSK_Push = 0x2 , PSK_Pop = 0x4 , PSK_Show = 0x8 , PSK_Push_Set = PSK_Push | PSK_Set , PSK_Pop_Set = PSK_Pop | PSK_Set } |
enum | PragmaSectionKind { PSK_DataSeg , PSK_BSSSeg , PSK_ConstSeg , PSK_CodeSeg } |
enum | PragmaOptionsAlignKind { POAK_Native , POAK_Natural , POAK_Packed , POAK_Power , POAK_Mac68k , POAK_Reset } |
enum class | PragmaAlignPackDiagnoseKind { NonDefaultStateAtInclude , ChangedStateAtExit } |
LangOptions::PragmaMSPointersToMembersKind | MSPointerToMemberRepresentationMethod |
Controls member pointer representation format under the MS ABI. More... | |
bool | MSStructPragmaOn |
SourceLocation | ImplicitMSInheritanceAttrLoc |
Source location for newly created implicit MSInheritanceAttrs. More... | |
PragmaClangSection | PragmaClangBSSSection |
PragmaClangSection | PragmaClangDataSection |
PragmaClangSection | PragmaClangRodataSection |
PragmaClangSection | PragmaClangRelroSection |
PragmaClangSection | PragmaClangTextSection |
PragmaStack< MSVtorDispMode > | VtorDispStack |
Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI. More... | |
PragmaStack< AlignPackInfo > | AlignPackStack |
SmallVector< AlignPackIncludeState, 8 > | AlignPackIncludeStack |
PragmaStack< StringLiteral * > | DataSegStack |
PragmaStack< StringLiteral * > | BSSSegStack |
PragmaStack< StringLiteral * > | ConstSegStack |
PragmaStack< StringLiteral * > | CodeSegStack |
PragmaStack< bool > | StrictGuardStackCheckStack |
PragmaStack< FPOptionsOverride > | FpPragmaStack |
StringLiteral * | CurInitSeg |
Last section used with #pragma init_seg. More... | |
SourceLocation | CurInitSegLoc |
llvm::StringMap< std::tuple< StringRef, SourceLocation > > | FunctionToSectionMap |
Sections used with #pragma alloc_text. More... | |
void * | VisContext |
VisContext - Manages the stack for #pragma GCC visibility. More... | |
SmallVector< PragmaAttributeGroup, 2 > | PragmaAttributeStack |
const Decl * | PragmaAttributeCurrentTargetDecl |
The declaration that is currently receiving an attribute from the #pragma attribute stack. More... | |
SourceLocation | OptimizeOffPragmaLocation |
This represents the last location of a "#pragma clang optimize off" directive if such a directive has not been closed by an "on" yet. More... | |
bool | MSPragmaOptimizeIsOn = true |
The "on" or "off" argument passed by #pragma optimize, that denotes whether the optimizations in the list passed to the pragma should be turned off or on. More... | |
llvm::SmallSetVector< StringRef, 4 > | MSFunctionNoBuiltins |
Set of no-builtin functions listed by #pragma function. More... | |
FPOptionsOverride | CurFPFeatureOverrides () |
SourceLocation | getOptimizeOffPragmaLocation () const |
Get the location for the currently active "\#pragma clang optimize
off". If this location is invalid, then the state of the pragma is "on". More... | |
void | AddAlignmentAttributesForRecord (RecordDecl *RD) |
AddAlignmentAttributesForRecord - Adds any needed alignment attributes to a the record decl, to handle '#pragma pack' and '#pragma options align'. More... | |
void | AddMsStructLayoutForRecord (RecordDecl *RD) |
AddMsStructLayoutForRecord - Adds ms_struct layout attribute to record. More... | |
void | inferGslPointerAttribute (NamedDecl *ND, CXXRecordDecl *UnderlyingRecord) |
Add gsl::Pointer attribute to std::container::iterator. More... | |
void | inferGslOwnerPointerAttribute (CXXRecordDecl *Record) |
Add [[gsl::Owner]] and [[gsl::Pointer]] attributes for std:: types. More... | |
void | inferGslPointerAttribute (TypedefNameDecl *TD) |
Add [[gsl::Pointer]] attributes for std:: types. More... | |
void | inferNullableClassAttribute (CXXRecordDecl *CRD) |
Add _Nullable attributes for std:: types. More... | |
void | ActOnPragmaClangSection (SourceLocation PragmaLoc, PragmaClangSectionAction Action, PragmaClangSectionKind SecKind, StringRef SecName) |
ActOnPragmaClangSection - Called on well formed #pragma clang section. More... | |
void | ActOnPragmaOptionsAlign (PragmaOptionsAlignKind Kind, SourceLocation PragmaLoc) |
ActOnPragmaOptionsAlign - Called on well formed #pragma options align. More... | |
void | ActOnPragmaPack (SourceLocation PragmaLoc, PragmaMsStackAction Action, StringRef SlotLabel, Expr *Alignment) |
ActOnPragmaPack - Called on well formed #pragma pack(...). More... | |
bool | ConstantFoldAttrArgs (const AttributeCommonInfo &CI, MutableArrayRef< Expr * > Args) |
ConstantFoldAttrArgs - Folds attribute arguments into ConstantExprs (unless they are value dependent or type dependent). More... | |
void | DiagnoseNonDefaultPragmaAlignPack (PragmaAlignPackDiagnoseKind Kind, SourceLocation IncludeLoc) |
void | DiagnoseUnterminatedPragmaAlignPack () |
void | ActOnPragmaMSStruct (PragmaMSStructKind Kind) |
ActOnPragmaMSStruct - Called on well formed #pragma ms_struct [on|off]. More... | |
void | ActOnPragmaMSComment (SourceLocation CommentLoc, PragmaMSCommentKind Kind, StringRef Arg) |
ActOnPragmaMSComment - Called on well formed #pragma comment(kind, "arg"). More... | |
void | ActOnPragmaDetectMismatch (SourceLocation Loc, StringRef Name, StringRef Value) |
ActOnPragmaDetectMismatch - Call on well-formed #pragma detect_mismatch. More... | |
bool | isPreciseFPEnabled () |
Are precise floating point semantics currently enabled? More... | |
void | ActOnPragmaFPEvalMethod (SourceLocation Loc, LangOptions::FPEvalMethodKind Value) |
void | ActOnPragmaFloatControl (SourceLocation Loc, PragmaMsStackAction Action, PragmaFloatControlKind Value) |
ActOnPragmaFloatControl - Call on well-formed #pragma float_control. More... | |
void | ActOnPragmaMSPointersToMembers (LangOptions::PragmaMSPointersToMembersKind Kind, SourceLocation PragmaLoc) |
ActOnPragmaMSPointersToMembers - called on well formed #pragma pointers_to_members(representation method[, general purpose representation]). More... | |
void | ActOnPragmaMSVtorDisp (PragmaMsStackAction Action, SourceLocation PragmaLoc, MSVtorDispMode Value) |
Called on well formed #pragma vtordisp(). More... | |
bool | UnifySection (StringRef SectionName, int SectionFlags, NamedDecl *TheDecl) |
bool | UnifySection (StringRef SectionName, int SectionFlags, SourceLocation PragmaSectionLocation) |
void | ActOnPragmaMSSeg (SourceLocation PragmaLocation, PragmaMsStackAction Action, llvm::StringRef StackSlotLabel, StringLiteral *SegmentName, llvm::StringRef PragmaName) |
Called on well formed #pragma bss_seg/data_seg/const_seg/code_seg. More... | |
void | ActOnPragmaMSSection (SourceLocation PragmaLocation, int SectionFlags, StringLiteral *SegmentName) |
Called on well formed #pragma section(). More... | |
void | ActOnPragmaMSInitSeg (SourceLocation PragmaLocation, StringLiteral *SegmentName) |
Called on well-formed #pragma init_seg(). More... | |
void | ActOnPragmaMSAllocText (SourceLocation PragmaLocation, StringRef Section, const SmallVector< std::tuple< IdentifierInfo *, SourceLocation >> &Functions) |
Called on well-formed #pragma alloc_text(). More... | |
void | ActOnPragmaMSStrictGuardStackCheck (SourceLocation PragmaLocation, PragmaMsStackAction Action, bool Value) |
ActOnPragmaMSStrictGuardStackCheck - Called on well formed #pragma strict_gs_check. More... | |
void | ActOnPragmaUnused (const Token &Identifier, Scope *curScope, SourceLocation PragmaLoc) |
ActOnPragmaUnused - Called on well-formed '#pragma unused'. More... | |
void | ActOnPragmaAttributeAttribute (ParsedAttr &Attribute, SourceLocation PragmaLoc, attr::ParsedSubjectMatchRuleSet Rules) |
void | ActOnPragmaAttributeEmptyPush (SourceLocation PragmaLoc, const IdentifierInfo *Namespace) |
void | ActOnPragmaAttributePop (SourceLocation PragmaLoc, const IdentifierInfo *Namespace) |
Called on well-formed '#pragma clang attribute pop'. More... | |
void | AddPragmaAttributes (Scope *S, Decl *D) |
Adds the attributes that have been specified using the '#pragma clang attribute push' directives to the given declaration. More... | |
void | PrintPragmaAttributeInstantiationPoint () |
void | DiagnoseUnterminatedPragmaAttribute () |
void | ActOnPragmaOptimize (bool On, SourceLocation PragmaLoc) |
Called on well formed #pragma clang optimize. More... | |
void | ActOnPragmaMSOptimize (SourceLocation Loc, bool IsOn) |
#pragma optimize("[optimization-list]", on | off). More... | |
void | ActOnPragmaMSFunction (SourceLocation Loc, const llvm::SmallVectorImpl< StringRef > &NoBuiltins) |
Call on well formed #pragma function. More... | |
void | AddRangeBasedOptnone (FunctionDecl *FD) |
Only called on function definitions; if there is a pragma in scope with the effect of a range-based optnone, consider marking the function with attribute optnone. More... | |
void | AddSectionMSAllocText (FunctionDecl *FD) |
Only called on function definitions; if there is a #pragma alloc_text that decides which code section the function should be in, add attribute section to the function. More... | |
void | AddOptnoneAttributeIfNoConflicts (FunctionDecl *FD, SourceLocation Loc) |
Adds the 'optnone' attribute to the function declaration if there are no conflicts; Loc represents the location causing the 'optnone' attribute to be added (usually because of a pragma). More... | |
void | ModifyFnAttributesMSPragmaOptimize (FunctionDecl *FD) |
Only called on function definitions; if there is a MSVC #pragma optimize in scope, consider changing the function's attributes based on the optimization list passed to the pragma. More... | |
void | AddImplicitMSFunctionNoBuiltinAttr (FunctionDecl *FD) |
Only called on function definitions; if there is a pragma in scope with the effect of a range-based no_builtin, consider marking the function with attribute no_builtin. More... | |
void | AddPushedVisibilityAttribute (Decl *RD) |
AddPushedVisibilityAttribute - If '#pragma GCC visibility' was used, add an appropriate visibility attribute. More... | |
void | FreeVisContext () |
FreeVisContext - Deallocate and null out VisContext. More... | |
void | ActOnPragmaVisibility (const IdentifierInfo *VisType, SourceLocation PragmaLoc) |
ActOnPragmaVisibility - Called on well formed #pragma GCC visibility... . More... | |
void | ActOnPragmaFPContract (SourceLocation Loc, LangOptions::FPModeKind FPC) |
ActOnPragmaFPContract - Called on well formed #pragma {STDC,OPENCL} FP_CONTRACT and #pragma clang fp contract. More... | |
void | ActOnPragmaFPValueChangingOption (SourceLocation Loc, PragmaFPKind Kind, bool IsEnabled) |
Called on well formed #pragma clang fp reassociate or #pragma clang fp reciprocal. More... | |
void | ActOnPragmaFEnvAccess (SourceLocation Loc, bool IsEnabled) |
ActOnPragmaFenvAccess - Called on well formed #pragma STDC FENV_ACCESS. More... | |
void | ActOnPragmaCXLimitedRange (SourceLocation Loc, LangOptions::ComplexRangeKind Range) |
ActOnPragmaCXLimitedRange - Called on well formed #pragma STDC CX_LIMITED_RANGE. More... | |
void | ActOnPragmaFPExceptions (SourceLocation Loc, LangOptions::FPExceptionModeKind) |
Called on well formed '#pragma clang fp' that has option 'exceptions'. More... | |
void | ActOnPragmaFEnvRound (SourceLocation Loc, llvm::RoundingMode) |
Called to set constant rounding mode for floating point operations. More... | |
void | setExceptionMode (SourceLocation Loc, LangOptions::FPExceptionModeKind) |
Called to set exception behavior for floating point operations. More... | |
void | PushNamespaceVisibilityAttr (const VisibilityAttr *Attr, SourceLocation Loc) |
PushNamespaceVisibilityAttr - Note that we've entered a namespace with a visibility attribute. More... | |
void | PopPragmaVisibility (bool IsNamespaceEnd, SourceLocation EndLoc) |
PopPragmaVisibility - Pop the top element of the visibility stack; used for '#pragma GCC visibility' and visibility attributes on namespaces. More... | |
bool | checkCommonAttributeFeatures (const Decl *D, const ParsedAttr &A, bool SkipArgCountCheck=false) |
Handles semantic checking for features that are common to all attributes, such as checking whether a parameter was properly specified, or the correct number of arguments were passed, etc. More... | |
bool | checkCommonAttributeFeatures (const Stmt *S, const ParsedAttr &A, bool SkipArgCountCheck=false) |
Extra Semantic Checking | |
Implementations are in SemaChecking.cpp | |
enum | FormatArgumentPassingKind { FAPK_Fixed , FAPK_Variadic , FAPK_VAList } |
enum | FormatStringType { FST_Scanf , FST_Printf , FST_NSString , FST_Strftime , FST_Strfmon , FST_Kprintf , FST_FreeBSDKPrintf , FST_OSTrace , FST_OSLog , FST_Unknown } |
enum class | AtomicArgumentOrder { API , AST } |
enum | VariadicCallType { VariadicFunction , VariadicBlock , VariadicMethod , VariadicConstructor , VariadicDoesNotApply } |
typedef std::pair< const IdentifierInfo *, uint64_t > | TypeTagMagicValue |
A pair of ArgumentKind identifier and magic value. More... | |
bool | isConstantEvaluatedOverride = false |
Used to change context to isConstantEvaluated without pushing a heavy ExpressionEvaluationContextRecord object. More... | |
bool | isConstantEvaluatedContext () const |
SourceLocation | getLocationOfStringLiteralByte (const StringLiteral *SL, unsigned ByteNo) const |
ExprResult | BuiltinShuffleVector (CallExpr *TheCall) |
BuiltinShuffleVector - Handle __builtin_shufflevector. More... | |
ExprResult | ConvertVectorExpr (Expr *E, TypeSourceInfo *TInfo, SourceLocation BuiltinLoc, SourceLocation RParenLoc) |
ConvertVectorExpr - Handle __builtin_convertvector. More... | |
bool | FormatStringHasSArg (const StringLiteral *FExpr) |
void | CheckFloatComparison (SourceLocation Loc, Expr *LHS, Expr *RHS, BinaryOperatorKind Opcode) |
Check for comparisons of floating-point values using == and !=. More... | |
void | RegisterTypeTagForDatatype (const IdentifierInfo *ArgumentKind, uint64_t MagicValue, QualType Type, bool LayoutCompatible, bool MustBeNull) |
Register a magic integral constant to be used as a type tag. More... | |
void | DiagnoseMisalignedMembers () |
Diagnoses the current set of gathered accesses. More... | |
void | DiscardMisalignedMemberAddress (const Type *T, Expr *E) |
This function checks if the expression is in the sef of potentially misaligned members and it is converted to some pointer type T with lower or equal alignment requirements. More... | |
void | RefersToMemberWithReducedAlignment (Expr *E, llvm::function_ref< void(Expr *, RecordDecl *, FieldDecl *, CharUnits)> Action) |
This function calls Action when it determines that E designates a misaligned member due to the packed attribute. More... | |
ExprResult | BuildAtomicExpr (SourceRange CallRange, SourceRange ExprRange, SourceLocation RParenLoc, MultiExprArg Args, AtomicExpr::AtomicOp Op, AtomicArgumentOrder ArgOrder=AtomicArgumentOrder::API) |
bool | hasCStrMethod (const Expr *E) |
Check to see if a given expression could have '.c_str()' called on it. More... | |
void | DiagnoseAlwaysNonNullPointer (Expr *E, Expr::NullPointerConstantKind NullType, bool IsEqual, SourceRange Range) |
Diagnose pointers that are always non-null. More... | |
bool | CheckParmsForFunctionDef (ArrayRef< ParmVarDecl * > Parameters, bool CheckParameterNames) |
CheckParmsForFunctionDef - Check that the parameters of the given function are appropriate for the definition of a function. More... | |
void | CheckCastAlign (Expr *Op, QualType T, SourceRange TRange) |
CheckCastAlign - Implements -Wcast-align, which warns when a pointer cast increases the alignment requirements. More... | |
bool | checkUnsafeAssigns (SourceLocation Loc, QualType LHS, Expr *RHS) |
checkUnsafeAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained type. More... | |
void | checkUnsafeExprAssigns (SourceLocation Loc, Expr *LHS, Expr *RHS) |
checkUnsafeExprAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained expression. More... | |
void | DiagnoseEmptyStmtBody (SourceLocation StmtLoc, const Stmt *Body, unsigned DiagID) |
Emit DiagID if statement located on StmtLoc has a suspicious null statement as a Body , and it is located on the same line. More... | |
void | DiagnoseEmptyLoopBody (const Stmt *S, const Stmt *PossibleBody) |
Warn if a for/while loop statement S , which is followed by PossibleBody , has a suspicious null statement as a body. More... | |
void | DiagnoseSelfMove (const Expr *LHSExpr, const Expr *RHSExpr, SourceLocation OpLoc) |
Warn if a value is moved to itself. More... | |
bool | IsLayoutCompatible (QualType T1, QualType T2) const |
bool | IsPointerInterconvertibleBaseOf (const TypeSourceInfo *Base, const TypeSourceInfo *Derived) |
bool | CheckFunctionCall (FunctionDecl *FDecl, CallExpr *TheCall, const FunctionProtoType *Proto) |
CheckFunctionCall - Check a direct function call for various correctness and safety properties not strictly enforced by the C type system. More... | |
bool | BuiltinVectorMath (CallExpr *TheCall, QualType &Res) |
bool | BuiltinVectorToScalarMath (CallExpr *TheCall) |
bool | CheckHLSLBuiltinFunctionCall (unsigned BuiltinID, CallExpr *TheCall) |
void | checkCall (NamedDecl *FDecl, const FunctionProtoType *Proto, const Expr *ThisArg, ArrayRef< const Expr * > Args, bool IsMemberFunction, SourceLocation Loc, SourceRange Range, VariadicCallType CallType) |
Handles the checks for format strings, non-POD arguments to vararg functions, NULL arguments passed to non-NULL parameters, diagnose_if attributes and AArch64 SME attributes. More... | |
void | CheckTCBEnforcement (const SourceLocation CallExprLoc, const NamedDecl *Callee) |
Enforce the bounds of a TCB CheckTCBEnforcement - Enforces that every function in a named TCB only directly calls other functions in the same TCB as marked by the enforce_tcb and enforce_tcb_leaf attributes. More... | |
void | CheckConstrainedAuto (const AutoType *AutoT, SourceLocation Loc) |
bool | BuiltinConstantArg (CallExpr *TheCall, int ArgNum, llvm::APSInt &Result) |
BuiltinConstantArg - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression. More... | |
bool | BuiltinConstantArgRange (CallExpr *TheCall, int ArgNum, int Low, int High, bool RangeIsError=true) |
BuiltinConstantArgRange - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression in the range [Low, High]. More... | |
bool | BuiltinConstantArgMultiple (CallExpr *TheCall, int ArgNum, unsigned Multiple) |
BuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression is a multiple of Num. More... | |
bool | BuiltinConstantArgPower2 (CallExpr *TheCall, int ArgNum) |
BuiltinConstantArgPower2 - Check if argument ArgNum of TheCall is a constant expression representing a power of 2. More... | |
bool | BuiltinConstantArgShiftedByte (CallExpr *TheCall, int ArgNum, unsigned ArgBits) |
BuiltinConstantArgShiftedByte - Check if argument ArgNum of TheCall is a constant expression representing an arbitrary byte value shifted left by a multiple of 8 bits. More... | |
bool | BuiltinConstantArgShiftedByteOrXXFF (CallExpr *TheCall, int ArgNum, unsigned ArgBits) |
BuiltinConstantArgShiftedByteOr0xFF - Check if argument ArgNum of TheCall is a constant expression representing either a shifted byte value, or a value of the form 0x??FF (i.e. More... | |
bool | checkArgCountAtLeast (CallExpr *Call, unsigned MinArgCount) |
Checks that a call expression's argument count is at least the desired number. More... | |
bool | checkArgCountAtMost (CallExpr *Call, unsigned MaxArgCount) |
Checks that a call expression's argument count is at most the desired number. More... | |
bool | checkArgCountRange (CallExpr *Call, unsigned MinArgCount, unsigned MaxArgCount) |
Checks that a call expression's argument count is in the desired range. More... | |
bool | checkArgCount (CallExpr *Call, unsigned DesiredArgCount) |
Checks that a call expression's argument count is the desired number. More... | |
static bool | getFormatStringInfo (const FormatAttr *Format, bool IsCXXMember, bool IsVariadic, FormatStringInfo *FSI) |
Given a FunctionDecl's FormatAttr, attempts to populate the FomatStringInfo parameter with the FormatAttr's correct format_idx and firstDataArg. More... | |
static FormatStringType | GetFormatStringType (const FormatAttr *Format) |
static bool | GetFormatNSStringIdx (const FormatAttr *Format, unsigned &Idx) |
Declarations | |
Implementations are in SemaDecl.cpp | |
enum | NameClassificationKind { NC_Unknown , NC_Error , NC_Keyword , NC_Type , NC_NonType , NC_UndeclaredNonType , NC_DependentNonType , NC_OverloadSet , NC_TypeTemplate , NC_VarTemplate , NC_FunctionTemplate , NC_UndeclaredTemplate , NC_Concept } |
Describes the result of the name lookup and resolution performed by ClassifyName() . More... | |
enum class | TemplateNameKindForDiagnostics { ClassTemplate , FunctionTemplate , VarTemplate , AliasTemplate , TemplateTemplateParam , Concept , DependentTemplate } |
Describes the detailed kind of a template name. Used in diagnostics. More... | |
enum | NonTrivialCUnionContext { NTCUC_FunctionParam , NTCUC_FunctionReturn , NTCUC_DefaultInitializedObject , NTCUC_AutoVar , NTCUC_CopyInit , NTCUC_Assignment , NTCUC_CompoundLiteral , NTCUC_BlockCapture , NTCUC_LValueToRValueVolatile } |
enum | NonTrivialCUnionKind { NTCUK_Init = 0x1 , NTCUK_Destruct = 0x2 , NTCUK_Copy = 0x4 } |
enum class | FnBodyKind { Other , Default , Delete } |
enum | NonTagKind { NTK_NonStruct , NTK_NonClass , NTK_NonUnion , NTK_NonEnum , NTK_Typedef , NTK_TypeAlias , NTK_Template , NTK_TypeAliasTemplate , NTK_TemplateTemplateArgument } |
Common ways to introduce type names without a tag for use in diagnostics. More... | |
enum | OffsetOfKind { OOK_Outside , OOK_Builtin , OOK_Macro } |
enum | AvailabilityMergeKind { AMK_None , AMK_Redeclaration , AMK_Override , AMK_ProtocolImplementation , AMK_OptionalProtocolImplementation } |
Describes the kind of merge to perform for availability attributes (including "deprecated", "unavailable", and "availability"). More... | |
enum class | FunctionEmissionStatus { Emitted , CUDADiscarded , OMPDiscarded , TemplateDiscarded , Unknown } |
Status of the function emission on the CUDA/HIP/OpenMP host/device attrs. More... | |
typedef LazyVector< const DeclaratorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2 > | UnusedFileScopedDeclsType |
typedef LazyVector< VarDecl *, ExternalSemaSource, &ExternalSemaSource::ReadTentativeDefinitions, 2, 2 > | TentativeDefinitionsType |
typedef void * | SkippedDefinitionContext |
typedef llvm::function_ref< void(SourceLocation Loc, PartialDiagnostic PD)> | DiagReceiverTy |
IdentifierResolver | IdResolver |
unsigned | InventedParameterInfosStart = 0 |
The index of the first InventedParameterInfo that refers to the current context. More... | |
llvm::SmallPtrSet< const NamedDecl *, 4 > | TypoCorrectedFunctionDefinitions |
The function definitions which were renamed as part of typo-correction to match their respective declarations. More... | |
llvm::DenseMap< const EnumDecl *, llvm::APInt > | FlagBitsCache |
A cache of the flags available in enumerations with the flag_bits attribute. More... | |
llvm::MapVector< IdentifierInfo *, llvm::SetVector< WeakInfo, llvm::SmallVector< WeakInfo, 1u >, llvm::SmallDenseSet< WeakInfo, 2u, WeakInfo::DenseMapInfoByAliasOnly > > > | WeakUndeclaredIdentifiers |
WeakUndeclaredIdentifiers - Identifiers contained in #pragma weak before declared. More... | |
llvm::DenseMap< IdentifierInfo *, AsmLabelAttr * > | ExtnameUndeclaredIdentifiers |
ExtnameUndeclaredIdentifiers - Identifiers contained in #pragma redefine_extname before declared. More... | |
llvm::SmallSetVector< const TypedefNameDecl *, 4 > | UnusedLocalTypedefNameCandidates |
Set containing all typedefs that are likely unused. More... | |
UnusedFileScopedDeclsType | UnusedFileScopedDecls |
The set of file scoped decls seen so far that have not been used and must warn if not used. More... | |
TentativeDefinitionsType | TentativeDefinitions |
All the tentative definitions encountered in the TU. More... | |
SmallVector< VarDecl *, 4 > | ExternalDeclarations |
All the external declarations encoutered and used in the TU. More... | |
DeclContext * | OriginalLexicalContext |
Generally null except when we temporarily switch decl contexts, like in. More... | |
llvm::SmallPtrSet< const Decl *, 4 > | ParsingInitForAutoVars |
ParsingInitForAutoVars - a set of declarations with auto types for which we are currently parsing the initializer. More... | |
void | DiagnoseInvalidJumps (Stmt *Body) |
bool | currentModuleIsHeaderUnit () const |
Is the module scope we are in a C++ Header Unit? More... | |
Module * | getOwningModule (const Decl *Entity) |
Get the module owning an entity. More... | |
DeclGroupPtrTy | ConvertDeclToDeclGroup (Decl *Ptr, Decl *OwnedType=nullptr) |
ParsedType | getTypeName (const IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec *SS=nullptr, bool isClassName=false, bool HasTrailingDot=false, ParsedType ObjectType=nullptr, bool IsCtorOrDtorName=false, bool WantNontrivialTypeSourceInfo=false, bool IsClassTemplateDeductionContext=true, ImplicitTypenameContext AllowImplicitTypename=ImplicitTypenameContext::No, IdentifierInfo **CorrectedII=nullptr) |
If the identifier refers to a type name within this scope, return the declaration of that type. More... | |
TypeSpecifierType | isTagName (IdentifierInfo &II, Scope *S) |
isTagName() - This method is called for error recovery purposes only to determine if the specified name is a valid tag name ("struct foo"). More... | |
bool | isMicrosoftMissingTypename (const CXXScopeSpec *SS, Scope *S) |
isMicrosoftMissingTypename - In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to the type of one of the base classes then downgrade the missing typename error to a warning. More... | |
void | DiagnoseUnknownTypeName (IdentifierInfo *&II, SourceLocation IILoc, Scope *S, CXXScopeSpec *SS, ParsedType &SuggestedType, bool IsTemplateName=false) |
ParsedType | ActOnMSVCUnknownTypeName (const IdentifierInfo &II, SourceLocation NameLoc, bool IsTemplateTypeArg) |
Attempt to behave like MSVC in situations where lookup of an unqualified type name has failed in a dependent context. More... | |
NameClassification | ClassifyName (Scope *S, CXXScopeSpec &SS, IdentifierInfo *&Name, SourceLocation NameLoc, const Token &NextToken, CorrectionCandidateCallback *CCC=nullptr) |
Perform name lookup on the given name, classifying it based on the results of name lookup and the following token. More... | |
ExprResult | ActOnNameClassifiedAsUndeclaredNonType (IdentifierInfo *Name, SourceLocation NameLoc) |
Act on the result of classifying a name as an undeclared (ADL-only) non-type declaration. More... | |
ExprResult | ActOnNameClassifiedAsDependentNonType (const CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, bool IsAddressOfOperand) |
Act on the result of classifying a name as an undeclared member of a dependent base class. More... | |
ExprResult | ActOnNameClassifiedAsNonType (Scope *S, const CXXScopeSpec &SS, NamedDecl *Found, SourceLocation NameLoc, const Token &NextToken) |
Act on the result of classifying a name as a specific non-type declaration. More... | |
ExprResult | ActOnNameClassifiedAsOverloadSet (Scope *S, Expr *OverloadSet) |
Act on the result of classifying a name as an overload set. More... | |
TemplateNameKindForDiagnostics | getTemplateNameKindForDiagnostics (TemplateName Name) |
bool | mightBeIntendedToBeTemplateName (ExprResult E, bool &Dependent) |
Determine whether it's plausible that E was intended to be a template-name. More... | |
void | warnOnReservedIdentifier (const NamedDecl *D) |
Decl * | ActOnDeclarator (Scope *S, Declarator &D) |
NamedDecl * | HandleDeclarator (Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists) |
bool | tryToFixVariablyModifiedVarType (TypeSourceInfo *&TInfo, QualType &T, SourceLocation Loc, unsigned FailedFoldDiagID) |
Attempt to fold a variable-sized type to a constant-sized type, returning true if we were successful. More... | |
void | RegisterLocallyScopedExternCDecl (NamedDecl *ND, Scope *S) |
Register the given locally-scoped extern "C" declaration so that it can be found later for redeclarations. More... | |
bool | DiagnoseClassNameShadow (DeclContext *DC, DeclarationNameInfo Info) |
DiagnoseClassNameShadow - Implement C++ [class.mem]p13: If T is the name of a class, then each of the following shall have a name different from T: More... | |
bool | diagnoseQualifiedDeclaration (CXXScopeSpec &SS, DeclContext *DC, DeclarationName Name, SourceLocation Loc, TemplateIdAnnotation *TemplateId, bool IsMemberSpecialization) |
Diagnose a declaration whose declarator-id has the given nested-name-specifier. More... | |
bool | checkConstantPointerAuthKey (Expr *keyExpr, unsigned &key) |
void | DiagnoseFunctionSpecifiers (const DeclSpec &DS) |
Diagnose function specifiers on a declaration of an identifier that does not identify a function. More... | |
NamedDecl * | getShadowedDeclaration (const TypedefNameDecl *D, const LookupResult &R) |
Return the declaration shadowed by the given typedef D , or null if it doesn't shadow any declaration or shadowing warnings are disabled. More... | |
NamedDecl * | getShadowedDeclaration (const VarDecl *D, const LookupResult &R) |
Return the declaration shadowed by the given variable D , or null if it doesn't shadow any declaration or shadowing warnings are disabled. More... | |
NamedDecl * | getShadowedDeclaration (const BindingDecl *D, const LookupResult &R) |
Return the declaration shadowed by the given variable D , or null if it doesn't shadow any declaration or shadowing warnings are disabled. More... | |
void | CheckShadow (NamedDecl *D, NamedDecl *ShadowedDecl, const LookupResult &R) |
Diagnose variable or built-in function shadowing. More... | |
void | CheckShadow (Scope *S, VarDecl *D) |
Check -Wshadow without the advantage of a previous lookup. More... | |
void | CheckShadowingDeclModification (Expr *E, SourceLocation Loc) |
Warn if 'E', which is an expression that is about to be modified, refers to a shadowing declaration. More... | |
void | DiagnoseShadowingLambdaDecls (const sema::LambdaScopeInfo *LSI) |
Diagnose shadowing for variables shadowed in the lambda record LambdaRD when these variables are captured by the lambda. More... | |
void | handleTagNumbering (const TagDecl *Tag, Scope *TagScope) |
void | setTagNameForLinkagePurposes (TagDecl *TagFromDeclSpec, TypedefNameDecl *NewTD) |
void | CheckTypedefForVariablyModifiedType (Scope *S, TypedefNameDecl *D) |
NamedDecl * | ActOnTypedefDeclarator (Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo, LookupResult &Previous) |
NamedDecl * | ActOnTypedefNameDecl (Scope *S, DeclContext *DC, TypedefNameDecl *D, LookupResult &Previous, bool &Redeclaration) |
ActOnTypedefNameDecl - Perform semantic checking for a declaration which declares a typedef-name, either using the 'typedef' type specifier or via a C++0x [dcl.typedef]p2 alias-declaration: 'using T = A;'. More... | |
NamedDecl * | ActOnVariableDeclarator (Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo, LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists, bool &AddToScope, ArrayRef< BindingDecl * > Bindings=std::nullopt) |
bool | CheckVariableDeclaration (VarDecl *NewVD, LookupResult &Previous) |
Perform semantic checking on a newly-created variable declaration. More... | |
void | CheckVariableDeclarationType (VarDecl *NewVD) |
void | CheckCompleteVariableDeclaration (VarDecl *VD) |
NamedDecl * | ActOnFunctionDeclarator (Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo, LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists, bool &AddToScope) |
bool | AddOverriddenMethods (CXXRecordDecl *DC, CXXMethodDecl *MD) |
AddOverriddenMethods - See if a method overrides any in the base classes, and if so, check that it's a valid override and remember it. More... | |
bool | CheckFunctionDeclaration (Scope *S, FunctionDecl *NewFD, LookupResult &Previous, bool IsMemberSpecialization, bool DeclIsDefn) |
Perform semantic checking of a new function declaration. More... | |
bool | shouldLinkDependentDeclWithPrevious (Decl *D, Decl *OldDecl) |
Checks if the new declaration declared in dependent context must be put in the same redeclaration chain as the specified declaration. More... | |
bool | canFullyTypeCheckRedeclaration (ValueDecl *NewD, ValueDecl *OldD, QualType NewT, QualType OldT) |
Determines if we can perform a correct type check for D as a redeclaration of PrevDecl . More... | |
void | CheckMain (FunctionDecl *FD, const DeclSpec &D) |
void | CheckMSVCRTEntryPoint (FunctionDecl *FD) |
Attr * | getImplicitCodeSegOrSectionAttrForFunction (const FunctionDecl *FD, bool IsDefinition) |
Returns an implicit CodeSegAttr if a __declspec(code_seg) is found on a containing class. More... | |
void | CheckFunctionOrTemplateParamDeclarator (Scope *S, Declarator &D) |
Common checks for a parameter-declaration that should apply to both function parameters and non-type template parameters. More... | |
Decl * | ActOnParamDeclarator (Scope *S, Declarator &D, SourceLocation ExplicitThisLoc={}) |
ActOnParamDeclarator - Called from Parser::ParseFunctionDeclarator() to introduce parameters into function prototype scope. More... | |
ParmVarDecl * | BuildParmVarDeclForTypedef (DeclContext *DC, SourceLocation Loc, QualType T) |
Synthesizes a variable for a parameter arising from a typedef. More... | |
ParmVarDecl * | CheckParameter (DeclContext *DC, SourceLocation StartLoc, SourceLocation NameLoc, const IdentifierInfo *Name, QualType T, TypeSourceInfo *TSInfo, StorageClass SC) |
void | checkNonTrivialCUnionInInitializer (const Expr *Init, SourceLocation Loc) |
Emit diagnostics if the initializer or any of its explicit or implicitly-generated subexpressions require copying or default-initializing a type that is or contains a C union type that is non-trivial to copy or default-initialize. More... | |
void | checkNonTrivialCUnion (QualType QT, SourceLocation Loc, NonTrivialCUnionContext UseContext, unsigned NonTrivialKind) |
Emit diagnostics if a non-trivial C union type or a struct that contains a non-trivial C union is used in an invalid context. More... | |
void | AddInitializerToDecl (Decl *dcl, Expr *init, bool DirectInit) |
AddInitializerToDecl - Adds the initializer Init to the declaration dcl. More... | |
void | ActOnUninitializedDecl (Decl *dcl) |
void | ActOnInitializerError (Decl *Dcl) |
ActOnInitializerError - Given that there was an error parsing an initializer for the given declaration, try to at least re-establish invariants such as whether a variable's type is either dependent or complete. More... | |
void | ActOnCXXForRangeDecl (Decl *D) |
StmtResult | ActOnCXXForRangeIdentifier (Scope *S, SourceLocation IdentLoc, IdentifierInfo *Ident, ParsedAttributes &Attrs) |
void | CheckStaticLocalForDllExport (VarDecl *VD) |
Check if VD needs to be dllexport/dllimport due to being in a dllexport/import function. More... | |
void | CheckThreadLocalForLargeAlignment (VarDecl *VD) |
void | FinalizeDeclaration (Decl *D) |
FinalizeDeclaration - called by ParseDeclarationAfterDeclarator to perform any semantic actions necessary after any initializer has been attached. More... | |
DeclGroupPtrTy | FinalizeDeclaratorGroup (Scope *S, const DeclSpec &DS, ArrayRef< Decl * > Group) |
DeclGroupPtrTy | BuildDeclaratorGroup (MutableArrayRef< Decl * > Group) |
BuildDeclaratorGroup - convert a list of declarations into a declaration group, performing any necessary semantic checking. More... | |
void | ActOnDocumentableDecl (Decl *D) |
Should be called on all declarations that might have attached documentation comments. More... | |
void | ActOnDocumentableDecls (ArrayRef< Decl * > Group) |
void | ActOnFinishKNRParamDeclarations (Scope *S, Declarator &D, SourceLocation LocAfterDecls) |
void | CheckForFunctionRedefinition (FunctionDecl *FD, const FunctionDecl *EffectiveDefinition=nullptr, SkipBodyInfo *SkipBody=nullptr) |
Decl * | ActOnStartOfFunctionDef (Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParamLists, SkipBodyInfo *SkipBody=nullptr, FnBodyKind BodyKind=FnBodyKind::Other) |
Decl * | ActOnStartOfFunctionDef (Scope *S, Decl *D, SkipBodyInfo *SkipBody=nullptr, FnBodyKind BodyKind=FnBodyKind::Other) |
void | applyFunctionAttributesBeforeParsingBody (Decl *FD) |
bool | canDelayFunctionBody (const Declarator &D) |
Determine whether we can delay parsing the body of a function or function template until it is used, assuming we don't care about emitting code for that function. More... | |
bool | canSkipFunctionBody (Decl *D) |
Determine whether we can skip parsing the body of a function definition, assuming we don't care about analyzing its body or emitting code for that function. More... | |
void | computeNRVO (Stmt *Body, sema::FunctionScopeInfo *Scope) |
Given the set of return statements within a function body, compute the variables that are subject to the named return value optimization. More... | |
Decl * | ActOnFinishFunctionBody (Decl *Decl, Stmt *Body) |
Decl * | ActOnFinishFunctionBody (Decl *Decl, Stmt *Body, bool IsInstantiation) |
Decl * | ActOnSkippedFunctionBody (Decl *Decl) |
void | ActOnFinishInlineFunctionDef (FunctionDecl *D) |
void | ActOnFinishDelayedAttribute (Scope *S, Decl *D, ParsedAttributes &Attrs) |
ActOnFinishDelayedAttribute - Invoked when we have finished parsing an attribute for which parsing is delayed. More... | |
void | DiagnoseUnusedParameters (ArrayRef< ParmVarDecl * > Parameters) |
Diagnose any unused parameters in the given sequence of ParmVarDecl pointers. More... | |
void | DiagnoseSizeOfParametersAndReturnValue (ArrayRef< ParmVarDecl * > Parameters, QualType ReturnTy, NamedDecl *D) |
Diagnose whether the size of parameters or return value of a function or obj-c method definition is pass-by-value and larger than a specified threshold. More... | |
Decl * | ActOnFileScopeAsmDecl (Expr *expr, SourceLocation AsmLoc, SourceLocation RParenLoc) |
TopLevelStmtDecl * | ActOnStartTopLevelStmtDecl (Scope *S) |
void | ActOnFinishTopLevelStmtDecl (TopLevelStmtDecl *D, Stmt *Statement) |
void | ActOnPopScope (SourceLocation Loc, Scope *S) |
Decl * | ParsedFreeStandingDeclSpec (Scope *S, AccessSpecifier AS, DeclSpec &DS, const ParsedAttributesView &DeclAttrs, RecordDecl *&AnonRecord) |
ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g. More... | |
Decl * | ParsedFreeStandingDeclSpec (Scope *S, AccessSpecifier AS, DeclSpec &DS, const ParsedAttributesView &DeclAttrs, MultiTemplateParamsArg TemplateParams, bool IsExplicitInstantiation, RecordDecl *&AnonRecord) |
ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g. More... | |
Decl * | BuildAnonymousStructOrUnion (Scope *S, DeclSpec &DS, AccessSpecifier AS, RecordDecl *Record, const PrintingPolicy &Policy) |
BuildAnonymousStructOrUnion - Handle the declaration of an anonymous structure or union. More... | |
void | ActOnDefinedDeclarationSpecifier (Decl *D) |
Called once it is known whether a tag declaration is an anonymous union or struct. More... | |
void | DiagPlaceholderFieldDeclDefinitions (RecordDecl *Record) |
Emit diagnostic warnings for placeholder members. More... | |
Decl * | BuildMicrosoftCAnonymousStruct (Scope *S, DeclSpec &DS, RecordDecl *Record) |
BuildMicrosoftCAnonymousStruct - Handle the declaration of an Microsoft C anonymous structure. More... | |
NonTagKind | getNonTagTypeDeclKind (const Decl *D, TagTypeKind TTK) |
Given a non-tag type declaration, returns an enum useful for indicating what kind of non-tag type this is. More... | |
bool | isAcceptableTagRedeclaration (const TagDecl *Previous, TagTypeKind NewTag, bool isDefinition, SourceLocation NewTagLoc, const IdentifierInfo *Name) |
Determine whether a tag with a given kind is acceptable as a redeclaration of the given tag declaration. More... | |
DeclResult | ActOnTag (Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr, AccessSpecifier AS, SourceLocation ModulePrivateLoc, MultiTemplateParamsArg TemplateParameterLists, bool &OwnedDecl, bool &IsDependent, SourceLocation ScopedEnumKWLoc, bool ScopedEnumUsesClassTag, TypeResult UnderlyingType, bool IsTypeSpecifier, bool IsTemplateParamOrArg, OffsetOfKind OOK, SkipBodyInfo *SkipBody=nullptr) |
This is invoked when we see 'struct foo' or 'struct {'. More... | |
Decl * | ActOnField (Scope *S, Decl *TagD, SourceLocation DeclStart, Declarator &D, Expr *BitfieldWidth) |
ActOnField - Each field of a C struct/union is passed into this in order to create a FieldDecl object for it. More... | |
FieldDecl * | HandleField (Scope *S, RecordDecl *TagD, SourceLocation DeclStart, Declarator &D, Expr *BitfieldWidth, InClassInitStyle InitStyle, AccessSpecifier AS) |
HandleField - Analyze a field of a C struct or a C++ data member. More... | |
FieldDecl * | CheckFieldDecl (DeclarationName Name, QualType T, TypeSourceInfo *TInfo, RecordDecl *Record, SourceLocation Loc, bool Mutable, Expr *BitfieldWidth, InClassInitStyle InitStyle, SourceLocation TSSL, AccessSpecifier AS, NamedDecl *PrevDecl, Declarator *D=nullptr) |
Build a new FieldDecl and check its well-formedness. More... | |
bool | CheckNontrivialField (FieldDecl *FD) |
void | ActOnLastBitfield (SourceLocation DeclStart, SmallVectorImpl< Decl * > &AllIvarDecls) |
ActOnLastBitfield - This routine handles synthesized bitfields rules for class and class extensions. More... | |
void | ActOnFields (Scope *S, SourceLocation RecLoc, Decl *TagDecl, ArrayRef< Decl * > Fields, SourceLocation LBrac, SourceLocation RBrac, const ParsedAttributesView &AttrList) |
void | ActOnTagStartDefinition (Scope *S, Decl *TagDecl) |
ActOnTagStartDefinition - Invoked when we have entered the scope of a tag's definition (e.g., for an enumeration, class, struct, or union). More... | |
bool | ActOnDuplicateDefinition (Decl *Prev, SkipBodyInfo &SkipBody) |
Perform ODR-like check for C/ObjC when merging tag types from modules. More... | |
SkippedDefinitionContext | ActOnTagStartSkippedDefinition (Scope *S, Decl *TD) |
Invoked when we enter a tag definition that we're skipping. More... | |
void | ActOnStartCXXMemberDeclarations (Scope *S, Decl *TagDecl, SourceLocation FinalLoc, bool IsFinalSpelledSealed, bool IsAbstract, SourceLocation LBraceLoc) |
ActOnStartCXXMemberDeclarations - Invoked when we have parsed a C++ record definition's base-specifiers clause and are starting its member declarations. More... | |
void | ActOnTagFinishDefinition (Scope *S, Decl *TagDecl, SourceRange BraceRange) |
ActOnTagFinishDefinition - Invoked once we have finished parsing the definition of a tag (enumeration, class, struct, or union). More... | |
void | ActOnTagFinishSkippedDefinition (SkippedDefinitionContext Context) |
void | ActOnTagDefinitionError (Scope *S, Decl *TagDecl) |
ActOnTagDefinitionError - Invoked when there was an unrecoverable error parsing the definition of a tag. More... | |
EnumConstantDecl * | CheckEnumConstant (EnumDecl *Enum, EnumConstantDecl *LastEnumConst, SourceLocation IdLoc, IdentifierInfo *Id, Expr *val) |
bool | CheckEnumUnderlyingType (TypeSourceInfo *TI) |
Check that this is a valid underlying type for an enum declaration. More... | |
bool | CheckEnumRedeclaration (SourceLocation EnumLoc, bool IsScoped, QualType EnumUnderlyingTy, bool IsFixed, const EnumDecl *Prev) |
Check whether this is a valid redeclaration of a previous enumeration. More... | |
SkipBodyInfo | shouldSkipAnonEnumBody (Scope *S, IdentifierInfo *II, SourceLocation IILoc) |
Determine whether the body of an anonymous enumeration should be skipped. More... | |
Decl * | ActOnEnumConstant (Scope *S, Decl *EnumDecl, Decl *LastEnumConstant, SourceLocation IdLoc, IdentifierInfo *Id, const ParsedAttributesView &Attrs, SourceLocation EqualLoc, Expr *Val) |
void | ActOnEnumBody (SourceLocation EnumLoc, SourceRange BraceRange, Decl *EnumDecl, ArrayRef< Decl * > Elements, Scope *S, const ParsedAttributesView &Attr) |
void | PushDeclContext (Scope *S, DeclContext *DC) |
Set the current declaration context until it gets popped. More... | |
void | PopDeclContext () |
void | EnterDeclaratorContext (Scope *S, DeclContext *DC) |
EnterDeclaratorContext - Used when we must lookup names in the context of a declarator's nested name specifier. More... | |
void | ExitDeclaratorContext (Scope *S) |
void | EnterTemplatedContext (Scope *S, DeclContext *DC) |
Enter a template parameter scope, after it's been associated with a particular DeclContext. More... | |
void | ActOnReenterFunctionContext (Scope *S, Decl *D) |
Push the parameters of D, which must be a function, into scope. More... | |
void | ActOnExitFunctionContext () |
void | PushOnScopeChains (NamedDecl *D, Scope *S, bool AddToContext=true) |
Add this decl to the scope shadowed decl chains. More... | |
bool | isDeclInScope (NamedDecl *D, DeclContext *Ctx, Scope *S=nullptr, bool AllowInlineNamespace=false) const |
isDeclInScope - If 'Ctx' is a function/method, isDeclInScope returns true if 'D' is in Scope 'S', otherwise 'S' is ignored and isDeclInScope returns true if 'D' belongs to the given declaration context. More... | |
TypedefDecl * | ParseTypedefDecl (Scope *S, Declarator &D, QualType T, TypeSourceInfo *TInfo) |
Subroutines of ActOnDeclarator(). More... | |
bool | isIncompatibleTypedef (const TypeDecl *Old, TypedefNameDecl *New) |
void | mergeDeclAttributes (NamedDecl *New, Decl *Old, AvailabilityMergeKind AMK=AMK_Redeclaration) |
mergeDeclAttributes - Copy attributes from the Old decl to the New one. More... | |
void | MergeTypedefNameDecl (Scope *S, TypedefNameDecl *New, LookupResult &OldDecls) |
MergeTypedefNameDecl - We just parsed a typedef 'New' which has the same name and scope as a previous declaration 'Old'. More... | |
bool | MergeFunctionDecl (FunctionDecl *New, NamedDecl *&Old, Scope *S, bool MergeTypeWithOld, bool NewDeclIsDefn) |
MergeFunctionDecl - We just parsed a function 'New' from declarator D which has the same name and scope as a previous declaration 'Old'. More... | |
bool | MergeCompatibleFunctionDecls (FunctionDecl *New, FunctionDecl *Old, Scope *S, bool MergeTypeWithOld) |
Completes the merge of two function declarations that are known to be compatible. More... | |
void | mergeObjCMethodDecls (ObjCMethodDecl *New, ObjCMethodDecl *Old) |
void | MergeVarDecl (VarDecl *New, LookupResult &Previous) |
MergeVarDecl - We just parsed a variable 'New' which has the same name and scope as a previous declaration 'Old'. More... | |
void | MergeVarDeclTypes (VarDecl *New, VarDecl *Old, bool MergeTypeWithOld) |
MergeVarDeclTypes - We parsed a variable 'New' which has the same name and scope as a previous declaration 'Old'. More... | |
bool | checkVarDeclRedefinition (VarDecl *OldDefn, VarDecl *NewDefn) |
We've just determined that Old and New both appear to be definitions of the same variable. More... | |
void | notePreviousDefinition (const NamedDecl *Old, SourceLocation New) |
void | FilterLookupForScope (LookupResult &R, DeclContext *Ctx, Scope *S, bool ConsiderLinkage, bool AllowInlineNamespace) |
Filters out lookup results that don't fall within the given scope as determined by isDeclInScope. More... | |
bool | CheckRedeclarationModuleOwnership (NamedDecl *New, NamedDecl *Old) |
We've determined that New is a redeclaration of Old . More... | |
bool | CheckRedeclarationExported (NamedDecl *New, NamedDecl *Old) |
bool | CheckRedeclarationInModule (NamedDecl *New, NamedDecl *Old) |
bool | IsRedefinitionInModule (const NamedDecl *New, const NamedDecl *Old) const |
bool | ShouldWarnIfUnusedFileScopedDecl (const DeclaratorDecl *D) const |
void | MarkUnusedFileScopedDecl (const DeclaratorDecl *D) |
If it's a file scoped decl that must warn if not used, keep track of it. More... | |
void | DiagnoseUnusedNestedTypedefs (const RecordDecl *D) |
void | DiagnoseUnusedNestedTypedefs (const RecordDecl *D, DiagReceiverTy DiagReceiver) |
void | DiagnoseUnusedDecl (const NamedDecl *ND) |
void | DiagnoseUnusedDecl (const NamedDecl *ND, DiagReceiverTy DiagReceiver) |
DiagnoseUnusedDecl - Emit warnings about declarations that are not used unless they are marked attr(unused). More... | |
void | DiagnoseUnusedButSetDecl (const VarDecl *VD, DiagReceiverTy DiagReceiver) |
If VD is set but not otherwise used, diagnose, for a parameter or a variable. More... | |
Scope * | getNonFieldDeclScope (Scope *S) |
getNonFieldDeclScope - Retrieves the innermost scope, starting from S, where a non-field would be declared. More... | |
FunctionDecl * | CreateBuiltin (IdentifierInfo *II, QualType Type, unsigned ID, SourceLocation Loc) |
NamedDecl * | LazilyCreateBuiltin (IdentifierInfo *II, unsigned ID, Scope *S, bool ForRedeclaration, SourceLocation Loc) |
LazilyCreateBuiltin - The specified Builtin-ID was first used at file scope. More... | |
const AttributedType * | getCallingConvAttributedType (QualType T) const |
Get the outermost AttributedType node that sets a calling convention. More... | |
DeclarationNameInfo | GetNameForDeclarator (Declarator &D) |
GetNameForDeclarator - Determine the full declaration name for the given Declarator. More... | |
DeclarationNameInfo | GetNameFromUnqualifiedId (const UnqualifiedId &Name) |
Retrieves the declaration name from a parsed unqualified-id. More... | |
NamedDecl * | findLocallyScopedExternCDecl (DeclarationName Name) |
Look for a locally scoped extern "C" declaration by the given name. More... | |
void | deduceOpenCLAddressSpace (ValueDecl *decl) |
void | MarkTypoCorrectedFunctionDefinition (const NamedDecl *F) |
bool | 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) |
Checks if the variant/multiversion functions are compatible. More... | |
bool | CheckForConstantInitializer (Expr *Init, unsigned DiagID=diag::err_init_element_not_constant) |
type checking declaration initializers (C99 6.7.8) More... | |
QualType | deduceVarTypeFromInitializer (VarDecl *VDecl, DeclarationName Name, QualType Type, TypeSourceInfo *TSI, SourceRange Range, bool DirectInit, Expr *Init) |
bool | DeduceVariableDeclarationType (VarDecl *VDecl, bool DirectInit, Expr *Init) |
sema::LambdaScopeInfo * | RebuildLambdaScopeInfo (CXXMethodDecl *CallOperator) |
NamedDecl * | ImplicitlyDefineFunction (SourceLocation Loc, IdentifierInfo &II, Scope *S) |
ImplicitlyDefineFunction - An undeclared identifier was used in a function call, forming a call to an implicitly defined function (per C99 6.5.1p2). More... | |
void | AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction (FunctionDecl *FD) |
If this function is a C++ replaceable global allocation function (C++2a [basic.stc.dynamic.allocation], C++2a [new.delete]), adds any function attributes that we know a priori based on the standard. More... | |
void | AddKnownFunctionAttributes (FunctionDecl *FD) |
Adds any function attributes that we know a priori based on the declaration of this function. More... | |
ExprResult | VerifyBitField (SourceLocation FieldLoc, const IdentifierInfo *FieldName, QualType FieldTy, bool IsMsStruct, Expr *BitWidth) |
VerifyBitField - verifies that a bit field expression is an ICE and has the correct width, and that the field type is valid. More... | |
bool | IsValueInFlagEnum (const EnumDecl *ED, const llvm::APInt &Val, bool AllowMask) const |
IsValueInFlagEnum - Determine if a value is allowed as part of a flag enum. More... | |
void | ActOnPragmaWeakID (IdentifierInfo *WeakName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc) |
ActOnPragmaWeakID - Called on well formed #pragma weak ident. More... | |
void | ActOnPragmaRedefineExtname (IdentifierInfo *WeakName, IdentifierInfo *AliasName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc, SourceLocation AliasNameLoc) |
ActOnPragmaRedefineExtname - Called on well formed #pragma redefine_extname oldname newname. More... | |
void | ActOnPragmaWeakAlias (IdentifierInfo *WeakName, IdentifierInfo *AliasName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc, SourceLocation AliasNameLoc) |
ActOnPragmaWeakAlias - Called on well formed #pragma weak ident = ident. More... | |
FunctionEmissionStatus | getEmissionStatus (const FunctionDecl *Decl, bool Final=false) |
bool | shouldIgnoreInHostDeviceCheck (FunctionDecl *Callee) |
DeviceDiagnosticReason | getEmissionReason (const FunctionDecl *Decl) |
static Scope * | getScopeForDeclContext (Scope *S, DeclContext *DC) |
Finds the scope corresponding to the given decl context, if it happens to be an enclosing scope. More... | |
static bool | adjustContextForLocalExternDecl (DeclContext *&DC) |
Adjust the DeclContext for a function or variable that might be a function-local external declaration. More... | |
static bool | CanBeGetReturnObject (const FunctionDecl *FD) |
static bool | CanBeGetReturnTypeOnAllocFailure (const FunctionDecl *FD) |
Declaration Attribute Handling | |
Implementations are in SemaDeclAttr.cpp | |
enum | AvailabilityPriority : int { AP_Explicit = 0 , AP_PragmaClangAttribute = 1 , AP_InferredFromOtherPlatform = 2 } |
Describes the kind of priority given to an availability attribute. More... | |
enum class | CallingConventionIgnoredReason { ForThisTarget = 0 , VariadicFunction , ConstructorDestructor , BuiltinFunction } |
Describes the reason a calling convention specification was ignored, used for diagnostics. More... | |
enum class | RetainOwnershipKind { NS , CF , OS } |
typedef LazyVector< TypedefNameDecl *, ExternalSemaSource, &ExternalSemaSource::ReadExtVectorDecls, 2, 2 > | ExtVectorDeclsType |
SmallVector< Decl *, 2 > | WeakTopLevelDecl |
WeakTopLevelDecl - Translation-unit scoped declarations generated by #pragma weak during processing of other Decls. More... | |
ExtVectorDeclsType | ExtVectorDecls |
ExtVectorDecls - This is a list all the extended vector types. More... | |
SmallVectorImpl< Decl * > & | WeakTopLevelDecls () |
WeakTopLevelDeclDecls - access to #pragma weak-generated Decls. More... | |
bool | checkStringLiteralArgumentAttr (const AttributeCommonInfo &CI, const Expr *E, StringRef &Str, SourceLocation *ArgLocation=nullptr) |
bool | checkStringLiteralArgumentAttr (const ParsedAttr &Attr, unsigned ArgNum, StringRef &Str, SourceLocation *ArgLocation=nullptr) |
bool | isValidPointerAttrType (QualType T, bool RefOkay=false) |
Determine if type T is a valid subject for a nonnull and similar attributes. More... | |
void | AddAssumeAlignedAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E, Expr *OE) |
AddAssumeAlignedAttr - Adds an assume_aligned attribute to a particular declaration. More... | |
void | AddAllocAlignAttr (Decl *D, const AttributeCommonInfo &CI, Expr *ParamExpr) |
AddAllocAlignAttr - Adds an alloc_align attribute to a particular declaration. More... | |
bool | CheckAttrTarget (const ParsedAttr &CurrAttr) |
bool | CheckAttrNoArgs (const ParsedAttr &CurrAttr) |
AvailabilityAttr * | mergeAvailabilityAttr (NamedDecl *D, const AttributeCommonInfo &CI, IdentifierInfo *Platform, bool Implicit, VersionTuple Introduced, VersionTuple Deprecated, VersionTuple Obsoleted, bool IsUnavailable, StringRef Message, bool IsStrict, StringRef Replacement, AvailabilityMergeKind AMK, int Priority, IdentifierInfo *IIEnvironment) |
TypeVisibilityAttr * | mergeTypeVisibilityAttr (Decl *D, const AttributeCommonInfo &CI, TypeVisibilityAttr::VisibilityType Vis) |
VisibilityAttr * | mergeVisibilityAttr (Decl *D, const AttributeCommonInfo &CI, VisibilityAttr::VisibilityType Vis) |
SectionAttr * | mergeSectionAttr (Decl *D, const AttributeCommonInfo &CI, StringRef Name) |
llvm::Error | isValidSectionSpecifier (StringRef Str) |
bool | checkSectionName (SourceLocation LiteralLoc, StringRef Str) |
CodeSegAttr * | mergeCodeSegAttr (Decl *D, const AttributeCommonInfo &CI, StringRef Name) |
bool | checkTargetAttr (SourceLocation LiteralLoc, StringRef Str) |
bool | checkTargetVersionAttr (SourceLocation LiteralLoc, Decl *D, StringRef &Str, bool &isDefault) |
bool | checkTargetClonesAttrString (SourceLocation LiteralLoc, StringRef Str, const StringLiteral *Literal, Decl *D, bool &HasDefault, bool &HasCommas, bool &HasNotDefault, SmallVectorImpl< SmallString< 64 >> &StringsBuffer) |
ErrorAttr * | mergeErrorAttr (Decl *D, const AttributeCommonInfo &CI, StringRef NewUserDiagnostic) |
FormatAttr * | mergeFormatAttr (Decl *D, const AttributeCommonInfo &CI, IdentifierInfo *Format, int FormatIdx, int FirstArg) |
void | AddAlignedAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E, bool IsPackExpansion) |
AddAlignedAttr - Adds an aligned attribute to a particular declaration. More... | |
void | AddAlignedAttr (Decl *D, const AttributeCommonInfo &CI, TypeSourceInfo *T, bool IsPackExpansion) |
void | AddAlignValueAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
AddAlignValueAttr - Adds an align_value attribute to a particular declaration. More... | |
void | AddAnnotationAttr (Decl *D, const AttributeCommonInfo &CI, StringRef Annot, MutableArrayRef< Expr * > Args) |
AddAnnotationAttr - Adds an annotation Annot with Args arguments to D. More... | |
bool | checkMSInheritanceAttrOnDefinition (CXXRecordDecl *RD, SourceRange Range, bool BestCase, MSInheritanceModel SemanticSpelling) |
void | CheckAlignasUnderalignment (Decl *D) |
void | AddModeAttr (Decl *D, const AttributeCommonInfo &CI, IdentifierInfo *Name, bool InInstantiation=false) |
AddModeAttr - Adds a mode attribute to a particular declaration. More... | |
AlwaysInlineAttr * | mergeAlwaysInlineAttr (Decl *D, const AttributeCommonInfo &CI, const IdentifierInfo *Ident) |
MinSizeAttr * | mergeMinSizeAttr (Decl *D, const AttributeCommonInfo &CI) |
SwiftNameAttr * | mergeSwiftNameAttr (Decl *D, const SwiftNameAttr &SNA, StringRef Name) |
OptimizeNoneAttr * | mergeOptimizeNoneAttr (Decl *D, const AttributeCommonInfo &CI) |
InternalLinkageAttr * | mergeInternalLinkageAttr (Decl *D, const ParsedAttr &AL) |
InternalLinkageAttr * | mergeInternalLinkageAttr (Decl *D, const InternalLinkageAttr &AL) |
bool | CheckCallingConvAttr (const ParsedAttr &attr, CallingConv &CC, const FunctionDecl *FD=nullptr, CUDAFunctionTarget CFT=CUDAFunctionTarget::InvalidTarget) |
Check validaty of calling convention attribute attr . More... | |
void | AddParameterABIAttr (Decl *D, const AttributeCommonInfo &CI, ParameterABI ABI) |
bool | CheckRegparmAttr (const ParsedAttr &attr, unsigned &value) |
CUDALaunchBoundsAttr * | CreateLaunchBoundsAttr (const AttributeCommonInfo &CI, Expr *MaxThreads, Expr *MinBlocks, Expr *MaxBlocks) |
Create an CUDALaunchBoundsAttr attribute. More... | |
void | AddLaunchBoundsAttr (Decl *D, const AttributeCommonInfo &CI, Expr *MaxThreads, Expr *MinBlocks, Expr *MaxBlocks) |
AddLaunchBoundsAttr - Adds a launch_bounds attribute to a particular declaration. More... | |
void | AddXConsumedAttr (Decl *D, const AttributeCommonInfo &CI, RetainOwnershipKind K, bool IsTemplateInstantiation) |
bool | checkNSReturnsRetainedReturnType (SourceLocation loc, QualType type) |
bool | DiagnoseSwiftName (Decl *D, StringRef Name, SourceLocation Loc, const ParsedAttr &AL, bool IsAsync) |
Do a check to make sure Name looks like a legal argument for the swift_name attribute applied to decl D . More... | |
UuidAttr * | mergeUuidAttr (Decl *D, const AttributeCommonInfo &CI, StringRef UuidAsWritten, MSGuidDecl *GuidDecl) |
BTFDeclTagAttr * | mergeBTFDeclTagAttr (Decl *D, const BTFDeclTagAttr &AL) |
WebAssemblyImportNameAttr * | mergeImportNameAttr (Decl *D, const WebAssemblyImportNameAttr &AL) |
WebAssemblyImportModuleAttr * | mergeImportModuleAttr (Decl *D, const WebAssemblyImportModuleAttr &AL) |
AMDGPUFlatWorkGroupSizeAttr * | CreateAMDGPUFlatWorkGroupSizeAttr (const AttributeCommonInfo &CI, Expr *Min, Expr *Max) |
Create an AMDGPUWavesPerEUAttr attribute. More... | |
void | addAMDGPUFlatWorkGroupSizeAttr (Decl *D, const AttributeCommonInfo &CI, Expr *Min, Expr *Max) |
addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size attribute to a particular declaration. More... | |
AMDGPUWavesPerEUAttr * | CreateAMDGPUWavesPerEUAttr (const AttributeCommonInfo &CI, Expr *Min, Expr *Max) |
Create an AMDGPUWavesPerEUAttr attribute. More... | |
void | addAMDGPUWavesPerEUAttr (Decl *D, const AttributeCommonInfo &CI, Expr *Min, Expr *Max) |
addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a particular declaration. More... | |
AMDGPUMaxNumWorkGroupsAttr * | CreateAMDGPUMaxNumWorkGroupsAttr (const AttributeCommonInfo &CI, Expr *XExpr, Expr *YExpr, Expr *ZExpr) |
Create an AMDGPUMaxNumWorkGroupsAttr attribute. More... | |
void | addAMDGPUMaxNumWorkGroupsAttr (Decl *D, const AttributeCommonInfo &CI, Expr *XExpr, Expr *YExpr, Expr *ZExpr) |
addAMDGPUMaxNumWorkGroupsAttr - Adds an amdgpu_max_num_work_groups attribute to a particular declaration. More... | |
DLLImportAttr * | mergeDLLImportAttr (Decl *D, const AttributeCommonInfo &CI) |
DLLExportAttr * | mergeDLLExportAttr (Decl *D, const AttributeCommonInfo &CI) |
MSInheritanceAttr * | mergeMSInheritanceAttr (Decl *D, const AttributeCommonInfo &CI, bool BestCase, MSInheritanceModel Model) |
EnforceTCBAttr * | mergeEnforceTCBAttr (Decl *D, const EnforceTCBAttr &AL) |
EnforceTCBLeafAttr * | mergeEnforceTCBLeafAttr (Decl *D, const EnforceTCBLeafAttr &AL) |
void | ProcessDeclAttributeDelayed (Decl *D, const ParsedAttributesView &AttrList) |
void | ProcessDeclAttributeList (Scope *S, Decl *D, const ParsedAttributesView &AttrList, const ProcessDeclAttributeOptions &Options=ProcessDeclAttributeOptions()) |
bool | ProcessAccessDeclAttributeList (AccessSpecDecl *ASDecl, const ParsedAttributesView &AttrList) |
void | checkUnusedDeclAttributes (Declarator &D) |
NamedDecl * | DeclClonePragmaWeak (NamedDecl *ND, const IdentifierInfo *II, SourceLocation Loc) |
void | DeclApplyPragmaWeak (Scope *S, NamedDecl *ND, const WeakInfo &W) |
void | ProcessPragmaWeak (Scope *S, Decl *D) |
void | ProcessDeclAttributes (Scope *S, Decl *D, const Declarator &PD) |
bool | CheckRebuiltAttributedStmtAttributes (ArrayRef< const Attr * > Attrs) |
void | PopParsingDeclaration (ParsingDeclState state, Decl *decl) |
void | redelayDiagnostics (sema::DelayedDiagnosticPool &pool) |
void | AddSYCLIntelBankBitsAttr (Decl *D, const AttributeCommonInfo &CI, Expr **Exprs, unsigned Size) |
bool | AnyWorkGroupSizesDiffer (const Expr *LHSXDim, const Expr *LHSYDim, const Expr *LHSZDim, const Expr *RHSXDim, const Expr *RHSYDim, const Expr *RHSZDim) |
bool | AllWorkGroupSizesSame (const Expr *LHSXDim, const Expr *LHSYDim, const Expr *LHSZDim, const Expr *RHSXDim, const Expr *RHSYDim, const Expr *RHSZDim) |
void | AddSYCLWorkGroupSizeHintAttr (Decl *D, const AttributeCommonInfo &CI, Expr *XDim, Expr *YDim, Expr *ZDim) |
SYCLWorkGroupSizeHintAttr * | MergeSYCLWorkGroupSizeHintAttr (Decl *D, const SYCLWorkGroupSizeHintAttr &A) |
void | AddIntelReqdSubGroupSize (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
IntelReqdSubGroupSizeAttr * | MergeIntelReqdSubGroupSizeAttr (Decl *D, const IntelReqdSubGroupSizeAttr &A) |
IntelNamedSubGroupSizeAttr * | MergeIntelNamedSubGroupSizeAttr (Decl *D, const IntelNamedSubGroupSizeAttr &A) |
void | AddSYCLIntelNumSimdWorkItemsAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelNumSimdWorkItemsAttr * | MergeSYCLIntelNumSimdWorkItemsAttr (Decl *D, const SYCLIntelNumSimdWorkItemsAttr &A) |
void | AddSYCLIntelESimdVectorizeAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelESimdVectorizeAttr * | MergeSYCLIntelESimdVectorizeAttr (Decl *D, const SYCLIntelESimdVectorizeAttr &A) |
void | AddSYCLIntelSchedulerTargetFmaxMhzAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelSchedulerTargetFmaxMhzAttr * | MergeSYCLIntelSchedulerTargetFmaxMhzAttr (Decl *D, const SYCLIntelSchedulerTargetFmaxMhzAttr &A) |
void | AddSYCLIntelNoGlobalWorkOffsetAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelNoGlobalWorkOffsetAttr * | MergeSYCLIntelNoGlobalWorkOffsetAttr (Decl *D, const SYCLIntelNoGlobalWorkOffsetAttr &A) |
void | AddSYCLIntelLoopFuseAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelLoopFuseAttr * | MergeSYCLIntelLoopFuseAttr (Decl *D, const SYCLIntelLoopFuseAttr &A) |
void | AddSYCLIntelPrivateCopiesAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
void | AddSYCLIntelMaxReplicatesAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelMaxReplicatesAttr * | MergeSYCLIntelMaxReplicatesAttr (Decl *D, const SYCLIntelMaxReplicatesAttr &A) |
void | AddSYCLIntelForcePow2DepthAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelForcePow2DepthAttr * | MergeSYCLIntelForcePow2DepthAttr (Decl *D, const SYCLIntelForcePow2DepthAttr &A) |
void | AddSYCLIntelInitiationIntervalAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelInitiationIntervalAttr * | MergeSYCLIntelInitiationIntervalAttr (Decl *D, const SYCLIntelInitiationIntervalAttr &A) |
SYCLIntelMaxConcurrencyAttr * | MergeSYCLIntelMaxConcurrencyAttr (Decl *D, const SYCLIntelMaxConcurrencyAttr &A) |
void | AddSYCLIntelMaxGlobalWorkDimAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelMaxGlobalWorkDimAttr * | MergeSYCLIntelMaxGlobalWorkDimAttr (Decl *D, const SYCLIntelMaxGlobalWorkDimAttr &A) |
void | AddSYCLIntelMinWorkGroupsPerComputeUnitAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelMinWorkGroupsPerComputeUnitAttr * | MergeSYCLIntelMinWorkGroupsPerComputeUnitAttr (Decl *D, const SYCLIntelMinWorkGroupsPerComputeUnitAttr &A) |
void | AddSYCLIntelMaxWorkGroupsPerMultiprocessorAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelMaxWorkGroupsPerMultiprocessorAttr * | MergeSYCLIntelMaxWorkGroupsPerMultiprocessorAttr (Decl *D, const SYCLIntelMaxWorkGroupsPerMultiprocessorAttr &A) |
void | AddSYCLIntelBankWidthAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelBankWidthAttr * | MergeSYCLIntelBankWidthAttr (Decl *D, const SYCLIntelBankWidthAttr &A) |
void | AddSYCLIntelNumBanksAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
SYCLIntelNumBanksAttr * | MergeSYCLIntelNumBanksAttr (Decl *D, const SYCLIntelNumBanksAttr &A) |
SYCLDeviceHasAttr * | MergeSYCLDeviceHasAttr (Decl *D, const SYCLDeviceHasAttr &A) |
void | AddSYCLDeviceHasAttr (Decl *D, const AttributeCommonInfo &CI, Expr **Exprs, unsigned Size) |
SYCLUsesAspectsAttr * | MergeSYCLUsesAspectsAttr (Decl *D, const SYCLUsesAspectsAttr &A) |
void | AddSYCLUsesAspectsAttr (Decl *D, const AttributeCommonInfo &CI, Expr **Exprs, unsigned Size) |
bool | CheckMaxAllowedWorkGroupSize (const Expr *RWGSXDim, const Expr *RWGSYDim, const Expr *RWGSZDim, const Expr *MWGSXDim, const Expr *MWGSYDim, const Expr *MWGSZDim) |
void | AddSYCLIntelMaxWorkGroupSizeAttr (Decl *D, const AttributeCommonInfo &CI, Expr *XDim, Expr *YDim, Expr *ZDim) |
SYCLIntelMaxWorkGroupSizeAttr * | MergeSYCLIntelMaxWorkGroupSizeAttr (Decl *D, const SYCLIntelMaxWorkGroupSizeAttr &A) |
void | CheckSYCLAddIRAttributesFunctionAttrConflicts (Decl *D) |
SYCLAddIRAttributesFunctionAttr * | MergeSYCLAddIRAttributesFunctionAttr (Decl *D, const SYCLAddIRAttributesFunctionAttr &A) |
void | AddSYCLAddIRAttributesFunctionAttr (Decl *D, const AttributeCommonInfo &CI, MutableArrayRef< Expr * > Args) |
SYCLAddIRAttributesKernelParameterAttr * | MergeSYCLAddIRAttributesKernelParameterAttr (Decl *D, const SYCLAddIRAttributesKernelParameterAttr &A) |
void | AddSYCLAddIRAttributesKernelParameterAttr (Decl *D, const AttributeCommonInfo &CI, MutableArrayRef< Expr * > Args) |
SYCLAddIRAttributesGlobalVariableAttr * | MergeSYCLAddIRAttributesGlobalVariableAttr (Decl *D, const SYCLAddIRAttributesGlobalVariableAttr &A) |
void | AddSYCLAddIRAttributesGlobalVariableAttr (Decl *D, const AttributeCommonInfo &CI, MutableArrayRef< Expr * > Args) |
SYCLAddIRAnnotationsMemberAttr * | MergeSYCLAddIRAnnotationsMemberAttr (Decl *D, const SYCLAddIRAnnotationsMemberAttr &A) |
void | AddSYCLAddIRAnnotationsMemberAttr (Decl *D, const AttributeCommonInfo &CI, MutableArrayRef< Expr * > Args) |
void | AddSYCLReqdWorkGroupSizeAttr (Decl *D, const AttributeCommonInfo &CI, Expr *XDim, Expr *YDim, Expr *ZDim) |
SYCLReqdWorkGroupSizeAttr * | MergeSYCLReqdWorkGroupSizeAttr (Decl *D, const SYCLReqdWorkGroupSizeAttr &A) |
SYCLTypeAttr * | MergeSYCLTypeAttr (Decl *D, const AttributeCommonInfo &CI, SYCLTypeAttr::SYCLType TypeName) |
void | DiagnoseDeprecatedAttribute (const ParsedAttr &A, StringRef NewScope, StringRef NewName) |
Emit a diagnostic about the given attribute having a deprecated name, and also emit a fixit hint to generate the new attribute name. More... | |
void | CheckDeprecatedSYCLAttributeSpelling (const ParsedAttr &A, StringRef NewName="") |
Diagnoses an attribute in the 'intelfpga' namespace and suggests using the attribute in the 'intel' namespace instead. More... | |
void | addSYCLIntelPipeIOAttr (Decl *D, const AttributeCommonInfo &CI, Expr *ID) |
addSYCLIntelPipeIOAttr - Adds a pipe I/O attribute to a particular declaration. More... | |
SYCLIntelPipeIOAttr * | MergeSYCLIntelPipeIOAttr (Decl *D, const SYCLIntelPipeIOAttr &A) |
void | AddSYCLIntelMaxConcurrencyAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E) |
AddSYCLIntelMaxConcurrencyAttr - Adds a max_concurrency attribute to a particular declaration. More... | |
bool | CheckCountedByAttr (Scope *Scope, const FieldDecl *FD) |
C++ Declarations | |
Implementations are in SemaDeclCXX.cpp | |
enum class | ComparisonCategoryUsage { OperatorInExpression , DefaultedOperator } |
enum class | DefaultedComparisonKind : unsigned char { None , Equal , ThreeWay , NotEqual , Relational } |
Kinds of defaulted comparison operator functions. More... | |
enum | AbstractDiagSelID { AbstractNone = -1 , AbstractReturnType , AbstractParamType , AbstractVariableType , AbstractFieldType , AbstractIvarType , AbstractSynthesizedIvarType , AbstractArrayType } |
enum | TrivialABIHandling { TAH_IgnoreTrivialABI , TAH_ConsiderTrivialABI } |
enum class | CheckConstexprKind { Diagnose , CheckValid } |
typedef std::pair< CXXRecordDecl *, SourceLocation > | VTableUse |
The list of classes whose vtables have been used within this translation unit, and the source locations at which the first use occurred. More... | |
typedef llvm::SmallSetVector< const NamedDecl *, 16 > | NamedDeclSetType |
typedef llvm::SmallPtrSet< const CXXRecordDecl *, 8 > | RecordDeclSetTy |
typedef LazyVector< CXXConstructorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadDelegatingConstructors, 2, 2 > | DelegatingCtorDeclsType |
typedef llvm::PointerIntPair< CXXRecordDecl *, 3, CXXSpecialMemberKind > | SpecialMemberDecl |
typedef ProcessingContextState | ParsingClassState |
SmallVector< VTableUse, 16 > | VTableUses |
The list of vtables that are required but have not yet been materialized. More... | |
llvm::DenseMap< CXXRecordDecl *, bool > | VTablesUsed |
The set of classes whose vtables have been used within this translation unit, and a bit that will be true if the vtable is required to be emitted (otherwise, it should be emitted only if needed by code generation). More... | |
SmallVector< CXXRecordDecl *, 4 > | DelayedDllExportClasses |
SmallVector< CXXMethodDecl *, 4 > | DelayedDllExportMemberFunctions |
SmallVector< InventedTemplateParameterInfo, 4 > | InventedParameterInfos |
Stack containing information needed when in C++2a an 'auto' is encountered in a function declaration parameter type specifier in order to invent a corresponding template parameter in the enclosing abbreviated function template. More... | |
std::unique_ptr< CXXFieldCollector > | FieldCollector |
FieldCollector - Collects CXXFieldDecls during parsing of C++ classes. More... | |
NamedDeclSetType | UnusedPrivateFields |
Set containing all declared private fields that are not used. More... | |
std::unique_ptr< RecordDeclSetTy > | PureVirtualClassDiagSet |
PureVirtualClassDiagSet - a set of class declarations which we have emitted a list of pure virtual functions. More... | |
DelegatingCtorDeclsType | DelegatingCtorDecls |
All the delegating constructors seen so far in the file, used for cycle detection at the end of the TU. More... | |
LazyDeclPtr | StdNamespace |
The C++ "std" namespace, where the standard library resides. More... | |
ClassTemplateDecl * | StdInitializerList |
The C++ "std::initializer_list" template, which is defined in <initializer_list>. More... | |
llvm::DenseMap< ParmVarDecl *, SourceLocation > | UnparsedDefaultArgLocs |
llvm::MapVector< NamedDecl *, SourceLocation > | UndefinedButUsed |
UndefinedInternals - all the used, undefined objects which require a definition in this translation unit. More... | |
llvm::SmallPtrSet< SpecialMemberDecl, 4 > | SpecialMembersBeingDeclared |
The C++ special members which we are currently in the process of declaring. More... | |
void | CheckDelegatingCtorCycles () |
void | ActOnStartFunctionDeclarationDeclarator (Declarator &D, unsigned TemplateParameterDepth) |
Called before parsing a function declarator belonging to a function declaration. More... | |
void | ActOnFinishFunctionDeclarationDeclarator (Declarator &D) |
Called after parsing a function declarator belonging to a function declaration. More... | |
Decl * | ActOnStartNamespaceDef (Scope *S, SourceLocation InlineLoc, SourceLocation NamespaceLoc, SourceLocation IdentLoc, IdentifierInfo *Ident, SourceLocation LBrace, const ParsedAttributesView &AttrList, UsingDirectiveDecl *&UsingDecl, bool IsNested) |
ActOnStartNamespaceDef - This is called at the start of a namespace definition. More... | |
void | ActOnFinishNamespaceDef (Decl *Dcl, SourceLocation RBrace) |
ActOnFinishNamespaceDef - This callback is called after a namespace is exited. More... | |
NamespaceDecl * | getStdNamespace () const |
NamespaceDecl * | getOrCreateStdNamespace () |
Retrieve the special "std" namespace, which may require us to implicitly define the namespace. More... | |
CXXRecordDecl * | getStdBadAlloc () const |
EnumDecl * | getStdAlignValT () const |
ValueDecl * | tryLookupUnambiguousFieldDecl (RecordDecl *ClassDecl, const IdentifierInfo *MemberOrBase) |
QualType | CheckComparisonCategoryType (ComparisonCategoryType Kind, SourceLocation Loc, ComparisonCategoryUsage Usage) |
Lookup the specified comparison category types in the standard library, an check the VarDecls possibly returned by the operator<=> builtins for that type. More... | |
bool | isStdInitializerList (QualType Ty, QualType *Element) |
Tests whether Ty is an instance of std::initializer_list and, if it is and Element is not NULL, assigns the element type to Element. More... | |
QualType | BuildStdInitializerList (QualType Element, SourceLocation Loc) |
Looks for the std::initializer_list template and instantiates it with Element, or emits an error if it's not found. More... | |
bool | isInitListConstructor (const FunctionDecl *Ctor) |
Determine whether Ctor is an initializer-list constructor, as defined in [dcl.init.list]p2. More... | |
Decl * | ActOnUsingDirective (Scope *CurScope, SourceLocation UsingLoc, SourceLocation NamespcLoc, CXXScopeSpec &SS, SourceLocation IdentLoc, IdentifierInfo *NamespcName, const ParsedAttributesView &AttrList) |
void | PushUsingDirective (Scope *S, UsingDirectiveDecl *UDir) |
Decl * | ActOnNamespaceAliasDef (Scope *CurScope, SourceLocation NamespaceLoc, SourceLocation AliasLoc, IdentifierInfo *Alias, CXXScopeSpec &SS, SourceLocation IdentLoc, IdentifierInfo *Ident) |
void | FilterUsingLookup (Scope *S, LookupResult &lookup) |
Remove decls we can't actually see from a lookup being used to declare shadow using decls. More... | |
void | HideUsingShadowDecl (Scope *S, UsingShadowDecl *Shadow) |
Hides a using shadow declaration. More... | |
bool | CheckUsingShadowDecl (BaseUsingDecl *BUD, NamedDecl *Target, const LookupResult &PreviousDecls, UsingShadowDecl *&PrevShadow) |
Determines whether to create a using shadow decl for a particular decl, given the set of decls existing prior to this using lookup. More... | |
UsingShadowDecl * | BuildUsingShadowDecl (Scope *S, BaseUsingDecl *BUD, NamedDecl *Target, UsingShadowDecl *PrevDecl) |
Builds a shadow declaration corresponding to a 'using' declaration. More... | |
bool | CheckUsingDeclRedeclaration (SourceLocation UsingLoc, bool HasTypenameKeyword, const CXXScopeSpec &SS, SourceLocation NameLoc, const LookupResult &Previous) |
Checks that the given using declaration is not an invalid redeclaration. More... | |
bool | CheckUsingDeclQualifier (SourceLocation UsingLoc, bool HasTypename, const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, SourceLocation NameLoc, const LookupResult *R=nullptr, const UsingDecl *UD=nullptr) |
Checks that the given nested-name qualifier used in a using decl in the current context is appropriately related to the current scope. More... | |
NamedDecl * | BuildUsingDeclaration (Scope *S, AccessSpecifier AS, SourceLocation UsingLoc, bool HasTypenameKeyword, SourceLocation TypenameLoc, CXXScopeSpec &SS, DeclarationNameInfo NameInfo, SourceLocation EllipsisLoc, const ParsedAttributesView &AttrList, bool IsInstantiation, bool IsUsingIfExists) |
Builds a using declaration. More... | |
NamedDecl * | BuildUsingEnumDeclaration (Scope *S, AccessSpecifier AS, SourceLocation UsingLoc, SourceLocation EnumLoc, SourceLocation NameLoc, TypeSourceInfo *EnumType, EnumDecl *ED) |
NamedDecl * | BuildUsingPackDecl (NamedDecl *InstantiatedFrom, ArrayRef< NamedDecl * > Expansions) |
bool | CheckInheritingConstructorUsingDecl (UsingDecl *UD) |
Additional checks for a using declaration referring to a constructor name. More... | |
CXXConstructorDecl * | findInheritingConstructor (SourceLocation Loc, CXXConstructorDecl *BaseCtor, ConstructorUsingShadowDecl *DerivedShadow) |
Given a derived-class using shadow declaration for a constructor and the correspnding base class constructor, find or create the implicit synthesized derived class constructor to use for this initialization. More... | |
Decl * | ActOnUsingDeclaration (Scope *CurScope, AccessSpecifier AS, SourceLocation UsingLoc, SourceLocation TypenameLoc, CXXScopeSpec &SS, UnqualifiedId &Name, SourceLocation EllipsisLoc, const ParsedAttributesView &AttrList) |
Decl * | ActOnUsingEnumDeclaration (Scope *CurScope, AccessSpecifier AS, SourceLocation UsingLoc, SourceLocation EnumLoc, SourceLocation IdentLoc, IdentifierInfo &II, CXXScopeSpec *SS=nullptr) |
Decl * | ActOnAliasDeclaration (Scope *CurScope, AccessSpecifier AS, MultiTemplateParamsArg TemplateParams, SourceLocation UsingLoc, UnqualifiedId &Name, const ParsedAttributesView &AttrList, TypeResult Type, Decl *DeclFromDeclSpec) |
ExprResult | BuildCXXConstructExpr (SourceLocation ConstructLoc, QualType DeclInitType, NamedDecl *FoundDecl, CXXConstructorDecl *Constructor, MultiExprArg Exprs, bool HadMultipleCandidates, bool IsListInitialization, bool IsStdInitListInitialization, bool RequiresZeroInit, CXXConstructionKind ConstructKind, SourceRange ParenRange) |
BuildCXXConstructExpr - Creates a complete call to a constructor, including handling of its default argument expressions. More... | |
ExprResult | BuildCXXConstructExpr (SourceLocation ConstructLoc, QualType DeclInitType, CXXConstructorDecl *Constructor, bool Elidable, MultiExprArg Exprs, bool HadMultipleCandidates, bool IsListInitialization, bool IsStdInitListInitialization, bool RequiresZeroInit, CXXConstructionKind ConstructKind, SourceRange ParenRange) |
Build a CXXConstructExpr whose constructor has already been resolved if it denotes an inherited constructor. More... | |
ExprResult | BuildCXXConstructExpr (SourceLocation ConstructLoc, QualType DeclInitType, NamedDecl *FoundDecl, CXXConstructorDecl *Constructor, bool Elidable, MultiExprArg Exprs, bool HadMultipleCandidates, bool IsListInitialization, bool IsStdInitListInitialization, bool RequiresZeroInit, CXXConstructionKind ConstructKind, SourceRange ParenRange) |
ExprResult | ConvertMemberDefaultInitExpression (FieldDecl *FD, Expr *InitExpr, SourceLocation InitLoc) |
void | FinalizeVarWithDestructor (VarDecl *VD, const RecordType *DeclInitType) |
FinalizeVarWithDestructor - Prepare for calling destructor on the constructed variable. More... | |
void | EvaluateImplicitExceptionSpec (SourceLocation Loc, FunctionDecl *FD) |
Evaluate the implicit exception specification for a defaulted special member function. More... | |
void | checkExceptionSpecification (bool IsTopLevel, ExceptionSpecificationType EST, ArrayRef< ParsedType > DynamicExceptions, ArrayRef< SourceRange > DynamicExceptionRanges, Expr *NoexceptExpr, SmallVectorImpl< QualType > &Exceptions, FunctionProtoType::ExceptionSpecInfo &ESI) |
Check the given exception-specification and update the exception specification information with the results. More... | |
void | actOnDelayedExceptionSpecification (Decl *D, ExceptionSpecificationType EST, SourceRange SpecificationRange, ArrayRef< ParsedType > DynamicExceptions, ArrayRef< SourceRange > DynamicExceptionRanges, Expr *NoexceptExpr) |
Add an exception-specification to the given member or friend function (or function template). More... | |
bool | ShouldDeleteSpecialMember (CXXMethodDecl *MD, CXXSpecialMemberKind CSM, InheritedConstructorInfo *ICI=nullptr, bool Diagnose=false) |
Determine if a special member function should have a deleted definition when it is defaulted. More... | |
void | DiagnoseDeletedDefaultedFunction (FunctionDecl *FD) |
Produce notes explaining why a defaulted function was defined as deleted. More... | |
CXXConstructorDecl * | DeclareImplicitDefaultConstructor (CXXRecordDecl *ClassDecl) |
Declare the implicit default constructor for the given class. More... | |
void | DefineImplicitDefaultConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor) |
DefineImplicitDefaultConstructor - Checks for feasibility of defining this constructor as the default constructor. More... | |
CXXDestructorDecl * | DeclareImplicitDestructor (CXXRecordDecl *ClassDecl) |
Declare the implicit destructor for the given class. More... | |
void | DefineImplicitDestructor (SourceLocation CurrentLocation, CXXDestructorDecl *Destructor) |
DefineImplicitDestructor - Checks for feasibility of defining this destructor as the default destructor. More... | |
void | AdjustDestructorExceptionSpec (CXXDestructorDecl *Destructor) |
Build an exception spec for destructors that don't have one. More... | |
void | DefineInheritingConstructor (SourceLocation UseLoc, CXXConstructorDecl *Constructor) |
Define the specified inheriting constructor. More... | |
CXXConstructorDecl * | DeclareImplicitCopyConstructor (CXXRecordDecl *ClassDecl) |
Declare the implicit copy constructor for the given class. More... | |
void | DefineImplicitCopyConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor) |
DefineImplicitCopyConstructor - Checks for feasibility of defining this constructor as the copy constructor. More... | |
CXXConstructorDecl * | DeclareImplicitMoveConstructor (CXXRecordDecl *ClassDecl) |
Declare the implicit move constructor for the given class. More... | |
void | DefineImplicitMoveConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor) |
DefineImplicitMoveConstructor - Checks for feasibility of defining this constructor as the move constructor. More... | |
CXXMethodDecl * | DeclareImplicitCopyAssignment (CXXRecordDecl *ClassDecl) |
Declare the implicit copy assignment operator for the given class. More... | |
void | DefineImplicitCopyAssignment (SourceLocation CurrentLocation, CXXMethodDecl *MethodDecl) |
Defines an implicitly-declared copy assignment operator. More... | |
CXXMethodDecl * | DeclareImplicitMoveAssignment (CXXRecordDecl *ClassDecl) |
Declare the implicit move assignment operator for the given class. More... | |
void | DefineImplicitMoveAssignment (SourceLocation CurrentLocation, CXXMethodDecl *MethodDecl) |
Defines an implicitly-declared move assignment operator. More... | |
void | CheckImplicitSpecialMemberDeclaration (Scope *S, FunctionDecl *FD) |
Check a completed declaration of an implicit special member. More... | |
bool | isImplicitlyDeleted (FunctionDecl *FD) |
Determine whether the given function is an implicitly-deleted special member function. More... | |
bool | checkThisInStaticMemberFunctionType (CXXMethodDecl *Method) |
Check whether 'this' shows up in the type of a static member function after the (naturally empty) cv-qualifier-seq would be. More... | |
bool | checkThisInStaticMemberFunctionExceptionSpec (CXXMethodDecl *Method) |
Whether this' shows up in the exception specification of a static member function. More... | |
bool | checkThisInStaticMemberFunctionAttributes (CXXMethodDecl *Method) |
Check whether 'this' shows up in the attributes of the given static member function. More... | |
bool | CheckImmediateEscalatingFunctionDefinition (FunctionDecl *FD, const sema::FunctionScopeInfo *FSI) |
void | DiagnoseImmediateEscalatingReason (FunctionDecl *FD) |
bool | CompleteConstructorCall (CXXConstructorDecl *Constructor, QualType DeclInitType, MultiExprArg ArgsPtr, SourceLocation Loc, SmallVectorImpl< Expr * > &ConvertedArgs, bool AllowExplicit=false, bool IsListInitialization=false) |
Given a constructor and the set of arguments provided for the constructor, convert the arguments and add any required default arguments to form a proper call to this constructor. More... | |
void | ActOnCXXEnterDeclInitializer (Scope *S, Decl *Dcl) |
ActOnCXXEnterDeclInitializer - Invoked when we are about to parse an initializer for the declaration 'Dcl'. More... | |
void | ActOnCXXExitDeclInitializer (Scope *S, Decl *Dcl) |
ActOnCXXExitDeclInitializer - Invoked after we are finished parsing an initializer for the declaration 'Dcl'. More... | |
void | DefineImplicitLambdaToFunctionPointerConversion (SourceLocation CurrentLoc, CXXConversionDecl *Conv) |
Define the "body" of the conversion from a lambda object to a function pointer. More... | |
void | DefineImplicitLambdaToBlockPointerConversion (SourceLocation CurrentLoc, CXXConversionDecl *Conv) |
Define the "body" of the conversion from a lambda object to a block pointer. More... | |
Decl * | ActOnStartLinkageSpecification (Scope *S, SourceLocation ExternLoc, Expr *LangStr, SourceLocation LBraceLoc) |
ActOnStartLinkageSpecification - Parsed the beginning of a C++ linkage specification, including the language and (if present) the '{'. More... | |
Decl * | ActOnFinishLinkageSpecification (Scope *S, Decl *LinkageSpec, SourceLocation RBraceLoc) |
ActOnFinishLinkageSpecification - Complete the definition of the C++ linkage specification LinkageSpec. More... | |
CXXRecordDecl * | getCurrentClass (Scope *S, const CXXScopeSpec *SS) |
Get the class that is directly named by the current context. More... | |
bool | isCurrentClassName (const IdentifierInfo &II, Scope *S, const CXXScopeSpec *SS=nullptr) |
isCurrentClassName - Determine whether the identifier II is the name of the class type currently being defined. More... | |
bool | isCurrentClassNameTypo (IdentifierInfo *&II, const CXXScopeSpec *SS) |
Determine whether the identifier II is a typo for the name of the class type currently being defined. More... | |
bool | ActOnAccessSpecifier (AccessSpecifier Access, SourceLocation ASLoc, SourceLocation ColonLoc, const ParsedAttributesView &Attrs) |
ActOnAccessSpecifier - Parsed an access specifier followed by a colon. More... | |
NamedDecl * | ActOnCXXMemberDeclarator (Scope *S, AccessSpecifier AS, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, Expr *BitfieldWidth, const VirtSpecifiers &VS, InClassInitStyle InitStyle) |
ActOnCXXMemberDeclarator - This is invoked when a C++ class member declarator is parsed. More... | |
void | ActOnStartCXXInClassMemberInitializer () |
Enter a new C++ default initializer scope. More... | |
void | ActOnFinishCXXInClassMemberInitializer (Decl *VarDecl, SourceLocation EqualLoc, Expr *Init) |
This is invoked after parsing an in-class initializer for a non-static C++ class member, and after instantiating an in-class initializer in a class template. More... | |
MemInitResult | ActOnMemInitializer (Decl *ConstructorD, Scope *S, CXXScopeSpec &SS, IdentifierInfo *MemberOrBase, ParsedType TemplateTypeTy, const DeclSpec &DS, SourceLocation IdLoc, SourceLocation LParenLoc, ArrayRef< Expr * > Args, SourceLocation RParenLoc, SourceLocation EllipsisLoc) |
Handle a C++ member initializer using parentheses syntax. More... | |
MemInitResult | ActOnMemInitializer (Decl *ConstructorD, Scope *S, CXXScopeSpec &SS, IdentifierInfo *MemberOrBase, ParsedType TemplateTypeTy, const DeclSpec &DS, SourceLocation IdLoc, Expr *InitList, SourceLocation EllipsisLoc) |
Handle a C++ member initializer using braced-init-list syntax. More... | |
MemInitResult | BuildMemInitializer (Decl *ConstructorD, Scope *S, CXXScopeSpec &SS, IdentifierInfo *MemberOrBase, ParsedType TemplateTypeTy, const DeclSpec &DS, SourceLocation IdLoc, Expr *Init, SourceLocation EllipsisLoc) |
Handle a C++ member initializer. More... | |
MemInitResult | BuildMemberInitializer (ValueDecl *Member, Expr *Init, SourceLocation IdLoc) |
MemInitResult | BuildBaseInitializer (QualType BaseType, TypeSourceInfo *BaseTInfo, Expr *Init, CXXRecordDecl *ClassDecl, SourceLocation EllipsisLoc) |
MemInitResult | BuildDelegatingInitializer (TypeSourceInfo *TInfo, Expr *Init, CXXRecordDecl *ClassDecl) |
bool | SetDelegatingInitializer (CXXConstructorDecl *Constructor, CXXCtorInitializer *Initializer) |
bool | SetCtorInitializers (CXXConstructorDecl *Constructor, bool AnyErrors, ArrayRef< CXXCtorInitializer * > Initializers=std::nullopt) |
void | MarkBaseAndMemberDestructorsReferenced (SourceLocation Loc, CXXRecordDecl *Record) |
MarkBaseAndMemberDestructorsReferenced - Given a record decl, mark all the non-trivial destructors of its members and bases as referenced. More... | |
void | MarkVirtualBaseDestructorsReferenced (SourceLocation Location, CXXRecordDecl *ClassDecl, llvm::SmallPtrSetImpl< const RecordType * > *DirectVirtualBases=nullptr) |
Mark destructors of virtual bases of this class referenced. More... | |
void | CheckCompleteDestructorVariant (SourceLocation CurrentLocation, CXXDestructorDecl *Dtor) |
Do semantic checks to allow the complete destructor variant to be emitted when the destructor is defined in another translation unit. More... | |
void | LoadExternalVTableUses () |
Load any externally-stored vtable uses. More... | |
void | MarkVTableUsed (SourceLocation Loc, CXXRecordDecl *Class, bool DefinitionRequired=false) |
Note that the vtable for the given class was used at the given location. More... | |
void | MarkVirtualMemberExceptionSpecsNeeded (SourceLocation Loc, const CXXRecordDecl *RD) |
Mark the exception specifications of all virtual member functions in the given class as needed. More... | |
void | MarkVirtualMembersReferenced (SourceLocation Loc, const CXXRecordDecl *RD, bool ConstexprOnly=false) |
MarkVirtualMembersReferenced - Will mark all members of the given CXXRecordDecl referenced. More... | |
bool | DefineUsedVTables () |
Define all of the vtables that have been used in this translation unit and reference any virtual members used by those vtables. More... | |
void | AddImplicitlyDeclaredMembersToClass (CXXRecordDecl *ClassDecl) |
AddImplicitlyDeclaredMembersToClass - Adds any implicitly-declared special functions, such as the default constructor, copy constructor, or destructor, to the given C++ class (C++ [special]p1). More... | |
void | ActOnMemInitializers (Decl *ConstructorDecl, SourceLocation ColonLoc, ArrayRef< CXXCtorInitializer * > MemInits, bool AnyErrors) |
ActOnMemInitializers - Handle the member initializers for a constructor. More... | |
void | checkClassLevelDLLAttribute (CXXRecordDecl *Class) |
Check class-level dllimport/dllexport attribute. More... | |
void | checkClassLevelCodeSegAttribute (CXXRecordDecl *Class) |
void | referenceDLLExportedClassMethods () |
void | propagateDLLAttrToBaseClassTemplate (CXXRecordDecl *Class, Attr *ClassAttr, ClassTemplateSpecializationDecl *BaseTemplateSpec, SourceLocation BaseLoc) |
Perform propagation of DLL attributes from a derived class to a templated base class for MS compatibility. More... | |
void | CheckCompletedCXXClass (Scope *S, CXXRecordDecl *Record) |
Perform semantic checks on a class definition that has been completing, introducing implicitly-declared members, checking for abstract types, etc. More... | |
void | checkIllFormedTrivialABIStruct (CXXRecordDecl &RD) |
Check that the C++ class annoated with "trivial_abi" satisfies all the conditions that are needed for the attribute to have an effect. More... | |
void | ActOnFinishCXXMemberSpecification (Scope *S, SourceLocation RLoc, Decl *TagDecl, SourceLocation LBrac, SourceLocation RBrac, const ParsedAttributesView &AttrList) |
void | ActOnFinishCXXMemberDecls () |
Perform any semantic analysis which needs to be delayed until all pending class member declarations have been parsed. More... | |
void | ActOnFinishCXXNonNestedClass () |
void | ActOnReenterCXXMethodParameter (Scope *S, ParmVarDecl *Param) |
This is used to implement the constant expression evaluation part of the attribute enable_if extension. More... | |
unsigned | ActOnReenterTemplateScope (Decl *Template, llvm::function_ref< Scope *()> EnterScope) |
void | ActOnStartDelayedMemberDeclarations (Scope *S, Decl *Record) |
void | ActOnStartDelayedCXXMethodDeclaration (Scope *S, Decl *Method) |
ActOnStartDelayedCXXMethodDeclaration - We have completed parsing a top-level (non-nested) C++ class, and we are now parsing those parts of the given Method declaration that could not be parsed earlier (C++ [class.mem]p2), such as default arguments. More... | |
void | ActOnDelayedCXXMethodParameter (Scope *S, Decl *Param) |
ActOnDelayedCXXMethodParameter - We've already started a delayed C++ method declaration. More... | |
void | ActOnFinishDelayedMemberDeclarations (Scope *S, Decl *Record) |
void | ActOnFinishDelayedCXXMethodDeclaration (Scope *S, Decl *Method) |
ActOnFinishDelayedCXXMethodDeclaration - We have finished processing the delayed method declaration for Method. More... | |
void | ActOnFinishDelayedMemberInitializers (Decl *Record) |
bool | EvaluateStaticAssertMessageAsString (Expr *Message, std::string &Result, ASTContext &Ctx, bool ErrorOnInvalidMessage) |
Decl * | ActOnStaticAssertDeclaration (SourceLocation StaticAssertLoc, Expr *AssertExpr, Expr *AssertMessageExpr, SourceLocation RParenLoc) |
Decl * | BuildStaticAssertDeclaration (SourceLocation StaticAssertLoc, Expr *AssertExpr, Expr *AssertMessageExpr, SourceLocation RParenLoc, bool Failed) |
void | DiagnoseStaticAssertDetails (const Expr *E) |
Try to print more useful information about a failed static_assert with expression \E. More... | |
Decl * | ActOnFriendTypeDecl (Scope *S, const DeclSpec &DS, MultiTemplateParamsArg TemplateParams) |
Handle a friend type declaration. More... | |
NamedDecl * | ActOnFriendFunctionDecl (Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParams) |
QualType | CheckConstructorDeclarator (Declarator &D, QualType R, StorageClass &SC) |
CheckConstructorDeclarator - Called by ActOnDeclarator to check the well-formedness of the constructor declarator D with type R . More... | |
void | CheckConstructor (CXXConstructorDecl *Constructor) |
CheckConstructor - Checks a fully-formed constructor for well-formedness, issuing any diagnostics required. More... | |
QualType | CheckDestructorDeclarator (Declarator &D, QualType R, StorageClass &SC) |
CheckDestructorDeclarator - Called by ActOnDeclarator to check the well-formednes of the destructor declarator D with type R . More... | |
bool | CheckDestructor (CXXDestructorDecl *Destructor) |
CheckDestructor - Checks a fully-formed destructor definition for well-formedness, issuing any diagnostics required. More... | |
void | CheckConversionDeclarator (Declarator &D, QualType &R, StorageClass &SC) |
CheckConversionDeclarator - Called by ActOnDeclarator to check the well-formednes of the conversion function declarator D with type R . More... | |
Decl * | ActOnConversionDeclarator (CXXConversionDecl *Conversion) |
ActOnConversionDeclarator - Called by ActOnDeclarator to complete the declaration of the given C++ conversion function. More... | |
bool | CheckDeductionGuideDeclarator (Declarator &D, QualType &R, StorageClass &SC) |
Check the validity of a declarator that we parsed for a deduction-guide. More... | |
void | CheckExplicitlyDefaultedFunction (Scope *S, FunctionDecl *MD) |
bool | CheckExplicitlyDefaultedSpecialMember (CXXMethodDecl *MD, CXXSpecialMemberKind CSM, SourceLocation DefaultLoc) |
void | CheckDelayedMemberExceptionSpecs () |
bool | CheckExplicitlyDefaultedComparison (Scope *S, FunctionDecl *MD, DefaultedComparisonKind DCK) |
void | DeclareImplicitEqualityComparison (CXXRecordDecl *RD, FunctionDecl *Spaceship) |
void | DefineDefaultedComparison (SourceLocation Loc, FunctionDecl *FD, DefaultedComparisonKind DCK) |
void | CheckExplicitObjectMemberFunction (Declarator &D, DeclarationName Name, QualType R, bool IsLambda, DeclContext *DC=nullptr) |
void | CheckExplicitObjectMemberFunction (DeclContext *DC, Declarator &D, DeclarationName Name, QualType R) |
void | CheckExplicitObjectLambda (Declarator &D) |
CXXBaseSpecifier * | CheckBaseSpecifier (CXXRecordDecl *Class, SourceRange SpecifierRange, bool Virtual, AccessSpecifier Access, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc) |
ActOnBaseSpecifier - Parsed a base specifier. More... | |
BaseResult | ActOnBaseSpecifier (Decl *classdecl, SourceRange SpecifierRange, const ParsedAttributesView &Attrs, bool Virtual, AccessSpecifier Access, ParsedType basetype, SourceLocation BaseLoc, SourceLocation EllipsisLoc) |
ActOnBaseSpecifier - Parsed a base specifier. More... | |
bool | AttachBaseSpecifiers (CXXRecordDecl *Class, MutableArrayRef< CXXBaseSpecifier * > Bases) |
Performs the actual work of attaching the given base class specifiers to a C++ class. More... | |
void | ActOnBaseSpecifiers (Decl *ClassDecl, MutableArrayRef< CXXBaseSpecifier * > Bases) |
ActOnBaseSpecifiers - Attach the given base specifiers to the class, after checking whether there are any duplicate base classes. More... | |
bool | IsDerivedFrom (SourceLocation Loc, QualType Derived, QualType Base) |
Determine whether the type Derived is a C++ class that is derived from the type Base . More... | |
bool | IsDerivedFrom (SourceLocation Loc, QualType Derived, QualType Base, CXXBasePaths &Paths) |
Determine whether the type Derived is a C++ class that is derived from the type Base . More... | |
void | BuildBasePathArray (const CXXBasePaths &Paths, CXXCastPath &BasePath) |
bool | CheckDerivedToBaseConversion (QualType Derived, QualType Base, SourceLocation Loc, SourceRange Range, CXXCastPath *BasePath=nullptr, bool IgnoreAccess=false) |
bool | CheckDerivedToBaseConversion (QualType Derived, QualType Base, unsigned InaccessibleBaseID, unsigned AmbiguousBaseConvID, SourceLocation Loc, SourceRange Range, DeclarationName Name, CXXCastPath *BasePath, bool IgnoreAccess=false) |
CheckDerivedToBaseConversion - Check whether the Derived-to-Base conversion (where Derived and Base are class types) is well-formed, meaning that the conversion is unambiguous (and that all of the base classes are accessible). More... | |
std::string | getAmbiguousPathsDisplayString (CXXBasePaths &Paths) |
Builds a string representing ambiguous paths from a specific derived class to different subobjects of the same base class. More... | |
bool | CheckOverridingFunctionAttributes (const CXXMethodDecl *New, const CXXMethodDecl *Old) |
bool | CheckOverridingFunctionReturnType (const CXXMethodDecl *New, const CXXMethodDecl *Old) |
CheckOverridingFunctionReturnType - Checks whether the return types are covariant, according to C++ [class.virtual]p5. More... | |
bool | CheckExplicitObjectOverride (CXXMethodDecl *New, const CXXMethodDecl *Old) |
bool | CheckPureMethod (CXXMethodDecl *Method, SourceRange InitRange) |
Mark the given method pure. More... | |
void | CheckOverrideControl (NamedDecl *D) |
CheckOverrideControl - Check C++11 override control semantics. More... | |
void | DiagnoseAbsenceOfOverrideControl (NamedDecl *D, bool Inconsistent) |
DiagnoseAbsenceOfOverrideControl - Diagnose if 'override' keyword was not used in the declaration of an overriding method. More... | |
bool | CheckIfOverriddenFunctionIsMarkedFinal (const CXXMethodDecl *New, const CXXMethodDecl *Old) |
CheckForFunctionMarkedFinal - Checks whether a virtual member function overrides a virtual member function marked 'final', according to C++11 [class.virtual]p4. More... | |
bool | isAbstractType (SourceLocation Loc, QualType T) |
bool | RequireNonAbstractType (SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) |
template<typename... Ts> | |
bool | RequireNonAbstractType (SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args) |
void | DiagnoseAbstractType (const CXXRecordDecl *RD) |
bool | CheckOverloadedOperatorDeclaration (FunctionDecl *FnDecl) |
CheckOverloadedOperatorDeclaration - Check whether the declaration of this overloaded operator is well-formed. More... | |
bool | CheckLiteralOperatorDeclaration (FunctionDecl *FnDecl) |
CheckLiteralOperatorDeclaration - Check whether the declaration of this literal operator function is well-formed. More... | |
ExplicitSpecifier | ActOnExplicitBoolSpecifier (Expr *E) |
ActOnExplicitBoolSpecifier - Build an ExplicitSpecifier from an expression found in an explicit(bool) specifier. More... | |
bool | tryResolveExplicitSpecifier (ExplicitSpecifier &ExplicitSpec) |
tryResolveExplicitSpecifier - Attempt to resolve the explict specifier. More... | |
DeclResult | ActOnCXXConditionDeclaration (Scope *S, Declarator &D) |
ActOnCXXConditionDeclarationExpr - Parsed a condition declaration of a C++ if/switch/while/for statement. More... | |
void | MergeVarDeclExceptionSpecs (VarDecl *New, VarDecl *Old) |
Merge the exception specifications of two variable declarations. More... | |
bool | MergeCXXFunctionDecl (FunctionDecl *New, FunctionDecl *Old, Scope *S) |
MergeCXXFunctionDecl - Merge two declarations of the same C++ function, once we already know that they have the same type. More... | |
void | CheckCXXDefaultArguments (FunctionDecl *FD) |
Helpers for dealing with blocks and functions. More... | |
void | CheckExtraCXXDefaultArguments (Declarator &D) |
CheckExtraCXXDefaultArguments - Check for any extra default arguments in the declarator, which is not a function declaration or definition and therefore is not permitted to have default arguments. More... | |
CXXSpecialMemberKind | getSpecialMember (const CXXMethodDecl *MD) |
VarDecl * | BuildExceptionDeclaration (Scope *S, TypeSourceInfo *TInfo, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id) |
Perform semantic analysis for the variable declaration that occurs within a C++ catch clause, returning the newly-created variable. More... | |
Decl * | ActOnExceptionDeclarator (Scope *S, Declarator &D) |
ActOnExceptionDeclarator - Parsed the exception-declarator in a C++ catch handler. More... | |
void | DiagnoseReturnInConstructorExceptionHandler (CXXTryStmt *TryBlock) |
DeclResult | ActOnTemplatedFriendTag (Scope *S, SourceLocation FriendLoc, unsigned TagSpec, SourceLocation TagLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr, MultiTemplateParamsArg TempParamLists) |
Handle a friend tag declaration where the scope specifier was templated. More... | |
MSPropertyDecl * | HandleMSProperty (Scope *S, RecordDecl *TagD, SourceLocation DeclStart, Declarator &D, Expr *BitfieldWidth, InClassInitStyle InitStyle, AccessSpecifier AS, const ParsedAttr &MSPropertyAttr) |
HandleMSProperty - Analyze a __delcspec(property) field of a C++ class. More... | |
void | DiagnoseNontrivial (const CXXRecordDecl *Record, CXXSpecialMemberKind CSM) |
Diagnose why the specified class does not have a trivial special member of the given kind. More... | |
bool | SpecialMemberIsTrivial (CXXMethodDecl *MD, CXXSpecialMemberKind CSM, TrivialABIHandling TAH=TAH_IgnoreTrivialABI, bool Diagnose=false) |
Determine whether a defaulted or deleted special member function is trivial, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25, and C++11 [class.dtor]p5. More... | |
DefaultedFunctionKind | getDefaultedFunctionKind (const FunctionDecl *FD) |
Determine the kind of defaulting that would be done for a given function. More... | |
Decl * | ActOnEmptyDeclaration (Scope *S, const ParsedAttributesView &AttrList, SourceLocation SemiLoc) |
Handle a C++11 empty-declaration and attribute-declaration. More... | |
bool | CheckConstexprFunctionDefinition (const FunctionDecl *FD, CheckConstexprKind Kind) |
void | DiagnoseHiddenVirtualMethods (CXXMethodDecl *MD) |
Diagnose methods which overload virtual methods in a base class without overriding any. More... | |
void | FindHiddenVirtualMethods (CXXMethodDecl *MD, SmallVectorImpl< CXXMethodDecl * > &OverloadedMethods) |
Check if a method overloads virtual methods in a base class without overriding any. More... | |
void | NoteHiddenVirtualMethods (CXXMethodDecl *MD, SmallVectorImpl< CXXMethodDecl * > &OverloadedMethods) |
void | ActOnParamDefaultArgument (Decl *param, SourceLocation EqualLoc, Expr *defarg) |
ActOnParamDefaultArgument - Check whether the default argument provided for a function parameter is well-formed. More... | |
void | ActOnParamUnparsedDefaultArgument (Decl *param, SourceLocation EqualLoc, SourceLocation ArgLoc) |
ActOnParamUnparsedDefaultArgument - We've seen a default argument for a function parameter, but we can't parse it yet because we're inside a class definition. More... | |
void | ActOnParamDefaultArgumentError (Decl *param, SourceLocation EqualLoc, Expr *DefaultArg) |
ActOnParamDefaultArgumentError - Parsing or semantic analysis of the default argument for the parameter param failed. More... | |
ExprResult | ConvertParamDefaultArgument (ParmVarDecl *Param, Expr *DefaultArg, SourceLocation EqualLoc) |
void | SetParamDefaultArgument (ParmVarDecl *Param, Expr *DefaultArg, SourceLocation EqualLoc) |
void | ActOnPureSpecifier (Decl *D, SourceLocation PureSpecLoc) |
void | SetDeclDeleted (Decl *dcl, SourceLocation DelLoc, StringLiteral *Message=nullptr) |
void | SetDeclDefaulted (Decl *dcl, SourceLocation DefaultLoc) |
void | SetFunctionBodyKind (Decl *D, SourceLocation Loc, FnBodyKind BodyKind, StringLiteral *DeletedMessage=nullptr) |
void | ActOnStartTrailingRequiresClause (Scope *S, Declarator &D) |
ExprResult | ActOnFinishTrailingRequiresClause (ExprResult ConstraintExpr) |
ExprResult | ActOnRequiresClause (ExprResult ConstraintExpr) |
NamedDecl * | ActOnDecompositionDeclarator (Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParamLists) |
void | DiagPlaceholderVariableDefinition (SourceLocation Loc) |
bool | DiagRedefinedPlaceholderFieldDecl (SourceLocation Loc, RecordDecl *ClassDecl, const IdentifierInfo *Name) |
void | CheckCompleteDecompositionDeclaration (DecompositionDecl *DD) |
void | NoteDeletedInheritingConstructor (CXXConstructorDecl *CD) |
void | ActOnDefaultCtorInitializers (Decl *CDtorDecl) |
ParsingClassState | PushParsingClass () |
void | PopParsingClass (ParsingClassState state) |
ValueDecl * | tryLookupCtorInitMemberDecl (CXXRecordDecl *ClassDecl, CXXScopeSpec &SS, ParsedType TemplateTypeTy, IdentifierInfo *MemberOrBase) |
Expressions | |
Implementations are in SemaExpr.cpp | |
enum class | ExpressionEvaluationContext { Unevaluated , UnevaluatedList , DiscardedStatement , UnevaluatedAbstract , ConstantEvaluated , ImmediateFunctionContext , PotentiallyEvaluated , PotentiallyEvaluatedIfUsed } |
Describes how the expressions currently being parsed are evaluated at run-time, if at all. More... | |
enum | AssignmentAction { AA_Assigning , AA_Passing , AA_Returning , AA_Converting , AA_Initializing , AA_Sending , AA_Casting , AA_Passing_CFAudited } |
enum | ReuseLambdaContextDecl_t { ReuseLambdaContextDecl } |
enum | TryCaptureKind { TryCapture_Implicit , TryCapture_ExplicitByVal , TryCapture_ExplicitByRef } |
enum | AllowFoldKind { NoFold , AllowFold } |
enum class | ConditionKind { Boolean , ConstexprIf , Switch } |
enum | ArithConvKind { ACK_Arithmetic , ACK_BitwiseOp , ACK_Comparison , ACK_Conditional , ACK_CompAssign } |
Context in which we're performing a usual arithmetic conversion. More... | |
enum | VarArgKind { VAK_Valid , VAK_ValidInCXX11 , VAK_Undefined , VAK_MSVCUndefined , VAK_Invalid } |
enum | AssignConvertType { Compatible , PointerToInt , IntToPointer , FunctionVoidPointer , IncompatiblePointer , IncompatibleFunctionPointer , IncompatibleFunctionPointerStrict , IncompatiblePointerSign , CompatiblePointerDiscardsQualifiers , IncompatiblePointerDiscardsQualifiers , IncompatibleNestedPointerAddressSpaceMismatch , IncompatibleNestedPointerQualifiers , IncompatibleVectors , IntToBlockPointer , IncompatibleBlockPointer , IncompatibleObjCQualifiedId , IncompatibleObjCWeakRef , Incompatible } |
AssignConvertType - All of the 'assignment' semantic checks return this enum to indicate whether the assignment was allowed. More... | |
using | MaybeODRUseExprSet = llvm::SmallSetVector< Expr *, 4 > |
Store a set of either DeclRefExprs or MemberExprs that contain a reference to a variable (constant) that may or may not be odr-used in this Expr, and we won't know until all lvalue-to-rvalue and discarded value conversions have been applied to all subexpressions of the enclosing full expression. More... | |
using | ImmediateInvocationCandidate = llvm::PointerIntPair< ConstantExpr *, 1 > |
using | ADLCallKind = CallExpr::ADLCallKind |
MaybeODRUseExprSet | MaybeODRUseExprs |
llvm::DenseMap< const VarDecl *, int > | RefsMinusAssignments |
Increment when we find a reference; decrement when we find an ignored assignment. More... | |
CleanupInfo | Cleanup |
Used to control the generation of ExprWithCleanups. More... | |
SmallVector< ExprWithCleanups::CleanupObject, 8 > | ExprCleanupObjects |
ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current full expression. More... | |
bool | RebuildingImmediateInvocation = false |
Whether the AST is currently being rebuilt to correct immediate invocations. More... | |
RecordDecl * | StdSourceLocationImplDecl |
The C++ "std::source_location::__impl" struct, defined in <source_location>. More... | |
SmallVector< ExpressionEvaluationContextRecord, 8 > | ExprEvalContexts |
A stack of expression evaluation contexts. More... | |
llvm::SmallPtrSet< ConstantExpr *, 4 > | FailedImmediateInvocations |
llvm::SmallVector< std::pair< SourceLocation, const BlockDecl * >, 1 > | ImplicitlyRetainedSelfLocs |
List of SourceLocations where 'self' is implicitly retained inside a block. More... | |
const ExpressionEvaluationContextRecord & | currentEvaluationContext () const |
ExpressionEvaluationContextRecord & | parentEvaluationContext () |
const ExpressionEvaluationContextRecord & | parentEvaluationContext () const |
bool | isBoundsAttrContext () const |
bool | CanUseDecl (NamedDecl *D, bool TreatUnavailableAsInvalid) |
Determine whether the use of this declaration is valid, without emitting diagnostics. More... | |
bool | DiagnoseUseOfOverloadedDecl (NamedDecl *D, SourceLocation Loc) |
bool | DiagnoseUseOfDecl (NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass=nullptr, bool ObjCPropertyAccess=false, bool AvoidPartialAvailabilityChecks=false, ObjCInterfaceDecl *ClassReciever=nullptr, bool SkipTrailingRequiresClause=false) |
Determine whether the use of this declaration is valid, and emit any corresponding diagnostics. More... | |
void | NoteDeletedFunction (FunctionDecl *FD) |
Emit a note explaining that this function is deleted. More... | |
void | DiagnoseSentinelCalls (const NamedDecl *D, SourceLocation Loc, ArrayRef< Expr * > Args) |
DiagnoseSentinelCalls - This routine checks whether a call or message-send is to a declaration with the sentinel attribute, and if so, it checks that the requirements of the sentinel are satisfied. More... | |
void | PushExpressionEvaluationContext (ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, ExpressionEvaluationContextRecord::ExpressionKind Type=ExpressionEvaluationContextRecord::EK_Other) |
void | PushExpressionEvaluationContext (ExpressionEvaluationContext NewContext, ReuseLambdaContextDecl_t, ExpressionEvaluationContextRecord::ExpressionKind Type=ExpressionEvaluationContextRecord::EK_Other) |
void | PopExpressionEvaluationContext () |
void | DiscardCleanupsInEvaluationContext () |
ExprResult | TransformToPotentiallyEvaluated (Expr *E) |
TypeSourceInfo * | TransformToPotentiallyEvaluated (TypeSourceInfo *TInfo) |
ExprResult | HandleExprEvaluationContextForTypeof (Expr *E) |
void | CheckUnusedVolatileAssignment (Expr *E) |
Check whether E, which is either a discarded-value expression or an unevaluated operand, is a simple-assignment to a volatlie-qualified lvalue, and if so, remove it from the list of volatile-qualified assignments that we are going to warn are deprecated. More... | |
ExprResult | ActOnConstantExpression (ExprResult Res) |
void | MarkAnyDeclReferenced (SourceLocation Loc, Decl *D, bool MightBeOdrUse) |
Perform marking for a reference to an arbitrary declaration. More... | |
void | MarkFunctionReferenced (SourceLocation Loc, FunctionDecl *Func, bool MightBeOdrUse=true) |
Mark a function referenced, and check whether it is odr-used (C++ [basic.def.odr]p2, C99 6.9p3) More... | |
void | MarkVariableReferenced (SourceLocation Loc, VarDecl *Var) |
Mark a variable referenced, and check whether it is odr-used (C++ [basic.def.odr]p2, C99 6.9p3). More... | |
void | MarkDeclRefReferenced (DeclRefExpr *E, const Expr *Base=nullptr) |
Perform reference-marking and odr-use handling for a DeclRefExpr. More... | |
void | MarkMemberReferenced (MemberExpr *E) |
Perform reference-marking and odr-use handling for a MemberExpr. More... | |
void | MarkFunctionParmPackReferenced (FunctionParmPackExpr *E) |
Perform reference-marking and odr-use handling for a FunctionParmPackExpr. More... | |
void | MarkCaptureUsedInEnclosingContext (ValueDecl *Capture, SourceLocation Loc, unsigned CapturingScopeIndex) |
ExprResult | CheckLValueToRValueConversionOperand (Expr *E) |
void | CleanupVarDeclMarking () |
bool | tryCaptureVariable (ValueDecl *Var, SourceLocation Loc, TryCaptureKind Kind, SourceLocation EllipsisLoc, bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const unsigned *const FunctionScopeIndexToStopAt) |
Try to capture the given variable. More... | |
bool | tryCaptureVariable (ValueDecl *Var, SourceLocation Loc, TryCaptureKind Kind=TryCapture_Implicit, SourceLocation EllipsisLoc=SourceLocation()) |
Try to capture the given variable. More... | |
bool | NeedToCaptureVariable (ValueDecl *Var, SourceLocation Loc) |
Checks if the variable must be captured. More... | |
QualType | getCapturedDeclRefType (ValueDecl *Var, SourceLocation Loc) |
Given a variable, determine the type that a reference to that variable will have in the given scope. More... | |
void | MarkDeclarationsReferencedInType (SourceLocation Loc, QualType T) |
Mark all of the declarations referenced within a particular AST node as referenced. More... | |
void | MarkDeclarationsReferencedInExpr (Expr *E, bool SkipLocalVariables=false, ArrayRef< const Expr * > StopAt=std::nullopt) |
Mark any declarations that appear within this expression or any potentially-evaluated subexpressions as "referenced". More... | |
ExprResult | tryConvertExprToType (Expr *E, QualType Ty) |
Try to convert an expression E to type Ty . More... | |
bool | DiagIfReachable (SourceLocation Loc, ArrayRef< const Stmt * > Stmts, const PartialDiagnostic &PD) |
Conditionally issue a diagnostic based on the statements's reachability analysis. More... | |
bool | DiagRuntimeBehavior (SourceLocation Loc, const Stmt *Statement, const PartialDiagnostic &PD) |
Conditionally issue a diagnostic based on the current evaluation context. More... | |
bool | DiagRuntimeBehavior (SourceLocation Loc, ArrayRef< const Stmt * > Stmts, const PartialDiagnostic &PD) |
Similar, but diagnostic is only produced if all the specified statements are reachable. More... | |
SourceRange | getExprRange (Expr *E) const |
ExprResult | ActOnIdExpression (Scope *S, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, UnqualifiedId &Id, bool HasTrailingLParen, bool IsAddressOfOperand, CorrectionCandidateCallback *CCC=nullptr, bool IsInlineAsmIdentifier=false, Token *KeywordReplacement=nullptr) |
void | DecomposeUnqualifiedId (const UnqualifiedId &Id, TemplateArgumentListInfo &Buffer, DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *&TemplateArgs) |
Decomposes the given name into a DeclarationNameInfo, its location, and possibly a list of template arguments. More... | |
bool | DiagnoseDependentMemberLookup (const LookupResult &R) |
Diagnose a lookup that found results in an enclosing class during error recovery. More... | |
bool | DiagnoseEmptyLookup (Scope *S, CXXScopeSpec &SS, LookupResult &R, CorrectionCandidateCallback &CCC, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr, ArrayRef< Expr * > Args=std::nullopt, DeclContext *LookupCtx=nullptr, TypoExpr **Out=nullptr) |
Diagnose an empty lookup. More... | |
NonOdrUseReason | getNonOdrUseReasonInCurrentContext (ValueDecl *D) |
If D cannot be odr-used in the current expression evaluation context, return a reason explaining why. More... | |
DeclRefExpr * | BuildDeclRefExpr (ValueDecl *D, QualType Ty, ExprValueKind VK, SourceLocation Loc, const CXXScopeSpec *SS=nullptr) |
DeclRefExpr * | BuildDeclRefExpr (ValueDecl *D, QualType Ty, ExprValueKind VK, const DeclarationNameInfo &NameInfo, const CXXScopeSpec *SS=nullptr, NamedDecl *FoundD=nullptr, SourceLocation TemplateKWLoc=SourceLocation(), const TemplateArgumentListInfo *TemplateArgs=nullptr) |
DeclRefExpr * | BuildDeclRefExpr (ValueDecl *D, QualType Ty, ExprValueKind VK, const DeclarationNameInfo &NameInfo, NestedNameSpecifierLoc NNS, NamedDecl *FoundD=nullptr, SourceLocation TemplateKWLoc=SourceLocation(), const TemplateArgumentListInfo *TemplateArgs=nullptr) |
BuildDeclRefExpr - Build an expression that references a declaration that does not require a closure capture. More... | |
bool | UseArgumentDependentLookup (const CXXScopeSpec &SS, const LookupResult &R, bool HasTrailingLParen) |
ExprResult | BuildQualifiedDeclarationNameExpr (CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, bool IsAddressOfOperand, TypeSourceInfo **RecoveryTSI=nullptr) |
BuildQualifiedDeclarationNameExpr - Build a C++ qualified declaration name, generally during template instantiation. More... | |
ExprResult | BuildDeclarationNameExpr (const CXXScopeSpec &SS, LookupResult &R, bool NeedsADL, bool AcceptInvalidDecl=false) |
ExprResult | BuildDeclarationNameExpr (const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, NamedDecl *D, NamedDecl *FoundD=nullptr, const TemplateArgumentListInfo *TemplateArgs=nullptr, bool AcceptInvalidDecl=false) |
Complete semantic analysis for a reference to the given declaration. More... | |
std::vector< Token > | ExpandFunctionLocalPredefinedMacros (ArrayRef< Token > Toks) |
ExprResult | BuildPredefinedExpr (SourceLocation Loc, PredefinedIdentKind IK) |
ExprResult | ActOnPredefinedExpr (SourceLocation Loc, tok::TokenKind Kind) |
ExprResult | ActOnIntegerConstant (SourceLocation Loc, uint64_t Val) |
bool | CheckLoopHintExpr (Expr *E, SourceLocation Loc, bool AllowZero) |
ExprResult | ActOnNumericConstant (const Token &Tok, Scope *UDLScope=nullptr) |
ExprResult | ActOnCharacterConstant (const Token &Tok, Scope *UDLScope=nullptr) |
ExprResult | ActOnParenExpr (SourceLocation L, SourceLocation R, Expr *E) |
ExprResult | ActOnParenListExpr (SourceLocation L, SourceLocation R, MultiExprArg Val) |
ExprResult | ActOnStringLiteral (ArrayRef< Token > StringToks, Scope *UDLScope=nullptr) |
ActOnStringLiteral - The specified tokens were lexed as pasted string fragments (e.g. More... | |
ExprResult | ActOnUnevaluatedStringLiteral (ArrayRef< Token > StringToks) |
ExprResult | ActOnGenericSelectionExpr (SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, bool PredicateIsExpr, void *ControllingExprOrType, ArrayRef< ParsedType > ArgTypes, ArrayRef< Expr * > ArgExprs) |
ControllingExprOrType is either an opaque pointer coming out of a ParsedType or an Expr *. More... | |
ExprResult | CreateGenericSelectionExpr (SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, bool PredicateIsExpr, void *ControllingExprOrType, ArrayRef< TypeSourceInfo * > Types, ArrayRef< Expr * > Exprs) |
ControllingExprOrType is either a TypeSourceInfo * or an Expr *. More... | |
ExprResult | CreateBuiltinUnaryOp (SourceLocation OpLoc, UnaryOperatorKind Opc, Expr *InputExpr, bool IsAfterAmp=false) |
ExprResult | BuildUnaryOp (Scope *S, SourceLocation OpLoc, UnaryOperatorKind Opc, Expr *Input, bool IsAfterAmp=false) |
ExprResult | ActOnUnaryOp (Scope *S, SourceLocation OpLoc, tok::TokenKind Op, Expr *Input, bool IsAfterAmp=false) |
bool | isQualifiedMemberAccess (Expr *E) |
Determine whether the given expression is a qualified member access expression, of a form that could be turned into a pointer to member with the address-of operator. More... | |
bool | CheckUseOfCXXMethodAsAddressOfOperand (SourceLocation OpLoc, const Expr *Op, const CXXMethodDecl *MD) |
QualType | CheckAddressOfOperand (ExprResult &Operand, SourceLocation OpLoc) |
CheckAddressOfOperand - The operand of & must be either a function designator or an lvalue designating an object. More... | |
bool | ActOnAlignasTypeArgument (StringRef KWName, ParsedType Ty, SourceLocation OpLoc, SourceRange R) |
ActOnAlignasTypeArgument - Handle alignas (type-id) and _Alignas (type-name) . More... | |
bool | CheckAlignasTypeArgument (StringRef KWName, TypeSourceInfo *TInfo, SourceLocation OpLoc, SourceRange R) |
ExprResult | CreateUnaryExprOrTypeTraitExpr (TypeSourceInfo *TInfo, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, SourceRange R) |
Build a sizeof or alignof expression given a type operand. More... | |
ExprResult | CreateUnaryExprOrTypeTraitExpr (Expr *E, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind) |
Build a sizeof or alignof expression given an expression operand. More... | |
ExprResult | ActOnUnaryExprOrTypeTraitExpr (SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, bool IsType, void *TyOrEx, SourceRange ArgRange) |
ActOnUnaryExprOrTypeTraitExpr - Handle sizeof(type) and sizeof expr and the same for alignof and __alignof Note that the ArgRange is invalid if isType is false. More... | |
ExprResult | CheckPlaceholderExpr (Expr *E) |
Check for operands with placeholder types and complain if found. More... | |
bool | CheckVecStepExpr (Expr *E) |
bool | CheckUnaryExprOrTypeTraitOperand (Expr *E, UnaryExprOrTypeTrait ExprKind) |
Check the constraints on expression operands to unary type expression and type traits. More... | |
bool | CheckUnaryExprOrTypeTraitOperand (QualType ExprType, SourceLocation OpLoc, SourceRange ExprRange, UnaryExprOrTypeTrait ExprKind, StringRef KWName) |
Check the constraints on operands to unary expression and type traits. More... | |
ExprResult | ActOnPostfixUnaryOp (Scope *S, SourceLocation OpLoc, tok::TokenKind Kind, Expr *Input) |
ExprResult | ActOnArraySubscriptExpr (Scope *S, Expr *Base, SourceLocation LLoc, MultiExprArg ArgExprs, SourceLocation RLoc) |
ExprResult | CreateBuiltinArraySubscriptExpr (Expr *Base, SourceLocation LLoc, Expr *Idx, SourceLocation RLoc) |
ExprResult | CreateBuiltinMatrixSubscriptExpr (Expr *Base, Expr *RowIdx, Expr *ColumnIdx, SourceLocation RBLoc) |
bool | ConvertArgumentsForCall (CallExpr *Call, Expr *Fn, FunctionDecl *FDecl, const FunctionProtoType *Proto, ArrayRef< Expr * > Args, SourceLocation RParenLoc, bool ExecConfig=false) |
ConvertArgumentsForCall - Converts the arguments specified in Args/NumArgs to the parameter types of the function FDecl with function prototype Proto. More... | |
void | CheckStaticArrayArgument (SourceLocation CallLoc, ParmVarDecl *Param, const Expr *ArgExpr) |
CheckStaticArrayArgument - If the given argument corresponds to a static array parameter, check that it is non-null, and that if it is formed by array-to-pointer decay, the underlying array is sufficiently large. More... | |
ExprResult | ActOnCallExpr (Scope *S, Expr *Fn, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig=nullptr) |
ActOnCallExpr - Handle a call to Fn with the specified array of arguments. More... | |
ExprResult | BuildCallExpr (Scope *S, Expr *Fn, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig=nullptr, bool IsExecConfig=false, bool AllowRecovery=false) |
BuildCallExpr - Handle a call to Fn with the specified array of arguments. More... | |
Expr * | BuildBuiltinCallExpr (SourceLocation Loc, Builtin::ID Id, MultiExprArg CallArgs) |
BuildBuiltinCallExpr - Create a call to a builtin function specified by Id. More... | |
ExprResult | BuildResolvedCallExpr (Expr *Fn, NamedDecl *NDecl, SourceLocation LParenLoc, ArrayRef< Expr * > Arg, SourceLocation RParenLoc, Expr *Config=nullptr, bool IsExecConfig=false, ADLCallKind UsesADL=ADLCallKind::NotADL) |
BuildResolvedCallExpr - Build a call to a resolved expression, i.e. More... | |
ExprResult | ActOnCastExpr (Scope *S, SourceLocation LParenLoc, Declarator &D, ParsedType &Ty, SourceLocation RParenLoc, Expr *CastExpr) |
CastKind | PrepareScalarCast (ExprResult &src, QualType destType) |
Prepares for a scalar cast, performing all the necessary stages except the final cast and returning the kind required. More... | |
ExprResult | BuildVectorLiteral (SourceLocation LParenLoc, SourceLocation RParenLoc, Expr *E, TypeSourceInfo *TInfo) |
Build an altivec or OpenCL literal. More... | |
ExprResult | MaybeConvertParenListExprToParenExpr (Scope *S, Expr *ME) |
This is not an AltiVec-style cast or or C++ direct-initialization, so turn the ParenListExpr into a sequence of comma binary operators. More... | |
ExprResult | ActOnCompoundLiteral (SourceLocation LParenLoc, ParsedType Ty, SourceLocation RParenLoc, Expr *InitExpr) |
ExprResult | BuildCompoundLiteralExpr (SourceLocation LParenLoc, TypeSourceInfo *TInfo, SourceLocation RParenLoc, Expr *LiteralExpr) |
ExprResult | ActOnInitList (SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc) |
ExprResult | BuildInitList (SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc) |
ExprResult | ActOnBinOp (Scope *S, SourceLocation TokLoc, tok::TokenKind Kind, Expr *LHSExpr, Expr *RHSExpr) |
ExprResult | BuildBinOp (Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr) |
ExprResult | CreateBuiltinBinOp (SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr) |
CreateBuiltinBinOp - Creates a new built-in binary operation with operator Opc at location TokLoc . More... | |
void | LookupBinOp (Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opc, UnresolvedSetImpl &Functions) |
void | DiagnoseCommaOperator (const Expr *LHS, SourceLocation Loc) |
ExprResult | ActOnConditionalOp (SourceLocation QuestionLoc, SourceLocation ColonLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr) |
ActOnConditionalOp - Parse a ?: operation. More... | |
ExprResult | ActOnAddrLabel (SourceLocation OpLoc, SourceLocation LabLoc, LabelDecl *TheDecl) |
ActOnAddrLabel - Parse the GNU address of label extension: "&&foo". More... | |
void | ActOnStartStmtExpr () |
ExprResult | ActOnStmtExpr (Scope *S, SourceLocation LPLoc, Stmt *SubStmt, SourceLocation RPLoc) |
ExprResult | BuildStmtExpr (SourceLocation LPLoc, Stmt *SubStmt, SourceLocation RPLoc, unsigned TemplateDepth) |
ExprResult | ActOnStmtExprResult (ExprResult E) |
void | ActOnStmtExprError () |
ExprResult | BuildBuiltinOffsetOf (SourceLocation BuiltinLoc, TypeSourceInfo *TInfo, ArrayRef< OffsetOfComponent > Components, SourceLocation RParenLoc) |
__builtin_offsetof(type, a.b[123][456].c) More... | |
ExprResult | ActOnBuiltinOffsetOf (Scope *S, SourceLocation BuiltinLoc, SourceLocation TypeLoc, ParsedType ParsedArgTy, ArrayRef< OffsetOfComponent > Components, SourceLocation RParenLoc) |
ExprResult | ActOnChooseExpr (SourceLocation BuiltinLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr, SourceLocation RPLoc) |
ExprResult | ActOnVAArg (SourceLocation BuiltinLoc, Expr *E, ParsedType Ty, SourceLocation RPLoc) |
ExprResult | BuildVAArgExpr (SourceLocation BuiltinLoc, Expr *E, TypeSourceInfo *TInfo, SourceLocation RPLoc) |
ExprResult | ActOnSourceLocExpr (SourceLocIdentKind Kind, SourceLocation BuiltinLoc, SourceLocation RPLoc) |
ExprResult | BuildSourceLocExpr (SourceLocIdentKind Kind, QualType ResultTy, SourceLocation BuiltinLoc, SourceLocation RPLoc, DeclContext *ParentContext) |
ExprResult | ActOnGNUNullExpr (SourceLocation TokenLoc) |
bool | CheckCaseExpression (Expr *E) |
void | ActOnBlockStart (SourceLocation CaretLoc, Scope *CurScope) |
ActOnBlockStart - This callback is invoked when a block literal is started. More... | |
void | ActOnBlockArguments (SourceLocation CaretLoc, Declarator &ParamInfo, Scope *CurScope) |
ActOnBlockArguments - This callback allows processing of block arguments. More... | |
void | ActOnBlockError (SourceLocation CaretLoc, Scope *CurScope) |
ActOnBlockError - If there is an error parsing a block, this callback is invoked to pop the information about the block from the action impl. More... | |
ExprResult | ActOnBlockStmtExpr (SourceLocation CaretLoc, Stmt *Body, Scope *CurScope) |
ActOnBlockStmtExpr - This is called when the body of a block statement literal was successfully completed. More... | |
ExprResult | ActOnConvertVectorExpr (Expr *E, ParsedType ParsedDestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc) |
__builtin_convertvector(...) More... | |
ExprResult | ActOnAsTypeExpr (Expr *E, ParsedType ParsedDestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc) |
__builtin_astype(...) More... | |
ExprResult | BuildAsTypeExpr (Expr *E, QualType DestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc) |
Create a new AsTypeExpr node (bitcast) from the arguments. More... | |
ExprResult | CreateRecoveryExpr (SourceLocation Begin, SourceLocation End, ArrayRef< Expr * > SubExprs, QualType T=QualType()) |
Attempts to produce a RecoveryExpr after some AST node cannot be created. More... | |
ExprResult | PerformObjectMemberConversion (Expr *From, NestedNameSpecifier *Qualifier, NamedDecl *FoundDecl, NamedDecl *Member) |
Cast a base object to a member's actual type. More... | |
bool | CheckCallReturnType (QualType ReturnType, SourceLocation Loc, CallExpr *CE, FunctionDecl *FD) |
CheckCallReturnType - Checks that a call expression's return type is complete. More... | |
void | WarnOnPendingNoDerefs (ExpressionEvaluationContextRecord &Rec) |
Emit a warning for all pending noderef expressions that we recorded. More... | |
ExprResult | BuildCXXDefaultInitExpr (SourceLocation Loc, FieldDecl *Field) |
bool | CheckCXXDefaultArgExpr (SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param, Expr *Init=nullptr, bool SkipImmediateInvocations=true) |
Instantiate or parse a C++ default argument expression as necessary. More... | |
ExprResult | BuildCXXDefaultArgExpr (SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param, Expr *Init=nullptr) |
BuildCXXDefaultArgExpr - Creates a CXXDefaultArgExpr, instantiating the default expr if needed. More... | |
ExprResult | CheckForImmediateInvocation (ExprResult E, FunctionDecl *Decl) |
Wrap the expression in a ConstantExpr if it is a potential immediate invocation. More... | |
void | MarkExpressionAsImmediateEscalating (Expr *E) |
bool | IsInvalidSMECallConversion (QualType FromType, QualType ToType) |
ExprResult | VerifyIntegerConstantExpression (Expr *E, llvm::APSInt *Result, VerifyICEDiagnoser &Diagnoser, AllowFoldKind CanFold=NoFold) |
VerifyIntegerConstantExpression - Verifies that an expression is an ICE, and reports the appropriate diagnostics. More... | |
ExprResult | VerifyIntegerConstantExpression (Expr *E, llvm::APSInt *Result, unsigned DiagID, AllowFoldKind CanFold=NoFold) |
ExprResult | VerifyIntegerConstantExpression (Expr *E, llvm::APSInt *Result=nullptr, AllowFoldKind CanFold=NoFold) |
ExprResult | VerifyIntegerConstantExpression (Expr *E, AllowFoldKind CanFold=NoFold) |
void | DiagnoseAssignmentAsCondition (Expr *E) |
DiagnoseAssignmentAsCondition - Given that an expression is being used as a boolean condition, warn if it's an assignment. More... | |
void | DiagnoseEqualityWithExtraParens (ParenExpr *ParenE) |
Redundant parentheses over an equality comparison can indicate that the user intended an assignment used as condition. More... | |
FullExprArg | MakeFullExpr (Expr *Arg) |
FullExprArg | MakeFullExpr (Expr *Arg, SourceLocation CC) |
FullExprArg | MakeFullDiscardedValueExpr (Expr *Arg) |
ExprResult | CheckBooleanCondition (SourceLocation Loc, Expr *E, bool IsConstexpr=false) |
CheckBooleanCondition - Diagnose problems involving the use of the given expression as a boolean condition (e.g. More... | |
ConditionResult | ActOnCondition (Scope *S, SourceLocation Loc, Expr *SubExpr, ConditionKind CK, bool MissingOK=false) |
QualType | CheckConditionalOperands (ExprResult &Cond, ExprResult &LHS, ExprResult &RHS, ExprValueKind &VK, ExprObjectKind &OK, SourceLocation QuestionLoc) |
Note that LHS is not null here, even if this is the gnu "x ?: y" extension. More... | |
bool | DiagnoseConditionalForNull (const Expr *LHSExpr, const Expr *RHSExpr, SourceLocation QuestionLoc) |
Emit a specialized diagnostic when one expression is a null pointer constant and the other is not a pointer. More... | |
QualType | CheckVectorOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign, bool AllowBothBool, bool AllowBoolConversion, bool AllowBoolOperation, bool ReportInvalid) |
type checking for vector binary operators. More... | |
QualType | GetSignedVectorType (QualType V) |
QualType | GetSignedSizelessVectorType (QualType V) |
QualType | CheckVectorCompareOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) |
CheckVectorCompareOperands - vector comparisons are a clang extension that operates on extended vector types. More... | |
QualType | CheckSizelessVectorCompareOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) |
QualType | CheckVectorLogicalOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc) |
QualType | CheckSizelessVectorOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign, ArithConvKind OperationKind) |
QualType | CheckMatrixElementwiseOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign) |
Type checking for matrix binary operators. More... | |
QualType | CheckMatrixMultiplyOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign) |
bool | isValidSveBitcast (QualType srcType, QualType destType) |
Are the two types SVE-bitcast-compatible types? I.e. More... | |
bool | areMatrixTypesOfTheSameDimension (QualType srcTy, QualType destTy) |
Are the two types matrix types and do they have the same dimensions i.e. More... | |
bool | areVectorTypesSameSize (QualType srcType, QualType destType) |
bool | areLaxCompatibleVectorTypes (QualType srcType, QualType destType) |
Are the two types lax-compatible vector types? That is, given that one of them is a vector, do they have equal storage sizes, where the storage size is the number of elements times the element size? More... | |
bool | isLaxVectorConversion (QualType srcType, QualType destType) |
Is this a legal conversion between two types, one of which is known to be a vector type? More... | |
bool | anyAltivecTypes (QualType srcType, QualType destType) |
ExprResult | checkUnknownAnyCast (SourceRange TypeRange, QualType CastType, Expr *CastExpr, CastKind &CastKind, ExprValueKind &VK, CXXCastPath &Path) |
Check a cast of an unknown-any type. More... | |
ExprResult | forceUnknownAnyToType (Expr *E, QualType ToType) |
Force an expression with unknown-type to an expression of the given type. More... | |
ExprResult | checkUnknownAnyArg (SourceLocation callLoc, Expr *result, QualType ¶mType) |
Type-check an expression that's being passed to an __unknown_anytype parameter. More... | |
bool | CheckMatrixCast (SourceRange R, QualType DestTy, QualType SrcTy, CastKind &Kind) |
bool | CheckVectorCast (SourceRange R, QualType VectorTy, QualType Ty, CastKind &Kind) |
ExprResult | prepareVectorSplat (QualType VectorTy, Expr *SplattedExpr) |
Prepare SplattedExpr for a vector splat operation, adding implicit casts if necessary. More... | |
ExprResult | CheckExtVectorCast (SourceRange R, QualType DestTy, Expr *CastExpr, CastKind &Kind) |
QualType | PreferredConditionType (ConditionKind K) const |
ExprResult | UsualUnaryConversions (Expr *E) |
UsualUnaryConversions - Performs various conversions that are common to most operators (C99 6.3). More... | |
ExprResult | CallExprUnaryConversions (Expr *E) |
CallExprUnaryConversions - a special case of an unary conversion performed on a function designator of a call expression. More... | |
ExprResult | DefaultFunctionArrayConversion (Expr *E, bool Diagnose=true) |
DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4). More... | |
ExprResult | DefaultFunctionArrayLvalueConversion (Expr *E, bool Diagnose=true) |
ExprResult | DefaultLvalueConversion (Expr *E) |
ExprResult | DefaultArgumentPromotion (Expr *E) |
DefaultArgumentPromotion (C99 6.5.2.2p6). More... | |
VariadicCallType | getVariadicCallType (FunctionDecl *FDecl, const FunctionProtoType *Proto, Expr *Fn) |
VarArgKind | isValidVarArgType (const QualType &Ty) |
Determine the degree of POD-ness for an expression. More... | |
void | checkVariadicArgument (const Expr *E, VariadicCallType CT) |
Check to see if the given expression is a valid argument to a variadic function, issuing a diagnostic if not. More... | |
bool | GatherArgumentsForCall (SourceLocation CallLoc, FunctionDecl *FDecl, const FunctionProtoType *Proto, unsigned FirstParam, ArrayRef< Expr * > Args, SmallVectorImpl< Expr * > &AllArgs, VariadicCallType CallType=VariadicDoesNotApply, bool AllowExplicit=false, bool IsListInitialization=false) |
GatherArgumentsForCall - Collector argument expressions for various form of call prototypes. More... | |
ExprResult | DefaultVariadicArgumentPromotion (Expr *E, VariadicCallType CT, FunctionDecl *FDecl) |
DefaultVariadicArgumentPromotion - Like DefaultArgumentPromotion, but will create a trap if the resulting type is not a POD type. More... | |
QualType | UsualArithmeticConversions (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, ArithConvKind ACK) |
UsualArithmeticConversions - Performs various conversions that are common to binary operators (C99 6.3.1.8). More... | |
bool | DiagnoseAssignmentResult (AssignConvertType ConvTy, SourceLocation Loc, QualType DstType, QualType SrcType, Expr *SrcExpr, AssignmentAction Action, bool *Complained=nullptr) |
DiagnoseAssignmentResult - Emit a diagnostic, if required, for the assignment conversion type specified by ConvTy. More... | |
AssignConvertType | CheckAssignmentConstraints (SourceLocation Loc, QualType LHSType, QualType RHSType) |
CheckAssignmentConstraints - Perform type checking for assignment, argument passing, variable initialization, and function return values. More... | |
AssignConvertType | CheckAssignmentConstraints (QualType LHSType, ExprResult &RHS, CastKind &Kind, bool ConvertRHS=true) |
Check assignment constraints and optionally prepare for a conversion of the RHS to the LHS type. More... | |
AssignConvertType | CheckSingleAssignmentConstraints (QualType LHSType, ExprResult &RHS, bool Diagnose=true, bool DiagnoseCFAudited=false, bool ConvertRHS=true) |
Check assignment constraints for an assignment of RHS to LHSType. More... | |
AssignConvertType | CheckTransparentUnionArgumentConstraints (QualType ArgType, ExprResult &RHS) |
QualType | InvalidOperands (SourceLocation Loc, ExprResult &LHS, ExprResult &RHS) |
the following "Check" methods will return a valid/converted QualType or a null QualType (indicating an error diagnostic was issued). More... | |
QualType | InvalidLogicalVectorOperands (SourceLocation Loc, ExprResult &LHS, ExprResult &RHS) |
QualType | CheckMultiplyDivideOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign, bool IsDivide) |
QualType | CheckRemainderOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign=false) |
QualType | CheckAdditionOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc, QualType *CompLHSTy=nullptr) |
QualType | CheckSubtractionOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, QualType *CompLHSTy=nullptr) |
QualType | CheckShiftOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc, bool IsCompAssign=false) |
void | CheckPtrComparisonWithNullChar (ExprResult &E, ExprResult &NullE) |
QualType | CheckCompareOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) |
QualType | CheckBitwiseOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) |
QualType | CheckLogicalOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) |
QualType | CheckAssignmentOperands (Expr *LHSExpr, ExprResult &RHS, SourceLocation Loc, QualType CompoundType, BinaryOperatorKind Opc) |
bool | isAlwaysConstantEvaluatedContext () const |
bool | isUnevaluatedContext () const |
Determines whether we are currently in a context that is not evaluated as per C++ [expr] p5. More... | |
bool | isImmediateFunctionContext () const |
bool | isInLifetimeExtendingContext () const |
bool | isCheckingDefaultArgumentOrInitializer () const |
std::optional< ExpressionEvaluationContextRecord::InitializationContext > | InnermostDeclarationWithDelayedImmediateInvocations () const |
std::optional< ExpressionEvaluationContextRecord::InitializationContext > | OutermostDeclarationWithDelayedImmediateInvocations () const |
void | keepInLifetimeExtendingContext () |
keepInLifetimeExtendingContext - Pull down InLifetimeExtendingContext flag from previous context. More... | |
DefaultedComparisonKind | getDefaultedComparisonKind (const FunctionDecl *FD) |
const FieldDecl * | getSelfAssignmentClassMemberCandidate (const ValueDecl *SelfAssigned) |
Returns a field in a CXXRecordDecl that has the same name as the decl SelfAssigned when inside a CXXMethodDecl. More... | |
void | MaybeSuggestAddingStaticToDecl (const FunctionDecl *D) |
template<typename... Ts> | |
bool | RequireCompleteSizedType (SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args) |
template<typename... Ts> | |
bool | RequireCompleteSizedExprType (Expr *E, unsigned DiagID, const Ts &...Args) |
bool | CheckArgsForPlaceholders (MultiExprArg args) |
Check an argument list for placeholders that we won't try to handle later. More... | |
void | maybeExtendBlockObject (ExprResult &E) |
Do an explicit extend of the given block pointer if we're in ARC. More... | |
static ConditionResult | ConditionError () |
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 parameters expected for it. More... | |
C++ Expressions | |
Implementations are in SemaExprCXX.cpp | |
enum | AllocationFunctionScope { AFS_Global , AFS_Class , AFS_Both } |
The scope in which to find allocation functions. More... | |
enum | IfExistsResult { IER_Exists , IER_DoesNotExist , IER_Dependent , IER_Error } |
Describes the result of an "if-exists" condition check. More... | |
LazyDeclPtr | StdBadAlloc |
The C++ "std::bad_alloc" class, which is defined by the C++ standard library. More... | |
LazyDeclPtr | StdAlignValT |
The C++ "std::align_val_t" enum class, which is defined by the C++ standard library. More... | |
RecordDecl * | CXXTypeInfoDecl |
The C++ "type_info" declaration, which is defined in <typeinfo>. More... | |
bool | GlobalNewDeleteDeclared |
A flag to remember whether the implicit forms of operator new and delete have been declared. More... | |
llvm::MapVector< FieldDecl *, DeleteLocs > | DeleteExprs |
Delete-expressions to be analyzed at the end of translation unit. More... | |
QualType | CXXThisTypeOverride |
When non-NULL, the C++ 'this' expression is allowed despite the current context not being a non-static member function. More... | |
ParsedType | getInheritingConstructorName (CXXScopeSpec &SS, SourceLocation NameLoc, const IdentifierInfo &Name) |
Handle the result of the special case name lookup for inheriting constructor declarations. More... | |
ParsedType | getConstructorName (const IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, bool EnteringContext) |
ParsedType | getDestructorName (const IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, ParsedType ObjectType, bool EnteringContext) |
ParsedType | getDestructorTypeForDecltype (const DeclSpec &DS, ParsedType ObjectType) |
ExprResult | BuildCXXTypeId (QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc) |
Build a C++ typeid expression with a type operand. More... | |
ExprResult | BuildCXXTypeId (QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc) |
Build a C++ typeid expression with an expression operand. More... | |
ExprResult | ActOnCXXTypeid (SourceLocation OpLoc, SourceLocation LParenLoc, bool isType, void *TyOrExpr, SourceLocation RParenLoc) |
ActOnCXXTypeid - Parse typeid( something ). More... | |
ExprResult | BuildCXXUuidof (QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc) |
Build a Microsoft __uuidof expression with a type operand. More... | |
ExprResult | BuildCXXUuidof (QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc) |
Build a Microsoft __uuidof expression with an expression operand. More... | |
ExprResult | ActOnCXXUuidof (SourceLocation OpLoc, SourceLocation LParenLoc, bool isType, void *TyOrExpr, SourceLocation RParenLoc) |
ActOnCXXUuidof - Parse __uuidof( something ). More... | |
ExprResult | ActOnCXXThis (SourceLocation Loc) |
bool | CheckCXXThisType (SourceLocation Loc, QualType Type) |
Check whether the type of 'this' is valid in the current context. More... | |
Expr * | BuildCXXThisExpr (SourceLocation Loc, QualType Type, bool IsImplicit) |
Build a CXXThisExpr and mark it referenced in the current context. More... | |
void | MarkThisReferenced (CXXThisExpr *This) |
QualType | getCurrentThisType () |
Try to retrieve the type of the 'this' pointer. More... | |
bool | CheckCXXThisCapture (SourceLocation Loc, bool Explicit=false, bool BuildAndDiagnose=true, const unsigned *const FunctionScopeIndexToStopAt=nullptr, bool ByCopy=false) |
Make sure the value of 'this' is actually available in the current context, if it is a potentially evaluated context. More... | |
bool | isThisOutsideMemberFunctionBody (QualType BaseType) |
Determine whether the given type is the type of *this that is used outside of the body of a member function for a type that is currently being defined. More... | |
ExprResult | ActOnCXXBoolLiteral (SourceLocation OpLoc, tok::TokenKind Kind) |
ActOnCXXBoolLiteral - Parse {true,false} literals. More... | |
ExprResult | ActOnCXXNullPtrLiteral (SourceLocation Loc) |
ActOnCXXNullPtrLiteral - Parse 'nullptr'. More... | |
ExprResult | ActOnCXXThrow (Scope *S, SourceLocation OpLoc, Expr *expr) |
ActOnCXXThrow - Parse throw expressions. More... | |
ExprResult | BuildCXXThrow (SourceLocation OpLoc, Expr *Ex, bool IsThrownVarInScope) |
bool | CheckCXXThrowOperand (SourceLocation ThrowLoc, QualType ThrowTy, Expr *E) |
CheckCXXThrowOperand - Validate the operand of a throw. More... | |
ExprResult | ActOnCXXTypeConstructExpr (ParsedType TypeRep, SourceLocation LParenOrBraceLoc, MultiExprArg Exprs, SourceLocation RParenOrBraceLoc, bool ListInitialization) |
ActOnCXXTypeConstructExpr - Parse construction of a specified type. More... | |
ExprResult | BuildCXXTypeConstructExpr (TypeSourceInfo *Type, SourceLocation LParenLoc, MultiExprArg Exprs, SourceLocation RParenLoc, bool ListInitialization) |
ExprResult | ActOnCXXNew (SourceLocation StartLoc, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, Declarator &D, Expr *Initializer) |
ActOnCXXNew - Parsed a C++ 'new' expression. More... | |
ExprResult | BuildCXXNew (SourceRange Range, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocType, TypeSourceInfo *AllocTypeInfo, std::optional< Expr * > ArraySize, SourceRange DirectInitRange, Expr *Initializer) |
bool | isUnavailableAlignedAllocationFunction (const FunctionDecl &FD) const |
Determine whether FD is an aligned allocation or deallocation function that is unavailable. More... | |
void | diagnoseUnavailableAlignedAllocation (const FunctionDecl &FD, SourceLocation Loc) |
Produce diagnostics if FD is an aligned allocation or deallocation function that is unavailable. More... | |
bool | CheckAllocatedType (QualType AllocType, SourceLocation Loc, SourceRange R) |
Checks that a type is suitable as the allocated type in a new-expression. More... | |
bool | FindAllocationFunctions (SourceLocation StartLoc, SourceRange Range, AllocationFunctionScope NewScope, AllocationFunctionScope DeleteScope, QualType AllocType, bool IsArray, bool &PassAlignment, MultiExprArg PlaceArgs, FunctionDecl *&OperatorNew, FunctionDecl *&OperatorDelete, bool Diagnose=true) |
Finds the overloads of operator new and delete that are appropriate for the allocation. More... | |
void | DeclareGlobalNewDelete () |
DeclareGlobalNewDelete - Declare the global forms of operator new and delete. More... | |
void | DeclareGlobalAllocationFunction (DeclarationName Name, QualType Return, ArrayRef< QualType > Params) |
DeclareGlobalAllocationFunction - Declares a single implicit global allocation function if it doesn't already exist. More... | |
bool | FindDeallocationFunction (SourceLocation StartLoc, CXXRecordDecl *RD, DeclarationName Name, FunctionDecl *&Operator, bool Diagnose=true, bool WantSize=false, bool WantAligned=false) |
FunctionDecl * | FindUsualDeallocationFunction (SourceLocation StartLoc, bool CanProvideSize, bool Overaligned, DeclarationName Name) |
FunctionDecl * | FindDeallocationFunctionForDestructor (SourceLocation StartLoc, CXXRecordDecl *RD) |
ExprResult | ActOnCXXDelete (SourceLocation StartLoc, bool UseGlobal, bool ArrayForm, Expr *Operand) |
ActOnCXXDelete - Parsed a C++ 'delete' expression. More... | |
void | CheckVirtualDtorCall (CXXDestructorDecl *dtor, SourceLocation Loc, bool IsDelete, bool CallCanBeVirtual, bool WarnOnNonAbstractTypes, SourceLocation DtorLoc) |
ExprResult | ActOnNoexceptExpr (SourceLocation KeyLoc, SourceLocation LParen, Expr *Operand, SourceLocation RParen) |
ExprResult | BuildCXXNoexceptExpr (SourceLocation KeyLoc, Expr *Operand, SourceLocation RParen) |
ExprResult | ActOnStartCXXMemberReference (Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, ParsedType &ObjectType, bool &MayBePseudoDestructor) |
ExprResult | BuildPseudoDestructorExpr (Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, const CXXScopeSpec &SS, TypeSourceInfo *ScopeType, SourceLocation CCLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType) |
ExprResult | ActOnPseudoDestructorExpr (Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, CXXScopeSpec &SS, UnqualifiedId &FirstTypeName, SourceLocation CCLoc, SourceLocation TildeLoc, UnqualifiedId &SecondTypeName) |
ExprResult | ActOnPseudoDestructorExpr (Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, SourceLocation TildeLoc, const DeclSpec &DS) |
Expr * | MaybeCreateExprWithCleanups (Expr *SubExpr) |
MaybeCreateExprWithCleanups - If the current full-expression requires any cleanups, surround it with a ExprWithCleanups node. More... | |
Stmt * | MaybeCreateStmtWithCleanups (Stmt *SubStmt) |
ExprResult | MaybeCreateExprWithCleanups (ExprResult SubExpr) |
ExprResult | ActOnFinishFullExpr (Expr *Expr, bool DiscardedValue) |
ExprResult | ActOnFinishFullExpr (Expr *Expr, SourceLocation CC, bool DiscardedValue, bool IsConstexpr=false, bool IsTemplateArgument=false) |
StmtResult | ActOnFinishFullStmt (Stmt *Stmt) |
ExprResult | ActOnDecltypeExpression (Expr *E) |
Process the expression contained within a decltype. More... | |
bool | checkLiteralOperatorId (const CXXScopeSpec &SS, const UnqualifiedId &Id, bool IsUDSuffix) |
bool | isUsualDeallocationFunction (const CXXMethodDecl *FD) |
ConditionResult | ActOnConditionVariable (Decl *ConditionVar, SourceLocation StmtLoc, ConditionKind CK) |
ExprResult | CheckConditionVariable (VarDecl *ConditionVar, SourceLocation StmtLoc, ConditionKind CK) |
Check the use of the given variable as a C++ condition in an if, while, do-while, or switch statement. More... | |
ExprResult | CheckCXXBooleanCondition (Expr *CondExpr, bool IsConstexpr=false) |
CheckCXXBooleanCondition - Returns true if conversion to bool is invalid. More... | |
bool | IsStringLiteralToNonConstPointerConversion (Expr *From, QualType ToType) |
Helper function to determine whether this is the (deprecated) C++ conversion from a string literal to a pointer to non-const char or non-const wchar_t (for narrow and wide string literals, respectively). More... | |
ExprResult | PerformImplicitConversion (Expr *From, QualType ToType, const ImplicitConversionSequence &ICS, AssignmentAction Action, CheckedConversionKind CCK=CheckedConversionKind::Implicit) |
PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType using the pre-computed implicit conversion sequence ICS. More... | |
ExprResult | PerformImplicitConversion (Expr *From, QualType ToType, const StandardConversionSequence &SCS, AssignmentAction Action, CheckedConversionKind CCK) |
PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType by following the standard conversion sequence SCS. More... | |
bool | CheckTypeTraitArity (unsigned Arity, SourceLocation Loc, size_t N) |
ExprResult | ActOnTypeTrait (TypeTrait Kind, SourceLocation KWLoc, ArrayRef< ParsedType > Args, SourceLocation RParenLoc) |
Parsed one of the type trait support pseudo-functions. More... | |
ExprResult | BuildTypeTrait (TypeTrait Kind, SourceLocation KWLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc) |
ExprResult | ActOnArrayTypeTrait (ArrayTypeTrait ATT, SourceLocation KWLoc, ParsedType LhsTy, Expr *DimExpr, SourceLocation RParen) |
ActOnArrayTypeTrait - Parsed one of the binary type trait support pseudo-functions. More... | |
ExprResult | BuildArrayTypeTrait (ArrayTypeTrait ATT, SourceLocation KWLoc, TypeSourceInfo *TSInfo, Expr *DimExpr, SourceLocation RParen) |
ExprResult | ActOnExpressionTrait (ExpressionTrait OET, SourceLocation KWLoc, Expr *Queried, SourceLocation RParen) |
ActOnExpressionTrait - Parsed one of the unary type trait support pseudo-functions. More... | |
ExprResult | BuildExpressionTrait (ExpressionTrait OET, SourceLocation KWLoc, Expr *Queried, SourceLocation RParen) |
QualType | CheckPointerToMemberOperands (ExprResult &LHS, ExprResult &RHS, ExprValueKind &VK, SourceLocation OpLoc, bool isIndirect) |
QualType | CheckVectorConditionalTypes (ExprResult &Cond, ExprResult &LHS, ExprResult &RHS, SourceLocation QuestionLoc) |
QualType | CheckSizelessVectorConditionalTypes (ExprResult &Cond, ExprResult &LHS, ExprResult &RHS, SourceLocation QuestionLoc) |
QualType | CXXCheckConditionalOperands (ExprResult &cond, ExprResult &lhs, ExprResult &rhs, ExprValueKind &VK, ExprObjectKind &OK, SourceLocation questionLoc) |
Check the operands of ?: under C++ semantics. More... | |
QualType | FindCompositePointerType (SourceLocation Loc, Expr *&E1, Expr *&E2, bool ConvertArgs=true) |
Find a merged pointer type and convert the two expressions to it. More... | |
QualType | FindCompositePointerType (SourceLocation Loc, ExprResult &E1, ExprResult &E2, bool ConvertArgs=true) |
ExprResult | MaybeBindToTemporary (Expr *E) |
MaybeBindToTemporary - If the passed in expression has a record type with a non-trivial destructor, this will return CXXBindTemporaryExpr. More... | |
ExprResult | IgnoredValueConversions (Expr *E) |
IgnoredValueConversions - Given that an expression's result is syntactically ignored, perform any conversions that are required. More... | |
ExprResult | CheckUnevaluatedOperand (Expr *E) |
ExprResult | CorrectDelayedTyposInExpr (Expr *E, VarDecl *InitDecl=nullptr, bool RecoverUncorrectedTypos=false, llvm::function_ref< ExprResult(Expr *)> Filter=[](Expr *E) -> ExprResult { return E;}) |
Process any TypoExprs in the given Expr and its children, generating diagnostics as appropriate and returning a new Expr if there were typos that were all successfully corrected and ExprError if one or more typos could not be corrected. More... | |
ExprResult | CorrectDelayedTyposInExpr (ExprResult ER, VarDecl *InitDecl=nullptr, bool RecoverUncorrectedTypos=false, llvm::function_ref< ExprResult(Expr *)> Filter=[](Expr *E) -> ExprResult { return E;}) |
IfExistsResult | CheckMicrosoftIfExistsSymbol (Scope *S, CXXScopeSpec &SS, const DeclarationNameInfo &TargetNameInfo) |
IfExistsResult | CheckMicrosoftIfExistsSymbol (Scope *S, SourceLocation KeywordLoc, bool IsIfExists, CXXScopeSpec &SS, UnqualifiedId &Name) |
RequiresExprBodyDecl * | ActOnStartRequiresExpr (SourceLocation RequiresKWLoc, ArrayRef< ParmVarDecl * > LocalParameters, Scope *BodyScope) |
void | ActOnFinishRequiresExpr () |
concepts::Requirement * | ActOnSimpleRequirement (Expr *E) |
concepts::Requirement * | ActOnTypeRequirement (SourceLocation TypenameKWLoc, CXXScopeSpec &SS, SourceLocation NameLoc, const IdentifierInfo *TypeName, TemplateIdAnnotation *TemplateId) |
concepts::Requirement * | ActOnCompoundRequirement (Expr *E, SourceLocation NoexceptLoc) |
concepts::Requirement * | ActOnCompoundRequirement (Expr *E, SourceLocation NoexceptLoc, CXXScopeSpec &SS, TemplateIdAnnotation *TypeConstraint, unsigned Depth) |
concepts::Requirement * | ActOnNestedRequirement (Expr *Constraint) |
concepts::ExprRequirement * | BuildExprRequirement (Expr *E, bool IsSatisfied, SourceLocation NoexceptLoc, concepts::ExprRequirement::ReturnTypeRequirement ReturnTypeRequirement) |
concepts::ExprRequirement * | BuildExprRequirement (concepts::Requirement::SubstitutionDiagnostic *ExprSubstDiag, bool IsSatisfied, SourceLocation NoexceptLoc, concepts::ExprRequirement::ReturnTypeRequirement ReturnTypeRequirement) |
concepts::TypeRequirement * | BuildTypeRequirement (TypeSourceInfo *Type) |
concepts::TypeRequirement * | BuildTypeRequirement (concepts::Requirement::SubstitutionDiagnostic *SubstDiag) |
concepts::NestedRequirement * | BuildNestedRequirement (Expr *E) |
concepts::NestedRequirement * | BuildNestedRequirement (StringRef InvalidConstraintEntity, const ASTConstraintSatisfaction &Satisfaction) |
ExprResult | ActOnRequiresExpr (SourceLocation RequiresKWLoc, RequiresExprBodyDecl *Body, SourceLocation LParenLoc, ArrayRef< ParmVarDecl * > LocalParameters, SourceLocation RParenLoc, ArrayRef< concepts::Requirement * > Requirements, SourceLocation ClosingBraceLoc) |
Name Lookup | |
These routines provide name lookup that is used during semantic analysis to resolve the various kinds of names (identifiers, overloaded operator names, constructor names, etc.) into zero or more declarations within a particular scope. The major entry points are LookupName, which performs unqualified name lookup, and LookupQualifiedName, which performs qualified name lookup. All name lookup is performed based on some specific criteria, which specify what names will be visible to name lookup and how far name lookup should work. These criteria are important both for capturing language semantics (certain lookups will ignore certain names, for example) and for performance, since name lookup is often a bottleneck in the compilation of C++. Name lookup criteria is specified via the LookupCriteria enumeration. The results of name lookup can vary based on the kind of name lookup performed, the current language, and the translation unit. In C, for example, name lookup will either return nothing (no entity found) or a single declaration. In C++, name lookup can additionally refer to a set of overloaded functions or result in an ambiguity. All of the possible results of name lookup are captured by the LookupResult class, which provides the ability to distinguish among them. Implementations are in SemaLookup.cpp | |
enum class | AcceptableKind { Visible , Reachable } |
enum | LookupNameKind { LookupOrdinaryName = 0 , LookupTagName , LookupLabel , LookupMemberName , LookupOperatorName , LookupDestructorName , LookupNestedNameSpecifierName , LookupNamespaceName , LookupUsingDeclName , LookupRedeclarationWithLinkage , LookupLocalFriendName , LookupObjCProtocolName , LookupObjCImplicitSelfParam , LookupOMPReductionName , LookupOMPMapperName , LookupAnyName } |
Describes the kind of name lookup to perform. More... | |
enum | LiteralOperatorLookupResult { LOLR_Error , LOLR_ErrorNoDiagnostic , LOLR_Cooked , LOLR_Raw , LOLR_Template , LOLR_StringTemplatePack } |
The possible outcomes of name lookup for a literal operator. More... | |
enum | CorrectTypoKind { CTK_NonError , CTK_ErrorRecovery } |
enum class | MissingImportKind { Declaration , Definition , DefaultArgument , ExplicitSpecialization , PartialSpecialization } |
Kinds of missing import. More... | |
typedef llvm::SmallSet< SourceLocation, 2 > | SrcLocSet |
typedef llvm::DenseMap< IdentifierInfo *, SrcLocSet > | IdentifierSourceLocations |
typedef llvm::SmallSetVector< DeclContext *, 16 > | AssociatedNamespaceSet |
typedef llvm::SmallSetVector< CXXRecordDecl *, 16 > | AssociatedClassSet |
typedef std::function< void(const TypoCorrection &)> | TypoDiagnosticGenerator |
typedef std::function< ExprResult(Sema &, TypoExpr *, TypoCorrection)> | TypoRecoveryCallback |
bool | DisableTypoCorrection |
Tracks whether we are in a context where typo correction is disabled. More... | |
unsigned | TyposCorrected |
The number of typos corrected by CorrectTypo. More... | |
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. More... | |
llvm::FoldingSet< SpecialMemberOverloadResultEntry > | SpecialMemberCache |
A cache of special member function overload resolution results for C++ records. More... | |
llvm::SmallVector< TypoExpr *, 2 > | TypoExprs |
Holds TypoExprs that are created from createDelayedTypo . More... | |
SpecialMemberOverloadResult | LookupSpecialMember (CXXRecordDecl *D, CXXSpecialMemberKind SM, bool ConstArg, bool VolatileArg, bool RValueThis, bool ConstThis, bool VolatileThis) |
RedeclarationKind | forRedeclarationInCurContext () const |
NamedDecl * | LookupSingleName (Scope *S, DeclarationName Name, SourceLocation Loc, LookupNameKind NameKind, RedeclarationKind Redecl=RedeclarationKind::NotForRedeclaration) |
Look up a name, looking for a single declaration. More... | |
bool | LookupBuiltin (LookupResult &R) |
Lookup a builtin function, when name lookup would otherwise fail. More... | |
void | LookupNecessaryTypesForBuiltin (Scope *S, unsigned ID) |
bool | LookupName (LookupResult &R, Scope *S, bool AllowBuiltinCreation=false, bool ForceNoCPlusPlus=false) |
Perform unqualified name lookup starting from a given scope. More... | |
bool | LookupQualifiedName (LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false) |
Perform qualified name lookup into a given context. More... | |
bool | LookupQualifiedName (LookupResult &R, DeclContext *LookupCtx, CXXScopeSpec &SS) |
Performs qualified name lookup or special type of lookup for "__super::" scope specifier. More... | |
bool | LookupParsedName (LookupResult &R, Scope *S, CXXScopeSpec *SS, QualType ObjectType, bool AllowBuiltinCreation=false, bool EnteringContext=false) |
Performs name lookup for a name that was parsed in the source code, and may contain a C++ scope specifier. More... | |
bool | LookupInSuper (LookupResult &R, CXXRecordDecl *Class) |
Perform qualified name lookup into all base classes of the given class. More... | |
void | LookupOverloadedOperatorName (OverloadedOperatorKind Op, Scope *S, UnresolvedSetImpl &Functions) |
LabelDecl * | LookupOrCreateLabel (IdentifierInfo *II, SourceLocation IdentLoc, SourceLocation GnuLabelLoc=SourceLocation()) |
LookupOrCreateLabel - Do a name lookup of a label with the specified name. More... | |
DeclContextLookupResult | LookupConstructors (CXXRecordDecl *Class) |
Look up the constructors for the given class. More... | |
CXXConstructorDecl * | LookupDefaultConstructor (CXXRecordDecl *Class) |
Look up the default constructor for the given class. More... | |
CXXConstructorDecl * | LookupCopyingConstructor (CXXRecordDecl *Class, unsigned Quals) |
Look up the copying constructor for the given class. More... | |
CXXMethodDecl * | LookupCopyingAssignment (CXXRecordDecl *Class, unsigned Quals, bool RValueThis, unsigned ThisQuals) |
Look up the copying assignment operator for the given class. More... | |
CXXConstructorDecl * | LookupMovingConstructor (CXXRecordDecl *Class, unsigned Quals) |
Look up the moving constructor for the given class. More... | |
CXXMethodDecl * | LookupMovingAssignment (CXXRecordDecl *Class, unsigned Quals, bool RValueThis, unsigned ThisQuals) |
Look up the moving assignment operator for the given class. More... | |
CXXDestructorDecl * | LookupDestructor (CXXRecordDecl *Class) |
Look for the destructor of the given class. More... | |
void | ForceDeclarationOfImplicitMembers (CXXRecordDecl *Class) |
Force the declaration of any implicitly-declared members of this class. More... | |
void | makeMergedDefinitionVisible (NamedDecl *ND) |
Make a merged definition of an existing hidden definition ND visible at the specified location. More... | |
template<typename T , typename = std::enable_if_t<std::is_base_of<NamedDecl, T>::value>> | |
bool | ActOnDuplicateODRHashDefinition (T *Duplicate, T *Previous) |
Check ODR hashes for C/ObjC when merging types from modules. More... | |
llvm::DenseSet< Module * > & | getLookupModules () |
Get the set of additional modules that should be checked during name lookup. More... | |
bool | hasVisibleMergedDefinition (const NamedDecl *Def) |
bool | hasMergedDefinitionInCurrentModule (const NamedDecl *Def) |
bool | hasVisibleDefaultArgument (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine if the template parameter D has a visible default argument. More... | |
bool | hasReachableDefaultArgument (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine if the template parameter D has a reachable default argument. More... | |
bool | hasAcceptableDefaultArgument (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules, Sema::AcceptableKind Kind) |
Determine if the template parameter D has a reachable default argument. More... | |
bool | hasVisibleExplicitSpecialization (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine if there is a visible declaration of D that is an explicit specialization declaration for a specialization of a template. More... | |
bool | hasReachableExplicitSpecialization (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine if there is a reachable declaration of D that is an explicit specialization declaration for a specialization of a template. More... | |
bool | hasVisibleMemberSpecialization (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine if there is a visible declaration of D that is a member specialization declaration (as opposed to an instantiated declaration). More... | |
bool | hasReachableMemberSpecialization (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine if there is a reachable declaration of D that is a member specialization declaration (as opposed to an instantiated declaration). More... | |
bool | isModuleVisible (const Module *M, bool ModulePrivate=false) |
bool | hasVisibleDeclaration (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine whether any declaration of an entity is visible. More... | |
bool | hasVisibleDeclarationSlow (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules) |
bool | hasReachableDeclaration (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine whether any declaration of an entity is reachable. More... | |
bool | hasReachableDeclarationSlow (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
void | diagnoseTypo (const TypoCorrection &Correction, const PartialDiagnostic &TypoDiag, bool ErrorRecovery=true) |
void | diagnoseTypo (const TypoCorrection &Correction, const PartialDiagnostic &TypoDiag, const PartialDiagnostic &PrevNote, bool ErrorRecovery=true) |
Diagnose a successfully-corrected typo. More... | |
void | FindAssociatedClassesAndNamespaces (SourceLocation InstantiationLoc, ArrayRef< Expr * > Args, AssociatedNamespaceSet &AssociatedNamespaces, AssociatedClassSet &AssociatedClasses) |
Find the associated classes and namespaces for argument-dependent lookup for a call with the given set of arguments. More... | |
void | DiagnoseAmbiguousLookup (LookupResult &Result) |
Produce a diagnostic describing the ambiguity that resulted from name lookup. More... | |
LiteralOperatorLookupResult | LookupLiteralOperator (Scope *S, LookupResult &R, ArrayRef< QualType > ArgTys, bool AllowRaw, bool AllowTemplate, bool AllowStringTemplate, bool DiagnoseMissing, StringLiteral *StringLit=nullptr) |
LookupLiteralOperator - Determine which literal operator should be used for a user-defined literal, per C++11 [lex.ext]. More... | |
void | ArgumentDependentLookup (DeclarationName Name, SourceLocation Loc, ArrayRef< Expr * > Args, ADLResult &Functions) |
void | LookupVisibleDecls (Scope *S, LookupNameKind Kind, VisibleDeclConsumer &Consumer, bool IncludeGlobalScope=true, bool LoadExternal=true) |
void | LookupVisibleDecls (DeclContext *Ctx, LookupNameKind Kind, VisibleDeclConsumer &Consumer, bool IncludeGlobalScope=true, bool IncludeDependentBases=false, bool LoadExternal=true) |
TypoCorrection | CorrectTypo (const DeclarationNameInfo &Typo, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, CorrectTypoKind Mode, DeclContext *MemberContext=nullptr, bool EnteringContext=false, const ObjCObjectPointerType *OPT=nullptr, bool RecordFailure=true) |
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to the name that was present in the source code. More... | |
TypoExpr * | CorrectTypoDelayed (const DeclarationNameInfo &Typo, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, TypoDiagnosticGenerator TDG, TypoRecoveryCallback TRC, CorrectTypoKind Mode, DeclContext *MemberContext=nullptr, bool EnteringContext=false, const ObjCObjectPointerType *OPT=nullptr) |
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to the name that was present in the source code. More... | |
void | diagnoseMissingImport (SourceLocation Loc, const NamedDecl *Decl, MissingImportKind MIK, bool Recover=true) |
Diagnose that the specified declaration needs to be visible but isn't, and suggest a module import that would resolve the problem. More... | |
void | diagnoseMissingImport (SourceLocation Loc, const NamedDecl *Decl, SourceLocation DeclLoc, ArrayRef< Module * > Modules, MissingImportKind MIK, bool Recover) |
const TypoExprState & | getTypoExprState (TypoExpr *TE) const |
void | clearDelayedTypo (TypoExpr *TE) |
Clears the state of the given TypoExpr. More... | |
void | ActOnPragmaDump (Scope *S, SourceLocation Loc, IdentifierInfo *II) |
Called on #pragma clang __debug dump II. More... | |
void | ActOnPragmaDump (Expr *E) |
Called on #pragma clang __debug dump E. More... | |
Modules | |
Implementations are in SemaModule.cpp | |
enum class | ModuleDeclKind { Interface , Implementation , PartitionInterface , PartitionImplementation } |
enum class | ModuleImportState { FirstDecl , GlobalFragment , ImportAllowed , ImportFinished , PrivateFragmentImportAllowed , PrivateFragmentImportFinished , NotACXX20Module } |
An enumeration to represent the transition of states in parsing module fragments and imports. More... | |
Module * | getCurrentModule () const |
Get the module unit whose scope we are currently within. More... | |
bool | currentModuleIsImplementation () const |
Is the module scope we are an implementation unit? More... | |
void | makeModuleVisible (Module *Mod, SourceLocation ImportLoc) |
DeclGroupPtrTy | ActOnModuleDecl (SourceLocation StartLoc, SourceLocation ModuleLoc, ModuleDeclKind MDK, ModuleIdPath Path, ModuleIdPath Partition, ModuleImportState &ImportState) |
The parser has processed a module-declaration that begins the definition of a module interface or implementation. More... | |
DeclGroupPtrTy | ActOnGlobalModuleFragmentDecl (SourceLocation ModuleLoc) |
The parser has processed a global-module-fragment declaration that begins the definition of the global module fragment of the current module unit. More... | |
DeclGroupPtrTy | ActOnPrivateModuleFragmentDecl (SourceLocation ModuleLoc, SourceLocation PrivateLoc) |
The parser has processed a private-module-fragment declaration that begins the definition of the private module fragment of the current module unit. More... | |
DeclResult | ActOnModuleImport (SourceLocation StartLoc, SourceLocation ExportLoc, SourceLocation ImportLoc, ModuleIdPath Path, bool IsPartition=false) |
The parser has processed a module import declaration. More... | |
DeclResult | ActOnModuleImport (SourceLocation StartLoc, SourceLocation ExportLoc, SourceLocation ImportLoc, Module *M, ModuleIdPath Path={}) |
void | ActOnAnnotModuleInclude (SourceLocation DirectiveLoc, Module *Mod) |
The parser has processed a module import translated from a #include or similar preprocessing directive. More... | |
void | BuildModuleInclude (SourceLocation DirectiveLoc, Module *Mod) |
void | ActOnAnnotModuleBegin (SourceLocation DirectiveLoc, Module *Mod) |
The parsed has entered a submodule. More... | |
void | ActOnAnnotModuleEnd (SourceLocation DirectiveLoc, Module *Mod) |
The parser has left a submodule. More... | |
void | createImplicitModuleImportForErrorRecovery (SourceLocation Loc, Module *Mod) |
Create an implicit import of the given module at the given source location, for error recovery, if possible. More... | |
Decl * | ActOnStartExportDecl (Scope *S, SourceLocation ExportLoc, SourceLocation LBraceLoc) |
We have parsed the start of an export declaration, including the '{' (if present). More... | |
Decl * | ActOnFinishExportDecl (Scope *S, Decl *ExportDecl, SourceLocation RBraceLoc) |
Complete the definition of an export declaration. More... | |
C++ Overloading | |
Implementations are in SemaOverload.cpp | |
enum | OverloadKind { Ovl_Overload , Ovl_Match , Ovl_NonFunction } |
enum class | AllowedExplicit { None , Conversions , All } |
enum | CCEKind { CCEK_CaseValue , CCEK_Enumerator , CCEK_TemplateArg , CCEK_ArrayBound , CCEK_ExplicitBool , CCEK_Noexcept , CCEK_StaticAssertMessageSize , CCEK_StaticAssertMessageData } |
Contexts in which a converted constant expression is required. More... | |
enum | ReferenceCompareResult { Ref_Incompatible = 0 , Ref_Related , Ref_Compatible } |
ReferenceCompareResult - Expresses the result of comparing two types (cv1 T1 and cv2 T2) to determine their compatibility for the purposes of initialization by reference (C++ [dcl.init.ref]p4). More... | |
enum | ForRangeStatus { FRS_Success , FRS_NoViableFunction , FRS_DiagnosticIssued } |
using | ReferenceConversions = ReferenceConversionsScope::ReferenceConversions |
bool | DeferDiags = false |
Whether deferrable diagnostics should be deferred. More... | |
bool | IsBuildingRecoveryCallExpr |
Flag indicating if Sema is building a recovery call expression. More... | |
OverloadKind | CheckOverload (Scope *S, FunctionDecl *New, const LookupResult &OldDecls, NamedDecl *&OldDecl, bool UseMemberUsingDeclRules) |
Determine whether the given New declaration is an overload of the declarations in Old. More... | |
bool | IsOverload (FunctionDecl *New, FunctionDecl *Old, bool UseMemberUsingDeclRules, bool ConsiderCudaAttrs=true) |
bool | IsOverride (FunctionDecl *MD, FunctionDecl *BaseMD, bool UseMemberUsingDeclRules, bool ConsiderCudaAttrs=true) |
ImplicitConversionSequence | TryImplicitConversion (Expr *From, QualType ToType, bool SuppressUserConversions, AllowedExplicit AllowExplicit, bool InOverloadResolution, bool CStyle, bool AllowObjCWritebackConversion) |
ExprResult | PerformImplicitConversion (Expr *From, QualType ToType, AssignmentAction Action, bool AllowExplicit=false) |
PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType. More... | |
bool | IsIntegralPromotion (Expr *From, QualType FromType, QualType ToType) |
IsIntegralPromotion - Determines whether the conversion from the expression From (whose potentially-adjusted type is FromType) to ToType is an integral promotion (C++ 4.5). More... | |
bool | IsFloatingPointPromotion (QualType FromType, QualType ToType) |
IsFloatingPointPromotion - Determines whether the conversion from FromType to ToType is a floating point promotion (C++ 4.6). More... | |
bool | IsComplexPromotion (QualType FromType, QualType ToType) |
Determine if a conversion is a complex promotion. More... | |
bool | IsPointerConversion (Expr *From, QualType FromType, QualType ToType, bool InOverloadResolution, QualType &ConvertedType, bool &IncompatibleObjC) |
IsPointerConversion - Determines whether the conversion of the expression From, which has the (possibly adjusted) type FromType, can be converted to the type ToType via a pointer conversion (C++ 4.10). More... | |
bool | isObjCPointerConversion (QualType FromType, QualType ToType, QualType &ConvertedType, bool &IncompatibleObjC) |
isObjCPointerConversion - Determines whether this is an Objective-C pointer conversion. More... | |
bool | IsBlockPointerConversion (QualType FromType, QualType ToType, QualType &ConvertedType) |
bool | FunctionParamTypesAreEqual (ArrayRef< QualType > Old, ArrayRef< QualType > New, unsigned *ArgPos=nullptr, bool Reversed=false) |
FunctionParamTypesAreEqual - This routine checks two function proto types for equality of their parameter types. More... | |
bool | FunctionParamTypesAreEqual (const FunctionProtoType *OldType, const FunctionProtoType *NewType, unsigned *ArgPos=nullptr, bool Reversed=false) |
bool | FunctionNonObjectParamTypesAreEqual (const FunctionDecl *OldFunction, const FunctionDecl *NewFunction, unsigned *ArgPos=nullptr, bool Reversed=false) |
void | HandleFunctionTypeMismatch (PartialDiagnostic &PDiag, QualType FromType, QualType ToType) |
HandleFunctionTypeMismatch - Gives diagnostic information for differeing function types. More... | |
bool | CheckPointerConversion (Expr *From, QualType ToType, CastKind &Kind, CXXCastPath &BasePath, bool IgnoreBaseAccess, bool Diagnose=true) |
CheckPointerConversion - Check the pointer conversion from the expression From to the type ToType. More... | |
bool | IsMemberPointerConversion (Expr *From, QualType FromType, QualType ToType, bool InOverloadResolution, QualType &ConvertedType) |
IsMemberPointerConversion - Determines whether the conversion of the expression From, which has the (possibly adjusted) type FromType, can be converted to the type ToType via a member pointer conversion (C++ 4.11). More... | |
bool | CheckMemberPointerConversion (Expr *From, QualType ToType, CastKind &Kind, CXXCastPath &BasePath, bool IgnoreBaseAccess) |
CheckMemberPointerConversion - Check the member pointer conversion from the expression From to the type ToType. More... | |
bool | IsQualificationConversion (QualType FromType, QualType ToType, bool CStyle, bool &ObjCLifetimeConversion) |
IsQualificationConversion - Determines whether the conversion from an rvalue of type FromType to ToType is a qualification conversion (C++ 4.4). More... | |
bool | IsFunctionConversion (QualType FromType, QualType ToType, QualType &ResultTy) |
Determine whether the conversion from FromType to ToType is a valid conversion that strips "noexcept" or "noreturn" off the nested function type. More... | |
bool | DiagnoseMultipleUserDefinedConversion (Expr *From, QualType ToType) |
void | DiagnoseUseOfDeletedFunction (SourceLocation Loc, SourceRange Range, DeclarationName Name, OverloadCandidateSet &CandidateSet, FunctionDecl *Fn, MultiExprArg Args, bool IsMember=false) |
ExprResult | InitializeExplicitObjectArgument (Sema &S, Expr *Obj, FunctionDecl *Fun) |
ExprResult | PerformImplicitObjectArgumentInitialization (Expr *From, NestedNameSpecifier *Qualifier, NamedDecl *FoundDecl, CXXMethodDecl *Method) |
PerformObjectArgumentInitialization - Perform initialization of the implicit object parameter for the given Method with the given expression. More... | |
ExprResult | PerformContextuallyConvertToBool (Expr *From) |
PerformContextuallyConvertToBool - Perform a contextual conversion of the expression From to bool (C++0x [conv]p3). More... | |
ExprResult | PerformContextuallyConvertToObjCPointer (Expr *From) |
PerformContextuallyConvertToObjCPointer - Perform a contextual conversion of the expression From to an Objective-C pointer type. More... | |
ExprResult | BuildConvertedConstantExpression (Expr *From, QualType T, CCEKind CCE, NamedDecl *Dest=nullptr) |
ExprResult | CheckConvertedConstantExpression (Expr *From, QualType T, llvm::APSInt &Value, CCEKind CCE) |
ExprResult | CheckConvertedConstantExpression (Expr *From, QualType T, APValue &Value, CCEKind CCE, NamedDecl *Dest=nullptr) |
ExprResult | EvaluateConvertedConstantExpression (Expr *E, QualType T, APValue &Value, CCEKind CCE, bool RequireInt, const APValue &PreNarrowingValue) |
EvaluateConvertedConstantExpression - Evaluate an Expression That is a converted constant expression (which was built with BuildConvertedConstantExpression) More... | |
ExprResult | PerformContextualImplicitConversion (SourceLocation Loc, Expr *FromE, ContextualImplicitConverter &Converter) |
Perform a contextual implicit conversion. More... | |
ReferenceCompareResult | CompareReferenceRelationship (SourceLocation Loc, QualType T1, QualType T2, ReferenceConversions *Conv=nullptr) |
CompareReferenceRelationship - Compare the two types T1 and T2 to determine whether they are reference-compatible, reference-related, or incompatible, for use in C++ initialization by reference (C++ [dcl.ref.init]p4). More... | |
void | AddOverloadCandidate (FunctionDecl *Function, DeclAccessPair FoundDecl, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, bool AllowExplicit=true, bool AllowExplicitConversion=false, ADLCallKind IsADLCandidate=ADLCallKind::NotADL, ConversionSequenceList EarlyConversions=std::nullopt, OverloadCandidateParamOrder PO={}, bool AggregateCandidateDeduction=false) |
AddOverloadCandidate - Adds the given function to the set of candidate functions, using the given function call arguments. More... | |
void | AddFunctionCandidates (const UnresolvedSetImpl &Functions, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr, bool SuppressUserConversions=false, bool PartialOverloading=false, bool FirstArgumentIsBase=false) |
Add all of the function declarations in the given function set to the overload candidate set. More... | |
void | AddMethodCandidate (DeclAccessPair FoundDecl, QualType ObjectType, Expr::Classification ObjectClassification, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversion=false, OverloadCandidateParamOrder PO={}) |
AddMethodCandidate - Adds a named decl (which is some kind of method) as a method candidate to the given overload set. More... | |
void | AddMethodCandidate (CXXMethodDecl *Method, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, QualType ObjectType, Expr::Classification ObjectClassification, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, ConversionSequenceList EarlyConversions=std::nullopt, OverloadCandidateParamOrder PO={}) |
AddMethodCandidate - Adds the given C++ member function to the set of candidate functions, using the given function call arguments and the object argument (Object ). More... | |
void | AddMethodTemplateCandidate (FunctionTemplateDecl *MethodTmpl, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, TemplateArgumentListInfo *ExplicitTemplateArgs, QualType ObjectType, Expr::Classification ObjectClassification, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, OverloadCandidateParamOrder PO={}) |
Add a C++ member function template as a candidate to the candidate set, using template argument deduction to produce an appropriate member function template specialization. More... | |
void | AddTemplateOverloadCandidate (FunctionTemplateDecl *FunctionTemplate, DeclAccessPair FoundDecl, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, bool AllowExplicit=true, ADLCallKind IsADLCandidate=ADLCallKind::NotADL, OverloadCandidateParamOrder PO={}, bool AggregateCandidateDeduction=false) |
Add a C++ function template specialization as a candidate in the candidate set, using template argument deduction to produce an appropriate function template specialization. More... | |
bool | CheckNonDependentConversions (FunctionTemplateDecl *FunctionTemplate, ArrayRef< QualType > ParamTypes, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, ConversionSequenceList &Conversions, bool SuppressUserConversions, CXXRecordDecl *ActingContext=nullptr, QualType ObjectType=QualType(), Expr::Classification ObjectClassification={}, OverloadCandidateParamOrder PO={}) |
Check that implicit conversion sequences can be formed for each argument whose corresponding parameter has a non-dependent type, per DR1391's [temp.deduct.call]p10. More... | |
void | AddConversionCandidate (CXXConversionDecl *Conversion, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, Expr *From, QualType ToType, OverloadCandidateSet &CandidateSet, bool AllowObjCConversionOnExplicit, bool AllowExplicit, bool AllowResultConversion=true) |
AddConversionCandidate - Add a C++ conversion function as a candidate in the candidate set (C++ [over.match.conv], C++ [over.match.copy]). More... | |
void | AddTemplateConversionCandidate (FunctionTemplateDecl *FunctionTemplate, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, Expr *From, QualType ToType, OverloadCandidateSet &CandidateSet, bool AllowObjCConversionOnExplicit, bool AllowExplicit, bool AllowResultConversion=true) |
Adds a conversion function template specialization candidate to the overload set, using template argument deduction to deduce the template arguments of the conversion function template from the type that we are converting to (C++ [temp.deduct.conv]). More... | |
void | AddSurrogateCandidate (CXXConversionDecl *Conversion, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, const FunctionProtoType *Proto, Expr *Object, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet) |
AddSurrogateCandidate - Adds a "surrogate" candidate function that converts the given Object to a function pointer via the conversion function Conversion , and then attempts to call it with the given arguments (C++ [over.call.object]p2-4). More... | |
void | AddNonMemberOperatorCandidates (const UnresolvedSetImpl &Functions, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr) |
Add all of the non-member operator function declarations in the given function set to the overload candidate set. More... | |
void | AddMemberOperatorCandidates (OverloadedOperatorKind Op, SourceLocation OpLoc, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, OverloadCandidateParamOrder PO={}) |
Add overload candidates for overloaded operators that are member functions. More... | |
void | AddBuiltinCandidate (QualType *ParamTys, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool IsAssignmentOperator=false, unsigned NumContextualBoolArguments=0) |
AddBuiltinCandidate - Add a candidate for a built-in operator. More... | |
void | AddBuiltinOperatorCandidates (OverloadedOperatorKind Op, SourceLocation OpLoc, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet) |
AddBuiltinOperatorCandidates - Add the appropriate built-in operator overloads to the candidate set (C++ [over.built]), based on the operator Op and the arguments given. More... | |
void | AddArgumentDependentLookupCandidates (DeclarationName Name, SourceLocation Loc, ArrayRef< Expr * > Args, TemplateArgumentListInfo *ExplicitTemplateArgs, OverloadCandidateSet &CandidateSet, bool PartialOverloading=false) |
Add function candidates found via argument-dependent lookup to the set of overloading candidates. More... | |
EnableIfAttr * | CheckEnableIf (FunctionDecl *Function, SourceLocation CallLoc, ArrayRef< Expr * > Args, bool MissingImplicitThis=false) |
Check the enable_if expressions on the given function. More... | |
bool | diagnoseArgDependentDiagnoseIfAttrs (const FunctionDecl *Function, const Expr *ThisArg, ArrayRef< const Expr * > Args, SourceLocation Loc) |
Emit diagnostics for the diagnose_if attributes on Function, ignoring any non-ArgDependent DiagnoseIfAttrs. More... | |
bool | diagnoseArgIndependentDiagnoseIfAttrs (const NamedDecl *ND, SourceLocation Loc) |
Emit diagnostics for the diagnose_if attributes on Function, ignoring any ArgDependent DiagnoseIfAttrs. More... | |
bool | isEquivalentInternalLinkageDeclaration (const NamedDecl *A, const NamedDecl *B) |
Determine if A and B are equivalent internal linkage declarations from different modules, and thus an ambiguity error can be downgraded to an extension warning. More... | |
void | diagnoseEquivalentInternalLinkageDeclarations (SourceLocation Loc, const NamedDecl *D, ArrayRef< const NamedDecl * > Equiv) |
void | NoteOverloadCandidate (const NamedDecl *Found, const FunctionDecl *Fn, OverloadCandidateRewriteKind RewriteKind=OverloadCandidateRewriteKind(), QualType DestType=QualType(), bool TakingAddress=false) |
void | NoteAllOverloadCandidates (Expr *E, QualType DestType=QualType(), bool TakingAddress=false) |
bool | checkAddressOfFunctionIsAvailable (const FunctionDecl *Function, bool Complain=false, SourceLocation Loc=SourceLocation()) |
Returns whether the given function's address can be taken or not, optionally emitting a diagnostic if the address can't be taken. More... | |
QualType | ExtractUnqualifiedFunctionType (QualType PossiblyAFunctionType) |
FunctionDecl * | ResolveAddressOfOverloadedFunction (Expr *AddressOfExpr, QualType TargetType, bool Complain, DeclAccessPair &Found, bool *pHadMultipleCandidates=nullptr) |
ResolveAddressOfOverloadedFunction - Try to resolve the address of an overloaded function (C++ [over.over]), where From is an expression with overloaded function type and ToType is the type we're trying to resolve to. More... | |
FunctionDecl * | resolveAddressOfSingleOverloadCandidate (Expr *E, DeclAccessPair &FoundResult) |
Given an expression that refers to an overloaded function, try to resolve that function to a single function that can have its address taken. More... | |
bool | resolveAndFixAddressOfSingleOverloadCandidate (ExprResult &SrcExpr, bool DoFunctionPointerConversion=false) |
Given an overloaded function, tries to turn it into a non-overloaded function reference using resolveAddressOfSingleOverloadCandidate. More... | |
FunctionDecl * | ResolveSingleFunctionTemplateSpecialization (OverloadExpr *ovl, bool Complain=false, DeclAccessPair *Found=nullptr, TemplateSpecCandidateSet *FailedTSC=nullptr) |
Given an expression that refers to an overloaded function, try to resolve that overloaded function expression down to a single function. More... | |
bool | ResolveAndFixSingleFunctionTemplateSpecialization (ExprResult &SrcExpr, bool DoFunctionPointerConversion=false, bool Complain=false, SourceRange OpRangeForComplaining=SourceRange(), QualType DestTypeForComplaining=QualType(), unsigned DiagIDForComplaining=0) |
void | AddOverloadedCallCandidates (UnresolvedLookupExpr *ULE, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool PartialOverloading=false) |
Add the overload candidates named by callee and/or found by argument dependent lookup to the given overload set. More... | |
void | AddOverloadedCallCandidates (LookupResult &R, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet) |
Add the call candidates from the given set of lookup results to the given overload set. More... | |
ForRangeStatus | BuildForRangeBeginEndCall (SourceLocation Loc, SourceLocation RangeLoc, const DeclarationNameInfo &NameInfo, LookupResult &MemberLookup, OverloadCandidateSet *CandidateSet, Expr *Range, ExprResult *CallExpr) |
Build a call to 'begin' or 'end' for a C++11 for-range statement. More... | |
ExprResult | BuildOverloadedCallExpr (Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc, Expr *ExecConfig, bool AllowTypoCorrection=true, bool CalleesAddressIsTaken=false) |
BuildOverloadedCallExpr - Given the call expression that calls Fn (which eventually refers to the declaration Func) and the call arguments Args/NumArgs, attempt to resolve the function call down to a specific function. More... | |
bool | buildOverloadedCallSet (Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE, MultiExprArg Args, SourceLocation RParenLoc, OverloadCandidateSet *CandidateSet, ExprResult *Result) |
Constructs and populates an OverloadedCandidateSet from the given function. More... | |
ExprResult | CreateUnresolvedLookupExpr (CXXRecordDecl *NamingClass, NestedNameSpecifierLoc NNSLoc, DeclarationNameInfo DNI, const UnresolvedSetImpl &Fns, bool PerformADL=true) |
ExprResult | CreateOverloadedUnaryOp (SourceLocation OpLoc, UnaryOperatorKind Opc, const UnresolvedSetImpl &Fns, Expr *input, bool RequiresADL=true) |
Create a unary operation that may resolve to an overloaded operator. More... | |
void | LookupOverloadedBinOp (OverloadCandidateSet &CandidateSet, OverloadedOperatorKind Op, const UnresolvedSetImpl &Fns, ArrayRef< Expr * > Args, bool RequiresADL=true) |
Perform lookup for an overloaded binary operator. More... | |
ExprResult | CreateOverloadedBinOp (SourceLocation OpLoc, BinaryOperatorKind Opc, const UnresolvedSetImpl &Fns, Expr *LHS, Expr *RHS, bool RequiresADL=true, bool AllowRewrittenCandidates=true, FunctionDecl *DefaultedFn=nullptr) |
Create a binary operation that may resolve to an overloaded operator. More... | |
ExprResult | BuildSynthesizedThreeWayComparison (SourceLocation OpLoc, const UnresolvedSetImpl &Fns, Expr *LHS, Expr *RHS, FunctionDecl *DefaultedFn) |
ExprResult | CreateOverloadedArraySubscriptExpr (SourceLocation LLoc, SourceLocation RLoc, Expr *Base, MultiExprArg Args) |
ExprResult | BuildCallToMemberFunction (Scope *S, Expr *MemExpr, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc, Expr *ExecConfig=nullptr, bool IsExecConfig=false, bool AllowRecovery=false) |
BuildCallToMemberFunction - Build a call to a member function. More... | |
ExprResult | BuildCallToObjectOfClassType (Scope *S, Expr *Object, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc) |
BuildCallToObjectOfClassType - Build a call to an object of class type (C++ [over.call.object]), which can end up invoking an overloaded function call operator (operator() ) or performing a user-defined conversion on the object argument. More... | |
ExprResult | BuildOverloadedArrowExpr (Scope *S, Expr *Base, SourceLocation OpLoc, bool *NoArrowOperatorFound=nullptr) |
BuildOverloadedArrowExpr - Build a call to an overloaded operator-> (if one exists), where Base is an expression of class type and Member is the name of the member we're trying to find. More... | |
ExprResult | BuildCXXMemberCallExpr (Expr *Exp, NamedDecl *FoundDecl, CXXConversionDecl *Method, bool HadMultipleCandidates) |
ExprResult | BuildLiteralOperatorCall (LookupResult &R, DeclarationNameInfo &SuffixInfo, ArrayRef< Expr * > Args, SourceLocation LitEndLoc, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr) |
BuildLiteralOperatorCall - Build a UserDefinedLiteral by creating a call to a literal operator described by the provided lookup results. More... | |
ExprResult | FixOverloadedFunctionReference (Expr *E, DeclAccessPair FoundDecl, FunctionDecl *Fn) |
FixOverloadedFunctionReference - E is an expression that refers to a C++ overloaded function (possibly with some parentheses and perhaps a '&' around it). More... | |
ExprResult | FixOverloadedFunctionReference (ExprResult, DeclAccessPair FoundDecl, FunctionDecl *Fn) |
ObjCMethodDecl * | SelectBestMethod (Selector Sel, MultiExprArg Args, bool IsInstance, SmallVectorImpl< ObjCMethodDecl * > &Methods) |
Statements | |
Implementations are in SemaStmt.cpp | |
enum | BuildForRangeKind { BFRK_Build , BFRK_Rebuild , BFRK_Check } |
enum class | SimplerImplicitMoveMode { ForceOff , Normal , ForceOn } |
typedef std::pair< StringRef, QualType > | CapturedParamNameType |
SmallVector< Scope *, 2 > | CurrentSEHFinally |
Stack of active SEH __finally scopes. Can be empty. More... | |
StmtResult | ActOnExprStmt (ExprResult Arg, bool DiscardedValue=true) |
StmtResult | ActOnExprStmtError () |
StmtResult | ActOnNullStmt (SourceLocation SemiLoc, bool HasLeadingEmptyMacro=false) |
StmtResult | ActOnDeclStmt (DeclGroupPtrTy Decl, SourceLocation StartLoc, SourceLocation EndLoc) |
void | ActOnForEachDeclStmt (DeclGroupPtrTy Decl) |
void | DiagnoseUnusedExprResult (const Stmt *S, unsigned DiagID) |
DiagnoseUnusedExprResult - If the statement passed in is an expression whose result is unused, warn. More... | |
void | ActOnStartOfCompoundStmt (bool IsStmtExpr) |
void | ActOnAfterCompoundStatementLeadingPragmas () |
void | ActOnFinishOfCompoundStmt () |
StmtResult | ActOnCompoundStmt (SourceLocation L, SourceLocation R, ArrayRef< Stmt * > Elts, bool isStmtExpr) |
sema::CompoundScopeInfo & | getCurCompoundScope () const |
ExprResult | ActOnCaseExpr (SourceLocation CaseLoc, ExprResult Val) |
StmtResult | ActOnCaseStmt (SourceLocation CaseLoc, ExprResult LHS, SourceLocation DotDotDotLoc, ExprResult RHS, SourceLocation ColonLoc) |
void | ActOnCaseStmtBody (Stmt *CaseStmt, Stmt *SubStmt) |
ActOnCaseStmtBody - This installs a statement as the body of a case. More... | |
StmtResult | ActOnDefaultStmt (SourceLocation DefaultLoc, SourceLocation ColonLoc, Stmt *SubStmt, Scope *CurScope) |
StmtResult | ActOnLabelStmt (SourceLocation IdentLoc, LabelDecl *TheDecl, SourceLocation ColonLoc, Stmt *SubStmt) |
StmtResult | BuildAttributedStmt (SourceLocation AttrsLoc, ArrayRef< const Attr * > Attrs, Stmt *SubStmt) |
StmtResult | ActOnAttributedStmt (const ParsedAttributes &AttrList, Stmt *SubStmt) |
bool | checkAndRewriteMustTailAttr (Stmt *St, const Attr &MTA) |
Check whether the given statement can have musttail applied to it, issuing a diagnostic and returning false if not. More... | |
StmtResult | ActOnIfStmt (SourceLocation IfLoc, IfStatementKind StatementKind, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc, Stmt *ThenVal, SourceLocation ElseLoc, Stmt *ElseVal) |
StmtResult | BuildIfStmt (SourceLocation IfLoc, IfStatementKind StatementKind, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc, Stmt *ThenVal, SourceLocation ElseLoc, Stmt *ElseVal) |
ExprResult | CheckSwitchCondition (SourceLocation SwitchLoc, Expr *Cond) |
StmtResult | ActOnStartOfSwitchStmt (SourceLocation SwitchLoc, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc) |
StmtResult | ActOnFinishSwitchStmt (SourceLocation SwitchLoc, Stmt *Switch, Stmt *Body) |
void | DiagnoseAssignmentEnum (QualType DstType, QualType SrcType, Expr *SrcExpr) |
DiagnoseAssignmentEnum - Warn if assignment to enum is a constant integer not in the range of enum values. More... | |
StmtResult | ActOnWhileStmt (SourceLocation WhileLoc, SourceLocation LParenLoc, ConditionResult Cond, SourceLocation RParenLoc, Stmt *Body) |
StmtResult | ActOnDoStmt (SourceLocation DoLoc, Stmt *Body, SourceLocation WhileLoc, SourceLocation CondLParen, Expr *Cond, SourceLocation CondRParen) |
StmtResult | ActOnForStmt (SourceLocation ForLoc, SourceLocation LParenLoc, Stmt *First, ConditionResult Second, FullExprArg Third, SourceLocation RParenLoc, Stmt *Body) |
StmtResult | ActOnForEachLValueExpr (Expr *E) |
In an Objective C collection iteration statement: for (x in y) x can be an arbitrary l-value expression. More... | |
StmtResult | ActOnCXXForRangeStmt (Scope *S, SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *InitStmt, Stmt *LoopVar, SourceLocation ColonLoc, Expr *Collection, SourceLocation RParenLoc, BuildForRangeKind Kind, ArrayRef< MaterializeTemporaryExpr * > LifetimeExtendTemps={}) |
ActOnCXXForRangeStmt - Check and build a C++11 for-range statement. More... | |
StmtResult | BuildCXXForRangeStmt (SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *InitStmt, SourceLocation ColonLoc, Stmt *RangeDecl, Stmt *Begin, Stmt *End, Expr *Cond, Expr *Inc, Stmt *LoopVarDecl, SourceLocation RParenLoc, BuildForRangeKind Kind, ArrayRef< MaterializeTemporaryExpr * > LifetimeExtendTemps={}) |
BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement. More... | |
StmtResult | FinishCXXForRangeStmt (Stmt *ForRange, Stmt *Body) |
FinishCXXForRangeStmt - Attach the body to a C++0x for-range statement. More... | |
StmtResult | ActOnGotoStmt (SourceLocation GotoLoc, SourceLocation LabelLoc, LabelDecl *TheDecl) |
StmtResult | ActOnIndirectGotoStmt (SourceLocation GotoLoc, SourceLocation StarLoc, Expr *DestExp) |
StmtResult | ActOnContinueStmt (SourceLocation ContinueLoc, Scope *CurScope) |
StmtResult | ActOnBreakStmt (SourceLocation BreakLoc, Scope *CurScope) |
NamedReturnInfo | getNamedReturnInfo (Expr *&E, SimplerImplicitMoveMode Mode=SimplerImplicitMoveMode::Normal) |
Determine whether the given expression might be move-eligible or copy-elidable in either a (co_)return statement or throw expression, without considering function return type, if applicable. More... | |
NamedReturnInfo | getNamedReturnInfo (const VarDecl *VD) |
Determine whether the given NRVO candidate variable is move-eligible or copy-elidable, without considering function return type. More... | |
const VarDecl * | getCopyElisionCandidate (NamedReturnInfo &Info, QualType ReturnType) |
Updates given NamedReturnInfo's move-eligible and copy-elidable statuses, considering the function return type criteria as applicable to return statements. More... | |
ExprResult | PerformMoveOrCopyInitialization (const InitializedEntity &Entity, const NamedReturnInfo &NRInfo, Expr *Value, bool SupressSimplerImplicitMoves=false) |
Perform the initialization of a potentially-movable value, which is the result of return value. More... | |
TypeLoc | getReturnTypeLoc (FunctionDecl *FD) const |
bool | DeduceFunctionTypeFromReturnExpr (FunctionDecl *FD, SourceLocation ReturnLoc, Expr *RetExpr, const AutoType *AT) |
Deduce the return type for a function from a returned expression, per C++1y [dcl.spec.auto]p6. More... | |
StmtResult | ActOnReturnStmt (SourceLocation ReturnLoc, Expr *RetValExp, Scope *CurScope) |
StmtResult | BuildReturnStmt (SourceLocation ReturnLoc, Expr *RetValExp, bool AllowRecovery=false) |
StmtResult | ActOnCapScopeReturnStmt (SourceLocation ReturnLoc, Expr *RetValExp, NamedReturnInfo &NRInfo, bool SupressSimplerImplicitMoves) |
ActOnCapScopeReturnStmt - Utility routine to type-check return statements for capturing scopes. More... | |
StmtResult | ActOnCXXCatchBlock (SourceLocation CatchLoc, Decl *ExDecl, Stmt *HandlerBlock) |
ActOnCXXCatchBlock - Takes an exception declaration and a handler block and creates a proper catch handler from them. More... | |
StmtResult | ActOnCXXTryBlock (SourceLocation TryLoc, Stmt *TryBlock, ArrayRef< Stmt * > Handlers) |
ActOnCXXTryBlock - Takes a try compound-statement and a number of handlers and creates a try statement from them. More... | |
StmtResult | ActOnSEHTryBlock (bool IsCXXTry, SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler) |
StmtResult | ActOnSEHExceptBlock (SourceLocation Loc, Expr *FilterExpr, Stmt *Block) |
void | ActOnStartSEHFinallyBlock () |
void | ActOnAbortSEHFinallyBlock () |
StmtResult | ActOnFinishSEHFinallyBlock (SourceLocation Loc, Stmt *Block) |
StmtResult | ActOnSEHLeaveStmt (SourceLocation Loc, Scope *CurScope) |
StmtResult | BuildMSDependentExistsStmt (SourceLocation KeywordLoc, bool IsIfExists, NestedNameSpecifierLoc QualifierLoc, DeclarationNameInfo NameInfo, Stmt *Nested) |
StmtResult | ActOnMSDependentExistsStmt (SourceLocation KeywordLoc, bool IsIfExists, CXXScopeSpec &SS, UnqualifiedId &Name, Stmt *Nested) |
void | ActOnCapturedRegionStart (SourceLocation Loc, Scope *CurScope, CapturedRegionKind Kind, unsigned NumParams) |
void | ActOnCapturedRegionStart (SourceLocation Loc, Scope *CurScope, CapturedRegionKind Kind, ArrayRef< CapturedParamNameType > Params, unsigned OpenMPCaptureLevel=0) |
StmtResult | ActOnCapturedRegionEnd (Stmt *S) |
void | ActOnCapturedRegionError () |
RecordDecl * | CreateCapturedStmtRecordDecl (CapturedDecl *&CD, SourceLocation Loc, unsigned NumParams) |
C++ Templates | |
Implementations are in SemaTemplate.cpp | |
enum | TemplateNameIsRequiredTag { TemplateNameIsRequired } |
enum class | AssumedTemplateKind { None , FoundNothing , FoundFunctions } |
enum | TemplateParamListContext { TPC_ClassTemplate , TPC_VarTemplate , TPC_FunctionTemplate , TPC_ClassTemplateMember , TPC_FriendClassTemplate , TPC_FriendFunctionTemplate , TPC_FriendFunctionTemplateDefinition , TPC_TypeAliasTemplate } |
The context in which we are checking a template parameter list. More... | |
enum | CheckTemplateArgumentKind { CTAK_Specified , CTAK_Deduced , CTAK_DeducedFromArrayBound } |
Specifies the context in which a particular template argument is being checked. More... | |
enum | TemplateParameterListEqualKind { TPL_TemplateMatch , TPL_TemplateTemplateParmMatch , TPL_TemplateTemplateArgumentMatch , TPL_TemplateParamsEquivalent } |
Enumeration describing how template parameter lists are compared for equality. More... | |
typedef llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > | LateParsedTemplateMapT |
unsigned | NumSFINAEErrors |
The number of SFINAE diagnostics that have been trapped. More... | |
LateParsedTemplateMapT | LateParsedTemplateMap |
void | resetFPOptions (FPOptions FPO) |
ArrayRef< InventedTemplateParameterInfo > | getInventedParameterInfos () const |
ArrayRef< sema::FunctionScopeInfo * > | getFunctionScopes () const |
unsigned | getTemplateDepth (Scope *S) const |
Determine the number of levels of enclosing template parameters. More... | |
void | FilterAcceptableTemplateNames (LookupResult &R, bool AllowFunctionTemplates=true, bool AllowDependent=true) |
bool | hasAnyAcceptableTemplateNames (LookupResult &R, bool AllowFunctionTemplates=true, bool AllowDependent=true, bool AllowNonTemplateFunctions=false) |
bool | LookupTemplateName (LookupResult &R, Scope *S, CXXScopeSpec &SS, QualType ObjectType, bool EnteringContext, RequiredTemplateKind RequiredTemplate=SourceLocation(), AssumedTemplateKind *ATK=nullptr, bool AllowTypoCorrection=true) |
TemplateNameKind | isTemplateName (Scope *S, CXXScopeSpec &SS, bool hasTemplateKeyword, const UnqualifiedId &Name, ParsedType ObjectType, bool EnteringContext, TemplateTy &Template, bool &MemberOfUnknownSpecialization, bool Disambiguation=false) |
void | ActOnUndeclaredTypeTemplateName (Scope *S, TemplateTy &Name, TemplateNameKind &TNK, SourceLocation NameLoc, IdentifierInfo *&II) |
Try to resolve an undeclared template name as a type template. More... | |
bool | resolveAssumedTemplateNameAsType (Scope *S, TemplateName &Name, SourceLocation NameLoc, bool Diagnose=true) |
bool | isDeductionGuideName (Scope *S, const IdentifierInfo &Name, SourceLocation NameLoc, CXXScopeSpec &SS, ParsedTemplateTy *Template=nullptr) |
Determine whether a particular identifier might be the name in a C++1z deduction-guide declaration. More... | |
bool | DiagnoseUnknownTemplateName (const IdentifierInfo &II, SourceLocation IILoc, Scope *S, const CXXScopeSpec *SS, TemplateTy &SuggestedTemplate, TemplateNameKind &SuggestedKind) |
bool | DiagnoseUninstantiableTemplate (SourceLocation PointOfInstantiation, NamedDecl *Instantiation, bool InstantiatedFromMember, const NamedDecl *Pattern, const NamedDecl *PatternDef, TemplateSpecializationKind TSK, bool Complain=true) |
Determine whether we would be unable to instantiate this template (because it either has no definition, or is in the process of being instantiated). More... | |
void | DiagnoseTemplateParameterShadow (SourceLocation Loc, Decl *PrevDecl, bool SupportedForCompatibility=false) |
DiagnoseTemplateParameterShadow - Produce a diagnostic complaining that the template parameter 'PrevDecl' is being shadowed by a new declaration at location Loc. More... | |
TemplateDecl * | AdjustDeclIfTemplate (Decl *&Decl) |
AdjustDeclIfTemplate - If the given decl happens to be a template, reset the parameter D to reference the templated declaration and return a pointer to the template declaration. More... | |
NamedDecl * | ActOnTypeParameter (Scope *S, bool Typename, SourceLocation EllipsisLoc, SourceLocation KeyLoc, IdentifierInfo *ParamName, SourceLocation ParamNameLoc, unsigned Depth, unsigned Position, SourceLocation EqualLoc, ParsedType DefaultArg, bool HasTypeConstraint) |
ActOnTypeParameter - Called when a C++ template type parameter (e.g., "typename T") has been parsed. More... | |
bool | CheckTypeConstraint (TemplateIdAnnotation *TypeConstraint) |
bool | ActOnTypeConstraint (const CXXScopeSpec &SS, TemplateIdAnnotation *TypeConstraint, TemplateTypeParmDecl *ConstrainedParameter, SourceLocation EllipsisLoc) |
bool | BuildTypeConstraint (const CXXScopeSpec &SS, TemplateIdAnnotation *TypeConstraint, TemplateTypeParmDecl *ConstrainedParameter, SourceLocation EllipsisLoc, bool AllowUnexpandedPack) |
bool | AttachTypeConstraint (NestedNameSpecifierLoc NS, DeclarationNameInfo NameInfo, ConceptDecl *NamedConcept, NamedDecl *FoundDecl, const TemplateArgumentListInfo *TemplateArgs, TemplateTypeParmDecl *ConstrainedParameter, SourceLocation EllipsisLoc) |
Attach a type-constraint to a template parameter. More... | |
bool | AttachTypeConstraint (AutoTypeLoc TL, NonTypeTemplateParmDecl *NewConstrainedParm, NonTypeTemplateParmDecl *OrigConstrainedParm, SourceLocation EllipsisLoc) |
bool | RequireStructuralType (QualType T, SourceLocation Loc) |
Require the given type to be a structural type, and diagnose if it is not. More... | |
QualType | CheckNonTypeTemplateParameterType (TypeSourceInfo *&TSI, SourceLocation Loc) |
Check that the type of a non-type template parameter is well-formed. More... | |
QualType | CheckNonTypeTemplateParameterType (QualType T, SourceLocation Loc) |
NamedDecl * | ActOnNonTypeTemplateParameter (Scope *S, Declarator &D, unsigned Depth, unsigned Position, SourceLocation EqualLoc, Expr *DefaultArg) |
NamedDecl * | ActOnTemplateTemplateParameter (Scope *S, SourceLocation TmpLoc, TemplateParameterList *Params, bool Typename, SourceLocation EllipsisLoc, IdentifierInfo *ParamName, SourceLocation ParamNameLoc, unsigned Depth, unsigned Position, SourceLocation EqualLoc, ParsedTemplateArgument DefaultArg) |
ActOnTemplateTemplateParameter - Called when a C++ template template parameter (e.g. More... | |
TemplateParameterList * | ActOnTemplateParameterList (unsigned Depth, SourceLocation ExportLoc, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef< NamedDecl * > Params, SourceLocation RAngleLoc, Expr *RequiresClause) |
ActOnTemplateParameterList - Builds a TemplateParameterList, optionally constrained by RequiresClause, that contains the template parameters in Params. More... | |
bool | CheckTemplateParameterList (TemplateParameterList *NewParams, TemplateParameterList *OldParams, TemplateParamListContext TPC, SkipBodyInfo *SkipBody=nullptr) |
Checks the validity of a template parameter list, possibly considering the template parameter list from a previous declaration. More... | |
TemplateParameterList * | MatchTemplateParametersToScopeSpecifier (SourceLocation DeclStartLoc, SourceLocation DeclLoc, const CXXScopeSpec &SS, TemplateIdAnnotation *TemplateId, ArrayRef< TemplateParameterList * > ParamLists, bool IsFriend, bool &IsMemberSpecialization, bool &Invalid, bool SuppressDiagnostic=false) |
Match the given template parameter lists to the given scope specifier, returning the template parameter list that applies to the name. More... | |
DeclResult | CheckClassTemplate (Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr, TemplateParameterList *TemplateParams, AccessSpecifier AS, SourceLocation ModulePrivateLoc, SourceLocation FriendLoc, unsigned NumOuterTemplateParamLists, TemplateParameterList **OuterTemplateParamLists, SkipBodyInfo *SkipBody=nullptr) |
void | translateTemplateArguments (const ASTTemplateArgsPtr &In, TemplateArgumentListInfo &Out) |
Translates template arguments as provided by the parser into template arguments used by semantic analysis. More... | |
ParsedTemplateArgument | ActOnTemplateTypeArgument (TypeResult ParsedType) |
Convert a parsed type into a parsed template argument. More... | |
void | NoteAllFoundTemplates (TemplateName Name) |
QualType | CheckTemplateIdType (TemplateName Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs) |
TypeResult | ActOnTemplateIdType (Scope *S, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, TemplateTy Template, const IdentifierInfo *TemplateII, SourceLocation TemplateIILoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc, bool IsCtorOrDtorName=false, bool IsClassName=false, ImplicitTypenameContext AllowImplicitTypename=ImplicitTypenameContext::No) |
TypeResult | ActOnTagTemplateIdType (TagUseKind TUK, TypeSpecifierType TagSpec, SourceLocation TagLoc, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, TemplateTy TemplateD, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgsIn, SourceLocation RAngleLoc) |
Parsed an elaborated-type-specifier that refers to a template-id, such as class T::template apply. More... | |
DeclResult | ActOnVarTemplateSpecialization (Scope *S, Declarator &D, TypeSourceInfo *DI, LookupResult &Previous, SourceLocation TemplateKWLoc, TemplateParameterList *TemplateParams, StorageClass SC, bool IsPartialSpecialization) |
DeclResult | CheckVarTemplateId (VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, const TemplateArgumentListInfo &TemplateArgs) |
Get the specialization of the given variable template corresponding to the specified argument list, or a null-but-valid result if the arguments are dependent. More... | |
ExprResult | CheckVarTemplateId (const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, VarTemplateDecl *Template, NamedDecl *FoundD, SourceLocation TemplateLoc, const TemplateArgumentListInfo *TemplateArgs) |
Form a reference to the specialization of the given variable template corresponding to the specified argument list, or a null-but-valid result if the arguments are dependent. More... | |
ExprResult | CheckConceptTemplateId (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const TemplateArgumentListInfo *TemplateArgs) |
void | diagnoseMissingTemplateArguments (TemplateName Name, SourceLocation Loc) |
ExprResult | BuildTemplateIdExpr (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, bool RequiresADL, const TemplateArgumentListInfo *TemplateArgs) |
ExprResult | BuildQualifiedTemplateIdExpr (CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, bool IsAddressOfOperand) |
TemplateNameKind | ActOnTemplateName (Scope *S, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const UnqualifiedId &Name, ParsedType ObjectType, bool EnteringContext, TemplateTy &Template, bool AllowInjectedClassName=false) |
Form a template name from a name that is syntactically required to name a template, either due to use of the 'template' keyword or because a name in this syntactic context is assumed to name a template (C++ [temp.names]p2-4). More... | |
DeclResult | ActOnClassTemplateSpecialization (Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, SourceLocation ModulePrivateLoc, CXXScopeSpec &SS, TemplateIdAnnotation &TemplateId, const ParsedAttributesView &Attr, MultiTemplateParamsArg TemplateParameterLists, SkipBodyInfo *SkipBody=nullptr) |
bool | CheckTemplatePartialSpecializationArgs (SourceLocation Loc, TemplateDecl *PrimaryTemplate, unsigned NumExplicitArgs, ArrayRef< TemplateArgument > Args) |
Check the non-type template arguments of a class template partial specialization according to C++ [temp.class.spec]p9. More... | |
void | CheckTemplatePartialSpecialization (ClassTemplatePartialSpecializationDecl *Partial) |
void | CheckTemplatePartialSpecialization (VarTemplatePartialSpecializationDecl *Partial) |
Decl * | ActOnTemplateDeclarator (Scope *S, MultiTemplateParamsArg TemplateParameterLists, Declarator &D) |
bool | CheckSpecializationInstantiationRedecl (SourceLocation NewLoc, TemplateSpecializationKind ActOnExplicitInstantiationNewTSK, NamedDecl *PrevDecl, TemplateSpecializationKind PrevTSK, SourceLocation PrevPtOfInstantiation, bool &SuppressNew) |
Diagnose cases where we have an explicit template specialization before/after an explicit template instantiation, producing diagnostics for those cases where they are required and determining whether the new specialization/instantiation will have any effect. More... | |
bool | CheckDependentFunctionTemplateSpecialization (FunctionDecl *FD, const TemplateArgumentListInfo *ExplicitTemplateArgs, LookupResult &Previous) |
Perform semantic analysis for the given dependent function template specialization. More... | |
bool | CheckFunctionTemplateSpecialization (FunctionDecl *FD, TemplateArgumentListInfo *ExplicitTemplateArgs, LookupResult &Previous, bool QualifiedFriend=false) |
Perform semantic analysis for the given function template specialization. More... | |
bool | CheckMemberSpecialization (NamedDecl *Member, LookupResult &Previous) |
Perform semantic analysis for the given non-template member specialization. More... | |
void | CompleteMemberSpecialization (NamedDecl *Member, LookupResult &Previous) |
DeclResult | ActOnExplicitInstantiation (Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, unsigned TagSpec, SourceLocation KWLoc, const CXXScopeSpec &SS, TemplateTy Template, SourceLocation TemplateNameLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc, const ParsedAttributesView &Attr) |
DeclResult | ActOnExplicitInstantiation (Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, unsigned TagSpec, SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr) |
DeclResult | ActOnExplicitInstantiation (Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, Declarator &D) |
TemplateArgumentLoc | SubstDefaultTemplateArgumentIfAvailable (TemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation RAngleLoc, Decl *Param, ArrayRef< TemplateArgument > SugaredConverted, ArrayRef< TemplateArgument > CanonicalConverted, bool &HasDefaultArg) |
If the given template parameter has a default template argument, substitute into that default template argument and return the corresponding template argument. More... | |
SourceLocation | getTopMostPointOfInstantiation (const NamedDecl *) const |
Returns the top most location responsible for the definition of N . More... | |
bool | CheckTemplateArgument (NamedDecl *Param, TemplateArgumentLoc &Arg, NamedDecl *Template, SourceLocation TemplateLoc, SourceLocation RAngleLoc, unsigned ArgumentPackIndex, SmallVectorImpl< TemplateArgument > &SugaredConverted, SmallVectorImpl< TemplateArgument > &CanonicalConverted, CheckTemplateArgumentKind CTAK) |
Check that the given template argument corresponds to the given template parameter. More... | |
bool | CheckTemplateArgumentList (TemplateDecl *Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs, bool PartialTemplateArgs, SmallVectorImpl< TemplateArgument > &SugaredConverted, SmallVectorImpl< TemplateArgument > &CanonicalConverted, bool UpdateArgsWithConversions=true, bool *ConstraintsNotSatisfied=nullptr, bool PartialOrderingTTP=false) |
Check that the given template arguments can be provided to the given template, converting the arguments along the way. More... | |
bool | CheckTemplateTypeArgument (TemplateTypeParmDecl *Param, TemplateArgumentLoc &Arg, SmallVectorImpl< TemplateArgument > &SugaredConverted, SmallVectorImpl< TemplateArgument > &CanonicalConverted) |
bool | CheckTemplateArgument (TypeSourceInfo *Arg) |
Check a template argument against its corresponding template type parameter. More... | |
ExprResult | CheckTemplateArgument (NonTypeTemplateParmDecl *Param, QualType InstantiatedParamType, Expr *Arg, TemplateArgument &SugaredConverted, TemplateArgument &CanonicalConverted, CheckTemplateArgumentKind CTAK) |
Check a template argument against its corresponding non-type template parameter. More... | |
bool | CheckTemplateTemplateArgument (TemplateTemplateParmDecl *Param, TemplateParameterList *Params, TemplateArgumentLoc &Arg, bool IsDeduced) |
Check a template argument against its corresponding template template parameter. More... | |
void | NoteTemplateLocation (const NamedDecl &Decl, std::optional< SourceRange > ParamRange={}) |
void | NoteTemplateParameterLocation (const NamedDecl &Decl) |
ExprResult | BuildExpressionFromDeclTemplateArgument (const TemplateArgument &Arg, QualType ParamType, SourceLocation Loc, NamedDecl *TemplateParam=nullptr) |
Given a non-type template argument that refers to a declaration and the type of its corresponding non-type template parameter, produce an expression that properly refers to that declaration. More... | |
ExprResult | BuildExpressionFromNonTypeTemplateArgument (const TemplateArgument &Arg, SourceLocation Loc) |
bool | TemplateParameterListsAreEqual (const TemplateCompareNewDeclInfo &NewInstFrom, TemplateParameterList *New, const NamedDecl *OldInstFrom, TemplateParameterList *Old, bool Complain, TemplateParameterListEqualKind Kind, SourceLocation TemplateArgLoc=SourceLocation()) |
Determine whether the given template parameter lists are equivalent. More... | |
bool | TemplateParameterListsAreEqual (TemplateParameterList *New, TemplateParameterList *Old, bool Complain, TemplateParameterListEqualKind Kind, SourceLocation TemplateArgLoc=SourceLocation()) |
bool | CheckTemplateDeclScope (Scope *S, TemplateParameterList *TemplateParams) |
Check whether a template can be declared within this scope. More... | |
TypeResult | ActOnTypenameType (Scope *S, SourceLocation TypenameLoc, const CXXScopeSpec &SS, const IdentifierInfo &II, SourceLocation IdLoc, ImplicitTypenameContext IsImplicitTypename=ImplicitTypenameContext::No) |
Called when the parser has parsed a C++ typename specifier, e.g., "typename T::type". More... | |
TypeResult | ActOnTypenameType (Scope *S, SourceLocation TypenameLoc, const CXXScopeSpec &SS, SourceLocation TemplateLoc, TemplateTy TemplateName, const IdentifierInfo *TemplateII, SourceLocation TemplateIILoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc) |
Called when the parser has parsed a C++ typename specifier that ends in a template-id, e.g., "typename MetaFun::template apply<T1, T2>". More... | |
QualType | CheckTypenameType (ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo &II, SourceLocation IILoc, TypeSourceInfo **TSI, bool DeducedTSTContext) |
QualType | CheckTypenameType (ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo &II, SourceLocation IILoc, bool DeducedTSTContext=true) |
Build the type that describes a C++ typename specifier, e.g., "typename T::type". More... | |
TypeSourceInfo * | RebuildTypeInCurrentInstantiation (TypeSourceInfo *T, SourceLocation Loc, DeclarationName Name) |
Rebuilds a type within the context of the current instantiation. More... | |
bool | RebuildNestedNameSpecifierInCurrentInstantiation (CXXScopeSpec &SS) |
ExprResult | RebuildExprInCurrentInstantiation (Expr *E) |
bool | RebuildTemplateParamsInCurrentInstantiation (TemplateParameterList *Params) |
Rebuild the template parameters now that we know we're in a current instantiation. More... | |
std::string | getTemplateArgumentBindingsText (const TemplateParameterList *Params, const TemplateArgumentList &Args) |
Produces a formatted string that describes the binding of template parameters to template arguments. More... | |
std::string | getTemplateArgumentBindingsText (const TemplateParameterList *Params, const TemplateArgument *Args, unsigned NumArgs) |
void | diagnoseExprIntendedAsTemplateName (Scope *S, ExprResult TemplateName, SourceLocation Less, SourceLocation Greater) |
ExprResult | ActOnDependentIdExpression (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, bool isAddressOfOperand, const TemplateArgumentListInfo *TemplateArgs) |
ActOnDependentIdExpression - Handle a dependent id-expression that was just parsed. More... | |
ExprResult | BuildDependentDeclRefExpr (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs) |
bool | ConstraintExpressionDependsOnEnclosingTemplate (const FunctionDecl *Friend, unsigned TemplateDepth, const Expr *Constraint) |
void | DeclareImplicitDeductionGuides (TemplateDecl *Template, SourceLocation Loc) |
Declare implicit deduction guides for a class template if we've not already done so. More... | |
FunctionTemplateDecl * | DeclareAggregateDeductionGuideFromInitList (TemplateDecl *Template, MutableArrayRef< QualType > ParamTypes, SourceLocation Loc) |
std::pair< Expr *, std::string > | findFailedBooleanCondition (Expr *Cond) |
Find the failed Boolean condition within a given Boolean constant expression, and describe it with a string. More... | |
void | CheckDeductionGuideTemplate (FunctionTemplateDecl *TD) |
Decl * | ActOnConceptDefinition (Scope *S, MultiTemplateParamsArg TemplateParameterLists, const IdentifierInfo *Name, SourceLocation NameLoc, Expr *ConstraintExpr, const ParsedAttributesView &Attrs) |
void | CheckConceptRedefinition (ConceptDecl *NewDecl, LookupResult &Previous, bool &AddToScope) |
TypeResult | ActOnDependentTag (Scope *S, unsigned TagSpec, TagUseKind TUK, const CXXScopeSpec &SS, const IdentifierInfo *Name, SourceLocation TagLoc, SourceLocation NameLoc) |
void | MarkAsLateParsedTemplate (FunctionDecl *FD, Decl *FnD, CachedTokens &Toks) |
void | UnmarkAsLateParsedTemplate (FunctionDecl *FD) |
bool | IsInsideALocalClassWithinATemplateFunction () |
void | checkSpecializationVisibility (SourceLocation Loc, NamedDecl *Spec) |
We've found a use of a templated declaration that would trigger an implicit instantiation. More... | |
void | checkSpecializationReachability (SourceLocation Loc, NamedDecl *Spec) |
static NamedDecl * | getAsTemplateNameDecl (NamedDecl *D, bool AllowFunctionTemplates=true, bool AllowDependent=true) |
Try to interpret the lookup result D as a template-name. More... | |
C++ Variadic Templates | |
Implementations are in SemaTemplateVariadic.cpp | |
enum | UnexpandedParameterPackContext { UPPC_Expression = 0 , UPPC_BaseType , UPPC_DeclarationType , UPPC_DataMemberType , UPPC_BitFieldWidth , UPPC_StaticAssertExpression , UPPC_FixedUnderlyingType , UPPC_EnumeratorValue , UPPC_UsingDeclaration , UPPC_FriendDeclaration , UPPC_DeclarationQualifier , UPPC_Initializer , UPPC_DefaultArgument , UPPC_NonTypeTemplateParameterType , UPPC_ExceptionType , UPPC_ExplicitSpecialization , UPPC_PartialSpecialization , UPPC_IfExists , UPPC_IfNotExists , UPPC_Lambda , UPPC_Block , UPPC_TypeConstraint , UPPC_Requirement , UPPC_RequiresClause } |
The context in which an unexpanded parameter pack is being diagnosed. More... | |
bool | isUnexpandedParameterPackPermitted () |
Determine whether an unexpanded parameter pack might be permitted in this location. More... | |
bool | DiagnoseUnexpandedParameterPacks (SourceLocation Loc, UnexpandedParameterPackContext UPPC, ArrayRef< UnexpandedParameterPack > Unexpanded) |
Diagnose unexpanded parameter packs. More... | |
bool | DiagnoseUnexpandedParameterPack (SourceLocation Loc, TypeSourceInfo *T, UnexpandedParameterPackContext UPPC) |
If the given type contains an unexpanded parameter pack, diagnose the error. More... | |
bool | DiagnoseUnexpandedParameterPack (Expr *E, UnexpandedParameterPackContext UPPC=UPPC_Expression) |
If the given expression contains an unexpanded parameter pack, diagnose the error. More... | |
bool | DiagnoseUnexpandedParameterPackInRequiresExpr (RequiresExpr *RE) |
If the given requirees-expression contains an unexpanded reference to one of its own parameter packs, diagnose the error. More... | |
bool | DiagnoseUnexpandedParameterPack (const CXXScopeSpec &SS, UnexpandedParameterPackContext UPPC) |
If the given nested-name-specifier contains an unexpanded parameter pack, diagnose the error. More... | |
bool | DiagnoseUnexpandedParameterPack (const DeclarationNameInfo &NameInfo, UnexpandedParameterPackContext UPPC) |
If the given name contains an unexpanded parameter pack, diagnose the error. More... | |
bool | DiagnoseUnexpandedParameterPack (SourceLocation Loc, TemplateName Template, UnexpandedParameterPackContext UPPC) |
If the given template name contains an unexpanded parameter pack, diagnose the error. More... | |
bool | DiagnoseUnexpandedParameterPack (TemplateArgumentLoc Arg, UnexpandedParameterPackContext UPPC) |
If the given template argument contains an unexpanded parameter pack, diagnose the error. More... | |
void | collectUnexpandedParameterPacks (TemplateArgument Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given template argument. More... | |
void | collectUnexpandedParameterPacks (TemplateArgumentLoc Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given template argument. More... | |
void | collectUnexpandedParameterPacks (QualType T, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given type. More... | |
void | collectUnexpandedParameterPacks (TypeLoc TL, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given type. More... | |
void | collectUnexpandedParameterPacks (NestedNameSpecifierLoc NNS, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given nested-name-specifier. More... | |
void | collectUnexpandedParameterPacks (const DeclarationNameInfo &NameInfo, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given name. More... | |
ParsedTemplateArgument | ActOnPackExpansion (const ParsedTemplateArgument &Arg, SourceLocation EllipsisLoc) |
Invoked when parsing a template argument followed by an ellipsis, which creates a pack expansion. More... | |
TypeResult | ActOnPackExpansion (ParsedType Type, SourceLocation EllipsisLoc) |
Invoked when parsing a type followed by an ellipsis, which creates a pack expansion. More... | |
TypeSourceInfo * | CheckPackExpansion (TypeSourceInfo *Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions) |
Construct a pack expansion type from the pattern of the pack expansion. More... | |
QualType | CheckPackExpansion (QualType Pattern, SourceRange PatternRange, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions) |
Construct a pack expansion type from the pattern of the pack expansion. More... | |
ExprResult | ActOnPackExpansion (Expr *Pattern, SourceLocation EllipsisLoc) |
Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion. More... | |
ExprResult | CheckPackExpansion (Expr *Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions) |
Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion. More... | |
bool | CheckParameterPacksForExpansion (SourceLocation EllipsisLoc, SourceRange PatternRange, ArrayRef< UnexpandedParameterPack > Unexpanded, const MultiLevelTemplateArgumentList &TemplateArgs, bool &ShouldExpand, bool &RetainExpansion, std::optional< unsigned > &NumExpansions) |
Determine whether we could expand a pack expansion with the given set of parameter packs into separate arguments by repeatedly transforming the pattern. More... | |
std::optional< unsigned > | getNumArgumentsInExpansion (QualType T, const MultiLevelTemplateArgumentList &TemplateArgs) |
Determine the number of arguments in the given pack expansion type. More... | |
bool | containsUnexpandedParameterPacks (Declarator &D) |
Determine whether the given declarator contains any unexpanded parameter packs. More... | |
TemplateArgumentLoc | getTemplateArgumentPackExpansionPattern (TemplateArgumentLoc OrigLoc, SourceLocation &Ellipsis, std::optional< unsigned > &NumExpansions) const |
Returns the pattern of the pack expansion for a template argument. More... | |
std::optional< unsigned > | getFullyPackExpandedSize (TemplateArgument Arg) |
Given a template argument that contains an unexpanded parameter pack, but which has already been substituted, attempt to determine the number of elements that will be produced once this argument is fully-expanded. More... | |
ExprResult | ActOnSizeofParameterPackExpr (Scope *S, SourceLocation OpLoc, IdentifierInfo &Name, SourceLocation NameLoc, SourceLocation RParenLoc) |
Called when an expression computing the size of a parameter pack is parsed. More... | |
ExprResult | ActOnPackIndexingExpr (Scope *S, Expr *PackExpression, SourceLocation EllipsisLoc, SourceLocation LSquareLoc, Expr *IndexExpr, SourceLocation RSquareLoc) |
ExprResult | BuildPackIndexingExpr (Expr *PackExpression, SourceLocation EllipsisLoc, Expr *IndexExpr, SourceLocation RSquareLoc, ArrayRef< Expr * > ExpandedExprs={}, bool EmptyPack=false) |
ExprResult | ActOnCXXFoldExpr (Scope *S, SourceLocation LParenLoc, Expr *LHS, tok::TokenKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc) |
Handle a C++1z fold-expression: ( expr op ... op expr ). More... | |
ExprResult | BuildCXXFoldExpr (UnresolvedLookupExpr *Callee, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, std::optional< unsigned > NumExpansions) |
ExprResult | BuildEmptyCXXFoldExpr (SourceLocation EllipsisLoc, BinaryOperatorKind Operator) |
C++ Template Argument Deduction | |
Implementations are in SemaTemplateDeduction.cpp | |
typedef llvm::DenseMap< Decl *, SmallVector< PartialDiagnosticAt, 1 > > | SuppressedDiagnosticsMap |
For each declaration that involved template argument deduction, the set of diagnostics that were suppressed during that template argument deduction. More... | |
bool | AccessCheckingSFINAE |
When true, access checking violations are treated as SFINAE failures rather than hard errors. More... | |
SuppressedDiagnosticsMap | SuppressedDiagnostics |
bool | isSameOrCompatibleFunctionType (QualType Param, QualType Arg) |
Compare types for equality with respect to possibly compatible function types (noreturn adjustment, implicit calling conventions). More... | |
TemplateArgumentLoc | getTrivialTemplateArgumentLoc (const TemplateArgument &Arg, QualType NTTPType, SourceLocation Loc, NamedDecl *TemplateParam=nullptr) |
Allocate a TemplateArgumentLoc where all locations have been initialized to the given location. More... | |
TemplateArgumentLoc | getIdentityTemplateArgumentLoc (NamedDecl *Param, SourceLocation Location) |
Get a template argument mapping the given template parameter to itself, e.g. More... | |
QualType | adjustCCAndNoReturn (QualType ArgFunctionType, QualType FunctionType, bool AdjustExceptionSpec=false) |
Adjust the type ArgFunctionType to match the calling convention, noreturn, and optionally the exception specification of FunctionType . More... | |
TemplateDeductionResult | DeduceTemplateArguments (ClassTemplatePartialSpecializationDecl *Partial, ArrayRef< TemplateArgument > TemplateArgs, sema::TemplateDeductionInfo &Info) |
TemplateDeductionResult | DeduceTemplateArguments (VarTemplatePartialSpecializationDecl *Partial, ArrayRef< TemplateArgument > TemplateArgs, sema::TemplateDeductionInfo &Info) |
TemplateDeductionResult | DeduceTemplateArgumentsFromType (TemplateDecl *TD, QualType FromType, sema::TemplateDeductionInfo &Info) |
Deduce the template arguments of the given template from FromType . More... | |
TemplateDeductionResult | DeduceTemplateArguments (TemplateParameterList *TemplateParams, ArrayRef< TemplateArgument > Ps, ArrayRef< TemplateArgument > As, sema::TemplateDeductionInfo &Info, SmallVectorImpl< DeducedTemplateArgument > &Deduced, bool NumberOfArgumentsMustMatch) |
TemplateDeductionResult | SubstituteExplicitTemplateArguments (FunctionTemplateDecl *FunctionTemplate, TemplateArgumentListInfo &ExplicitTemplateArgs, SmallVectorImpl< DeducedTemplateArgument > &Deduced, SmallVectorImpl< QualType > &ParamTypes, QualType *FunctionType, sema::TemplateDeductionInfo &Info) |
Substitute the explicitly-provided template arguments into the given function template according to C++ [temp.arg.explicit]. More... | |
TemplateDeductionResult | FinishTemplateArgumentDeduction (FunctionTemplateDecl *FunctionTemplate, SmallVectorImpl< DeducedTemplateArgument > &Deduced, unsigned NumExplicitlySpecified, FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, SmallVectorImpl< OriginalCallArg > const *OriginalCallArgs=nullptr, bool PartialOverloading=false, llvm::function_ref< bool()> CheckNonDependent=[] { return false;}) |
Finish template argument deduction for a function template, checking the deduced template arguments for completeness and forming the function template specialization. More... | |
TemplateDeductionResult | DeduceTemplateArguments (FunctionTemplateDecl *FunctionTemplate, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, bool PartialOverloading, bool AggregateDeductionCandidate, QualType ObjectType, Expr::Classification ObjectClassification, llvm::function_ref< bool(ArrayRef< QualType >)> CheckNonDependent) |
Perform template argument deduction from a function call (C++ [temp.deduct.call]). More... | |
TemplateDeductionResult | DeduceTemplateArguments (FunctionTemplateDecl *FunctionTemplate, TemplateArgumentListInfo *ExplicitTemplateArgs, QualType ArgFunctionType, FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, bool IsAddressOfFunction=false) |
Deduce template arguments when taking the address of a function template (C++ [temp.deduct.funcaddr]) or matching a specialization to a template. More... | |
TemplateDeductionResult | DeduceTemplateArguments (FunctionTemplateDecl *FunctionTemplate, QualType ObjectType, Expr::Classification ObjectClassification, QualType ToType, CXXConversionDecl *&Specialization, sema::TemplateDeductionInfo &Info) |
Deduce template arguments for a templated conversion function (C++ [temp.deduct.conv]) and, if successful, produce a conversion function template specialization. More... | |
TemplateDeductionResult | DeduceTemplateArguments (FunctionTemplateDecl *FunctionTemplate, TemplateArgumentListInfo *ExplicitTemplateArgs, FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, bool IsAddressOfFunction=false) |
Deduce template arguments for a function template when there is nothing to deduce against (C++0x [temp.arg.explicit]p3). More... | |
QualType | SubstAutoType (QualType TypeWithAuto, QualType Replacement) |
Substitute Replacement for auto in TypeWithAuto . More... | |
TypeSourceInfo * | SubstAutoTypeSourceInfo (TypeSourceInfo *TypeWithAuto, QualType Replacement) |
Substitute Replacement for auto in TypeWithAuto. More... | |
QualType | SubstAutoTypeDependent (QualType TypeWithAuto) |
TypeSourceInfo * | SubstAutoTypeSourceInfoDependent (TypeSourceInfo *TypeWithAuto) |
QualType | ReplaceAutoType (QualType TypeWithAuto, QualType Replacement) |
Completely replace the auto in TypeWithAuto by Replacement . More... | |
TypeSourceInfo * | ReplaceAutoTypeSourceInfo (TypeSourceInfo *TypeWithAuto, QualType Replacement) |
TemplateDeductionResult | DeduceAutoType (TypeLoc AutoTypeLoc, Expr *Initializer, QualType &Result, sema::TemplateDeductionInfo &Info, bool DependentDeduction=false, bool IgnoreConstraints=false, TemplateSpecCandidateSet *FailedTSC=nullptr) |
Deduce the type for an auto type-specifier (C++11 [dcl.spec.auto]p6) More... | |
void | DiagnoseAutoDeductionFailure (VarDecl *VDecl, Expr *Init) |
bool | DeduceReturnType (FunctionDecl *FD, SourceLocation Loc, bool Diagnose=true) |
bool | CheckIfFunctionSpecializationIsImmediate (FunctionDecl *FD, SourceLocation Loc) |
ClassTemplatePartialSpecializationDecl * | getMoreSpecializedPartialSpecialization (ClassTemplatePartialSpecializationDecl *PS1, ClassTemplatePartialSpecializationDecl *PS2, SourceLocation Loc) |
Returns the more specialized class template partial specialization according to the rules of partial ordering of class template partial specializations (C++ [temp.class.order]). More... | |
bool | isMoreSpecializedThanPrimary (ClassTemplatePartialSpecializationDecl *T, sema::TemplateDeductionInfo &Info) |
VarTemplatePartialSpecializationDecl * | getMoreSpecializedPartialSpecialization (VarTemplatePartialSpecializationDecl *PS1, VarTemplatePartialSpecializationDecl *PS2, SourceLocation Loc) |
bool | isMoreSpecializedThanPrimary (VarTemplatePartialSpecializationDecl *T, sema::TemplateDeductionInfo &Info) |
bool | isTemplateTemplateParameterAtLeastAsSpecializedAs (TemplateParameterList *PParam, TemplateDecl *AArg, SourceLocation Loc, bool IsDeduced) |
void | MarkUsedTemplateParameters (const Expr *E, bool OnlyDeduced, unsigned Depth, llvm::SmallBitVector &Used) |
Mark which template parameters are used in a given expression. More... | |
void | MarkUsedTemplateParameters (const TemplateArgumentList &TemplateArgs, bool OnlyDeduced, unsigned Depth, llvm::SmallBitVector &Used) |
Mark which template parameters can be deduced from a given template argument list. More... | |
void | MarkDeducedTemplateParameters (const FunctionTemplateDecl *FunctionTemplate, llvm::SmallBitVector &Deduced) |
FunctionTemplateDecl * | getMoreSpecializedTemplate (FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLocation Loc, TemplatePartialOrderingContext TPOC, unsigned NumCallArguments1, QualType RawObj1Ty={}, QualType RawObj2Ty={}, bool Reversed=false) |
Returns the more specialized function template according to the rules of function template partial ordering (C++ [temp.func.order]). More... | |
UnresolvedSetIterator | getMostSpecialized (UnresolvedSetIterator SBegin, UnresolvedSetIterator SEnd, TemplateSpecCandidateSet &FailedCandidates, SourceLocation Loc, const PartialDiagnostic &NoneDiag, const PartialDiagnostic &AmbigDiag, const PartialDiagnostic &CandidateDiag, bool Complain=true, QualType TargetType=QualType()) |
Retrieve the most specialized of the given function template specializations. More... | |
FunctionDecl * | getMoreConstrainedFunction (FunctionDecl *FD1, FunctionDecl *FD2) |
Returns the more constrained function according to the rules of partial ordering by constraints (C++ [temp.constr.order]). More... | |
static void | MarkDeducedTemplateParameters (ASTContext &Ctx, const FunctionTemplateDecl *FunctionTemplate, llvm::SmallBitVector &Deduced) |
Marks all of the template parameters that will be deduced by a call to the given function template. More... | |
C++ Template Instantiation | |
Implementations are in SemaTemplateInstantiate.cpp | |
typedef llvm::DenseMap< ParmVarDecl *, llvm::TinyPtrVector< ParmVarDecl * > > | UnparsedDefaultArgInstantiationsMap |
LocalInstantiationScope * | CurrentInstantiationScope |
The current instantiation scope used to store local variables. More... | |
UnparsedDefaultArgInstantiationsMap | UnparsedDefaultArgInstantiations |
A mapping from parameters with unparsed default arguments to the set of instantiations of each parameter. More... | |
SmallVector< CodeSynthesisContext, 16 > | CodeSynthesisContexts |
List of active code synthesis contexts. More... | |
llvm::DenseSet< std::pair< Decl *, unsigned > > | InstantiatingSpecializations |
Specializations whose definitions are currently being instantiated. More... | |
llvm::DenseSet< QualType > | InstantiatedNonDependentTypes |
Non-dependent types used in templates that have already been instantiated by some template instantiation. More... | |
SmallVector< Module *, 16 > | CodeSynthesisContextLookupModules |
Extra modules inspected when performing a lookup during a template instantiation. More... | |
llvm::DenseSet< Module * > | LookupModulesCache |
Cache of additional modules that should be used for name lookup within the current template instantiation. More... | |
llvm::DenseMap< NamedDecl *, NamedDecl * > | VisibleNamespaceCache |
Map from the most recent declaration of a namespace to the most recent visible declaration of that namespace. More... | |
bool | InNonInstantiationSFINAEContext |
Whether we are in a SFINAE context that is not associated with template instantiation. More... | |
unsigned | NonInstantiationEntries |
The number of CodeSynthesisContexts that are not template instantiations and, therefore, should not be counted as part of the instantiation depth. More... | |
unsigned | LastEmittedCodeSynthesisContextDepth = 0 |
The depth of the context stack at the point when the most recent error or warning was produced. More... | |
std::vector< std::unique_ptr< TemplateInstantiationCallback > > | TemplateInstCallbacks |
The template instantiation callbacks to trace or track instantiations (objects can be chained). More... | |
int | ArgumentPackSubstitutionIndex |
The current index into pack expansion arguments that will be used for substitution of parameter packs. More... | |
class | ArgumentPackSubstitutionRAII |
bool | SubstTemplateArgument (const TemplateArgumentLoc &Input, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateArgumentLoc &Output, SourceLocation Loc={}, const DeclarationName &Entity={}) |
bool | SubstTemplateArguments (ArrayRef< TemplateArgumentLoc > Args, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateArgumentListInfo &Outputs) |
MultiLevelTemplateArgumentList | getTemplateInstantiationArgs (const NamedDecl *D, const DeclContext *DC=nullptr, bool Final=false, std::optional< ArrayRef< TemplateArgument >> Innermost=std::nullopt, bool RelativeToPrimary=false, const FunctionDecl *Pattern=nullptr, bool ForConstraintInstantiation=false, bool SkipForSpecialization=false) |
Retrieve the template argument list(s) that should be used to instantiate the definition of the given declaration. More... | |
void | pushCodeSynthesisContext (CodeSynthesisContext Ctx) |
void | popCodeSynthesisContext () |
void | PrintContextStack () |
void | PrintInstantiationStack () |
Prints the current instantiation stack through a series of notes. More... | |
std::optional< sema::TemplateDeductionInfo * > | isSFINAEContext () const |
Determines whether we are currently in a context where template argument substitution failures are not considered errors. More... | |
TypeSourceInfo * | SubstType (TypeSourceInfo *T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity, bool AllowDeducedTST=false) |
Perform substitution on the type T with a given set of template arguments. More... | |
QualType | SubstType (QualType T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity) |
Deprecated form of the above. More... | |
TypeSourceInfo * | SubstType (TypeLoc TL, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity) |
TypeSourceInfo * | SubstFunctionDeclType (TypeSourceInfo *T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity, CXXRecordDecl *ThisContext, Qualifiers ThisTypeQuals, bool EvaluateConstraints=true) |
A form of SubstType intended specifically for instantiating the type of a FunctionDecl. More... | |
void | SubstExceptionSpec (FunctionDecl *New, const FunctionProtoType *Proto, const MultiLevelTemplateArgumentList &Args) |
bool | SubstExceptionSpec (SourceLocation Loc, FunctionProtoType::ExceptionSpecInfo &ESI, SmallVectorImpl< QualType > &ExceptionStorage, const MultiLevelTemplateArgumentList &Args) |
ParmVarDecl * | SubstParmVarDecl (ParmVarDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs, int indexAdjustment, std::optional< unsigned > NumExpansions, bool ExpectParameterPack, bool EvaluateConstraints=true) |
bool | SubstParmTypes (SourceLocation Loc, ArrayRef< ParmVarDecl * > Params, const FunctionProtoType::ExtParameterInfo *ExtParamInfos, const MultiLevelTemplateArgumentList &TemplateArgs, SmallVectorImpl< QualType > &ParamTypes, SmallVectorImpl< ParmVarDecl * > *OutParams, ExtParameterInfoBuilder &ParamInfos) |
Substitute the given template arguments into the given set of parameters, producing the set of parameter types that would be generated from such a substitution. More... | |
bool | SubstDefaultArgument (SourceLocation Loc, ParmVarDecl *Param, const MultiLevelTemplateArgumentList &TemplateArgs, bool ForCallExpr=false) |
Substitute the given template arguments into the default argument. More... | |
ExprResult | SubstExpr (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs) |
ExprResult | SubstConstraintExpr (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs) |
ExprResult | SubstConstraintExprWithoutSatisfaction (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs) |
bool | SubstExprs (ArrayRef< Expr * > Exprs, bool IsCall, const MultiLevelTemplateArgumentList &TemplateArgs, SmallVectorImpl< Expr * > &Outputs) |
Substitute the given template arguments into a list of expressions, expanding pack expansions if required. More... | |
StmtResult | SubstStmt (Stmt *S, const MultiLevelTemplateArgumentList &TemplateArgs) |
ExprResult | SubstInitializer (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs, bool CXXDirectInit) |
bool | SubstBaseSpecifiers (CXXRecordDecl *Instantiation, CXXRecordDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs) |
Perform substitution on the base class specifiers of the given class template specialization. More... | |
bool | InstantiateClass (SourceLocation PointOfInstantiation, CXXRecordDecl *Instantiation, CXXRecordDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK, bool Complain=true) |
Instantiate the definition of a class from a given pattern. More... | |
bool | InstantiateEnum (SourceLocation PointOfInstantiation, EnumDecl *Instantiation, EnumDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK) |
Instantiate the definition of an enum from a given pattern. More... | |
bool | InstantiateInClassInitializer (SourceLocation PointOfInstantiation, FieldDecl *Instantiation, FieldDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs) |
Instantiate the definition of a field from the given pattern. More... | |
bool | usesPartialOrExplicitSpecialization (SourceLocation Loc, ClassTemplateSpecializationDecl *ClassTemplateSpec) |
bool | InstantiateClassTemplateSpecialization (SourceLocation PointOfInstantiation, ClassTemplateSpecializationDecl *ClassTemplateSpec, TemplateSpecializationKind TSK, bool Complain=true) |
void | InstantiateClassMembers (SourceLocation PointOfInstantiation, CXXRecordDecl *Instantiation, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK) |
Instantiates the definitions of all of the member of the given class, which is an instantiation of a class template or a member class of a template. More... | |
void | InstantiateClassTemplateSpecializationMembers (SourceLocation PointOfInstantiation, ClassTemplateSpecializationDecl *ClassTemplateSpec, TemplateSpecializationKind TSK) |
Instantiate the definitions of all of the members of the given class template specialization, which was named as part of an explicit instantiation. More... | |
NestedNameSpecifierLoc | SubstNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS, const MultiLevelTemplateArgumentList &TemplateArgs) |
DeclarationNameInfo | SubstDeclarationNameInfo (const DeclarationNameInfo &NameInfo, const MultiLevelTemplateArgumentList &TemplateArgs) |
Do template substitution on declaration name info. More... | |
TemplateName | SubstTemplateName (NestedNameSpecifierLoc QualifierLoc, TemplateName Name, SourceLocation Loc, const MultiLevelTemplateArgumentList &TemplateArgs) |
bool | SubstTypeConstraint (TemplateTypeParmDecl *Inst, const TypeConstraint *TC, const MultiLevelTemplateArgumentList &TemplateArgs, bool EvaluateConstraint) |
bool | inTemplateInstantiation () const |
Determine whether we are currently performing template instantiation. More... | |
C++ Template Declaration Instantiation | |
Implementations are in SemaTemplateInstantiateDecl.cpp | |
typedef std::pair< ValueDecl *, SourceLocation > | PendingImplicitInstantiation |
An entity for which implicit template instantiation is required. More... | |
typedef SmallVector< LateInstantiatedAttribute, 16 > | LateInstantiatedAttrVec |
std::deque< PendingImplicitInstantiation > | PendingInstantiations |
The queue of implicit template instantiations that are required but have not yet been performed. More... | |
SmallVector< PendingImplicitInstantiation, 1 > | LateParsedInstantiations |
Queue of implicit template instantiations that cannot be performed eagerly. More... | |
SmallVector< SmallVector< VTableUse, 16 >, 8 > | SavedVTableUses |
SmallVector< std::deque< PendingImplicitInstantiation >, 8 > | SavedPendingInstantiations |
std::deque< PendingImplicitInstantiation > | PendingLocalImplicitInstantiations |
The queue of implicit template instantiations that are required and must be performed within the current local scope. More... | |
ExplicitSpecifier | instantiateExplicitSpecifier (const MultiLevelTemplateArgumentList &TemplateArgs, ExplicitSpecifier ES) |
void | InstantiateAttrs (const MultiLevelTemplateArgumentList &TemplateArgs, const Decl *Pattern, Decl *Inst, LateInstantiatedAttrVec *LateAttrs=nullptr, LocalInstantiationScope *OuterMostScope=nullptr) |
void | updateAttrsForLateParsedTemplate (const Decl *Pattern, Decl *Inst) |
Update instantiation attributes after template was late parsed. More... | |
void | InstantiateAttrsForDecl (const MultiLevelTemplateArgumentList &TemplateArgs, const Decl *Pattern, Decl *Inst, LateInstantiatedAttrVec *LateAttrs=nullptr, LocalInstantiationScope *OuterMostScope=nullptr) |
void | InstantiateDefaultCtorDefaultArgs (CXXConstructorDecl *Ctor) |
In the MS ABI, we need to instantiate default arguments of dllexported default constructors along with the constructor definition. More... | |
bool | InstantiateDefaultArgument (SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param) |
void | InstantiateExceptionSpec (SourceLocation PointOfInstantiation, FunctionDecl *Function) |
FunctionDecl * | InstantiateFunctionDeclaration (FunctionTemplateDecl *FTD, const TemplateArgumentList *Args, SourceLocation Loc, CodeSynthesisContext::SynthesisKind CSC=CodeSynthesisContext::ExplicitTemplateArgumentSubstitution) |
Instantiate (or find existing instantiation of) a function template with a given set of template arguments. More... | |
void | InstantiateFunctionDefinition (SourceLocation PointOfInstantiation, FunctionDecl *Function, bool Recursive=false, bool DefinitionRequired=false, bool AtEndOfTU=false) |
Instantiate the definition of the given function from its template. More... | |
VarTemplateSpecializationDecl * | BuildVarTemplateInstantiation (VarTemplateDecl *VarTemplate, VarDecl *FromVar, const TemplateArgumentList *PartialSpecArgs, const TemplateArgumentListInfo &TemplateArgsInfo, SmallVectorImpl< TemplateArgument > &Converted, SourceLocation PointOfInstantiation, LateInstantiatedAttrVec *LateAttrs=nullptr, LocalInstantiationScope *StartingScope=nullptr) |
VarTemplateSpecializationDecl * | CompleteVarTemplateSpecializationDecl (VarTemplateSpecializationDecl *VarSpec, VarDecl *PatternDecl, const MultiLevelTemplateArgumentList &TemplateArgs) |
Instantiates a variable template specialization by completing it with appropriate type information and initializer. More... | |
void | BuildVariableInstantiation (VarDecl *NewVar, VarDecl *OldVar, const MultiLevelTemplateArgumentList &TemplateArgs, LateInstantiatedAttrVec *LateAttrs, DeclContext *Owner, LocalInstantiationScope *StartingScope, bool InstantiatingVarTemplate=false, VarTemplateSpecializationDecl *PrevVTSD=nullptr) |
BuildVariableInstantiation - Used after a new variable has been created. More... | |
void | InstantiateVariableInitializer (VarDecl *Var, VarDecl *OldVar, const MultiLevelTemplateArgumentList &TemplateArgs) |
Instantiate the initializer of a variable. More... | |
void | InstantiateVariableDefinition (SourceLocation PointOfInstantiation, VarDecl *Var, bool Recursive=false, bool DefinitionRequired=false, bool AtEndOfTU=false) |
Instantiate the definition of the given variable from its template. More... | |
void | InstantiateMemInitializers (CXXConstructorDecl *New, const CXXConstructorDecl *Tmpl, const MultiLevelTemplateArgumentList &TemplateArgs) |
NamedDecl * | FindInstantiatedDecl (SourceLocation Loc, NamedDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs, bool FindingInstantiatedContext=false) |
Find the instantiation of the given declaration within the current instantiation. More... | |
DeclContext * | FindInstantiatedContext (SourceLocation Loc, DeclContext *DC, const MultiLevelTemplateArgumentList &TemplateArgs) |
Finds the instantiation of the given declaration context within the current instantiation. More... | |
Decl * | SubstDecl (Decl *D, DeclContext *Owner, const MultiLevelTemplateArgumentList &TemplateArgs) |
FunctionDecl * | SubstSpaceshipAsEqualEqual (CXXRecordDecl *RD, FunctionDecl *Spaceship) |
Substitute the name and return type of a defaulted 'operator<=>' to form an implicit 'operator=='. More... | |
void | PerformPendingInstantiations (bool LocalOnly=false) |
Performs template instantiation for all implicit template instantiations we have seen until this point. More... | |
TemplateParameterList * | SubstTemplateParams (TemplateParameterList *Params, DeclContext *Owner, const MultiLevelTemplateArgumentList &TemplateArgs, bool EvaluateConstraints=true) |
void | PerformDependentDiagnostics (const DeclContext *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs) |
Constraints and Concepts | |
Implementations are in SemaConcept.cpp | |
using | SatisfactionStackEntryTy = std::pair< const NamedDecl *, llvm::FoldingSetNodeID > |
void | PushSatisfactionStackEntry (const NamedDecl *D, const llvm::FoldingSetNodeID &ID) |
void | PopSatisfactionStackEntry () |
bool | SatisfactionStackContains (const NamedDecl *D, const llvm::FoldingSetNodeID &ID) const |
void | SwapSatisfactionStack (llvm::SmallVectorImpl< SatisfactionStackEntryTy > &NewSS) |
bool | CheckConstraintExpression (const Expr *CE, Token NextToken=Token(), bool *PossibleNonPrimary=nullptr, bool IsTrailingRequiresClause=false) |
Check whether the given expression is a valid constraint expression. More... | |
bool | CheckConstraintSatisfaction (const NamedDecl *Template, ArrayRef< const Expr * > ConstraintExprs, const MultiLevelTemplateArgumentList &TemplateArgLists, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction) |
Check whether the given list of constraint expressions are satisfied (as if in a 'conjunction') given template arguments. More... | |
bool | CheckConstraintSatisfaction (const NamedDecl *Template, ArrayRef< const Expr * > ConstraintExprs, llvm::SmallVectorImpl< Expr * > &ConvertedConstraints, const MultiLevelTemplateArgumentList &TemplateArgList, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction) |
Check whether the given list of constraint expressions are satisfied (as if in a 'conjunction') given template arguments. More... | |
bool | CheckConstraintSatisfaction (const Expr *ConstraintExpr, ConstraintSatisfaction &Satisfaction) |
Check whether the given non-dependent constraint expression is satisfied. More... | |
bool | CheckFunctionConstraints (const FunctionDecl *FD, ConstraintSatisfaction &Satisfaction, SourceLocation UsageLoc=SourceLocation(), bool ForOverloadResolution=false) |
Check whether the given function decl's trailing requires clause is satisfied, if any. More... | |
bool | AreConstraintExpressionsEqual (const NamedDecl *Old, const Expr *OldConstr, const TemplateCompareNewDeclInfo &New, const Expr *NewConstr) |
bool | FriendConstraintsDependOnEnclosingTemplate (const FunctionDecl *FD) |
bool | EnsureTemplateArgumentListConstraints (TemplateDecl *Template, const MultiLevelTemplateArgumentList &TemplateArgs, SourceRange TemplateIDRange) |
Ensure that the given template arguments satisfy the constraints associated with the given template, emitting a diagnostic if they do not. More... | |
bool | CheckInstantiatedFunctionTemplateConstraints (SourceLocation PointOfInstantiation, FunctionDecl *Decl, ArrayRef< TemplateArgument > TemplateArgs, ConstraintSatisfaction &Satisfaction) |
void | DiagnoseUnsatisfiedConstraint (const ConstraintSatisfaction &Satisfaction, bool First=true) |
Emit diagnostics explaining why a constraint expression was deemed unsatisfied. More... | |
void | DiagnoseUnsatisfiedConstraint (const ASTConstraintSatisfaction &Satisfaction, bool First=true) |
Emit diagnostics explaining why a constraint expression was deemed unsatisfied. More... | |
const NormalizedConstraint * | getNormalizedAssociatedConstraints (NamedDecl *ConstrainedDecl, ArrayRef< const Expr * > AssociatedConstraints) |
bool | IsAtLeastAsConstrained (NamedDecl *D1, MutableArrayRef< const Expr * > AC1, NamedDecl *D2, MutableArrayRef< const Expr * > AC2, bool &Result) |
Check whether the given declaration's associated constraints are at least as constrained than another declaration's according to the partial ordering of constraints. More... | |
bool | MaybeEmitAmbiguousAtomicConstraintsDiagnostic (NamedDecl *D1, ArrayRef< const Expr * > AC1, NamedDecl *D2, ArrayRef< const Expr * > AC2) |
If D1 was not at least as constrained as D2, but would've been if a pair of atomic constraints involved had been declared in a concept and not repeated in two separate places in code. More... | |
C++ Exception Specifications | |
Implementations are in SemaExceptionSpec.cpp | |
SmallVector< std::pair< const CXXMethodDecl *, const CXXMethodDecl * >, 2 > | DelayedOverridingExceptionSpecChecks |
All the overriding functions seen during a class definition that had their exception spec checks delayed, plus the overridden function. More... | |
SmallVector< std::pair< FunctionDecl *, FunctionDecl * >, 2 > | DelayedEquivalentExceptionSpecChecks |
All the function redeclarations seen during a class definition that had their exception spec checks delayed, plus the prior declaration they should be checked against. More... | |
bool | isLibstdcxxEagerExceptionSpecHack (const Declarator &D) |
Determine if we're in a case where we need to (incorrectly) eagerly parse an exception specification to work around a libstdc++ bug. More... | |
ExprResult | ActOnNoexceptSpec (Expr *NoexceptExpr, ExceptionSpecificationType &EST) |
Check the given noexcept-specifier, convert its expression, and compute the appropriate ExceptionSpecificationType. More... | |
CanThrowResult | canThrow (const Stmt *E) |
const FunctionProtoType * | ResolveExceptionSpec (SourceLocation Loc, const FunctionProtoType *FPT) |
void | UpdateExceptionSpec (FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI) |
bool | CheckSpecifiedExceptionType (QualType &T, SourceRange Range) |
CheckSpecifiedExceptionType - Check if the given type is valid in an exception specification. More... | |
bool | CheckDistantExceptionSpec (QualType T) |
CheckDistantExceptionSpec - Check if the given type is a pointer or pointer to member to a function with an exception specification. More... | |
bool | CheckEquivalentExceptionSpec (FunctionDecl *Old, FunctionDecl *New) |
bool | CheckEquivalentExceptionSpec (const FunctionProtoType *Old, SourceLocation OldLoc, const FunctionProtoType *New, SourceLocation NewLoc) |
CheckEquivalentExceptionSpec - Check if the two types have equivalent exception specifications. More... | |
bool | CheckEquivalentExceptionSpec (const PartialDiagnostic &DiagID, const PartialDiagnostic &NoteID, const FunctionProtoType *Old, SourceLocation OldLoc, const FunctionProtoType *New, SourceLocation NewLoc) |
bool | handlerCanCatch (QualType HandlerType, QualType ExceptionType) |
bool | CheckExceptionSpecSubset (const PartialDiagnostic &DiagID, const PartialDiagnostic &NestedDiagID, const PartialDiagnostic &NoteID, const PartialDiagnostic &NoThrowDiagID, const FunctionProtoType *Superset, bool SkipSupersetFirstParameter, SourceLocation SuperLoc, const FunctionProtoType *Subset, bool SkipSubsetFirstParameter, SourceLocation SubLoc) |
CheckExceptionSpecSubset - Check whether the second function type's exception specification is a subset (or equivalent) of the first function type. More... | |
bool | CheckParamExceptionSpec (const PartialDiagnostic &NestedDiagID, const PartialDiagnostic &NoteID, const FunctionProtoType *Target, bool SkipTargetFirstParameter, SourceLocation TargetLoc, const FunctionProtoType *Source, bool SkipSourceFirstParameter, SourceLocation SourceLoc) |
CheckParamExceptionSpec - Check if the parameter and return types of the two functions have equivalent exception specs. More... | |
bool | CheckExceptionSpecCompatibility (Expr *From, QualType ToType) |
bool | CheckOverridingFunctionExceptionSpec (const CXXMethodDecl *New, const CXXMethodDecl *Old) |
CheckOverridingFunctionExceptionSpec - Checks whether the exception spec is a subset of base spec. More... | |
static CanThrowResult | canCalleeThrow (Sema &S, const Expr *E, const Decl *D, SourceLocation Loc=SourceLocation()) |
Determine whether the callee of a particular function call can throw. More... | |
Availability Attribute Handling | |
Implementations are in SemaAvailability.cpp | |
void | DiagnoseUnguardedAvailabilityViolations (Decl *FD) |
Issue any -Wunguarded-availability warnings in FD . More... | |
void | handleDelayedAvailabilityCheck (sema::DelayedDiagnostic &DD, Decl *Ctx) |
sema::FunctionScopeInfo * | getCurFunctionAvailabilityContext () |
Retrieve the current function, if any, that should be analyzed for potential availability violations. More... | |
void | DiagnoseAvailabilityOfDecl (NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass, bool ObjCPropertyAccess, bool AvoidPartialAvailabilityChecks=false, ObjCInterfaceDecl *ClassReceiver=nullptr) |
C++ Scope Specifiers | |
Implementations are in SemaCXXScopeSpec.cpp | |
bool | RequireCompleteDeclContext (CXXScopeSpec &SS, DeclContext *DC) |
Require that the context specified by SS be complete. More... | |
bool | RequireCompleteEnumDecl (EnumDecl *D, SourceLocation L, CXXScopeSpec *SS=nullptr) |
Require that the EnumDecl is completed with its enumerators defined or instantiated. More... | |
DeclContext * | computeDeclContext (QualType T) |
Compute the DeclContext that is associated with the given type. More... | |
DeclContext * | computeDeclContext (const CXXScopeSpec &SS, bool EnteringContext=false) |
Compute the DeclContext that is associated with the given scope specifier. More... | |
bool | isDependentScopeSpecifier (const CXXScopeSpec &SS) |
CXXRecordDecl * | getCurrentInstantiationOf (NestedNameSpecifier *NNS) |
If the given nested name specifier refers to the current instantiation, return the declaration that corresponds to that current instantiation (C++0x [temp.dep.type]p1). More... | |
bool | ActOnCXXGlobalScopeSpecifier (SourceLocation CCLoc, CXXScopeSpec &SS) |
The parser has parsed a global nested-name-specifier '::'. More... | |
bool | ActOnSuperScopeSpecifier (SourceLocation SuperLoc, SourceLocation ColonColonLoc, CXXScopeSpec &SS) |
The parser has parsed a '__super' nested-name-specifier. More... | |
bool | isAcceptableNestedNameSpecifier (const NamedDecl *SD, bool *CanCorrect=nullptr) |
Determines whether the given declaration is an valid acceptable result for name lookup of a nested-name-specifier. More... | |
NamedDecl * | FindFirstQualifierInScope (Scope *S, NestedNameSpecifier *NNS) |
If the given nested-name-specifier begins with a bare identifier (e.g., Base::), perform name lookup for that identifier as a nested-name-specifier within the given scope, and return the result of that name lookup. More... | |
bool | BuildCXXNestedNameSpecifier (Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon=nullptr, bool OnlyNamespace=false) |
Build a new nested-name-specifier for "identifier::", as described by ActOnCXXNestedNameSpecifier. More... | |
bool | ActOnCXXNestedNameSpecifier (Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, bool *IsCorrectedToColon=nullptr, bool OnlyNamespace=false) |
The parser has parsed a nested-name-specifier 'identifier::'. More... | |
bool | ActOnCXXNestedNameSpecifier (Scope *S, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, TemplateTy TemplateName, SourceLocation TemplateNameLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc, SourceLocation CCLoc, bool EnteringContext) |
The parser has parsed a nested-name-specifier 'template[opt] template-name < template-args >::'. More... | |
bool | ActOnCXXNestedNameSpecifierDecltype (CXXScopeSpec &SS, const DeclSpec &DS, SourceLocation ColonColonLoc) |
bool | ActOnCXXNestedNameSpecifierIndexedPack (CXXScopeSpec &SS, const DeclSpec &DS, SourceLocation ColonColonLoc, QualType Type) |
bool | IsInvalidUnlessNestedName (Scope *S, CXXScopeSpec &SS, NestedNameSpecInfo &IdInfo, bool EnteringContext) |
IsInvalidUnlessNestedName - This method is used for error recovery purposes to determine whether the specified identifier is only valid as a nested name specifier, for example a namespace name. More... | |
void * | SaveNestedNameSpecifierAnnotation (CXXScopeSpec &SS) |
Given a C++ nested-name-specifier, produce an annotation value that the parser can use later to reconstruct the given nested-name-specifier. More... | |
void | RestoreNestedNameSpecifierAnnotation (void *Annotation, SourceRange AnnotationRange, CXXScopeSpec &SS) |
Given an annotation pointer for a nested-name-specifier, restore the nested-name-specifier structure. More... | |
bool | ShouldEnterDeclaratorScope (Scope *S, const CXXScopeSpec &SS) |
bool | ActOnCXXEnterDeclaratorScope (Scope *S, CXXScopeSpec &SS) |
ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global scope or nested-name-specifier) is parsed, part of a declarator-id. More... | |
void | ActOnCXXExitDeclaratorScope (Scope *S, const CXXScopeSpec &SS) |
ActOnCXXExitDeclaratorScope - Called when a declarator that previously invoked ActOnCXXEnterDeclaratorScope(), is finished. More... | |
C++ Lambda Expressions | |
Implementations are in SemaLambda.cpp | |
CXXRecordDecl * | createLambdaClosureType (SourceRange IntroducerRange, TypeSourceInfo *Info, unsigned LambdaDependencyKind, LambdaCaptureDefault CaptureDefault) |
Create a new lambda closure type. More... | |
void | handleLambdaNumbering (CXXRecordDecl *Class, CXXMethodDecl *Method, std::optional< CXXRecordDecl::LambdaNumbering > NumberingOverride=std::nullopt) |
Number lambda for linkage purposes if necessary. More... | |
void | buildLambdaScope (sema::LambdaScopeInfo *LSI, CXXMethodDecl *CallOperator, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, bool ExplicitParams, bool Mutable) |
Endow the lambda scope info with the relevant properties. More... | |
CXXMethodDecl * | CreateLambdaCallOperator (SourceRange IntroducerRange, CXXRecordDecl *Class) |
void | AddTemplateParametersToLambdaCallOperator (CXXMethodDecl *CallOperator, CXXRecordDecl *Class, TemplateParameterList *TemplateParams) |
void | CompleteLambdaCallOperator (CXXMethodDecl *Method, SourceLocation LambdaLoc, SourceLocation CallOperatorLoc, Expr *TrailingRequiresClause, TypeSourceInfo *MethodTyInfo, ConstexprSpecKind ConstexprKind, StorageClass SC, ArrayRef< ParmVarDecl * > Params, bool HasExplicitResultType) |
bool | DiagnoseInvalidExplicitObjectParameterInLambda (CXXMethodDecl *Method, SourceLocation CallLoc) |
Returns true if the explicit object parameter was invalid. More... | |
ParsedType | actOnLambdaInitCaptureInitialization (SourceLocation Loc, bool ByRef, SourceLocation EllipsisLoc, IdentifierInfo *Id, LambdaCaptureInitKind InitKind, Expr *&Init) |
Perform initialization analysis of the init-capture and perform any implicit conversions such as an lvalue-to-rvalue conversion if not being used to initialize a reference. More... | |
QualType | buildLambdaInitCaptureInitialization (SourceLocation Loc, bool ByRef, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions, IdentifierInfo *Id, bool DirectInit, Expr *&Init) |
VarDecl * | createLambdaInitCaptureVarDecl (SourceLocation Loc, QualType InitCaptureType, SourceLocation EllipsisLoc, IdentifierInfo *Id, unsigned InitStyle, Expr *Init, DeclContext *DeclCtx) |
Create a dummy variable within the declcontext of the lambda's call operator, for name lookup purposes for a lambda init capture. More... | |
void | addInitCapture (sema::LambdaScopeInfo *LSI, VarDecl *Var, bool ByRef) |
Add an init-capture to a lambda scope. More... | |
void | finishLambdaExplicitCaptures (sema::LambdaScopeInfo *LSI) |
Note that we have finished the explicit captures for the given lambda. More... | |
void | deduceClosureReturnType (sema::CapturingScopeInfo &CSI) |
Deduce a block or lambda's return type based on the return statements present in the body. More... | |
void | ActOnLambdaExpressionAfterIntroducer (LambdaIntroducer &Intro, Scope *CurContext) |
Once the Lambdas capture are known, we can start to create the closure, call operator method, and keep track of the captures. More... | |
void | ActOnLambdaExplicitTemplateParameterList (LambdaIntroducer &Intro, SourceLocation LAngleLoc, ArrayRef< NamedDecl * > TParams, SourceLocation RAngleLoc, ExprResult RequiresClause) |
This is called after parsing the explicit template parameter list on a lambda (if it exists) in C++2a. More... | |
void | ActOnLambdaClosureQualifiers (LambdaIntroducer &Intro, SourceLocation MutableLoc) |
void | ActOnLambdaClosureParameters (Scope *LambdaScope, MutableArrayRef< DeclaratorChunk::ParamInfo > ParamInfo) |
void | ActOnStartOfLambdaDefinition (LambdaIntroducer &Intro, Declarator &ParamInfo, const DeclSpec &DS) |
ActOnStartOfLambdaDefinition - This is called just before we start parsing the body of a lambda; it analyzes the explicit captures and arguments, and sets up various data-structures for the body of the lambda. More... | |
void | ActOnLambdaError (SourceLocation StartLoc, Scope *CurScope, bool IsInstantiation=false) |
ActOnLambdaError - If there is an error parsing a lambda, this callback is invoked to pop the information about the lambda. More... | |
ExprResult | ActOnLambdaExpr (SourceLocation StartLoc, Stmt *Body) |
ActOnLambdaExpr - This is called when the body of a lambda expression was successfully completed. More... | |
bool | CaptureHasSideEffects (const sema::Capture &From) |
Does copying/destroying the captured variable have side effects? More... | |
bool | DiagnoseUnusedLambdaCapture (SourceRange CaptureRange, const sema::Capture &From) |
Diagnose if an explicit lambda capture is unused. More... | |
FieldDecl * | BuildCaptureField (RecordDecl *RD, const sema::Capture &Capture) |
Build a FieldDecl suitable to hold the given capture. More... | |
ExprResult | BuildCaptureInit (const sema::Capture &Capture, SourceLocation ImplicitCaptureLoc, bool IsOpenMPMapping=false) |
Initialize the given capture with a suitable expression. More... | |
ExprResult | BuildLambdaExpr (SourceLocation StartLoc, SourceLocation EndLoc, sema::LambdaScopeInfo *LSI) |
Complete a lambda-expression having processed and attached the lambda body. More... | |
QualType | getLambdaConversionFunctionResultType (const FunctionProtoType *CallOpType, CallingConv CC) |
Get the return type to use for a lambda's conversion function(s) to function pointer type, given the type of the call operator. More... | |
ExprResult | BuildBlockForLambdaConversion (SourceLocation CurrentLocation, SourceLocation ConvLocation, CXXConversionDecl *Conv, Expr *Src) |
std::tuple< MangleNumberingContext *, Decl * > | getCurrentMangleNumberContext (const DeclContext *DC) |
Compute the mangling number context for a lambda expression or block literal. More... | |
<tt>inline asm</tt> Statement | |
Implementations are in SemaStmtAsm.cpp | |
StmtResult | ActOnGCCAsmStmt (SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg Constraints, MultiExprArg Exprs, Expr *AsmString, MultiExprArg Clobbers, unsigned NumLabels, SourceLocation RParenLoc) |
void | FillInlineAsmIdentifierInfo (Expr *Res, llvm::InlineAsmIdentifierInfo &Info) |
ExprResult | LookupInlineAsmIdentifier (CXXScopeSpec &SS, SourceLocation TemplateKWLoc, UnqualifiedId &Id, bool IsUnevaluatedContext) |
bool | LookupInlineAsmField (StringRef Base, StringRef Member, unsigned &Offset, SourceLocation AsmLoc) |
ExprResult | LookupInlineAsmVarDeclField (Expr *RefExpr, StringRef Member, SourceLocation AsmLoc) |
StmtResult | ActOnMSAsmStmt (SourceLocation AsmLoc, SourceLocation LBraceLoc, ArrayRef< Token > AsmToks, StringRef AsmString, unsigned NumOutputs, unsigned NumInputs, ArrayRef< StringRef > Constraints, ArrayRef< StringRef > Clobbers, ArrayRef< Expr * > Exprs, SourceLocation EndLoc) |
LabelDecl * | GetOrCreateMSAsmLabel (StringRef ExternalLabelName, SourceLocation Location, bool AlwaysCreate) |
FixIt Helpers | |
Implementations are in SemaFixItUtils.cpp | |
std::string | getFixItZeroInitializerForType (QualType T, SourceLocation Loc) const |
Get a string to suggest for zero-initialization of a type. More... | |
std::string | getFixItZeroLiteralForType (QualType T, SourceLocation Loc) const |
API Notes | |
Implementations are in SemaAPINotes.cpp | |
void | ProcessAPINotes (Decl *D) |
Map any API notes provided for this declaration to attributes on the declaration. More... | |
Additional Inherited Members | |
![]() | |
enum class | DeviceDiagnosticReason { None = 0 , OmpDevice = 1 << 0 , OmpHost = 1 << 1 , OmpAll = OmpDevice | OmpHost , CudaDevice = 1 << 2 , CudaHost = 1 << 3 , CudaAll = CudaDevice | CudaHost , Sycl = 1 << 4 , Esimd = 1 << 5 , All = OmpAll | CudaAll | Sycl | Esimd } |
Bitmask to contain the list of reasons a single diagnostic should be emitted, based on its language. More... | |
![]() | |
SemaBase (Sema &S) | |
ASTContext & | getASTContext () const |
DiagnosticsEngine & | getDiagnostics () const |
const LangOptions & | getLangOpts () const |
void | addFDToReachableFromSyclDevice (const FunctionDecl *Callee, const FunctionDecl *Caller) |
bool | isFDReachableFromSyclDevice (const FunctionDecl *Callee, const FunctionDecl *Caller) |
SemaDiagnosticBuilder | Diag (SourceLocation Loc, unsigned DiagID, bool DeferHint=false) |
Emit a diagnostic. More... | |
SemaDiagnosticBuilder | Diag (SourceLocation Loc, const PartialDiagnostic &PD, bool DeferHint=false) |
Emit a partial diagnostic. More... | |
![]() | |
Sema & | SemaRef |
Sema - This implements semantic analysis and AST building for C.
typedef llvm::SmallSetVector<CXXRecordDecl *, 16> clang::Sema::AssociatedClassSet |
typedef llvm::SmallSetVector<DeclContext *, 16> clang::Sema::AssociatedNamespaceSet |
typedef std::pair<StringRef, QualType> clang::Sema::CapturedParamNameType |
typedef std::pair<SourceLocation, bool> clang::Sema::DeleteExprLoc |
typedef llvm::SmallVector<DeleteExprLoc, 4> clang::Sema::DeleteLocs |
typedef llvm::function_ref<void(SourceLocation Loc, PartialDiagnostic PD)> clang::Sema::DiagReceiverTy |
typedef llvm::DenseMap<IdentifierInfo *, SrcLocSet> clang::Sema::IdentifierSourceLocations |
using clang::Sema::ImmediateInvocationCandidate = llvm::PointerIntPair<ConstantExpr *, 1> |
typedef llvm::MapVector<const FunctionDecl *, std::unique_ptr<LateParsedTemplate> > clang::Sema::LateParsedTemplateMapT |
typedef void clang::Sema::LateTemplateParserCB(void *P, LateParsedTemplate &LPT) |
typedef void clang::Sema::LateTemplateParserCleanupCB(void *P) |
using clang::Sema::MaybeODRUseExprSet = llvm::SmallSetVector<Expr *, 4> |
Store a set of either DeclRefExprs or MemberExprs that contain a reference to a variable (constant) that may or may not be odr-used in this Expr, and we won't know until all lvalue-to-rvalue and discarded value conversions have been applied to all subexpressions of the enclosing full expression.
This is cleared at the end of each full expression.
typedef llvm::SmallSetVector<const NamedDecl *, 16> clang::Sema::NamedDeclSetType |
typedef std::pair<ValueDecl *, SourceLocation> clang::Sema::PendingImplicitInstantiation |
An entity for which implicit template instantiation is required.
The source location associated with the declaration is the first place in the source code where the declaration was "used". It is not necessarily the point of instantiation (which will be either before or after the namespace-scope declaration that triggered this implicit instantiation), However, it is the location that diagnostics should generally refer to, because users will need to know what code triggered the instantiation.
using clang::Sema::PoppedFunctionScopePtr = std::unique_ptr<sema::FunctionScopeInfo, PoppedFunctionScopeDeleter> |
typedef llvm::SmallPtrSet<const CXXRecordDecl *, 8> clang::Sema::RecordDeclSetTy |
using clang::Sema::SatisfactionStackEntryTy = std::pair<const NamedDecl *, llvm::FoldingSetNodeID> |
typedef void* clang::Sema::SkippedDefinitionContext |
typedef llvm::PointerIntPair<CXXRecordDecl *, 3, CXXSpecialMemberKind> clang::Sema::SpecialMemberDecl |
typedef llvm::SmallSet<SourceLocation, 2> clang::Sema::SrcLocSet |
typedef llvm::DenseMap<Decl *, SmallVector<PartialDiagnosticAt, 1> > clang::Sema::SuppressedDiagnosticsMap |
typedef OpaquePtr<TemplateName> clang::Sema::TemplateTy |
typedef std::pair<const IdentifierInfo *, uint64_t> clang::Sema::TypeTagMagicValue |
typedef OpaquePtr<QualType> clang::Sema::TypeTy |
typedef std::function<void(const TypoCorrection &)> clang::Sema::TypoDiagnosticGenerator |
typedef std::function<ExprResult(Sema &, TypoExpr *, TypoCorrection)> clang::Sema::TypoRecoveryCallback |
typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *> > clang::Sema::UnparsedDefaultArgInstantiationsMap |
typedef std::pair<CXXRecordDecl *, SourceLocation> clang::Sema::VTableUse |
|
strong |
The scope in which to find allocation functions.
|
strong |
AssignConvertType - All of the 'assignment' semantic checks return this enum to indicate whether the assignment was allowed.
These checks are done for simple assignments, as well as initialization, return from function, argument passing, etc. The query is phrased in terms of a source and destination type.
|
strong |
|
strong |
Describes the kind of merge to perform for availability attributes (including "deprecated", "unavailable", and "availability").
Describes the kind of priority given to an availability attribute.
The sum of priorities deteremines the final priority of the attribute. The final priority determines how the attribute will be merged. An attribute with a lower priority will always remove higher priority attributes for the specified platform when it is being applied. An attribute with a higher priority will not be applied if the declaration already has an availability attribute with a lower priority for the specified platform. The final prirority values are not expected to match the values in this enumeration, but instead should be treated as a plain integer value. This enumeration just names the priority weights that are used to calculate that final vaue.
|
strong |
enum clang::Sema::CCEKind |
Contexts in which a converted constant expression is required.
Enumerator | |
---|---|
CCEK_CaseValue | Expression in a case label. |
CCEK_Enumerator | Enumerator value with fixed underlying type. |
CCEK_TemplateArg | Value of a non-type template parameter. |
CCEK_ArrayBound | Array bound in array declarator or new-expression. |
CCEK_ExplicitBool | Condition in an explicit(bool) specifier. |
CCEK_Noexcept | Condition in a noexcept(bool) specifier. |
CCEK_StaticAssertMessageSize | Call to size() in a static assert message. |
CCEK_StaticAssertMessageData | Call to data() in a static assert message. |
|
strong |
Specifies the context in which a particular template argument is being checked.
|
strong |
|
strong |
|
strong |
|
strong |
Kinds of defaulted comparison operator functions.
|
strong |
Describes how the expressions currently being parsed are evaluated at run-time, if at all.
|
strong |
|
strong |
The possible outcomes of name lookup for a literal operator.
Describes the kind of name lookup to perform.
|
strong |
|
strong |
|
strong |
An enumeration to represent the transition of states in parsing module fragments and imports.
If we are not parsing a C++20 TU, or we find an error in state transition, the state is set to NotACXX20Module.
Describes the result of the name lookup and resolution performed by ClassifyName()
.
|
strong |
ReferenceCompareResult - Expresses the result of comparing two types (cv1 T1 and cv2 T2) to determine their compatibility for the purposes of initialization by reference (C++ [dcl.init.ref]p4).
|
strong |
|
strong |
|
strong |
Enumeration describing how template parameter lists are compared for equality.
The context in which an unexpanded parameter pack is being diagnosed.
Note that the values of this enumeration line up with the first argument to the err_unexpanded_parameter_pack
diagnostic.
Sema::Sema | ( | Preprocessor & | pp, |
ASTContext & | ctxt, | ||
ASTConsumer & | consumer, | ||
TranslationUnitKind | TUKind = TU_Complete , |
||
CodeCompleteConsumer * | CompletionConsumer = nullptr |
||
) |
Sema::~Sema | ( | ) |
Definition at line 508 of file Sema.cpp.
References Consumer, Context, FreeVisContext(), FunctionScopes, clang::ASTContext::getExternalSource(), InstantiatingSpecializations, Node, OpenMP(), clang::sema::SemaPPCallbacks::reset(), clang::threadSafety::threadSafetyCleanup(), ThreadSafetyDeclCache, and VisContext.
void Sema::ActOnAbortSEHFinallyBlock | ( | ) |
Definition at line 4442 of file SemaStmt.cpp.
bool Sema::ActOnAccessSpecifier | ( | AccessSpecifier | Access, |
SourceLocation | ASLoc, | ||
SourceLocation | ColonLoc, | ||
const ParsedAttributesView & | Attrs | ||
) |
ActOnAccessSpecifier - Parsed an access specifier followed by a colon.
Definition at line 3201 of file SemaDeclCXX.cpp.
References clang::DeclContext::addHiddenDecl(), clang::AS_none, Context, clang::AccessSpecDecl::Create(), CurContext, and ProcessAccessDeclAttributeList().
ExprResult Sema::ActOnAddrLabel | ( | SourceLocation | OpLoc, |
SourceLocation | LabLoc, | ||
LabelDecl * | TheDecl | ||
) |
ActOnAddrLabel - Parse the GNU address of label extension: "&&foo".
Definition at line 15782 of file SemaExpr.cpp.
References clang::Decl::markUsed().
void Sema::ActOnAfterCompoundStatementLeadingPragmas | ( | ) |
Definition at line 400 of file SemaStmt.cpp.
References clang::sema::FunctionScopeInfo::setUsesFPIntrin().
Decl * Sema::ActOnAliasDeclaration | ( | Scope * | CurScope, |
AccessSpecifier | AS, | ||
MultiTemplateParamsArg | TemplateParams, | ||
SourceLocation | UsingLoc, | ||
UnqualifiedId & | Name, | ||
const ParsedAttributesView & | AttrList, | ||
TypeResult | Type, | ||
Decl * | DeclFromDeclSpec | ||
) |
Definition at line 13539 of file SemaDeclCXX.cpp.
bool Sema::ActOnAlignasTypeArgument | ( | StringRef | KWName, |
ParsedType | Ty, | ||
SourceLocation | OpLoc, | ||
SourceRange | R | ||
) |
ActOnAlignasTypeArgument - Handle alignas
(type-id) and _Alignas
(type-name) .
[dcl.align] An alignment-specifier of the form alignas(type-id) has the same effect as alignas(alignof(type-id)).
[N1570 6.7.5] _Alignas(type-name) is equivalent to _Alignas(_Alignof(type-name)).
Definition at line 4829 of file SemaExpr.cpp.
References clang::OpaquePtr< PtrTy >::getAsOpaquePtr(), and clang::OpaquePtr< QualType >::getFromOpaquePtr().
void Sema::ActOnAnnotModuleBegin | ( | SourceLocation | DirectiveLoc, |
Module * | Mod | ||
) |
The parsed has entered a submodule.
Definition at line 759 of file SemaModule.cpp.
References checkModuleImportContext(), clang::Decl::Visible, and clang::Decl::VisibleWhenImported.
Referenced by clang::Parser::ParseTopLevelDecl().
void Sema::ActOnAnnotModuleEnd | ( | SourceLocation | DirectiveLoc, |
Module * | Mod | ||
) |
The parser has left a submodule.
Definition at line 783 of file SemaModule.cpp.
References clang::File, and clang::Decl::Unowned.
Referenced by clang::Parser::ParseTopLevelDecl().
void Sema::ActOnAnnotModuleInclude | ( | SourceLocation | DirectiveLoc, |
Module * | Mod | ||
) |
The parser has processed a module import translated from a #include or similar preprocessing directive.
Definition at line 720 of file SemaModule.cpp.
References checkModuleImportContext().
Referenced by clang::Parser::ParseTopLevelDecl().
ExprResult Sema::ActOnArraySubscriptExpr | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | LLoc, | ||
MultiExprArg | ArgExprs, | ||
SourceLocation | RLoc | ||
) |
Definition at line 4947 of file SemaExpr.cpp.
ExprResult Sema::ActOnArrayTypeTrait | ( | ArrayTypeTrait | ATT, |
SourceLocation | KWLoc, | ||
ParsedType | LhsTy, | ||
Expr * | DimExpr, | ||
SourceLocation | RParen | ||
) |
ActOnArrayTypeTrait - Parsed one of the binary type trait support pseudo-functions.
Definition at line 6173 of file SemaExprCXX.cpp.
References BuildArrayTypeTrait(), Context, clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), and clang::T.
ExprResult Sema::ActOnAsTypeExpr | ( | Expr * | E, |
ParsedType | ParsedDestTy, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RParenLoc | ||
) |
__builtin_astype(...)
Parse a __builtin_astype expression.
__builtin_astype( value, dst type )
Definition at line 6775 of file SemaExpr.cpp.
StmtResult Sema::ActOnAttributedStmt | ( | const ParsedAttributes & | AttrList, |
Stmt * | SubStmt | ||
) |
Definition at line 625 of file SemaStmt.cpp.
References clang::SourceRange::getBegin(), and clang::ParsedAttributesView::Range.
BaseResult Sema::ActOnBaseSpecifier | ( | Decl * | classdecl, |
SourceRange | SpecifierRange, | ||
const ParsedAttributesView & | Attributes, | ||
bool | Virtual, | ||
AccessSpecifier | Access, | ||
ParsedType | basetype, | ||
SourceLocation | BaseLoc, | ||
SourceLocation | EllipsisLoc | ||
) |
ActOnBaseSpecifier - Parsed a base specifier.
A base specifier is one entry in the base class list of a class specifier, for example: class foo : public bar, virtual private baz { 'public bar' and 'virtual private baz' are each base-specifiers.
Definition at line 2788 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), CheckBaseSpecifier(), clang::Class, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::SourceRange::getBegin(), GetTypeFromParser(), clang::AttributeCommonInfo::IgnoredAttribute, clang::SourceLocation::isInvalid(), clang::AttributeCommonInfo::UnknownAttribute, UPPC_BaseType, and clang::Virtual.
void Sema::ActOnBaseSpecifiers | ( | Decl * | ClassDecl, |
MutableArrayRef< CXXBaseSpecifier * > | Bases | ||
) |
ActOnBaseSpecifiers - Attach the given base specifiers to the class, after checking whether there are any duplicate base classes.
Definition at line 2977 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), and AttachBaseSpecifiers().
ExprResult Sema::ActOnBinOp | ( | Scope * | S, |
SourceLocation | TokLoc, | ||
tok::TokenKind | Kind, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) |
Definition at line 15232 of file SemaExpr.cpp.
Referenced by clang::Parser::ParseConstraintLogicalAndExpression(), and clang::Parser::ParseConstraintLogicalOrExpression().
void Sema::ActOnBlockArguments | ( | SourceLocation | CaretLoc, |
Declarator & | ParamInfo, | ||
Scope * | CurScope | ||
) |
ActOnBlockArguments - This callback allows processing of block arguments.
If there are no arguments, this is still invoked.
Definition at line 16138 of file SemaExpr.cpp.
References clang::Qualifiers::addConst(), clang::BlockLiteral, clang::Declarator::getContext(), clang::Declarator::getIdentifier(), clang::TypeSourceInfo::getType(), clang::FunctionProtoType::ExtProtoInfo::HasTrailingReturn, clang::T, and clang::FunctionProtoType::ExtProtoInfo::TypeQuals.
void Sema::ActOnBlockError | ( | SourceLocation | CaretLoc, |
Scope * | CurScope | ||
) |
ActOnBlockError - If there is an error parsing a block, this callback is invoked to pop the information about the block from the action impl.
Definition at line 16259 of file SemaExpr.cpp.
void Sema::ActOnBlockStart | ( | SourceLocation | CaretLoc, |
Scope * | CurScope | ||
) |
ActOnBlockStart - This callback is invoked when a block literal is started.
Definition at line 16109 of file SemaExpr.cpp.
References Block, and clang::BlockDecl::Create().
ExprResult Sema::ActOnBlockStmtExpr | ( | SourceLocation | CaretLoc, |
Stmt * | Body, | ||
Scope * | CurScope | ||
) |
ActOnBlockStmtExpr - This is called when the body of a block statement literal was successfully completed.
^(int x){...}
Definition at line 16271 of file SemaExpr.cpp.
StmtResult Sema::ActOnBreakStmt | ( | SourceLocation | BreakLoc, |
Scope * | CurScope | ||
) |
Definition at line 3237 of file SemaStmt.cpp.
ExprResult Sema::ActOnBuiltinBitCastExpr | ( | SourceLocation | KWLoc, |
Declarator & | Dcl, | ||
ExprResult | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 387 of file SemaCast.cpp.
References BuildBuiltinBitCastExpr(), clang::ExprError(), GetTypeForDeclaratorCast(), and clang::Declarator::isInvalidType().
ExprResult Sema::ActOnBuiltinOffsetOf | ( | Scope * | S, |
SourceLocation | BuiltinLoc, | ||
SourceLocation | TypeLoc, | ||
ParsedType | ParsedArgTy, | ||
ArrayRef< OffsetOfComponent > | Components, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 16051 of file SemaExpr.cpp.
ExprResult Sema::ActOnCallExpr | ( | Scope * | S, |
Expr * | Fn, | ||
SourceLocation | LParenLoc, | ||
MultiExprArg | ArgExprs, | ||
SourceLocation | RParenLoc, | ||
Expr * | ExecConfig = nullptr |
||
) |
ActOnCallExpr - Handle a call to Fn with the specified array of arguments.
This provides the location of the left/right parens and a list of comma locations.
Definition at line 6515 of file SemaExpr.cpp.
References clang::CPlusPlus20, Diag(), and clang::Expr::getExprLoc().
StmtResult Sema::ActOnCapScopeReturnStmt | ( | SourceLocation | ReturnLoc, |
Expr * | RetValExp, | ||
NamedReturnInfo & | NRInfo, | ||
bool | SupressSimplerImplicitMoves | ||
) |
ActOnCapScopeReturnStmt - Utility routine to type-check return statements for capturing scopes.
Definition at line 3481 of file SemaStmt.cpp.
References clang::sema::LambdaScopeInfo::CallOperator, clang::ReturnStmt::Create(), clang::ActionResult< PtrTy, Compress >::get(), clang::ValueDecl::getType(), hasDeducedReturnType(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::sema::CapturingScopeInfo::ReturnType, and clang::StmtError().
StmtResult Sema::ActOnCapturedRegionEnd | ( | Stmt * | S | ) |
Definition at line 4660 of file SemaStmt.cpp.
Referenced by buildDistanceFunc(), and buildLoopVarFunc().
void Sema::ActOnCapturedRegionError | ( | ) |
Definition at line 4645 of file SemaStmt.cpp.
References clang::Decl::setInvalidDecl(), and clang::sema::CapturedRegionScopeInfo::TheRecordDecl.
void Sema::ActOnCapturedRegionStart | ( | SourceLocation | Loc, |
Scope * | CurScope, | ||
CapturedRegionKind | Kind, | ||
ArrayRef< CapturedParamNameType > | Params, | ||
unsigned | OpenMPCaptureLevel = 0 |
||
) |
Definition at line 4586 of file SemaStmt.cpp.
References clang::CapturedDecl::castToDeclContext(), and Loc.
void Sema::ActOnCapturedRegionStart | ( | SourceLocation | Loc, |
Scope * | CurScope, | ||
CapturedRegionKind | Kind, | ||
unsigned | NumParams | ||
) |
Definition at line 4556 of file SemaStmt.cpp.
References clang::CapturedDecl::castToDeclContext(), and Loc.
Referenced by buildDistanceFunc(), and buildLoopVarFunc().
ExprResult Sema::ActOnCaseExpr | ( | SourceLocation | CaseLoc, |
ExprResult | Val | ||
) |
Definition at line 465 of file SemaStmt.cpp.
References CheckConvertedConstantExpression(), clang::CPlusPlus11, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Type::isDependentType(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
Referenced by clang::Parser::ParseCaseExpression().
StmtResult Sema::ActOnCaseStmt | ( | SourceLocation | CaseLoc, |
ExprResult | LHS, | ||
SourceLocation | DotDotDotLoc, | ||
ExprResult | RHS, | ||
SourceLocation | ColonLoc | ||
) |
Definition at line 517 of file SemaStmt.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceLocation::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUnset(), and clang::StmtError().
ActOnCaseStmtBody - This installs a statement as the body of a case.
Definition at line 549 of file SemaStmt.cpp.
ExprResult Sema::ActOnCastExpr | ( | Scope * | S, |
SourceLocation | LParenLoc, | ||
Declarator & | D, | ||
ParsedType & | Ty, | ||
SourceLocation | RParenLoc, | ||
Expr * | CastExpr | ||
) |
Definition at line 7845 of file SemaExpr.cpp.
ExprResult Sema::ActOnCharacterConstant | ( | const Token & | Tok, |
Scope * | UDLScope = nullptr |
||
) |
Definition at line 3657 of file SemaExpr.cpp.
References clang::ExprError(), clang::Token::getKind(), and clang::Token::getLocation().
ExprResult Sema::ActOnChooseExpr | ( | SourceLocation | BuiltinLoc, |
Expr * | CondExpr, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 16070 of file SemaExpr.cpp.
References clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::OK_Ordinary, and clang::VK_PRValue.
Referenced by clang::TreeTransform< Derived >::RebuildChooseExpr().
DeclResult Sema::ActOnClassTemplateSpecialization | ( | Scope * | S, |
unsigned | TagSpec, | ||
TagUseKind | TUK, | ||
SourceLocation | KWLoc, | ||
SourceLocation | ModulePrivateLoc, | ||
CXXScopeSpec & | SS, | ||
TemplateIdAnnotation & | TemplateId, | ||
const ParsedAttributesView & | Attr, | ||
MultiTemplateParamsArg | TemplateParameterLists, | ||
SkipBodyInfo * | SkipBody = nullptr |
||
) |
Definition at line 9451 of file SemaTemplate.cpp.
ExprResult Sema::ActOnCoawaitExpr | ( | Scope * | S, |
SourceLocation | KwLoc, | ||
Expr * | E | ||
) |
Definition at line 790 of file SemaCoroutine.cpp.
Referenced by BuildNonArrayForRange().
void Sema::ActOnComment | ( | SourceRange | Comment | ) |
ExprResult Sema::ActOnCompoundLiteral | ( | SourceLocation | LParenLoc, |
ParsedType | Ty, | ||
SourceLocation | RParenLoc, | ||
Expr * | InitExpr | ||
) |
Definition at line 7127 of file SemaExpr.cpp.
concepts::Requirement * Sema::ActOnCompoundRequirement | ( | Expr * | E, |
SourceLocation | NoexceptLoc | ||
) |
Definition at line 9280 of file SemaExprCXX.cpp.
References BuildExprRequirement().
concepts::Requirement * Sema::ActOnCompoundRequirement | ( | Expr * | E, |
SourceLocation | NoexceptLoc, | ||
CXXScopeSpec & | SS, | ||
TemplateIdAnnotation * | TypeConstraint, | ||
unsigned | Depth | ||
) |
Definition at line 9286 of file SemaExprCXX.cpp.
References BuildExprRequirement(), BuildTypeConstraint(), Context, clang::TemplateTypeParmDecl::Create(), clang::TemplateParameterList::Create(), CurContext, Depth, clang::IdentifierTable::get(), and clang::ASTContext::Idents.
StmtResult Sema::ActOnCompoundStmt | ( | SourceLocation | L, |
SourceLocation | R, | ||
ArrayRef< Stmt * > | Elts, | ||
bool | isStmtExpr | ||
) |
Definition at line 416 of file SemaStmt.cpp.
References clang::CPlusPlus, clang::CompoundStmt::Create(), Diag(), and clang::Decl::getLocation().
Referenced by buildDistanceFunc(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitMoveAssignment(), and DefineImplicitMoveConstructor().
Decl * Sema::ActOnConceptDefinition | ( | Scope * | S, |
MultiTemplateParamsArg | TemplateParameterLists, | ||
const IdentifierInfo * | Name, | ||
SourceLocation | NameLoc, | ||
Expr * | ConstraintExpr, | ||
const ParsedAttributesView & | Attrs | ||
) |
Definition at line 9829 of file SemaTemplate.cpp.
Sema::ConditionResult Sema::ActOnCondition | ( | Scope * | S, |
SourceLocation | Loc, | ||
Expr * | SubExpr, | ||
ConditionKind | CK, | ||
bool | MissingOK = false |
||
) |
Definition at line 20310 of file SemaExpr.cpp.
ExprResult Sema::ActOnConditionalOp | ( | SourceLocation | QuestionLoc, |
SourceLocation | ColonLoc, | ||
Expr * | CondExpr, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) |
ActOnConditionalOp - Parse a ?: operation.
Note that 'LHS' may be null in the case of a the GNU conditional expr extension.
Definition at line 8892 of file SemaExpr.cpp.
Referenced by buildDistanceFunc().
Sema::ConditionResult Sema::ActOnConditionVariable | ( | Decl * | ConditionVar, |
SourceLocation | StmtLoc, | ||
ConditionKind | CK | ||
) |
Definition at line 4082 of file SemaExprCXX.cpp.
References CheckConditionVariable(), ConditionError(), ConstexprIf, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and MakeFullExpr().
ExprResult Sema::ActOnConstantExpression | ( | ExprResult | Res | ) |
Definition at line 19530 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), and clang::ActionResult< PtrTy, Compress >::isUsable().
Referenced by clang::Parser::ParseConstantExpressionInExprEvalContext().
StmtResult Sema::ActOnContinueStmt | ( | SourceLocation | ContinueLoc, |
Scope * | CurScope | ||
) |
Definition at line 3210 of file SemaStmt.cpp.
Decl * Sema::ActOnConversionDeclarator | ( | CXXConversionDecl * | Conversion | ) |
ActOnConversionDeclarator - Called by ActOnDeclarator to complete the declaration of the given C++ conversion function.
This routine is responsible for recording the conversion function in the C++ class, if possible.
Definition at line 11322 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::CXXConversionDecl::getConversionType(), clang::Decl::getDeclContext(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::AutoType::getKeyword(), clang::Decl::getLocation(), clang::Type::getPointeeType(), getReturnTypeLoc(), clang::TypeLoc::getSourceRange(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::ASTContext::getTypeDeclType(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::CanQual< T >::getUnqualifiedType(), IsDerivedFrom(), clang::Type::isRecordType(), clang::Type::isUndeducedAutoType(), clang::Type::isVoidType(), clang::CXXMethodDecl::size_overridden_methods(), clang::TSK_ExplicitSpecialization, and clang::TSK_Undeclared.
ExprResult Sema::ActOnConvertVectorExpr | ( | Expr * | E, |
ParsedType | ParsedDestTy, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RParenLoc | ||
) |
__builtin_convertvector(...)
ActOnConvertVectorExpr - create a new convert-vector expression from the provided arguments.
__builtin_convertvector( value, dst type )
Definition at line 6802 of file SemaExpr.cpp.
StmtResult Sema::ActOnCoreturnStmt | ( | Scope * | S, |
SourceLocation | KwLoc, | ||
Expr * | E | ||
) |
Definition at line 969 of file SemaCoroutine.cpp.
bool Sema::ActOnCoroutineBodyStart | ( | Scope * | S, |
SourceLocation | KwLoc, | ||
StringRef | Keyword | ||
) |
Definition at line 687 of file SemaCoroutine.cpp.
References checkCoroutineContext(), Loc, and PotentiallyEvaluated.
ExprResult Sema::ActOnCoyieldExpr | ( | Scope * | S, |
SourceLocation | KwLoc, | ||
Expr * | E | ||
) |
Definition at line 911 of file SemaCoroutine.cpp.
ExprResult Sema::ActOnCXXAssumeAttr | ( | Stmt * | St, |
const ParsedAttr & | A, | ||
SourceRange | Range | ||
) |
Definition at line 1244 of file SemaStmtAttr.cpp.
References clang::AttributeCommonInfo::AS_CXX11, clang::CPlusPlus23, Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ParsedAttr::getArgAsExpr(), clang::AttributeCommonInfo::getAttrName(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getNumArgs(), clang::AttributeCommonInfo::getSyntax(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::XRayInstrKind::None, and Range.
ExprResult Sema::ActOnCXXBoolLiteral | ( | SourceLocation | OpLoc, |
tok::TokenKind | Kind | ||
) |
ActOnCXXBoolLiteral - Parse {true,false} literals.
Definition at line 819 of file SemaExprCXX.cpp.
Referenced by BuildEmptyCXXFoldExpr().
StmtResult Sema::ActOnCXXCatchBlock | ( | SourceLocation | CatchLoc, |
Decl * | ExDecl, | ||
Stmt * | HandlerBlock | ||
) |
ActOnCXXCatchBlock - Takes an exception declaration and a handler block and creates a proper catch handler from them.
Definition at line 4139 of file SemaStmt.cpp.
DeclResult Sema::ActOnCXXConditionDeclaration | ( | Scope * | S, |
Declarator & | D | ||
) |
ActOnCXXConditionDeclarationExpr - Parsed a condition declaration of a C++ if/switch/while/for statement.
e.g: "if (int x = f()) {...}"
Definition at line 18584 of file SemaDeclCXX.cpp.
ExprResult Sema::ActOnCXXDelete | ( | SourceLocation | StartLoc, |
bool | UseGlobal, | ||
bool | ArrayForm, | ||
Expr * | ExE | ||
) |
ActOnCXXDelete - Parsed a C++ 'delete' expression.
ActOnCXXDelete - Parsed a C++ 'delete' expression (C++ 5.3.5), as in:
or
Definition at line 3689 of file SemaExprCXX.cpp.
References DefaultLvalueConversion(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), and clang::ast_matchers::match().
bool Sema::ActOnCXXEnterDeclaratorScope | ( | Scope * | S, |
CXXScopeSpec & | SS | ||
) |
ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global scope or nested-name-specifier) is parsed, part of a declarator-id.
After this method is called, according to [C++ 3.4.3p3], names should be looked up in the declarator-id's scope, until the declarator is parsed and ActOnCXXExitDeclaratorScope is called. The 'SS' should be a non-empty valid CXXScopeSpec.
Definition at line 1097 of file SemaCXXScopeSpec.cpp.
ActOnCXXEnterDeclInitializer - Invoked when we are about to parse an initializer for the declaration 'Dcl'.
Invoked when we are about to parse an initializer for the declaration 'Dcl'.
After this method is called, according to [C++ 3.4.1p13], if 'Dcl' is a static data member of class X, names should be looked up in the scope of class X.
After this method is called, according to [C++ 3.4.1p13], if 'Dcl' is a static data member of class X, names should be looked up in the scope of class X. If the declaration had a scope specifier, a scope will have been created and passed in for this purpose. Otherwise, S will be null.
Definition at line 18534 of file SemaDeclCXX.cpp.
void Sema::ActOnCXXExitDeclaratorScope | ( | Scope * | S, |
const CXXScopeSpec & | SS | ||
) |
ActOnCXXExitDeclaratorScope - Called when a declarator that previously invoked ActOnCXXEnterDeclaratorScope(), is finished.
'SS' is the same CXXScopeSpec that was passed to ActOnCXXEnterDeclaratorScope as well. Used to indicate that names should revert to being looked up in the defining scope.
Definition at line 1124 of file SemaCXXScopeSpec.cpp.
ActOnCXXExitDeclInitializer - Invoked after we are finished parsing an initializer for the declaration 'Dcl'.
Invoked after we are finished parsing an initializer for the declaration D.
Definition at line 18549 of file SemaDeclCXX.cpp.
ExprResult Sema::ActOnCXXFoldExpr | ( | Scope * | S, |
SourceLocation | LParenLoc, | ||
Expr * | LHS, | ||
tok::TokenKind | Operator, | ||
SourceLocation | EllipsisLoc, | ||
Expr * | RHS, | ||
SourceLocation | RParenLoc | ||
) |
Handle a C++1z fold-expression: ( expr op ... op expr ).
Definition at line 1281 of file SemaTemplateVariadic.cpp.
void Sema::ActOnCXXForRangeDecl | ( | Decl * | D | ) |
Definition at line 14399 of file SemaDecl.cpp.
References Diag(), clang::Decl::getLocation(), clang::DeclaratorDecl::getOuterLocStart(), clang::VarDecl::getStorageClass(), clang::VarDecl::getTSCSpec(), clang::SC_Auto, clang::SC_Extern, clang::SC_None, clang::SC_PrivateExtern, clang::SC_Register, clang::SC_Static, clang::VarDecl::setCXXForRangeDecl(), clang::Decl::setInvalidDecl(), clang::TSCS___thread, clang::TSCS__Thread_local, clang::TSCS_thread_local, and clang::TSCS_unspecified.
StmtResult Sema::ActOnCXXForRangeIdentifier | ( | Scope * | S, |
SourceLocation | IdentLoc, | ||
IdentifierInfo * | Ident, | ||
ParsedAttributes & | Attrs | ||
) |
Definition at line 14453 of file SemaDecl.cpp.
StmtResult Sema::ActOnCXXForRangeStmt | ( | Scope * | S, |
SourceLocation | ForLoc, | ||
SourceLocation | CoawaitLoc, | ||
Stmt * | InitStmt, | ||
Stmt * | First, | ||
SourceLocation | ColonLoc, | ||
Expr * | Range, | ||
SourceLocation | RParenLoc, | ||
BuildForRangeKind | Kind, | ||
ArrayRef< MaterializeTemporaryExpr * > | LifetimeExtendTemps = {} |
||
) |
ActOnCXXForRangeStmt - Check and build a C++11 for-range statement.
C++11 [stmt.ranged]: A range-based for statement is equivalent to
{ auto && __range = range-init; for ( auto __begin = begin-expr, __end = end-expr; __begin != __end; ++__begin ) { for-range-declaration = *__begin; statement } }
The body of the loop is not available yet, since it cannot be analysed until we have determined the type of the for-range-declaration.
Definition at line 2358 of file SemaStmt.cpp.
bool Sema::ActOnCXXGlobalScopeSpecifier | ( | SourceLocation | CCLoc, |
CXXScopeSpec & | SS | ||
) |
The parser has parsed a global nested-name-specifier '::'.
CCLoc | The location of the '::'. |
SS | The nested-name-specifier, which will be updated in-place to reflect the parsed nested-name-specifier. |
Definition at line 305 of file SemaCXXScopeSpec.cpp.
References Context, and clang::CXXScopeSpec::MakeGlobal().
NamedDecl * Sema::ActOnCXXMemberDeclarator | ( | Scope * | S, |
AccessSpecifier | AS, | ||
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParameterLists, | ||
Expr * | BW, | ||
const VirtSpecifiers & | VS, | ||
InClassInitStyle | InitStyle | ||
) |
ActOnCXXMemberDeclarator - This is invoked when a C++ class member declarator is parsed.
'AS' is the access specifier, 'BW' specifies the bitfield width if there is one, 'InitExpr' specifies the initializer if one has been parsed, and 'InitStyle' is set if an in-class initializer is present (but parsing it has been deferred).
Definition at line 3398 of file SemaDeclCXX.cpp.
ExprResult Sema::ActOnCXXNamedCast | ( | SourceLocation | OpLoc, |
tok::TokenKind | Kind, | ||
SourceLocation | LAngleBracketLoc, | ||
Declarator & | D, | ||
SourceLocation | RAngleBracketLoc, | ||
SourceLocation | LParenLoc, | ||
Expr * | E, | ||
SourceLocation | RParenLoc | ||
) |
ActOnCXXNamedCast - Parse {dynamic,static,reinterpret,const,addrspace}_cast's.
Definition at line 278 of file SemaCast.cpp.
References BuildCXXNamedCast(), CheckExtraCXXDefaultArguments(), clang::CPlusPlus, clang::ExprError(), getLangOpts(), clang::Expr::getType(), GetTypeForDeclaratorCast(), and clang::Declarator::isInvalidType().
bool Sema::ActOnCXXNestedNameSpecifier | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
TemplateTy | TemplateName, | ||
SourceLocation | TemplateNameLoc, | ||
SourceLocation | LAngleLoc, | ||
ASTTemplateArgsPtr | TemplateArgs, | ||
SourceLocation | RAngleLoc, | ||
SourceLocation | CCLoc, | ||
bool | EnteringContext | ||
) |
The parser has parsed a nested-name-specifier 'template[opt] template-name < template-args >::'.
S | The scope in which this nested-name-specifier occurs. |
SS | The nested-name-specifier, which is both an input parameter (the nested-name-specifier before this type) and an output parameter (containing the full nested-name-specifier, including this new type). |
TemplateKWLoc | the location of the 'template' keyword, if any. |
TemplateName | the template name. |
TemplateNameLoc | The location of the template name. |
LAngleLoc | The location of the opening angle bracket ('<'). |
TemplateArgs | The template arguments. |
RAngleLoc | The location of the closing angle bracket ('>'). |
CCLoc | The location of the '::'. |
EnteringContext | Whether we're entering the context of the nested-name-specifier. |
Definition at line 917 of file SemaCXXScopeSpec.cpp.
bool Sema::ActOnCXXNestedNameSpecifier | ( | Scope * | S, |
NestedNameSpecInfo & | IdInfo, | ||
bool | EnteringContext, | ||
CXXScopeSpec & | SS, | ||
bool * | IsCorrectedToColon = nullptr , |
||
bool | OnlyNamespace = false |
||
) |
The parser has parsed a nested-name-specifier 'identifier::'.
S | The scope in which this nested-name-specifier occurs. |
IdInfo | Parser information about an identifier in the nested-name-spec. |
EnteringContext | Whether we're entering the context nominated by this nested-name-specifier. |
SS | The nested-name-specifier, which is both an input parameter (the nested-name-specifier before this type) and an output parameter (containing the full nested-name-specifier, including this new type). |
IsCorrectedToColon | If not null, suggestions to replace '::' -> ':' are allowed. The bool value pointed by this parameter is set to 'true' if the identifier is treated as if it was followed by ':', not '::'. |
OnlyNamespace | If true, only considers namespaces in lookup. |
Definition at line 839 of file SemaCXXScopeSpec.cpp.
bool Sema::ActOnCXXNestedNameSpecifierDecltype | ( | CXXScopeSpec & | SS, |
const DeclSpec & | DS, | ||
SourceLocation | ColonColonLoc | ||
) |
Definition at line 851 of file SemaCXXScopeSpec.cpp.
References BuildDecltypeType(), Context, clang::SemaBase::Diag(), clang::CXXScopeSpec::Extend(), clang::Type::getAs(), clang::SourceRange::getEnd(), getLangOpts(), clang::DeclSpec::getRepAsExpr(), clang::TypeLocBuilder::getTypeLocInContext(), clang::DeclSpec::getTypeofParensRange(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::Type::isDependentType(), clang::CXXScopeSpec::isInvalid(), clang::TypeLocBuilder::push(), clang::DecltypeTypeLoc::setDecltypeLoc(), clang::DecltypeTypeLoc::setRParenLoc(), clang::T, clang::DeclSpec::TST_decltype, and clang::DeclSpec::TST_error.
bool Sema::ActOnCXXNestedNameSpecifierIndexedPack | ( | CXXScopeSpec & | SS, |
const DeclSpec & | DS, | ||
SourceLocation | ColonColonLoc, | ||
QualType | Type | ||
) |
Definition at line 878 of file SemaCXXScopeSpec.cpp.
References Context, clang::CXXScopeSpec::Extend(), getASTContext(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getEllipsisLoc(), clang::TypeLocBuilder::getTypeLocInContext(), clang::DeclSpec::getTypeSpecType(), clang::CXXScopeSpec::isInvalid(), clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushTrivial(), clang::PackIndexingTypeLoc::setEllipsisLoc(), clang::DeclSpec::TST_error, and clang::DeclSpec::TST_typename_pack_indexing.
ExprResult Sema::ActOnCXXNew | ( | SourceLocation | StartLoc, |
bool | UseGlobal, | ||
SourceLocation | PlacementLParen, | ||
MultiExprArg | PlacementArgs, | ||
SourceLocation | PlacementRParen, | ||
SourceRange | TypeIdParens, | ||
Declarator & | D, | ||
Expr * | Initializer | ||
) |
ActOnCXXNew - Parsed a C++ 'new' expression.
Parsed a C++ 'new' expression (C++ 5.3.4).
E.g.:
or
StartLoc | The first location of the expression. |
UseGlobal | True if 'new' was prefixed with '::'. |
PlacementLParen | Opening paren of the placement arguments. |
PlacementArgs | Placement new arguments. |
PlacementRParen | Closing paren of the placement arguments. |
TypeIdParens | If the type is in parens, the source range. |
D | The type to be allocated, as well as array dimensions. |
Initializer | The initializing expression or initializer-list, or null if there is none. |
Definition at line 1941 of file SemaExprCXX.cpp.
References AllowFold, clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, Array, CCEK_ArrayBound, CheckConvertedConstantExpression(), Context, clang::SemaBase::Diag(), clang::Declarator::DropFirstTypeObject(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Declarator::getDeclSpec(), clang::ASTContext::getIntWidth(), getLangOpts(), clang::Declarator::getNumTypeObjects(), clang::ASTContext::getSizeType(), clang::Declarator::getSourceRange(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::Declarator::getTypeObject(), clang::DeclSpec::hasAutoTypeSpec(), clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::Initializer, clang::Declarator::isInvalidType(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::Loc, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, and VerifyIntegerConstantExpression().
ExprResult Sema::ActOnCXXNullPtrLiteral | ( | SourceLocation | Loc | ) |
ActOnCXXNullPtrLiteral - Parse 'nullptr'.
Definition at line 828 of file SemaExprCXX.cpp.
ExprResult Sema::ActOnCXXThis | ( | SourceLocation | Loc | ) |
Definition at line 1424 of file SemaExprCXX.cpp.
References BuildCXXThisExpr(), CheckCXXThisType(), clang::ExprError(), getCurrentThisType(), and Loc.
Referenced by CheckDestructor(), and DefineImplicitLambdaToBlockPointerConversion().
ExprResult Sema::ActOnCXXThrow | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
Expr * | expr | ||
) |
ActOnCXXThrow - Parse throw expressions.
Definition at line 834 of file SemaExprCXX.cpp.
StmtResult Sema::ActOnCXXTryBlock | ( | SourceLocation | TryLoc, |
Stmt * | TryBlock, | ||
ArrayRef< Stmt * > | Handlers | ||
) |
ActOnCXXTryBlock - Takes a try compound-statement and a number of handlers and creates a try statement from them.
Definition at line 4261 of file SemaStmt.cpp.
References clang::T.
ExprResult Sema::ActOnCXXTypeConstructExpr | ( | ParsedType | TypeRep, |
SourceLocation | LParenOrBraceLoc, | ||
MultiExprArg | exprs, | ||
SourceLocation | RParenOrBraceLoc, | ||
bool | ListInitialization | ||
) |
ActOnCXXTypeConstructExpr - Parse construction of a specified type.
Parse construction of a specified type.
Can be interpreted either as function-style casting ("int(x)") or class type construction ("ClassType(x,y,z)") or creation of a value-initialized type ("int()").
Definition at line 1527 of file SemaExprCXX.cpp.
References BuildCXXTypeConstructExpr(), Context, CorrectDelayedTyposInExpr(), CreateRecoveryExpr(), clang::ExprError(), clang::TypeLoc::getBeginLoc(), clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), and clang::TypeSourceInfo::getTypeLoc().
ExprResult Sema::ActOnCXXTypeid | ( | SourceLocation | OpLoc, |
SourceLocation | LParenLoc, | ||
bool | isType, | ||
void * | TyOrExpr, | ||
SourceLocation | RParenLoc | ||
) |
ActOnCXXTypeid - Parse typeid( something ).
ActOnCXXTypeidOfType - Parse typeid( type-id ) or typeid (expression);.
Definition at line 652 of file SemaExprCXX.cpp.
References Diag(), clang::ExprError(), and clang::LookupResult::getAsSingle().
ExprResult Sema::ActOnCXXUuidof | ( | SourceLocation | OpLoc, |
SourceLocation | LParenLoc, | ||
bool | isType, | ||
void * | TyOrExpr, | ||
SourceLocation | RParenLoc | ||
) |
ActOnCXXUuidof - Parse __uuidof( something ).
ActOnCXXUuidof - Parse __uuidof( type-id ) or __uuidof (expression);.
Definition at line 794 of file SemaExprCXX.cpp.
Decl * Sema::ActOnDeclarator | ( | Scope * | S, |
Declarator & | D | ||
) |
Definition at line 6192 of file SemaDecl.cpp.
StmtResult Sema::ActOnDeclStmt | ( | DeclGroupPtrTy | Decl, |
SourceLocation | StartLoc, | ||
SourceLocation | EndLoc | ||
) |
Definition at line 80 of file SemaStmt.cpp.
References clang::OpaquePtr< PtrTy >::get(), clang::DeclGroupRef::isNull(), and clang::StmtError().
Referenced by buildCoroutineParameterMoves().
ExprResult Sema::ActOnDecltypeExpression | ( | Expr * | E | ) |
Process the expression contained within a decltype.
For such expressions, certain semantic checks on temporaries are delayed until this point, and are omitted for the 'topmost' call in the decltype expression. If the topmost call bound a temporary, strip that temporary off the expression.
Definition at line 7741 of file SemaExprCXX.cpp.
References ActOnParenExpr(), CheckCallReturnType(), CheckDestructorAccess(), CheckPlaceholderExpr(), CheckUnevaluatedOperand(), Cleanup, Context, clang::BinaryOperator::Create(), DiagnoseUseOfDecl(), clang::Sema::ExpressionEvaluationContextRecord::EK_Decltype, clang::Sema::ExpressionEvaluationContextRecord::EK_Other, clang::ExprError(), ExprEvalContexts, clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::CXXBindTemporaryExpr::getSubExpr(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), LookupDestructor(), MarkFunctionReferenced(), PDiag(), clang::CXXTemporary::setDestructor(), and clang::CleanupInfo::setExprNeedsCleanups().
NamedDecl * Sema::ActOnDecompositionDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParamLists | ||
) |
Definition at line 743 of file SemaDeclCXX.cpp.
void Sema::ActOnDefaultCtorInitializers | ( | Decl * | CDtorDecl | ) |
Definition at line 5980 of file SemaDeclCXX.cpp.
References SetCtorInitializers().
StmtResult Sema::ActOnDefaultStmt | ( | SourceLocation | DefaultLoc, |
SourceLocation | ColonLoc, | ||
Stmt * | SubStmt, | ||
Scope * | CurScope | ||
) |
Definition at line 554 of file SemaStmt.cpp.
References Diag().
void Sema::ActOnDefinedDeclarationSpecifier | ( | Decl * | D | ) |
Called once it is known whether a tag declaration is an anonymous union or struct.
Definition at line 5425 of file SemaDecl.cpp.
ActOnDelayedCXXMethodParameter - We've already started a delayed C++ method declaration.
We're (re-)introducing the given function parameter into scope for use in parsing later parts of the method declaration. For example, we could see an ActOnParamDefaultArgument event for this parameter.
Definition at line 10806 of file SemaDeclCXX.cpp.
void Sema::actOnDelayedExceptionSpecification | ( | Decl * | D, |
ExceptionSpecificationType | EST, | ||
SourceRange | SpecificationRange, | ||
ArrayRef< ParsedType > | DynamicExceptions, | ||
ArrayRef< SourceRange > | DynamicExceptionRanges, | ||
Expr * | NoexceptExpr | ||
) |
Add an exception-specification to the given member or friend function (or function template).
The exception-specification was parsed after the function itself was declared.
Definition at line 19096 of file SemaDeclCXX.cpp.
References clang::ASTContext::adjustExceptionSpec(), checkExceptionSpecification(), CheckOverridingFunctionExceptionSpec(), checkThisInStaticMemberFunctionExceptionSpec(), Context, clang::CXXMethodDecl::isStatic(), clang::CXXMethodDecl::isVirtual(), and clang::CXXMethodDecl::overridden_methods().
ExprResult Sema::ActOnDependentIdExpression | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
const DeclarationNameInfo & | NameInfo, | ||
bool | isAddressOfOperand, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) |
ActOnDependentIdExpression - Handle a dependent id-expression that was just parsed.
This is only possible with an explicit scope specifier naming a dependent type.
Definition at line 724 of file SemaTemplate.cpp.
References clang::CXXDependentScopeMemberExpr::Create(), clang::ExprError(), clang::CXXScopeSpec::isEmpty(), and clang::QualType::isNull().
ExprResult Sema::ActOnDependentMemberExpr | ( | Expr * | Base, |
QualType | BaseType, | ||
bool | IsArrow, | ||
SourceLocation | OpLoc, | ||
const CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
NamedDecl * | FirstQualifierInScope, | ||
const DeclarationNameInfo & | NameInfo, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) |
Definition at line 556 of file SemaExprMember.cpp.
References clang::TemplateArgumentListInfo::arguments(), clang::CXXDependentScopeMemberExpr::Create(), Diag(), clang::ExprError(), clang::Type::getAs(), clang::DeclarationNameInfo::getName(), clang::PointerType::getPointeeType(), clang::DeclarationNameInfo::getSourceRange(), clang::Stmt::getSourceRange(), clang::DeclarationName::isDependentName(), clang::Type::isDependentType(), and clang::Type::isRecordType().
TypeResult Sema::ActOnDependentTag | ( | Scope * | S, |
unsigned | TagSpec, | ||
TagUseKind | TUK, | ||
const CXXScopeSpec & | SS, | ||
const IdentifierInfo * | Name, | ||
SourceLocation | TagLoc, | ||
SourceLocation | NameLoc | ||
) |
Definition at line 11688 of file SemaTemplate.cpp.
ExprResult Sema::ActOnDesignatedInitializer | ( | Designation & | Desig, |
SourceLocation | EqualOrColonLoc, | ||
bool | GNUSyntax, | ||
ExprResult | Init | ||
) |
Definition at line 3369 of file SemaInit.cpp.
References clang::Designation::getDesignator(), clang::Designator::getDotLoc(), clang::Designator::getFieldDecl(), clang::Designator::getFieldLoc(), clang::Designation::getNumDesignators(), clang::Designator::isArrayDesignator(), and clang::Designator::isFieldDesignator().
Referenced by clang::TreeTransform< Derived >::RebuildDesignatedInitExpr().
void Sema::ActOnDocumentableDecl | ( | Decl * | D | ) |
Should be called on all declarations that might have attached documentation comments.
Definition at line 15125 of file SemaDecl.cpp.
Referenced by ActOnStartNamespaceDef().
Definition at line 15129 of file SemaDecl.cpp.
StmtResult Sema::ActOnDoStmt | ( | SourceLocation | DoLoc, |
Stmt * | Body, | ||
SourceLocation | WhileLoc, | ||
SourceLocation | CondLParen, | ||
Expr * | Cond, | ||
SourceLocation | CondRParen | ||
) |
Definition at line 1742 of file SemaStmt.cpp.
References clang::C99, clang::CPlusPlus, clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::StmtError().
bool Sema::ActOnDuplicateDefinition | ( | Decl * | Prev, |
SkipBodyInfo & | SkipBody | ||
) |
Perform ODR-like check for C/ObjC when merging tag types from modules.
Differently from C++, actually parse the body and reject / error out in case of a structural mismatch.
Definition at line 18373 of file SemaDecl.cpp.
References clang::SkipBodyInfo::New, and clang::SkipBodyInfo::Previous.
|
inline |
Check ODR hashes for C/ObjC when merging types from modules.
Differently from C++, actually parse the body and reject in case of a mismatch.
Definition at line 7621 of file Sema.h.
References makeMergedDefinitionVisible(), and Previous.
Decl * Sema::ActOnEmptyDeclaration | ( | Scope * | S, |
const ParsedAttributesView & | AttrList, | ||
SourceLocation | SemiLoc | ||
) |
Handle a C++11 empty-declaration and attribute-declaration.
Definition at line 16930 of file SemaDeclCXX.cpp.
void Sema::ActOnEndOfTranslationUnit | ( | ) |
ActOnEndOfTranslationUnit - This is called at the very end of the translation unit when EOF is reached and all but the top-level scope is popped.
Definition at line 1168 of file Sema.cpp.
References ActOnEndOfTranslationUnitFragment(), clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::begin(), CheckDelayedMemberExceptionSpecs(), CheckDelegatingCtorCycles(), checkUndefinedButUsed(), DelayedDllExportClasses, DelayedDllExportMemberFunctions, DelayedEquivalentExceptionSpecChecks, DelayedOverridingExceptionSpecChecks, clang::SemaBase::Diag(), clang::SemaOpenMP::DiagnoseUnterminatedOpenMPDeclareTarget(), DiagnoseUnterminatedPragmaAlignPack(), DiagnoseUnterminatedPragmaAttribute(), clang::SemaObjC::DiagnoseUseOfUnimplementedSelectors(), Diags, clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::end(), clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::erase(), clang::ExpectedVariableOrFunction, clang::Module::ExplicitGlobalModuleFragment, getASTContext(), clang::Preprocessor::getCurrentModule(), getCurrentModule(), clang::Sema::DelayedDiagnostics::getCurrentPool(), clang::Preprocessor::getHeaderSearchInfo(), clang::ASTContext::getModuleInitializers(), clang::HeaderSearch::getModuleMap(), clang::DiagnosticsEngine::hasErrorOccurred(), clang::Module::Imports, clang::Preprocessor::isCodeCompletionEnabled(), clang::DiagnosticsEngine::isIgnored(), clang::Preprocessor::isIncrementalProcessingEnabled(), clang::Module::isInterfaceOrPartition(), clang::Module::isNamedModuleInterfaceHasInit(), LangOpts, LateParsedInstantiations, LateTemplateParserCleanup, LoadExternalWeakUndeclaredIdentifiers(), LookupOrdinaryName, LookupSingleName(), ObjC(), OpaqueParser, OpenMP(), PendingInstantiations, PerformPendingInstantiations(), PP, clang::Module::PrivateModuleFragment, clang::TU_ClangModule, clang::TU_Prefix, TUKind, TUScope, UndefinedButUsed, UnusedFileScopedDecls, and WeakUndeclaredIdentifiers.
Referenced by clang::Parser::ParseTopLevelDecl().
void Sema::ActOnEndOfTranslationUnitFragment | ( | TUFragmentKind | Kind | ) |
Definition at line 1085 of file Sema.cpp.
References DefineUsedVTables(), clang::SYCLIntegrationHeader::emit(), clang::SYCLIntegrationFooter::emit(), emitDeferredDiags(), clang::Func, getLangOpts(), clang::SemaSYCL::getSyclIntegrationFooter(), clang::SemaSYCL::getSyclIntegrationHeader(), LateParsedInstantiations, clang::SemaSYCL::MarkDevices(), PendingInstantiations, PerformPendingInstantiations(), clang::SemaSYCL::SetSYCLKernelNames(), and SYCL().
Referenced by ActOnEndOfTranslationUnit().
void Sema::ActOnEnumBody | ( | SourceLocation | EnumLoc, |
SourceRange | BraceRange, | ||
Decl * | EnumDecl, | ||
ArrayRef< Decl * > | Elements, | ||
Scope * | S, | ||
const ParsedAttributesView & | Attr | ||
) |
Definition at line 20218 of file SemaDecl.cpp.
Referenced by clang::TemplateDeclInstantiator::InstantiateEnumDefinition().
Decl * Sema::ActOnEnumConstant | ( | Scope * | S, |
Decl * | EnumDecl, | ||
Decl * | LastEnumConstant, | ||
SourceLocation | IdLoc, | ||
IdentifierInfo * | Id, | ||
const ParsedAttributesView & | Attrs, | ||
SourceLocation | EqualLoc, | ||
Expr * | Val | ||
) |
Definition at line 19963 of file SemaDecl.cpp.
Decl * Sema::ActOnExceptionDeclarator | ( | Scope * | S, |
Declarator & | D | ||
) |
ActOnExceptionDeclarator - Parsed the exception-declarator in a C++ catch handler.
Definition at line 17081 of file SemaDeclCXX.cpp.
void Sema::ActOnExitFunctionContext | ( | ) |
Definition at line 1482 of file SemaDecl.cpp.
ExplicitSpecifier Sema::ActOnExplicitBoolSpecifier | ( | Expr * | E | ) |
ActOnExplicitBoolSpecifier - Build an ExplicitSpecifier from an expression found in an explicit(bool) specifier.
Definition at line 13862 of file SemaDeclCXX.cpp.
References clang::Expr::isTypeDependent(), tryResolveExplicitSpecifier(), and clang::Unresolved.
DeclResult Sema::ActOnExplicitInstantiation | ( | Scope * | S, |
SourceLocation | ExternLoc, | ||
SourceLocation | TemplateLoc, | ||
Declarator & | D | ||
) |
Definition at line 11271 of file SemaTemplate.cpp.
DeclResult Sema::ActOnExplicitInstantiation | ( | Scope * | S, |
SourceLocation | ExternLoc, | ||
SourceLocation | TemplateLoc, | ||
unsigned | TagSpec, | ||
SourceLocation | KWLoc, | ||
const CXXScopeSpec & | SS, | ||
TemplateTy | Template, | ||
SourceLocation | TemplateNameLoc, | ||
SourceLocation | LAngleLoc, | ||
ASTTemplateArgsPtr | TemplateArgs, | ||
SourceLocation | RAngleLoc, | ||
const ParsedAttributesView & | Attr | ||
) |
Definition at line 10861 of file SemaTemplate.cpp.
DeclResult Sema::ActOnExplicitInstantiation | ( | Scope * | S, |
SourceLocation | ExternLoc, | ||
SourceLocation | TemplateLoc, | ||
unsigned | TagSpec, | ||
SourceLocation | KWLoc, | ||
CXXScopeSpec & | SS, | ||
IdentifierInfo * | Name, | ||
SourceLocation | NameLoc, | ||
const ParsedAttributesView & | Attr | ||
) |
Definition at line 11157 of file SemaTemplate.cpp.
ExprResult Sema::ActOnExpressionTrait | ( | ExpressionTrait | OET, |
SourceLocation | KWLoc, | ||
Expr * | Queried, | ||
SourceLocation | RParen | ||
) |
ActOnExpressionTrait - Parsed one of the unary type trait support pseudo-functions.
Definition at line 6262 of file SemaExprCXX.cpp.
References BuildExpressionTrait(), and clang::ExprError().
StmtResult Sema::ActOnExprStmt | ( | ExprResult | Arg, |
bool | DiscardedValue = true |
||
) |
Definition at line 53 of file SemaStmt.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::StmtError().
StmtResult Sema::ActOnExprStmtError | ( | ) |
Definition at line 70 of file SemaStmt.cpp.
References clang::StmtError().
Decl * Sema::ActOnField | ( | Scope * | S, |
Decl * | TagD, | ||
SourceLocation | DeclStart, | ||
Declarator & | D, | ||
Expr * | BitfieldWidth | ||
) |
ActOnField - Each field of a C struct/union is passed into this in order to create a FieldDecl object for it.
Definition at line 18592 of file SemaDecl.cpp.
void Sema::ActOnFields | ( | Scope * | S, |
SourceLocation | RecLoc, | ||
Decl * | TagDecl, | ||
ArrayRef< Decl * > | Fields, | ||
SourceLocation | LBrac, | ||
SourceLocation | RBrac, | ||
const ParsedAttributesView & | AttrList | ||
) |
A field cannot be an Objective-c object
Definition at line 19210 of file SemaDecl.cpp.
Decl * Sema::ActOnFileScopeAsmDecl | ( | Expr * | expr, |
SourceLocation | AsmLoc, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 20461 of file SemaDecl.cpp.
References clang::FileScopeAsmDecl::Create(), and clang::ast_matchers::expr.
void Sema::ActOnFinishCXXInClassMemberInitializer | ( | Decl * | D, |
SourceLocation | InitLoc, | ||
Expr * | InitExpr | ||
) |
This is invoked after parsing an in-class initializer for a non-static C++ class member, and after instantiating an in-class initializer in a class template.
Such actions are deferred until the class is complete.
Definition at line 4217 of file SemaDeclCXX.cpp.
References ActOnFinishFullExpr(), ConvertMemberDefaultInitExpression(), CorrectDelayedTyposInExpr(), DiagnoseUnexpandedParameterPack(), clang::FieldDecl::getInClassInitStyle(), clang::ValueDecl::getType(), clang::ICIS_NoInit, clang::Type::isDependentType(), PopFunctionScopeInfo(), clang::FieldDecl::removeInClassInitializer(), clang::FieldDecl::setInClassInitializer(), clang::Decl::setInvalidDecl(), and UPPC_Initializer.
Referenced by InstantiateInClassInitializer().
void Sema::ActOnFinishCXXMemberDecls | ( | ) |
Perform any semantic analysis which needs to be delayed until all pending class member declarations have been parsed.
Definition at line 14420 of file SemaDeclCXX.cpp.
References checkForMultipleExportedDefaultConstructors(), CurContext, DelayedEquivalentExceptionSpecChecks, and DelayedOverridingExceptionSpecChecks.
void Sema::ActOnFinishCXXMemberSpecification | ( | Scope * | S, |
SourceLocation | RLoc, | ||
Decl * | TagDecl, | ||
SourceLocation | LBrac, | ||
SourceLocation | RBrac, | ||
const ParsedAttributesView & | AttrList | ||
) |
Definition at line 10534 of file SemaDeclCXX.cpp.
void Sema::ActOnFinishCXXNonNestedClass | ( | ) |
Definition at line 14432 of file SemaDeclCXX.cpp.
References ActOnFinishInlineFunctionDef(), DefineDefaultedFunction(), DelayedDllExportMemberFunctions, referenceDLLExportedClassMethods(), and clang::TSK_ExplicitInstantiationDefinition.
void Sema::ActOnFinishDelayedAttribute | ( | Scope * | S, |
Decl * | D, | ||
ParsedAttributes & | Attrs | ||
) |
ActOnFinishDelayedAttribute - Invoked when we have finished parsing an attribute for which parsing is delayed.
When we finish delayed parsing of an attribute, we must attach it to the relevant Decl.
Definition at line 16569 of file SemaDecl.cpp.
ActOnFinishDelayedCXXMethodDeclaration - We have finished processing the delayed method declaration for Method.
The method declaration is now considered finished. There may be a separate ActOnStartOfFunctionDef action later (not necessarily immediately!) for this method, if it was also defined inside the class body.
Definition at line 10823 of file SemaDeclCXX.cpp.
Definition at line 10773 of file SemaDeclCXX.cpp.
Referenced by clang::Parser::ReenterClassScopeRAII::~ReenterClassScopeRAII().
void Sema::ActOnFinishDelayedMemberInitializers | ( | Decl * | Record | ) |
Definition at line 14109 of file SemaDeclCXX.cpp.
References CheckDelayedMemberExceptionSpecs().
Decl * Sema::ActOnFinishExportDecl | ( | Scope * | S, |
Decl * | ExportDecl, | ||
SourceLocation | RBraceLoc | ||
) |
Complete the definition of an export declaration.
Definition at line 980 of file SemaModule.cpp.
|
inline |
Definition at line 6848 of file Sema.h.
References clang::Expr::getExprLoc().
Referenced by ActOnFinishCXXInClassMemberInitializer(), clang::SemaObjC::ActOnObjCAtSynchronizedOperand(), clang::SemaOpenMP::ActOnOpenMPCopyinClause(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), BuildBaseInitializer(), BuildDelegatingInitializer(), BuildMemberInitializer(), BuildStaticAssertDeclaration(), MakeFullDiscardedValueExpr(), MakeFullExpr(), clang::Parser::ParseOpenMPParensExpr(), clang::Parser::ParseOpenMPVarList(), parseStepSize(), and SubstDefaultArgument().
ExprResult Sema::ActOnFinishFullExpr | ( | Expr * | Expr, |
SourceLocation | CC, | ||
bool | DiscardedValue, | ||
bool | IsConstexpr = false , |
||
bool | IsTemplateArgument = false |
||
) |
Definition at line 9092 of file SemaExprCXX.cpp.
References CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), CheckPlaceholderExpr(), Context, CorrectDelayedTyposInExpr(), CurContext, DiagnoseUnexpandedParameterPack(), DiagnoseUnusedExprResult(), clang::ExprError(), forceUnknownAnyToType(), getCurLambda(), getLangOpts(), clang::ASTContext::getObjCIdType(), clang::DeclContext::getParent(), clang::Expr::getType(), clang::sema::LambdaScopeInfo::hasPotentialCaptures(), IgnoredValueConversions(), clang::isLambdaCallOperator(), MaybeCreateExprWithCleanups(), and clang::ASTContext::UnknownAnyTy.
StmtResult Sema::ActOnFinishFullStmt | ( | Stmt * | Stmt | ) |
Definition at line 9187 of file SemaExprCXX.cpp.
References MaybeCreateStmtWithCleanups(), and clang::StmtError().
Definition at line 16046 of file SemaDecl.cpp.
Definition at line 16119 of file SemaDecl.cpp.
References clang::Decl::addAttr(), clang::Decl::getAsFunction(), clang::Decl::hasAttr(), and clang::sema::FunctionScopeInfo::UsesFPIntrin.
void Sema::ActOnFinishFunctionDeclarationDeclarator | ( | Declarator & | D | ) |
Called after parsing a function declarator belonging to a function declaration.
Definition at line 19260 of file SemaDeclCXX.cpp.
References Context, clang::TemplateParameterList::Create(), clang::TemplateParameterList::getLAngleLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getRequiresClause(), clang::TemplateParameterList::getTemplateLoc(), clang::Declarator::getTemplateParameterLists(), InventedParameterInfos, and clang::Declarator::setInventedTemplateParameterList().
void Sema::ActOnFinishInlineFunctionDef | ( | FunctionDecl * | D | ) |
Definition at line 15551 of file SemaDecl.cpp.
Referenced by ActOnFinishCXXNonNestedClass().
void Sema::ActOnFinishKNRParamDeclarations | ( | Scope * | S, |
Declarator & | D, | ||
SourceLocation | LocAfterDecls | ||
) |
Definition at line 15473 of file SemaDecl.cpp.
Decl * Sema::ActOnFinishLinkageSpecification | ( | Scope * | S, |
Decl * | LinkageSpec, | ||
SourceLocation | RBraceLoc | ||
) |
ActOnFinishLinkageSpecification - Complete the definition of the C++ linkage specification LinkageSpec.
If RBraceLoc is valid, it's the position of the closing '}' brace in a linkage specification that uses braces.
Definition at line 16910 of file SemaDeclCXX.cpp.
void Sema::ActOnFinishNamespaceDef | ( | Decl * | Dcl, |
SourceLocation | RBrace | ||
) |
ActOnFinishNamespaceDef - This callback is called after a namespace is exited.
Decl is the DeclTy returned by ActOnStartNamespaceDef.
Definition at line 11822 of file SemaDeclCXX.cpp.
References clang::Decl::hasAttr(), PopDeclContext(), PopPragmaVisibility(), clang::Decl::setModuleOwnershipKind(), clang::NamespaceDecl::setRBraceLoc(), and clang::Decl::VisibleWhenImported.
void Sema::ActOnFinishOfCompoundStmt | ( | ) |
Definition at line 408 of file SemaStmt.cpp.
Referenced by clang::Sema::CompoundScopeRAII::~CompoundScopeRAII().
void Sema::ActOnFinishRequiresExpr | ( | ) |
Definition at line 9451 of file SemaExprCXX.cpp.
References CurContext, and clang::DeclContext::getLexicalParent().
StmtResult Sema::ActOnFinishSEHFinallyBlock | ( | SourceLocation | Loc, |
Stmt * | Block | ||
) |
Definition at line 4446 of file SemaStmt.cpp.
References Block, and clang::SEHFinallyStmt::Create().
StmtResult Sema::ActOnFinishSwitchStmt | ( | SourceLocation | SwitchLoc, |
Stmt * | Switch, | ||
Stmt * | Body | ||
) |
Definition at line 1247 of file SemaStmt.cpp.
References clang::SwitchStmt::getCond(), clang::Expr::getType(), GetTypeBeforeIntegralPromotion(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::SwitchStmt::setBody(), clang::StmtError(), and clang::Switch.
void Sema::ActOnFinishTopLevelStmtDecl | ( | TopLevelStmtDecl * | D, |
Stmt * | Statement | ||
) |
Definition at line 20482 of file SemaDecl.cpp.
References clang::TopLevelStmtDecl::setStmt().
ExprResult Sema::ActOnFinishTrailingRequiresClause | ( | ExprResult | ConstraintExpr | ) |
Definition at line 4180 of file SemaDeclCXX.cpp.
References ActOnRequiresClause().
void Sema::ActOnForEachDeclStmt | ( | DeclGroupPtrTy | Decl | ) |
Definition at line 90 of file SemaStmt.cpp.
References clang::ast_matchers::decl, Diag(), clang::OpaquePtr< PtrTy >::get(), clang::DeclGroupRef::getSingleDecl(), clang::DeclGroupRef::isNull(), clang::DeclGroupRef::isSingleDecl(), clang::Qualifiers::OCL_Strong, clang::ast_matchers::type, and clang::dataflow::var().
StmtResult Sema::ActOnForEachLValueExpr | ( | Expr * | E | ) |
In an Objective C collection iteration statement: for (x in y) x can be an arbitrary l-value expression.
Bind it up as a full-expression.
Definition at line 2228 of file SemaStmt.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::StmtError().
StmtResult Sema::ActOnForStmt | ( | SourceLocation | ForLoc, |
SourceLocation | LParenLoc, | ||
Stmt * | First, | ||
ConditionResult | Second, | ||
FullExprArg | Third, | ||
SourceLocation | RParenLoc, | ||
Stmt * | Body | ||
) |
Definition at line 2166 of file SemaStmt.cpp.
References clang::CPlusPlus, Diag(), clang::First, clang::Sema::FullExprArg::get(), clang::Sema::ConditionResult::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Decl::getLocation(), clang::VarDecl::hasLocalStorage(), clang::Sema::ConditionResult::isInvalid(), clang::VarDecl::isLocalVarDecl(), clang::Sema::FullExprArg::release(), and clang::StmtError().
NamedDecl * Sema::ActOnFriendFunctionDecl | ( | Scope * | S, |
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParams | ||
) |
Definition at line 17830 of file SemaDeclCXX.cpp.
Decl * Sema::ActOnFriendTypeDecl | ( | Scope * | S, |
const DeclSpec & | DS, | ||
MultiTemplateParamsArg | TempParams | ||
) |
Handle a friend type declaration.
This works in tandem with ActOnTag.
Notes on friend class templates:
We generally treat friend class declarations as if they were declaring a class. So, for example, the elaborated type specifier in a friend declaration is required to obey the restrictions of a class-head (i.e. no typedefs in the scope chain), template parameters are required to match up with simple template-ids, &c. However, unlike when declaring a template specialization, it's okay to refer to a template specialization without an empty template parameter declaration, e.g. friend class A<T>::B<unsigned>; We permit this as a special case; if there are any template parameters present at all, require proper matching, i.e. template <> template <class T> friend class A<int>::B;
Definition at line 17726 of file SemaDeclCXX.cpp.
NamedDecl * Sema::ActOnFunctionDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
DeclContext * | DC, | ||
TypeSourceInfo * | TInfo, | ||
LookupResult & | Previous, | ||
MultiTemplateParamsArg | TemplateParamLists, | ||
bool & | AddToScope | ||
) |
Definition at line 9912 of file SemaDecl.cpp.
StmtResult Sema::ActOnGCCAsmStmt | ( | SourceLocation | AsmLoc, |
bool | IsSimple, | ||
bool | IsVolatile, | ||
unsigned | NumOutputs, | ||
unsigned | NumInputs, | ||
IdentifierInfo ** | Names, | ||
MultiExprArg | Constraints, | ||
MultiExprArg | Exprs, | ||
Expr * | AsmString, | ||
MultiExprArg | Clobbers, | ||
unsigned | NumLabels, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 243 of file SemaStmtAsm.cpp.
References clang::StringLiteral::isOrdinary().
ExprResult Sema::ActOnGenericSelectionExpr | ( | SourceLocation | KeyLoc, |
SourceLocation | DefaultLoc, | ||
SourceLocation | RParenLoc, | ||
bool | PredicateIsExpr, | ||
void * | ControllingExprOrType, | ||
ArrayRef< ParsedType > | ArgTypes, | ||
ArrayRef< Expr * > | ArgExprs | ||
) |
ControllingExprOrType is either an opaque pointer coming out of a ParsedType or an Expr *.
FIXME: it'd be better to split this interface into two so we don't take a void *, but that's awkward because one of the operands is either a ParsedType or an Expr *, which doesn't lend itself to generic code very well.
Definition at line 1714 of file SemaExpr.cpp.
Sema::DeclGroupPtrTy Sema::ActOnGlobalModuleFragmentDecl | ( | SourceLocation | ModuleLoc | ) |
The parser has processed a global-module-fragment declaration that begins the definition of the global module fragment of the current module unit.
ModuleLoc | The location of the 'module' keyword. |
Definition at line 162 of file SemaModule.cpp.
ExprResult Sema::ActOnGNUNullExpr | ( | SourceLocation | TokenLoc | ) |
Definition at line 16623 of file SemaExpr.cpp.
StmtResult Sema::ActOnGotoStmt | ( | SourceLocation | GotoLoc, |
SourceLocation | LabelLoc, | ||
LabelDecl * | TheDecl | ||
) |
Definition at line 3155 of file SemaStmt.cpp.
References clang::Decl::markUsed().
ExprResult Sema::ActOnIdExpression | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
UnqualifiedId & | Id, | ||
bool | HasTrailingLParen, | ||
bool | IsAddressOfOperand, | ||
CorrectionCandidateCallback * | CCC = nullptr , |
||
bool | IsInlineAsmIdentifier = false , |
||
Token * | KeywordReplacement = nullptr |
||
) |
Definition at line 2763 of file SemaExpr.cpp.
StmtResult Sema::ActOnIfStmt | ( | SourceLocation | IfLoc, |
IfStatementKind | StatementKind, | ||
SourceLocation | LParenLoc, | ||
Stmt * | InitStmt, | ||
ConditionResult | Cond, | ||
SourceLocation | RParenLoc, | ||
Stmt * | ThenVal, | ||
SourceLocation | ElseLoc, | ||
Stmt * | ElseVal | ||
) |
Definition at line 910 of file SemaStmt.cpp.
References clang::C99, clang::ConstevalNegated, clang::ConstevalNonNegated, clang::Constexpr, clang::CPlusPlus, clang::Sema::ConditionResult::get(), clang::Expr::getExprLoc(), clang::Sema::ConditionResult::isInvalid(), and clang::StmtError().
StmtResult Sema::ActOnIndirectGotoStmt | ( | SourceLocation | GotoLoc, |
SourceLocation | StarLoc, | ||
Expr * | DestExp | ||
) |
Definition at line 3170 of file SemaStmt.cpp.
References clang::Expr::getType(), and clang::Expr::isTypeDependent().
void Sema::ActOnInitializerError | ( | Decl * | Dcl | ) |
ActOnInitializerError - Given that there was an error parsing an initializer for the given declaration, try to at least re-establish invariants such as whether a variable's type is either dependent or complete.
Definition at line 14067 of file SemaDecl.cpp.
References clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Type::isDependentType(), clang::Decl::isInvalidDecl(), clang::Type::isUndeducedType(), and clang::Decl::setInvalidDecl().
ExprResult Sema::ActOnInitList | ( | SourceLocation | LBraceLoc, |
MultiExprArg | InitArgList, | ||
SourceLocation | RBraceLoc | ||
) |
Definition at line 7273 of file SemaExpr.cpp.
References clang::C99, clang::CPlusPlus, clang::CPlusPlus20, Diag(), clang::SourceLocation::isInvalid(), and clang::SourceLocation::isValid().
ExprResult Sema::ActOnIntegerConstant | ( | SourceLocation | Loc, |
uint64_t | Val | ||
) |
Definition at line 3717 of file SemaExpr.cpp.
StmtResult Sema::ActOnLabelStmt | ( | SourceLocation | IdentLoc, |
LabelDecl * | TheDecl, | ||
SourceLocation | ColonLoc, | ||
Stmt * | SubStmt | ||
) |
Definition at line 574 of file SemaStmt.cpp.
References Diag(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), and clang::LabelDecl::getStmt().
Referenced by clang::TreeTransform< Derived >::RebuildLabelStmt().
void Sema::ActOnLambdaClosureParameters | ( | Scope * | LambdaScope, |
MutableArrayRef< DeclaratorChunk::ParamInfo > | ParamInfo | ||
) |
Definition at line 1346 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::AfterParameterList, clang::sema::LambdaScopeInfo::CallOperator, getCurrentLambdaScopeUnsafe(), getGenericLambdaTemplateParameterList(), clang::sema::LambdaScopeInfo::Lambda, P, and clang::CXXRecordDecl::setLambdaIsGeneric().
void Sema::ActOnLambdaClosureQualifiers | ( | LambdaIntroducer & | Intro, |
SourceLocation | MutableLoc | ||
) |
Definition at line 1320 of file SemaLambda.cpp.
References getCurrentLambdaScopeUnsafe(), clang::SourceLocation::isValid(), and clang::sema::LambdaScopeInfo::Mutable.
void Sema::ActOnLambdaError | ( | SourceLocation | StartLoc, |
Scope * | CurScope, | ||
bool | IsInstantiation = false |
||
) |
ActOnLambdaError - If there is an error parsing a lambda, this callback is invoked to pop the information about the lambda.
Definition at line 1538 of file SemaLambda.cpp.
References clang::Class, and clang::sema::LambdaScopeInfo::Lambda.
void Sema::ActOnLambdaExplicitTemplateParameterList | ( | LambdaIntroducer & | Intro, |
SourceLocation | LAngleLoc, | ||
ArrayRef< NamedDecl * > | TParams, | ||
SourceLocation | RAngleLoc, | ||
ExprResult | RequiresClause | ||
) |
This is called after parsing the explicit template parameter list on a lambda (if it exists) in C++2a.
Definition at line 544 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::ExplicitTemplateParamsRange, clang::InventedTemplateParameterInfo::NumExplicitTemplateParams, clang::sema::LambdaScopeInfo::RequiresClause, and clang::InventedTemplateParameterInfo::TemplateParams.
ExprResult Sema::ActOnLambdaExpr | ( | SourceLocation | StartLoc, |
Stmt * | Body | ||
) |
ActOnLambdaExpr - This is called when the body of a lambda expression was successfully completed.
Definition at line 1930 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::CallOperator, and clang::Stmt::getEndLoc().
void Sema::ActOnLambdaExpressionAfterIntroducer | ( | LambdaIntroducer & | Intro, |
Scope * | CurContext | ||
) |
Once the Lambdas capture are known, we can start to create the closure, call operator method, and keep track of the captures.
We do the capture lookup here, but they are not actually captured until after we know what the qualifiers of the call operator are.
Definition at line 1059 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::AfterParameterList, clang::VarDecl::CallInit, clang::sema::LambdaScopeInfo::CallOperator, clang::sema::LambdaScopeInfo::CaptureDefaultLoc, clang::LambdaIntroducer::Captures, clang::sema::CapturingScopeInfo::Captures, clang::VarDecl::CInit, clang::Class, clang::CopyInit, clang::CPlusPlus14, clang::CPlusPlus17, clang::CPlusPlus20, clang::FixItHint::CreateRemoval(), clang::LambdaIntroducer::Default, clang::LambdaIntroducer::DefaultLoc, Diag(), clang::DirectInit, clang::sema::LambdaScopeInfo::ExplicitCaptureRanges, clang::SourceRange::getBegin(), clang::sema::CapturingScopeInfo::getCXXThisCapture(), clang::sema::Capture::getLocation(), clang::Scope::getParent(), clang::Scope::getTemplateParamParent(), clang::sema::CapturingScopeInfo::ImpCap_LambdaByref, clang::sema::CapturingScopeInfo::ImpCap_LambdaByval, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::sema::LambdaScopeInfo::IntroducerRange, clang::sema::CapturingScopeInfo::isCXXThisCaptured(), clang::QualType::isNull(), clang::sema::LambdaScopeInfo::Lambda, clang::LCD_ByCopy, clang::LCD_ByRef, clang::LCD_None, clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_StarThis, clang::LCK_This, clang::CXXRecordDecl::LDK_AlwaysDependent, clang::CXXRecordDecl::LDK_Unknown, clang::VarDecl::ListInit, clang::ListInit, clang::NoInit, clang::InventedTemplateParameterInfo::NumExplicitTemplateParams, clang::LambdaIntroducer::Range, clang::Decl::setLexicalDeclContext(), and V.
|
inline |
Perform initialization analysis of the init-capture and perform any implicit conversions such as an lvalue-to-rvalue conversion if not being used to initialize a reference.
Definition at line 7263 of file Sema.h.
References buildLambdaInitCaptureInitialization(), clang::CopyInit, Id, Loc, and clang::OpaquePtr< QualType >::make().
void Sema::ActOnLastBitfield | ( | SourceLocation | DeclLoc, |
SmallVectorImpl< Decl * > & | AllIvarDecls | ||
) |
ActOnLastBitfield - This routine handles synthesized bitfields rules for class and class extensions.
For every class @interface and class extension @interface, if the last ivar is a bitfield of any type, then add an implicit char :0
ivar to the end of that interface.
Definition at line 18964 of file SemaDecl.cpp.
ExprResult Sema::ActOnMemberAccessExpr | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
UnqualifiedId & | Id, | ||
Decl * | ObjCImpDecl | ||
) |
The main callback when the parser finds something like expression .
[nested-name-specifier] identifier expression -> [nested-name-specifier] identifier where 'identifier' encompasses a fairly broad spectrum of possibilities, including destructor and operator references.
OpKind | either tok::arrow or tok::period |
ObjCImpDecl | the current Objective-C @implementation decl; this is an ugly hack around the fact that Objective-C @implementations aren't properly put in the context chain |
Definition at line 1769 of file SemaExprMember.cpp.
MemInitResult Sema::ActOnMemInitializer | ( | Decl * | ConstructorD, |
Scope * | S, | ||
CXXScopeSpec & | SS, | ||
IdentifierInfo * | MemberOrBase, | ||
ParsedType | TemplateTypeTy, | ||
const DeclSpec & | DS, | ||
SourceLocation | IdLoc, | ||
Expr * | InitList, | ||
SourceLocation | EllipsisLoc | ||
) |
Handle a C++ member initializer using braced-init-list syntax.
Definition at line 4305 of file SemaDeclCXX.cpp.
MemInitResult Sema::ActOnMemInitializer | ( | Decl * | ConstructorD, |
Scope * | S, | ||
CXXScopeSpec & | SS, | ||
IdentifierInfo * | MemberOrBase, | ||
ParsedType | TemplateTypeTy, | ||
const DeclSpec & | DS, | ||
SourceLocation | IdLoc, | ||
SourceLocation | LParenLoc, | ||
ArrayRef< Expr * > | Args, | ||
SourceLocation | RParenLoc, | ||
SourceLocation | EllipsisLoc | ||
) |
Handle a C++ member initializer using parentheses syntax.
Definition at line 4321 of file SemaDeclCXX.cpp.
void Sema::ActOnMemInitializers | ( | Decl * | ConstructorDecl, |
SourceLocation | ColonLoc, | ||
ArrayRef< CXXCtorInitializer * > | MemInits, | ||
bool | AnyErrors | ||
) |
ActOnMemInitializers - Handle the member initializers for a constructor.
Definition at line 5769 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), Context, clang::SemaBase::Diag(), DiagnoseBaseOrMemInitializerOrder(), GetKeyForMember(), SetCtorInitializers(), and SetDelegatingInitializer().
Referenced by InstantiateMemInitializers().
Sema::DeclGroupPtrTy Sema::ActOnModuleDecl | ( | SourceLocation | StartLoc, |
SourceLocation | ModuleLoc, | ||
ModuleDeclKind | MDK, | ||
ModuleIdPath | Path, | ||
ModuleIdPath | Partition, | ||
ModuleImportState & | ImportState | ||
) |
The parser has processed a module-declaration that begins the definition of a module interface or implementation.
Definition at line 258 of file SemaModule.cpp.
References clang::Module::AllVisible, clang::LangOptionsBase::CMK_HeaderUnit, clang::LangOptionsBase::CMK_ModuleInterface, clang::LangOptionsBase::CMK_ModuleMap, clang::LangOptionsBase::CMK_None, clang::FixItHint::CreateInsertion(), Diag(), DiagReservedModuleName(), clang::Interface, clang::isDigit(), clang::SourceLocation::isValid(), clang::Module::Kind, clang::Module::ModulePartitionImplementation, clang::Module::ModulePartitionInterface, and stringFromPath().
DeclResult Sema::ActOnModuleImport | ( | SourceLocation | StartLoc, |
SourceLocation | ExportLoc, | ||
SourceLocation | ImportLoc, | ||
Module * | M, | ||
ModuleIdPath | Path = {} |
||
) |
Definition at line 638 of file SemaModule.cpp.
References checkModuleImportContext(), clang::ImportDecl::Create(), Diag(), clang::Module::getFullModuleName(), clang::Module::isForBuilding(), clang::Module::isHeaderUnit(), clang::Module::isNamedModule(), makeTransitiveImportsVisible(), and clang::Module::Parent.
DeclResult Sema::ActOnModuleImport | ( | SourceLocation | StartLoc, |
SourceLocation | ExportLoc, | ||
SourceLocation | ImportLoc, | ||
ModuleIdPath | Path, | ||
bool | IsPartition = false |
||
) |
The parser has processed a module import declaration.
StartLoc | The location of the first token in the declaration. This could be the location of an '@', 'export', or 'import'. |
ExportLoc | The location of the 'export' keyword, if any. |
ImportLoc | The location of the 'import' keyword. |
Path | The module toplevel name as an access path. |
IsPartition | If the name is for a partition. |
Definition at line 572 of file SemaModule.cpp.
References clang::Module::getPrimaryModuleInterfaceName(), clang::Module::Module(), and stringFromPath().
Referenced by clang::Parser::ParseTopLevelDecl().
StmtResult Sema::ActOnMSAsmStmt | ( | SourceLocation | AsmLoc, |
SourceLocation | LBraceLoc, | ||
ArrayRef< Token > | AsmToks, | ||
StringRef | AsmString, | ||
unsigned | NumOutputs, | ||
unsigned | NumInputs, | ||
ArrayRef< StringRef > | Constraints, | ||
ArrayRef< StringRef > | Clobbers, | ||
ArrayRef< Expr * > | Exprs, | ||
SourceLocation | EndLoc | ||
) |
Definition at line 932 of file SemaStmtAsm.cpp.
References Diag(), clang::Stmt::getBeginLoc(), clang::Decl::getLocation(), clang::Expr::getSourceBitField(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isBitIntType(), clang::Expr::refersToBitField(), and clang::StmtError().
StmtResult Sema::ActOnMSDependentExistsStmt | ( | SourceLocation | KeywordLoc, |
bool | IsIfExists, | ||
CXXScopeSpec & | SS, | ||
UnqualifiedId & | Name, | ||
Stmt * | Nested | ||
) |
Definition at line 4476 of file SemaStmt.cpp.
ParsedType Sema::ActOnMSVCUnknownTypeName | ( | const IdentifierInfo & | II, |
SourceLocation | NameLoc, | ||
bool | IsTemplateTypeArg | ||
) |
Attempt to behave like MSVC in situations where lookup of an unqualified type name has failed in a dependent context.
In these situations, we automatically form a DependentTypeName that will retry lookup in a related scope during instantiation.
Definition at line 595 of file SemaDecl.cpp.
References synthesizeCurrentNestedNameSpecifier().
ExprResult Sema::ActOnNameClassifiedAsDependentNonType | ( | const CXXScopeSpec & | SS, |
IdentifierInfo * | Name, | ||
SourceLocation | NameLoc, | ||
bool | IsAddressOfOperand | ||
) |
Act on the result of classifying a name as an undeclared member of a dependent base class.
Definition at line 1261 of file SemaDecl.cpp.
ExprResult Sema::ActOnNameClassifiedAsNonType | ( | Scope * | S, |
const CXXScopeSpec & | SS, | ||
NamedDecl * | Found, | ||
SourceLocation | NameLoc, | ||
const Token & | NextToken | ||
) |
Act on the result of classifying a name as a specific non-type declaration.
Definition at line 1271 of file SemaDecl.cpp.
ExprResult Sema::ActOnNameClassifiedAsOverloadSet | ( | Scope * | S, |
Expr * | OverloadSet | ||
) |
Act on the result of classifying a name as an overload set.
Definition at line 1288 of file SemaDecl.cpp.
ExprResult Sema::ActOnNameClassifiedAsUndeclaredNonType | ( | IdentifierInfo * | Name, |
SourceLocation | NameLoc | ||
) |
Act on the result of classifying a name as an undeclared (ADL-only) non-type declaration.
Definition at line 1252 of file SemaDecl.cpp.
Decl * Sema::ActOnNamespaceAliasDef | ( | Scope * | CurScope, |
SourceLocation | NamespaceLoc, | ||
SourceLocation | AliasLoc, | ||
IdentifierInfo * | Alias, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | IdentLoc, | ||
IdentifierInfo * | Ident | ||
) |
Definition at line 13694 of file SemaDeclCXX.cpp.
concepts::Requirement * Sema::ActOnNestedRequirement | ( | Expr * | Constraint | ) |
Definition at line 9398 of file SemaExprCXX.cpp.
References BuildNestedRequirement().
ExprResult Sema::ActOnNoexceptExpr | ( | SourceLocation | KeyLoc, |
SourceLocation | LParen, | ||
Expr * | Operand, | ||
SourceLocation | RParen | ||
) |
Definition at line 8416 of file SemaExprCXX.cpp.
References BuildCXXNoexceptExpr().
ExprResult clang::Sema::ActOnNoexceptSpec | ( | Expr * | NoexceptExpr, |
ExceptionSpecificationType & | EST | ||
) |
Check the given noexcept-specifier, convert its expression, and compute the appropriate ExceptionSpecificationType.
Definition at line 82 of file SemaExceptionSpec.cpp.
References clang::ASTContext::BoolTy, CCEK_Noexcept, CheckConvertedConstantExpression(), clang::Expr::containsUnexpandedParameterPack(), Context, clang::ConstantExpr::Create(), clang::EST_DependentNoexcept, clang::EST_NoexceptFalse, clang::EST_NoexceptTrue, clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
NamedDecl * Sema::ActOnNonTypeTemplateParameter | ( | Scope * | S, |
Declarator & | D, | ||
unsigned | Depth, | ||
unsigned | Position, | ||
SourceLocation | EqualLoc, | ||
Expr * | DefaultArg | ||
) |
Definition at line 1480 of file SemaTemplate.cpp.
StmtResult Sema::ActOnNullStmt | ( | SourceLocation | SemiLoc, |
bool | HasLeadingEmptyMacro = false |
||
) |
Definition at line 75 of file SemaStmt.cpp.
ExprResult Sema::ActOnNumericConstant | ( | const Token & | Tok, |
Scope * | UDLScope = nullptr |
||
) |
Definition at line 3790 of file SemaExpr.cpp.
References clang::ExprError(), clang::Token::getLength(), and clang::Token::getLocation().
ParsedTemplateArgument Sema::ActOnPackExpansion | ( | const ParsedTemplateArgument & | Arg, |
SourceLocation | EllipsisLoc | ||
) |
Invoked when parsing a template argument followed by an ellipsis, which creates a pack expansion.
Arg | The template argument preceding the ellipsis, which may already be invalid. |
EllipsisLoc | The location of the ellipsis. |
Definition at line 571 of file SemaTemplateVariadic.cpp.
References clang::TemplateName::containsUnexpandedParameterPack(), clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), clang::ParsedTemplateArgument::getAsExpr(), clang::ParsedTemplateArgument::getAsTemplate(), clang::ParsedTemplateArgument::getAsType(), clang::CXXScopeSpec::getBeginLoc(), clang::ParsedTemplateArgument::getKind(), clang::ParsedTemplateArgument::getLocation(), clang::ParsedTemplateArgument::getScopeSpec(), clang::ParsedTemplateArgument::getTemplatePackExpansion(), clang::ParsedTemplateArgument::isInvalid(), clang::CXXScopeSpec::isValid(), clang::ParsedTemplateArgument::NonType, clang::SourceRange::setBegin(), clang::ParsedTemplateArgument::Template, and clang::ParsedTemplateArgument::Type.
ExprResult Sema::ActOnPackExpansion | ( | Expr * | Pattern, |
SourceLocation | EllipsisLoc | ||
) |
Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion.
Pattern | The expression preceding the ellipsis, which will become the pattern of the pack expansion. |
EllipsisLoc | The location of the ellipsis. |
Definition at line 664 of file SemaTemplateVariadic.cpp.
References CheckPackExpansion().
TypeResult Sema::ActOnPackExpansion | ( | ParsedType | Type, |
SourceLocation | EllipsisLoc | ||
) |
Invoked when parsing a type followed by an ellipsis, which creates a pack expansion.
Type | The type preceding the ellipsis, which will become the pattern of the pack expansion. |
EllipsisLoc | The location of the ellipsis. |
Definition at line 610 of file SemaTemplateVariadic.cpp.
References CheckPackExpansion(), CreateParsedType(), clang::TypeSourceInfo::getType(), and GetTypeFromParser().
ExprResult Sema::ActOnPackIndexingExpr | ( | Scope * | S, |
Expr * | PackExpression, | ||
SourceLocation | EllipsisLoc, | ||
SourceLocation | LSquareLoc, | ||
Expr * | IndexExpr, | ||
SourceLocation | RSquareLoc | ||
) |
Definition at line 1084 of file SemaTemplateVariadic.cpp.
QualType Sema::ActOnPackIndexingType | ( | QualType | Pattern, |
Expr * | IndexExpr, | ||
SourceLocation | Loc, | ||
SourceLocation | EllipsisLoc | ||
) |
Definition at line 9542 of file SemaType.cpp.
References BuildPackIndexingType(), clang::Type::containsUnexpandedParameterPack(), clang::CPlusPlus26, clang::SemaBase::Diag(), getLangOpts(), and Loc.
Decl * Sema::ActOnParamDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
SourceLocation | ExplicitThisLoc = {} |
||
) |
ActOnParamDeclarator - Called from Parser::ParseFunctionDeclarator() to introduce parameters into function prototype scope.
Definition at line 15223 of file SemaDecl.cpp.
void Sema::ActOnParamDefaultArgument | ( | Decl * | param, |
SourceLocation | EqualLoc, | ||
Expr * | DefaultArg | ||
) |
ActOnParamDefaultArgument - Check whether the default argument provided for a function parameter is well-formed.
If so, attach it to the parameter declaration.
Definition at line 334 of file SemaDeclCXX.cpp.
References ActOnParamDefaultArgumentError(), ConvertParamDefaultArgument(), clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), getLangOpts(), clang::Stmt::getSourceRange(), clang::VarDecl::isParameterPack(), clang::ParmVarDecl::setDefaultArg(), SetParamDefaultArgument(), UnparsedDefaultArgLocs, and UPPC_DefaultArgument.
void Sema::ActOnParamDefaultArgumentError | ( | Decl * | param, |
SourceLocation | EqualLoc, | ||
Expr * | DefaultArg | ||
) |
ActOnParamDefaultArgumentError - Parsing or semantic analysis of the default argument for the parameter param failed.
Definition at line 395 of file SemaDeclCXX.cpp.
References CreateRecoveryExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getEndLoc(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::ParmVarDecl::setDefaultArg(), clang::Decl::setInvalidDecl(), and UnparsedDefaultArgLocs.
Referenced by ActOnParamDefaultArgument().
void Sema::ActOnParamUnparsedDefaultArgument | ( | Decl * | param, |
SourceLocation | EqualLoc, | ||
SourceLocation | ArgLoc | ||
) |
ActOnParamUnparsedDefaultArgument - We've seen a default argument for a function parameter, but we can't parse it yet because we're inside a class definition.
Note that this default argument will be parsed later.
Definition at line 382 of file SemaDeclCXX.cpp.
References clang::ParmVarDecl::setUnparsedDefaultArg(), and UnparsedDefaultArgLocs.
ExprResult Sema::ActOnParenExpr | ( | SourceLocation | L, |
SourceLocation | R, | ||
Expr * | E | ||
) |
Definition at line 4220 of file SemaExpr.cpp.
References clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), and clang::Expr::isLValue().
Referenced by ActOnDecltypeExpression().
ExprResult Sema::ActOnParenListExpr | ( | SourceLocation | L, |
SourceLocation | R, | ||
MultiExprArg | Val | ||
) |
Definition at line 8019 of file SemaExpr.cpp.
References clang::ParenListExpr::Create().
void Sema::ActOnPopScope | ( | SourceLocation | Loc, |
Scope * | S | ||
) |
We visit the decls in non-deterministic order, but we want diagnostics emitted in deterministic order. Collect any diagnostic that may be emitted and sort the diagnostics before emitting them, after we visited all decls.
Definition at line 2239 of file SemaDecl.cpp.
Referenced by clang::Parser::ExitScope().
ExprResult Sema::ActOnPostfixUnaryOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
tok::TokenKind | Kind, | ||
Expr * | Input | ||
) |
Definition at line 4874 of file SemaExpr.cpp.
void Sema::ActOnPragmaAttributeAttribute | ( | ParsedAttr & | Attribute, |
SourceLocation | PragmaLoc, | ||
attr::ParsedSubjectMatchRuleSet | Rules | ||
) |
Definition at line 918 of file SemaAttr.cpp.
References clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), clang::ParsedAttr::getMatchRules(), clang::attr::getSubjectMatchRuleSpelling(), LangOpts, PragmaAttributeStack, and clang::ParsedAttr::setIsPragmaClangAttribute().
void Sema::ActOnPragmaAttributeEmptyPush | ( | SourceLocation | PragmaLoc, |
const IdentifierInfo * | Namespace | ||
) |
Definition at line 1051 of file SemaAttr.cpp.
References PragmaAttributeStack.
void Sema::ActOnPragmaAttributePop | ( | SourceLocation | PragmaLoc, |
const IdentifierInfo * | Namespace | ||
) |
Called on well-formed '#pragma clang attribute pop'.
Definition at line 1058 of file SemaAttr.cpp.
References clang::SemaBase::Diag(), and PragmaAttributeStack.
void Sema::ActOnPragmaClangSection | ( | SourceLocation | PragmaLoc, |
PragmaClangSectionAction | Action, | ||
PragmaClangSectionKind | SecKind, | ||
StringRef | SecName | ||
) |
ActOnPragmaClangSection - Called on well formed #pragma clang section.
Definition at line 285 of file SemaAttr.cpp.
References clang::SemaBase::Diag(), isValidSectionSpecifier(), PragmaClangBSSSection, PragmaClangDataSection, PragmaClangRelroSection, PragmaClangRodataSection, PragmaClangTextSection, clang::Sema::PragmaClangSection::PragmaLocation, clang::ASTContext::PSF_Execute, clang::ASTContext::PSF_Read, clang::ASTContext::PSF_Write, clang::ASTContext::PSF_ZeroInit, clang::Sema::PragmaClangSection::SectionName, clang::threadSafety::sx::toString(), UnifySection(), and clang::Sema::PragmaClangSection::Valid.
void Sema::ActOnPragmaCXLimitedRange | ( | SourceLocation | Loc, |
LangOptions::ComplexRangeKind | Range | ||
) |
ActOnPragmaCXLimitedRange - Called on well formed #pragma STDC CX_LIMITED_RANGE.
Definition at line 1351 of file SemaAttr.cpp.
References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, FpPragmaStack, getLangOpts(), Loc, PSK_Set, and Range.
void Sema::ActOnPragmaDetectMismatch | ( | SourceLocation | Loc, |
StringRef | Name, | ||
StringRef | Value | ||
) |
ActOnPragmaDetectMismatch - Call on well-formed #pragma detect_mismatch.
Definition at line 526 of file SemaAttr.cpp.
void Sema::ActOnPragmaDump | ( | Expr * | E | ) |
Called on #pragma clang __debug dump E.
Definition at line 6006 of file SemaLookup.cpp.
References clang::Stmt::dump().
void Sema::ActOnPragmaDump | ( | Scope * | S, |
SourceLocation | Loc, | ||
IdentifierInfo * | II | ||
) |
Called on #pragma clang __debug dump II.
Definition at line 5996 of file SemaLookup.cpp.
void Sema::ActOnPragmaFEnvAccess | ( | SourceLocation | Loc, |
bool | IsEnabled | ||
) |
ActOnPragmaFenvAccess - Called on well formed #pragma STDC FENV_ACCESS.
Definition at line 1335 of file SemaAttr.cpp.
References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, clang::SemaBase::Diag(), FpPragmaStack, getLangOpts(), isPreciseFPEnabled(), Loc, and PSK_Set.
void Sema::ActOnPragmaFEnvRound | ( | SourceLocation | Loc, |
llvm::RoundingMode | FPR | ||
) |
Called to set constant rounding mode for floating point operations.
Definition at line 1320 of file SemaAttr.cpp.
References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, FpPragmaStack, getLangOpts(), Loc, and PSK_Set.
void Sema::ActOnPragmaFloatControl | ( | SourceLocation | Loc, |
PragmaMsStackAction | Action, | ||
PragmaFloatControlKind | Value | ||
) |
ActOnPragmaFloatControl - Call on well-formed #pragma float_control.
Definition at line 561 of file SemaAttr.cpp.
References clang::FPOptionsOverride::applyOverrides(), CurContext, CurFPFeatureOverrides(), CurFPFeatures, clang::SemaBase::Diag(), clang::LangOptionsBase::FPE_Ignore, clang::LangOptionsBase::FPE_Strict, FpPragmaStack, clang::FPOptions::getExceptionMode(), getLangOpts(), clang::DeclContext::getRedeclContext(), clang::DeclContext::isFileContext(), isPreciseFPEnabled(), Loc, clang::PFC_Except, clang::PFC_NoExcept, clang::PFC_NoPrecise, clang::PFC_Pop, clang::PFC_Precise, clang::PFC_Push, PSK_Pop, PSK_Push, PSK_Push_Set, and clang::FPOptionsOverride::setFPPreciseEnabled().
void Sema::ActOnPragmaFPContract | ( | SourceLocation | Loc, |
LangOptions::FPModeKind | FPC | ||
) |
ActOnPragmaFPContract - Called on well formed #pragma {STDC,OPENCL} FP_CONTRACT and #pragma clang fp contract.
Definition at line 1264 of file SemaAttr.cpp.
References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, clang::LangOptionsBase::FPM_Fast, clang::LangOptionsBase::FPM_FastHonorPragmas, clang::LangOptionsBase::FPM_Off, clang::LangOptionsBase::FPM_On, FpPragmaStack, getLangOpts(), Loc, PSK_Set, clang::FPOptionsOverride::setAllowFPContractAcrossStatement(), clang::FPOptionsOverride::setAllowFPContractWithinStatement(), and clang::FPOptionsOverride::setDisallowFPContract().
void Sema::ActOnPragmaFPEvalMethod | ( | SourceLocation | Loc, |
LangOptions::FPEvalMethodKind | Value | ||
) |
Definition at line 534 of file SemaAttr.cpp.
References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, clang::SemaBase::Diag(), clang::LangOptionsBase::FEM_Double, clang::LangOptionsBase::FEM_Extended, clang::LangOptionsBase::FEM_Source, FpPragmaStack, getLangOpts(), Loc, PP, PSK_Set, and clang::Preprocessor::setCurrentFPEvalMethod().
void Sema::ActOnPragmaFPExceptions | ( | SourceLocation | Loc, |
LangOptions::FPExceptionModeKind | FPE | ||
) |
Called on well formed '#pragma clang fp' that has option 'exceptions'.
Definition at line 1359 of file SemaAttr.cpp.
References Loc, and setExceptionMode().
void Sema::ActOnPragmaFPValueChangingOption | ( | SourceLocation | Loc, |
PragmaFPKind | Kind, | ||
bool | IsEnabled | ||
) |
Called on well formed #pragma clang fp reassociate or #pragma clang fp reciprocal.
Definition at line 1284 of file SemaAttr.cpp.
References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, clang::SemaBase::Diag(), clang::LangOptionsBase::FEM_UnsetOnCommandLine, FpPragmaStack, getLangOpts(), clang::Preprocessor::getLastFPEvalPragmaLocation(), clang::SourceLocation::isValid(), Loc, clang::PFK_Reassociate, clang::PFK_Reciprocal, PP, and PSK_Set.
void Sema::ActOnPragmaMSAllocText | ( | SourceLocation | PragmaLocation, |
StringRef | Section, | ||
const SmallVector< std::tuple< IdentifierInfo *, SourceLocation >> & | Functions | ||
) |
Called on well-formed #pragma alloc_text().
Definition at line 799 of file SemaAttr.cpp.
References clang::CPlusPlus, CurContext, clang::SemaBase::Diag(), clang::Function, FunctionToSectionMap, clang::Decl::getCanonicalDecl(), getLangOpts(), clang::IdentifierInfo::getName(), clang::DeclContext::getRedeclContext(), clang::DeclContext::isFileContext(), Loc, LookupOrdinaryName, LookupSingleName(), and TUScope.
void Sema::ActOnPragmaMSComment | ( | SourceLocation | CommentLoc, |
PragmaMSCommentKind | Kind, | ||
StringRef | Arg | ||
) |
ActOnPragmaMSComment - Called on well formed #pragma comment(kind, "arg").
Definition at line 518 of file SemaAttr.cpp.
References clang::DeclContext::addDecl(), Consumer, Context, clang::PragmaCommentDecl::Create(), clang::ASTContext::getTranslationUnitDecl(), and clang::ASTConsumer::HandleTopLevelDecl().
void Sema::ActOnPragmaMSFunction | ( | SourceLocation | Loc, |
const llvm::SmallVectorImpl< StringRef > & | NoBuiltins | ||
) |
Call on well formed #pragma function.
Definition at line 1151 of file SemaAttr.cpp.
References CurContext, clang::SemaBase::Diag(), clang::DeclContext::getRedeclContext(), clang::DeclContext::isFileContext(), Loc, and MSFunctionNoBuiltins.
void Sema::ActOnPragmaMSInitSeg | ( | SourceLocation | PragmaLocation, |
StringLiteral * | SegmentName | ||
) |
Called on well-formed #pragma init_seg().
Definition at line 790 of file SemaAttr.cpp.
References CurInitSeg, CurInitSegLoc, and clang::StringLiteral::getString().
void Sema::ActOnPragmaMSOptimize | ( | SourceLocation | Loc, |
bool | IsOn | ||
) |
#pragma optimize("[optimization-list]", on | off).
Definition at line 1142 of file SemaAttr.cpp.
References CurContext, clang::SemaBase::Diag(), clang::DeclContext::getRedeclContext(), clang::DeclContext::isFileContext(), Loc, and MSPragmaOptimizeIsOn.
void Sema::ActOnPragmaMSPointersToMembers | ( | LangOptions::PragmaMSPointersToMembersKind | Kind, |
SourceLocation | PragmaLoc | ||
) |
ActOnPragmaMSPointersToMembers - called on well formed #pragma pointers_to_members(representation method[, general purpose representation]).
Definition at line 615 of file SemaAttr.cpp.
References ImplicitMSInheritanceAttrLoc, and MSPointerToMemberRepresentationMethod.
void Sema::ActOnPragmaMSSection | ( | SourceLocation | PragmaLocation, |
int | SectionFlags, | ||
StringLiteral * | SegmentName | ||
) |
Called on well formed #pragma section().
Called on well formed #pragma bss_seg().
Definition at line 785 of file SemaAttr.cpp.
References clang::StringLiteral::getString(), and UnifySection().
void Sema::ActOnPragmaMSSeg | ( | SourceLocation | PragmaLocation, |
PragmaMsStackAction | Action, | ||
llvm::StringRef | StackSlotLabel, | ||
StringLiteral * | SegmentName, | ||
llvm::StringRef | PragmaName | ||
) |
Called on well formed #pragma bss_seg/data_seg/const_seg/code_seg.
Called on well formed #pragma bss_seg().
Definition at line 747 of file SemaAttr.cpp.
void Sema::ActOnPragmaMSStrictGuardStackCheck | ( | SourceLocation | PragmaLocation, |
PragmaMsStackAction | Action, | ||
bool | Value | ||
) |
ActOnPragmaMSStrictGuardStackCheck - Called on well formed #pragma strict_gs_check.
Called on well formed #pragma strict_gs_check().
Definition at line 774 of file SemaAttr.cpp.
References clang::Sema::PragmaStack< ValueType >::Act(), clang::SemaBase::Diag(), PSK_Pop, clang::Sema::PragmaStack< ValueType >::Stack, and StrictGuardStackCheckStack.
void Sema::ActOnPragmaMSStruct | ( | PragmaMSStructKind | Kind | ) |
ActOnPragmaMSStruct - Called on well formed #pragma ms_struct [on|off].
Definition at line 514 of file SemaAttr.cpp.
References MSStructPragmaOn, and clang::PMSST_ON.
void Sema::ActOnPragmaMSVtorDisp | ( | PragmaMsStackAction | Action, |
SourceLocation | PragmaLoc, | ||
MSVtorDispMode | Value | ||
) |
Called on well formed #pragma vtordisp().
Definition at line 622 of file SemaAttr.cpp.
References clang::Sema::PragmaStack< ValueType >::Act(), clang::SemaBase::Diag(), PSK_Pop, clang::Sema::PragmaStack< ValueType >::Stack, and VtorDispStack.
void Sema::ActOnPragmaOptimize | ( | bool | On, |
SourceLocation | PragmaLoc | ||
) |
Called on well formed #pragma clang optimize.
Definition at line 1135 of file SemaAttr.cpp.
References OptimizeOffPragmaLocation.
void Sema::ActOnPragmaOptionsAlign | ( | PragmaOptionsAlignKind | Kind, |
SourceLocation | PragmaLoc | ||
) |
ActOnPragmaOptionsAlign - Called on well formed #pragma options align.
Definition at line 230 of file SemaAttr.cpp.
References AlignPackStack, Context, clang::SemaBase::Diag(), getLangOpts(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::hasAlignMac68kSupport(), clang::Sema::AlignPackInfo::Mac68k, clang::Sema::AlignPackInfo::Native, clang::Sema::AlignPackInfo::Natural, clang::Sema::AlignPackInfo::Packed, POAK_Mac68k, POAK_Native, POAK_Natural, POAK_Packed, POAK_Power, POAK_Reset, PSK_Pop, PSK_Push_Set, and PSK_Reset.
void Sema::ActOnPragmaPack | ( | SourceLocation | PragmaLoc, |
PragmaMsStackAction | Action, | ||
StringRef | SlotLabel, | ||
Expr * | Alignment | ||
) |
ActOnPragmaPack - Called on well formed #pragma pack(...).
Definition at line 334 of file SemaAttr.cpp.
References AlignPackStack, Context, clang::SemaBase::Diag(), clang::Sema::AlignPackInfo::getAlignMode(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::Sema::AlignPackInfo::getPackNumber(), clang::Sema::AlignPackInfo::IsAlignAttr(), clang::Sema::AlignPackInfo::IsPackSet(), clang::Expr::isTypeDependent(), clang::Sema::AlignPackInfo::Mac68k, clang::Sema::AlignPackInfo::Native, PSK_Pop, and PSK_Show.
void Sema::ActOnPragmaRedefineExtname | ( | IdentifierInfo * | WeakName, |
IdentifierInfo * | AliasName, | ||
SourceLocation | PragmaLoc, | ||
SourceLocation | WeakNameLoc, | ||
SourceLocation | AliasNameLoc | ||
) |
ActOnPragmaRedefineExtname - Called on well formed #pragma redefine_extname oldname newname.
Definition at line 20489 of file SemaDecl.cpp.
void Sema::ActOnPragmaUnused | ( | const Token & | Identifier, |
Scope * | curScope, | ||
SourceLocation | PragmaLoc | ||
) |
ActOnPragmaUnused - Called on well-formed '#pragma unused'.
Definition at line 835 of file SemaAttr.cpp.
void Sema::ActOnPragmaVisibility | ( | const IdentifierInfo * | VisType, |
SourceLocation | PragmaLoc | ||
) |
ActOnPragmaVisibility - Called on well formed #pragma GCC visibility... .
Definition at line 1249 of file SemaAttr.cpp.
References clang::SemaBase::Diag(), clang::IdentifierInfo::getName(), PopPragmaVisibility(), PushPragmaVisibility(), and clang::T.
void Sema::ActOnPragmaWeakAlias | ( | IdentifierInfo * | WeakName, |
IdentifierInfo * | AliasName, | ||
SourceLocation | PragmaLoc, | ||
SourceLocation | WeakNameLoc, | ||
SourceLocation | AliasNameLoc | ||
) |
ActOnPragmaWeakAlias - Called on well formed #pragma weak ident = ident.
Definition at line 20528 of file SemaDecl.cpp.
void Sema::ActOnPragmaWeakID | ( | IdentifierInfo * | WeakName, |
SourceLocation | PragmaLoc, | ||
SourceLocation | WeakNameLoc | ||
) |
ActOnPragmaWeakID - Called on well formed #pragma weak ident.
Definition at line 20516 of file SemaDecl.cpp.
ExprResult Sema::ActOnPredefinedExpr | ( | SourceLocation | Loc, |
tok::TokenKind | Kind | ||
) |
Definition at line 3653 of file SemaExpr.cpp.
References getPredefinedExprKind(), and Loc.
Sema::DeclGroupPtrTy Sema::ActOnPrivateModuleFragmentDecl | ( | SourceLocation | ModuleLoc, |
SourceLocation | PrivateLoc | ||
) |
The parser has processed a private-module-fragment declaration that begins the definition of the private module fragment of the current module unit.
ModuleLoc | The location of the 'module' keyword. |
PrivateLoc | The location of the 'private' keyword. |
Definition at line 510 of file SemaModule.cpp.
References clang::FixItHint::CreateInsertion(), Diag(), clang::Module::ExplicitGlobalModuleFragment, clang::Module::ImplicitGlobalModuleFragment, clang::Module::ModuleHeaderUnit, clang::Module::ModuleImplementationUnit, clang::Module::ModuleInterfaceUnit, clang::Module::ModuleMapModule, clang::Module::ModulePartitionImplementation, clang::Module::ModulePartitionInterface, and clang::Module::PrivateModuleFragment.
ExprResult Sema::ActOnPseudoDestructorExpr | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
CXXScopeSpec & | SS, | ||
UnqualifiedId & | FirstTypeName, | ||
SourceLocation | CCLoc, | ||
SourceLocation | TildeLoc, | ||
UnqualifiedId & | SecondTypeName | ||
) |
Definition at line 8200 of file SemaExprCXX.cpp.
ExprResult Sema::ActOnPseudoDestructorExpr | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
SourceLocation | TildeLoc, | ||
const DeclSpec & | DS | ||
) |
Definition at line 8345 of file SemaExprCXX.cpp.
void Sema::ActOnPureSpecifier | ( | Decl * | D, |
SourceLocation | PureSpecLoc | ||
) |
Definition at line 18518 of file SemaDeclCXX.cpp.
References CheckPureMethod(), clang::SemaBase::Diag(), clang::Decl::getFriendObjectKind(), and clang::Decl::getLocation().
void Sema::ActOnReenterCXXMethodParameter | ( | Scope * | S, |
ParmVarDecl * | Param | ||
) |
This is used to implement the constant expression evaluation part of the attribute enable_if extension.
There is nothing in standard C++ which would require reentering parameters.
Definition at line 10781 of file SemaDeclCXX.cpp.
Push the parameters of D, which must be a function, into scope.
Definition at line 1458 of file SemaDecl.cpp.
unsigned Sema::ActOnReenterTemplateScope | ( | Decl * | Template, |
llvm::function_ref< Scope *()> | EnterScope | ||
) |
Definition at line 10700 of file SemaDeclCXX.cpp.
References clang::Scope::AddDecl(), clang::IdentifierResolver::AddDecl(), AdjustDeclIfTemplate(), EnterTemplatedContext(), clang::Decl::getDeclContext(), clang::CXXRecordDecl::getDescribedClassTemplate(), clang::VarDecl::getDescribedVarTemplate(), and IdResolver.
ExprResult Sema::ActOnRequiresClause | ( | ExprResult | ConstraintExpr | ) |
Definition at line 4184 of file SemaDeclCXX.cpp.
References CorrectDelayedTyposInExpr(), DiagnoseUnexpandedParameterPack(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and UPPC_RequiresClause.
Referenced by ActOnFinishTrailingRequiresClause().
ExprResult Sema::ActOnRequiresExpr | ( | SourceLocation | RequiresKWLoc, |
RequiresExprBodyDecl * | Body, | ||
SourceLocation | LParenLoc, | ||
ArrayRef< ParmVarDecl * > | LocalParameters, | ||
SourceLocation | RParenLoc, | ||
ArrayRef< concepts::Requirement * > | Requirements, | ||
SourceLocation | ClosingBraceLoc | ||
) |
Definition at line 9457 of file SemaExprCXX.cpp.
References Context, clang::RequiresExpr::Create(), DiagnoseUnexpandedParameterPackInRequiresExpr(), and clang::ExprError().
StmtResult Sema::ActOnReturnStmt | ( | SourceLocation | ReturnLoc, |
Expr * | RetValExp, | ||
Scope * | CurScope | ||
) |
Definition at line 3807 of file SemaStmt.cpp.
References CheckJumpOutOfSEHFinally(), Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Scope::getFnParent(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::StmtError(), and clang::Scope::updateNRVOCandidate().
StmtResult Sema::ActOnSEHExceptBlock | ( | SourceLocation | Loc, |
Expr * | FilterExpr, | ||
Stmt * | Block | ||
) |
Definition at line 4426 of file SemaStmt.cpp.
References Block, clang::SEHExceptStmt::Create(), Diag(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Type::isDependentType(), clang::Type::isIntegerType(), and clang::StmtError().
StmtResult Sema::ActOnSEHLeaveStmt | ( | SourceLocation | Loc, |
Scope * | CurScope | ||
) |
Definition at line 4453 of file SemaStmt.cpp.
References CheckJumpOutOfSEHFinally(), Diag(), clang::Scope::getParent(), clang::Scope::isSEHTryScope(), Loc, and clang::StmtError().
StmtResult Sema::ActOnSEHTryBlock | ( | bool | IsCXXTry, |
SourceLocation | TryLoc, | ||
Stmt * | TryBlock, | ||
Stmt * | Handler | ||
) |
Definition at line 4379 of file SemaStmt.cpp.
References Diag(), clang::sema::FunctionScopeInfo::FirstCXXOrObjCTryLoc, clang::sema::FunctionScopeInfo::FirstTryType, clang::DeclContext::getParent(), clang::DeclContext::isFunctionOrMethod(), clang::SourceLocation::isValid(), clang::SemaSYCL::KernelUseExceptions, clang::sema::FunctionScopeInfo::setHasSEHTry(), clang::FunctionDecl::setUsesSEHTry(), and clang::sema::FunctionScopeInfo::TryLocIsCXX.
concepts::Requirement * Sema::ActOnSimpleRequirement | ( | Expr * | E | ) |
Definition at line 9243 of file SemaExprCXX.cpp.
References BuildExprRequirement().
ExprResult Sema::ActOnSizeofParameterPackExpr | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
IdentifierInfo & | Name, | ||
SourceLocation | NameLoc, | ||
SourceLocation | RParenLoc | ||
) |
Called when an expression computing the size of a parameter pack is parsed.
OpLoc | The location of the "sizeof" keyword. |
Name | The name of the parameter pack whose size will be determined. |
NameLoc | The source location of the name of the parameter pack. |
RParenLoc | The location of the closing parentheses. |
Definition at line 1027 of file SemaTemplateVariadic.cpp.
Definition at line 16036 of file SemaDecl.cpp.
References clang::Decl::getAsFunction(), and clang::FunctionDecl::setHasSkippedBody().
ExprResult Sema::ActOnSourceLocExpr | ( | SourceLocIdentKind | Kind, |
SourceLocation | BuiltinLoc, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 16708 of file SemaExpr.cpp.
References clang::File, clang::FileName, clang::FuncSig, and clang::Function.
void Sema::ActOnStartCXXInClassMemberInitializer | ( | ) |
Enter a new C++ default initializer scope.
After calling this, the caller must call ActOnFinishCXXInClassMemberInitializer, even if parsing or instantiating the initializer failed.
Definition at line 4160 of file SemaDeclCXX.cpp.
References PushFunctionScope().
Referenced by InstantiateInClassInitializer().
void Sema::ActOnStartCXXMemberDeclarations | ( | Scope * | S, |
Decl * | TagDecl, | ||
SourceLocation | FinalLoc, | ||
bool | IsFinalSpelledSealed, | ||
bool | IsAbstract, | ||
SourceLocation | LBraceLoc | ||
) |
ActOnStartCXXMemberDeclarations - Invoked when we have parsed a C++ record definition's base-specifiers clause and are starting its member declarations.
Definition at line 18382 of file SemaDecl.cpp.
ExprResult Sema::ActOnStartCXXMemberReference | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
ParsedType & | ObjectType, | ||
bool & | MayBePseudoDestructor | ||
) |
Definition at line 7874 of file SemaExprCXX.cpp.
ActOnStartDelayedCXXMethodDeclaration - We have completed parsing a top-level (non-nested) C++ class, and we are now parsing those parts of the given Method declaration that could not be parsed earlier (C++ [class.mem]p2), such as default arguments.
This action should enter the scope of the given Method declaration as if we had just parsed the qualified method name. However, it should not bring the parameters into scope; that will be performed by ActOnDelayedCXXMethodParameter.
Definition at line 10798 of file SemaDeclCXX.cpp.
Definition at line 10766 of file SemaDeclCXX.cpp.
Referenced by clang::Parser::ReenterClassScopeRAII::ReenterClassScopeRAII().
Decl * Sema::ActOnStartExportDecl | ( | Scope * | S, |
SourceLocation | ExportLoc, | ||
SourceLocation | LBraceLoc | ||
) |
We have parsed the start of an export declaration, including the '{' (if present).
Definition at line 844 of file SemaModule.cpp.
void Sema::ActOnStartFunctionDeclarationDeclarator | ( | Declarator & | D, |
unsigned | TemplateParameterDepth | ||
) |
Called before parsing a function declarator belonging to a function declaration.
Definition at line 19227 of file SemaDeclCXX.cpp.
References clang::TemplateParameterList::empty(), clang::Declarator::getBeginLoc(), clang::Declarator::getCXXScopeSpec(), clang::TemplateParameterList::getDepth(), clang::Declarator::getIdentifierLoc(), clang::Declarator::getTemplateParameterLists(), InventedParameterInfos, MatchTemplateParametersToScopeSpecifier(), and clang::TemplateParameterList::size().
Decl * Sema::ActOnStartLinkageSpecification | ( | Scope * | S, |
SourceLocation | ExternLoc, | ||
Expr * | LangStr, | ||
SourceLocation | LBraceLoc | ||
) |
ActOnStartLinkageSpecification - Parsed the beginning of a C++ linkage specification, including the language and (if present) the '{'.
ExternLoc is the location of the 'extern', Lang is the language string literal. LBraceLoc, if valid, provides the location of the '{' brace. Otherwise, this linkage specification does not have any braces.
C++ [module.unit]p7.2.3
If the declaration is already in global module fragment, we don't need to attach it again.
Definition at line 16863 of file SemaDeclCXX.cpp.
Decl * Sema::ActOnStartNamespaceDef | ( | Scope * | S, |
SourceLocation | InlineLoc, | ||
SourceLocation | NamespaceLoc, | ||
SourceLocation | IdentLoc, | ||
IdentifierInfo * | Ident, | ||
SourceLocation | LBrace, | ||
const ParsedAttributesView & | AttrList, | ||
UsingDirectiveDecl *& | UsingDecl, | ||
bool | IsNested | ||
) |
ActOnStartNamespaceDef - This is called at the start of a namespace definition.
Definition at line 11646 of file SemaDeclCXX.cpp.
References ActOnDocumentableDecl(), clang::DeclContext::addDecl(), AddPragmaAttributes(), Context, clang::NamespaceDecl::Create(), clang::UsingDirectiveDecl::Create(), CurContext, clang::SemaBase::Diag(), DiagnoseNamespaceInlineMismatch(), ForExternalRedeclaration, clang::NamespaceDecl::getAnonymousNamespace(), clang::Decl::getAttr(), clang::Decl::getLocation(), clang::SourceLocation::getLocWithOffset(), clang::Scope::getParent(), clang::DeclContext::getRedeclContext(), clang::LookupResult::getRepresentativeDecl(), getStdNamespace(), clang::NamespaceDecl::isInline(), clang::LookupResult::isSingleResult(), clang::IdentifierInfo::isStr(), clang::DeclContext::isTranslationUnit(), clang::SourceLocation::isValid(), Loc, LookupOrdinaryName, LookupQualifiedName(), Parent, ProcessAPINotes(), ProcessDeclAttributeList(), PushDeclContext(), PushNamespaceVisibilityAttr(), PushOnScopeChains(), clang::Decl::setImplicit(), clang::Decl::setInvalidDecl(), and StdNamespace.
void Sema::ActOnStartOfCompoundStmt | ( | bool | IsStmtExpr | ) |
Definition at line 396 of file SemaStmt.cpp.
Decl * Sema::ActOnStartOfFunctionDef | ( | Scope * | S, |
Decl * | D, | ||
SkipBodyInfo * | SkipBody = nullptr , |
||
FnBodyKind | BodyKind = FnBodyKind::Other |
||
) |
Definition at line 15731 of file SemaDecl.cpp.
References Diag(), clang::Decl::dropAttr(), clang::Decl::getAttr(), clang::Attr::getLocation(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isImmediateEscalating(), clang::isLambdaCallOperator(), and clang::Decl::setInvalidDecl().
Decl * Sema::ActOnStartOfFunctionDef | ( | Scope * | S, |
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParamLists, | ||
SkipBodyInfo * | SkipBody = nullptr , |
||
FnBodyKind | BodyKind = FnBodyKind::Other |
||
) |
Definition at line 15521 of file SemaDecl.cpp.
References clang::Scope::getParent(), and clang::Declarator::isFunctionDeclarator().
void Sema::ActOnStartOfLambdaDefinition | ( | LambdaIntroducer & | Intro, |
Declarator & | ParamInfo, | ||
const DeclSpec & | DS | ||
) |
ActOnStartOfLambdaDefinition - This is called just before we start parsing the body of a lambda; it analyzes the explicit captures and arguments, and sets up various data-structures for the body of the lambda.
Definition at line 1372 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::CallOperator, clang::DeclSpec::getConstexprSpecifier(), getCurrentLambdaScopeUnsafe(), clang::SourceRange::getEnd(), clang::Declarator::getNumTypeObjects(), clang::LambdaIntroducer::Range, and clang::FunctionDecl::setConstexprKind().
StmtResult Sema::ActOnStartOfSwitchStmt | ( | SourceLocation | SwitchLoc, |
SourceLocation | LParenLoc, | ||
Stmt * | InitStmt, | ||
ConditionResult | Cond, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 1123 of file SemaStmt.cpp.
References clang::SwitchStmt::Create(), Diag(), clang::Sema::ConditionResult::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isIntegralOrEnumerationType(), clang::Sema::ConditionResult::isInvalid(), clang::Expr::isKnownToHaveBooleanValue(), clang::Expr::isTypeDependent(), and clang::StmtError().
void Sema::ActOnStartOfTranslationUnit | ( | ) |
This is called before the very first declaration in the translation unit is parsed.
Note that the ASTContext may have already injected some declarations.
Definition at line 1079 of file Sema.cpp.
References clang::LangOptionsBase::CMK_HeaderUnit, and getLangOpts().
Referenced by clang::Parser::ParseFirstTopLevelDecl().
RequiresExprBodyDecl * Sema::ActOnStartRequiresExpr | ( | SourceLocation | RequiresKWLoc, |
ArrayRef< ParmVarDecl * > | LocalParameters, | ||
Scope * | BodyScope | ||
) |
Definition at line 9422 of file SemaExprCXX.cpp.
References CheckShadow(), Context, clang::RequiresExprBodyDecl::Create(), CurContext, clang::SemaBase::Diag(), PushDeclContext(), and PushOnScopeChains().
void Sema::ActOnStartSEHFinallyBlock | ( | ) |
Definition at line 4438 of file SemaStmt.cpp.
void Sema::ActOnStartStmtExpr | ( | ) |
Definition at line 15795 of file SemaExpr.cpp.
TopLevelStmtDecl * Sema::ActOnStartTopLevelStmtDecl | ( | Scope * | S | ) |
Definition at line 20473 of file SemaDecl.cpp.
void Sema::ActOnStartTrailingRequiresClause | ( | Scope * | S, |
Declarator & | D | ||
) |
Definition at line 4166 of file SemaDeclCXX.cpp.
Decl * Sema::ActOnStaticAssertDeclaration | ( | SourceLocation | StaticAssertLoc, |
Expr * | AssertExpr, | ||
Expr * | AssertMessageExpr, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 17132 of file SemaDeclCXX.cpp.
References BuildStaticAssertDeclaration(), DiagnoseUnexpandedParameterPack(), and UPPC_StaticAssertExpression.
ExprResult Sema::ActOnStmtExpr | ( | Scope * | S, |
SourceLocation | LPLoc, | ||
Stmt * | SubStmt, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 15809 of file SemaExpr.cpp.
void Sema::ActOnStmtExprError | ( | ) |
Definition at line 15801 of file SemaExpr.cpp.
ExprResult Sema::ActOnStmtExprResult | ( | ExprResult | E | ) |
Definition at line 15853 of file SemaExpr.cpp.
References clang::interp::Cast(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::InitializedEntity::InitializeStmtExprResult(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isTypeDependent().
ExprResult Sema::ActOnStringLiteral | ( | ArrayRef< Token > | StringToks, |
Scope * | UDLScope = nullptr |
||
) |
ActOnStringLiteral - The specified tokens were lexed as pasted string fragments (e.g.
"foo" "bar" L"baz").
"foo" "bar" L"baz"). The result string has to handle string concatenation ([C99 5.1.1.2, translation phase #6]), so it may come from multiple tokens. However, the common case is that StringToks points to one string.
Definition at line 2129 of file SemaExpr.cpp.
References clang::ExprError().
bool Sema::ActOnSuperScopeSpecifier | ( | SourceLocation | SuperLoc, |
SourceLocation | ColonColonLoc, | ||
CXXScopeSpec & | SS | ||
) |
The parser has parsed a '__super' nested-name-specifier.
SuperLoc | The location of the '__super' keyword. |
ColonColonLoc | The location of the '::'. |
SS | The nested-name-specifier, which will be updated in-place to reflect the parsed nested-name-specifier. |
Definition at line 311 of file SemaCXXScopeSpec.cpp.
References clang::SemaBase::Diag(), and getCurLambda().
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 = nullptr |
||
) |
This is invoked when we see 'struct foo' or 'struct {'.
In the former case, Name will be non-null. In the later case, Name will be null. TagSpec indicates what kind of tag this is. TUK indicates whether this is a reference/declaration/definition of a tag.
IsTypeSpecifier | true if this is a type-specifier (or trailing-type-specifier) other than one in an alias-declaration. |
SkipBody | If non-null, will be set to indicate if the caller should skip the definition of this tag and treat it as if it were a declaration. |
Create a new tag decl in C/ObjC. Since the ODR-like semantics for ObjC/C implemented asks for structural equivalence checking, the returned decl here is passed back to the parser, allowing the tag body to be parsed.
Definition at line 17354 of file SemaDecl.cpp.
ActOnTagDefinitionError - Invoked when there was an unrecoverable error parsing the definition of a tag.
Definition at line 18483 of file SemaDecl.cpp.
void Sema::ActOnTagFinishDefinition | ( | Scope * | S, |
Decl * | TagDecl, | ||
SourceRange | BraceRange | ||
) |
ActOnTagFinishDefinition - Invoked once we have finished parsing the definition of a tag (enumeration, class, struct, or union).
Definition at line 18424 of file SemaDecl.cpp.
void Sema::ActOnTagFinishSkippedDefinition | ( | SkippedDefinitionContext | Context | ) |
Definition at line 1360 of file SemaDecl.cpp.
ActOnTagStartDefinition - Invoked when we have entered the scope of a tag's definition (e.g., for an enumeration, class, struct, or union).
Definition at line 18359 of file SemaDecl.cpp.
Sema::SkippedDefinitionContext Sema::ActOnTagStartSkippedDefinition | ( | Scope * | S, |
Decl * | TD | ||
) |
Invoked when we enter a tag definition that we're skipping.
Definition at line 1346 of file SemaDecl.cpp.
TypeResult Sema::ActOnTagTemplateIdType | ( | TagUseKind | TUK, |
TypeSpecifierType | TagSpec, | ||
SourceLocation | TagLoc, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
TemplateTy | TemplateD, | ||
SourceLocation | TemplateLoc, | ||
SourceLocation | LAngleLoc, | ||
ASTTemplateArgsPtr | TemplateArgsIn, | ||
SourceLocation | RAngleLoc | ||
) |
Parsed an elaborated-type-specifier that refers to a template-id, such as class
T::template apply.
Definition at line 4956 of file SemaTemplate.cpp.
References clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsDependentTemplateName(), clang::TypeWithKeyword::getKeywordForTagTypeKind(), clang::CXXScopeSpec::getScopeRep(), clang::TypeWithKeyword::getTagTypeKindForTypeSpec(), clang::CXXScopeSpec::isInvalid(), and clang::T.
Decl * Sema::ActOnTemplateDeclarator | ( | Scope * | S, |
MultiTemplateParamsArg | TemplateParameterLists, | ||
Declarator & | D | ||
) |
Definition at line 9821 of file SemaTemplate.cpp.
DeclResult Sema::ActOnTemplatedFriendTag | ( | Scope * | S, |
SourceLocation | FriendLoc, | ||
unsigned | TagSpec, | ||
SourceLocation | TagLoc, | ||
CXXScopeSpec & | SS, | ||
IdentifierInfo * | Name, | ||
SourceLocation | NameLoc, | ||
const ParsedAttributesView & | Attr, | ||
MultiTemplateParamsArg | TempParamLists | ||
) |
Handle a friend tag declaration where the scope specifier was templated.
Definition at line 17593 of file SemaDeclCXX.cpp.
TypeResult Sema::ActOnTemplateIdType | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
TemplateTy | Template, | ||
const IdentifierInfo * | TemplateII, | ||
SourceLocation | TemplateIILoc, | ||
SourceLocation | LAngleLoc, | ||
ASTTemplateArgsPtr | TemplateArgs, | ||
SourceLocation | RAngleLoc, | ||
bool | IsCtorOrDtorName = false , |
||
bool | IsClassName = false , |
||
ImplicitTypenameContext | AllowImplicitTypename = ImplicitTypenameContext::No |
||
) |
Definition at line 4846 of file SemaTemplate.cpp.
TemplateNameKind Sema::ActOnTemplateName | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
const UnqualifiedId & | Name, | ||
ParsedType | ObjectType, | ||
bool | EnteringContext, | ||
TemplateTy & | Result, | ||
bool | AllowInjectedClassName = false |
||
) |
Form a template name from a name that is syntactically required to name a template, either due to use of the 'template' keyword or because a name in this syntactic context is assumed to name a template (C++ [temp.names]p2-4).
This action forms a template name given the name of the template and its optional scope specifier. This is used when the 'template' keyword is used or when the parsing context unambiguously treats a following '<' as introducing a template argument list. Note that this may produce a non-dependent template name if we can perform the lookup now and identify the named template.
For example, given "x.MetaFun::template apply", the scope specifier SS
will be "MetaFun::", TemplateKWLoc
contains the location of the "template" keyword, and "apply" is the Name
.
Definition at line 5781 of file SemaTemplate.cpp.
Referenced by clang::Parser::ParseUnqualifiedId().
TemplateParameterList * Sema::ActOnTemplateParameterList | ( | unsigned | Depth, |
SourceLocation | ExportLoc, | ||
SourceLocation | TemplateLoc, | ||
SourceLocation | LAngleLoc, | ||
ArrayRef< NamedDecl * > | Params, | ||
SourceLocation | RAngleLoc, | ||
Expr * | RequiresClause | ||
) |
ActOnTemplateParameterList - Builds a TemplateParameterList, optionally constrained by RequiresClause, that contains the template parameters in Params.
Definition at line 1783 of file SemaTemplate.cpp.
References clang::TemplateParameterList::Create(), Diag(), clang::SourceLocation::isValid(), and P.
NamedDecl * Sema::ActOnTemplateTemplateParameter | ( | Scope * | S, |
SourceLocation | TmpLoc, | ||
TemplateParameterList * | Params, | ||
bool | Typename, | ||
SourceLocation | EllipsisLoc, | ||
IdentifierInfo * | Name, | ||
SourceLocation | NameLoc, | ||
unsigned | Depth, | ||
unsigned | Position, | ||
SourceLocation | EqualLoc, | ||
ParsedTemplateArgument | Default | ||
) |
ActOnTemplateTemplateParameter - Called when a C++ template template parameter (e.g.
T in template <template <typename> class T> class array) has been parsed. S is the current scope.
Definition at line 1613 of file SemaTemplate.cpp.
ParsedTemplateArgument Sema::ActOnTemplateTypeArgument | ( | TypeResult | ParsedType | ) |
Convert a parsed type into a parsed template argument.
This is mostly trivial, except that we may have parsed a C++17 deduced class template specialization type, in which case we should form a template template argument instead of a type template argument.
Definition at line 961 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::Adopt(), clang::CPlusPlus17, clang::OpaquePtr< PtrTy >::get(), clang::TypeLoc::getAs(), clang::TypeSourceInfo::getTypeLoc(), and clang::T.
void Sema::ActOnTranslationUnitScope | ( | Scope * | S | ) |
bool Sema::ActOnTypeConstraint | ( | const CXXScopeSpec & | SS, |
TemplateIdAnnotation * | TypeConstraint, | ||
TemplateTypeParmDecl * | ConstrainedParameter, | ||
SourceLocation | EllipsisLoc | ||
) |
Definition at line 1118 of file SemaTemplate.cpp.
NamedDecl * Sema::ActOnTypedefDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
DeclContext * | DC, | ||
TypeSourceInfo * | TInfo, | ||
LookupResult & | Previous | ||
) |
Definition at line 6806 of file SemaDecl.cpp.
NamedDecl * Sema::ActOnTypedefNameDecl | ( | Scope * | S, |
DeclContext * | DC, | ||
TypedefNameDecl * | D, | ||
LookupResult & | Previous, | ||
bool & | Redeclaration | ||
) |
ActOnTypedefNameDecl - Perform semantic checking for a declaration which declares a typedef-name, either using the 'typedef' type specifier or via a C++0x [dcl.typedef]p2 alias-declaration: 'using T = A;'.
Definition at line 6893 of file SemaDecl.cpp.
TypeResult Sema::ActOnTypeName | ( | Declarator & | D | ) |
Definition at line 6395 of file SemaType.cpp.
References clang::AliasDecl, clang::AliasTemplate, CheckConstrainedAuto(), CheckExtraCXXDefaultArguments(), checkUnusedDeclAttributes(), clang::CPlusPlus, CreateParsedType(), clang::Type::getAs(), clang::AutoTypeLoc::getConceptNameLoc(), clang::TypeLoc::getContainedAutoTypeLoc(), clang::Declarator::getContext(), clang::Declarator::getIdentifier(), getLangOpts(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::TypeSourceInfo::getTypeLoc(), clang::Declarator::isInvalidType(), clang::ObjCParameter, and clang::T.
TypeResult Sema::ActOnTypenameType | ( | Scope * | S, |
SourceLocation | TypenameLoc, | ||
const CXXScopeSpec & | SS, | ||
const IdentifierInfo & | II, | ||
SourceLocation | IdLoc, | ||
ImplicitTypenameContext | IsImplicitTypename = ImplicitTypenameContext::No |
||
) |
Called when the parser has parsed a C++ typename specifier, e.g., "typename T::type".
S | The scope in which this typename type occurs. |
TypenameLoc | the location of the 'typename' keyword |
SS | the nested-name-specifier following the typename (e.g., 'T::'). |
II | the identifier we're retrieving (e.g., 'type' in the example). |
IdLoc | the location of the identifier. |
IsImplicitTypename | context where T::type refers to a type. |
Definition at line 11722 of file SemaTemplate.cpp.
Referenced by ActOnTypeRequirement(), and clang::Parser::TryAnnotateTypeOrScopeToken().
TypeResult Sema::ActOnTypenameType | ( | Scope * | S, |
SourceLocation | TypenameLoc, | ||
const CXXScopeSpec & | SS, | ||
SourceLocation | TemplateLoc, | ||
TemplateTy | TemplateName, | ||
const IdentifierInfo * | TemplateII, | ||
SourceLocation | TemplateIILoc, | ||
SourceLocation | LAngleLoc, | ||
ASTTemplateArgsPtr | TemplateArgs, | ||
SourceLocation | RAngleLoc | ||
) |
Called when the parser has parsed a C++ typename specifier that ends in a template-id, e.g., "typename MetaFun::template apply<T1, T2>".
S | The scope in which this typename type occurs. |
TypenameLoc | the location of the 'typename' keyword |
SS | the nested-name-specifier following the typename (e.g., 'T::'). |
TemplateLoc | the location of the 'template' keyword, if any. |
TemplateName | The template name. |
TemplateII | The identifier used to name the template. |
TemplateIILoc | The location of the template name. |
LAngleLoc | The location of the opening angle bracket ('<'). |
TemplateArgs | The template arguments. |
RAngleLoc | The location of the closing angle bracket ('>'). |
Definition at line 11752 of file SemaTemplate.cpp.
NamedDecl * Sema::ActOnTypeParameter | ( | Scope * | S, |
bool | Typename, | ||
SourceLocation | EllipsisLoc, | ||
SourceLocation | KeyLoc, | ||
IdentifierInfo * | ParamName, | ||
SourceLocation | ParamNameLoc, | ||
unsigned | Depth, | ||
unsigned | Position, | ||
SourceLocation | EqualLoc, | ||
ParsedType | DefaultArg, | ||
bool | HasTypeConstraint | ||
) |
ActOnTypeParameter - Called when a C++ template type parameter (e.g., "typename T") has been parsed.
Typename specifies whether the keyword "typename" was used to declare the type parameter (otherwise, "class" was used), and KeyLoc is the location of the "class" or "typename" keyword. ParamName is the name of the parameter (NULL indicates an unnamed template parameter) and ParamNameLoc is the location of the parameter name (if any). If the type parameter has a default argument, it will be added later via ActOnTypeParameterDefault.
Definition at line 1016 of file SemaTemplate.cpp.
concepts::Requirement * Sema::ActOnTypeRequirement | ( | SourceLocation | TypenameKWLoc, |
CXXScopeSpec & | SS, | ||
SourceLocation | NameLoc, | ||
const IdentifierInfo * | TypeName, | ||
TemplateIdAnnotation * | TemplateId | ||
) |
Definition at line 9249 of file SemaExprCXX.cpp.
References ActOnTypenameType(), BuildTypeRequirement(), CheckTypenameType(), Context, clang::TemplateIdAnnotation::getTemplateArgs(), GetTypeFromParser(), clang::CXXScopeSpec::getWithLocInContext(), clang::QualType::isNull(), clang::TemplateIdAnnotation::LAngleLoc, clang::TemplateIdAnnotation::Name, clang::TemplateIdAnnotation::NumArgs, clang::TemplateIdAnnotation::RAngleLoc, clang::T, clang::TemplateIdAnnotation::Template, clang::TemplateIdAnnotation::TemplateKWLoc, clang::TemplateIdAnnotation::TemplateNameLoc, clang::Typename, and clang::TypeName.
ExprResult Sema::ActOnTypeTrait | ( | TypeTrait | Kind, |
SourceLocation | KWLoc, | ||
ArrayRef< ParsedType > | Args, | ||
SourceLocation | RParenLoc | ||
) |
Parsed one of the type trait support pseudo-functions.
Definition at line 5953 of file SemaExprCXX.cpp.
References BuildTypeTrait(), Context, clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), and clang::T.
ExprResult Sema::ActOnUnaryExprOrTypeTraitExpr | ( | SourceLocation | OpLoc, |
UnaryExprOrTypeTrait | ExprKind, | ||
bool | IsType, | ||
void * | TyOrEx, | ||
SourceRange | ArgRange | ||
) |
ActOnUnaryExprOrTypeTraitExpr - Handle sizeof(type)
and sizeof
expr
and the same for alignof
and __alignof
Note that the ArgRange is invalid if isType is false.
Definition at line 4797 of file SemaExpr.cpp.
References clang::ExprError(), and clang::OpaquePtr< QualType >::getFromOpaquePtr().
ExprResult Sema::ActOnUnaryOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
tok::TokenKind | Op, | ||
Expr * | Input, | ||
bool | IsAfterAmp = false |
||
) |
Definition at line 15775 of file SemaExpr.cpp.
void Sema::ActOnUndeclaredTypeTemplateName | ( | Scope * | S, |
TemplateTy & | Name, | ||
TemplateNameKind & | TNK, | ||
SourceLocation | NameLoc, | ||
IdentifierInfo *& | II | ||
) |
Try to resolve an undeclared template name as a type template.
Sets II to the identifier corresponding to the template name, and updates Name to a corresponding (typo-corrected) type template name and TNK to the corresponding kind, if possible.
Definition at line 4793 of file SemaTemplate.cpp.
ExprResult Sema::ActOnUnevaluatedStringLiteral | ( | ArrayRef< Token > | StringToks | ) |
Definition at line 2044 of file SemaExpr.cpp.
References clang::StringLiteral::Create(), clang::ExprError(), and clang::Unevaluated.
void Sema::ActOnUninitializedDecl | ( | Decl * | dcl | ) |
Definition at line 14109 of file SemaDecl.cpp.
References clang::CPlusPlus17, Diag(), and clang::Type::isUndeducedType().
Referenced by clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::EndOpenMPDSABlock(), and InstantiateVariableInitializer().
Decl * Sema::ActOnUsingDeclaration | ( | Scope * | CurScope, |
AccessSpecifier | AS, | ||
SourceLocation | UsingLoc, | ||
SourceLocation | TypenameLoc, | ||
CXXScopeSpec & | SS, | ||
UnqualifiedId & | Name, | ||
SourceLocation | EllipsisLoc, | ||
const ParsedAttributesView & | AttrList | ||
) |
Definition at line 12320 of file SemaDeclCXX.cpp.
Decl * Sema::ActOnUsingDirective | ( | Scope * | CurScope, |
SourceLocation | UsingLoc, | ||
SourceLocation | NamespcLoc, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | IdentLoc, | ||
IdentifierInfo * | NamespcName, | ||
const ParsedAttributesView & | AttrList | ||
) |
Definition at line 12224 of file SemaDeclCXX.cpp.
Decl * Sema::ActOnUsingEnumDeclaration | ( | Scope * | CurScope, |
AccessSpecifier | AS, | ||
SourceLocation | UsingLoc, | ||
SourceLocation | EnumLoc, | ||
SourceLocation | IdentLoc, | ||
IdentifierInfo & | II, | ||
CXXScopeSpec * | SS = nullptr |
||
) |
Definition at line 12404 of file SemaDeclCXX.cpp.
ExprResult Sema::ActOnVAArg | ( | SourceLocation | BuiltinLoc, |
Expr * | E, | ||
ParsedType | Ty, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 16460 of file SemaExpr.cpp.
NamedDecl * Sema::ActOnVariableDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
DeclContext * | DC, | ||
TypeSourceInfo * | TInfo, | ||
LookupResult & | Previous, | ||
MultiTemplateParamsArg | TemplateParamLists, | ||
bool & | AddToScope, | ||
ArrayRef< BindingDecl * > | Bindings = std::nullopt |
||
) |
Definition at line 7548 of file SemaDecl.cpp.
DeclResult Sema::ActOnVarTemplateSpecialization | ( | Scope * | S, |
Declarator & | D, | ||
TypeSourceInfo * | DI, | ||
LookupResult & | Previous, | ||
SourceLocation | TemplateKWLoc, | ||
TemplateParameterList * | TemplateParams, | ||
StorageClass | SC, | ||
bool | IsPartialSpecialization | ||
) |
Definition at line 5239 of file SemaTemplate.cpp.
StmtResult Sema::ActOnWhileStmt | ( | SourceLocation | WhileLoc, |
SourceLocation | LParenLoc, | ||
ConditionResult | Cond, | ||
SourceLocation | RParenLoc, | ||
Stmt * | Body | ||
) |
Definition at line 1721 of file SemaStmt.cpp.
References clang::WhileStmt::Create(), clang::Sema::ConditionResult::get(), clang::Sema::ConditionResult::isInvalid(), and clang::StmtError().
void clang::Sema::AddAlignedAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E, | ||
bool | IsPackExpansion | ||
) |
AddAlignedAttr - Adds an aligned attribute to a particular declaration.
void clang::Sema::AddAlignedAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
TypeSourceInfo * | T, | ||
bool | IsPackExpansion | ||
) |
void Sema::AddAlignmentAttributesForRecord | ( | RecordDecl * | RD | ) |
AddAlignmentAttributesForRecord - Adds any needed alignment attributes to a the record decl, to handle '#pragma pack' and '#pragma options align'.
Definition at line 53 of file SemaAttr.cpp.
References clang::Decl::addAttr(), AlignPackIncludeStack, AlignPackStack, Context, clang::Sema::AlignPackInfo::getAlignMode(), getLangOpts(), clang::Sema::AlignPackInfo::getPackNumber(), clang::Sema::AlignPackInfo::IsAlignAttr(), clang::Sema::AlignPackInfo::IsPackSet(), clang::Sema::AlignPackInfo::Mac68k, and clang::Sema::AlignPackInfo::Natural.
void clang::Sema::AddAlignValueAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
AddAlignValueAttr - Adds an align_value attribute to a particular declaration.
void clang::Sema::AddAllocAlignAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | ParamExpr | ||
) |
AddAllocAlignAttr - Adds an alloc_align attribute to a particular declaration.
void clang::Sema::addAMDGPUFlatWorkGroupSizeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | Min, | ||
Expr * | Max | ||
) |
addAMDGPUFlatWorkGroupSizeAttr - Adds an amdgpu_flat_work_group_size attribute to a particular declaration.
void clang::Sema::addAMDGPUMaxNumWorkGroupsAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | XExpr, | ||
Expr * | YExpr, | ||
Expr * | ZExpr | ||
) |
addAMDGPUMaxNumWorkGroupsAttr - Adds an amdgpu_max_num_work_groups attribute to a particular declaration.
void clang::Sema::addAMDGPUWavesPerEUAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | Min, | ||
Expr * | Max | ||
) |
addAMDGPUWavePersEUAttr - Adds an amdgpu_waves_per_eu attribute to a particular declaration.
void clang::Sema::AddAnnotationAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | Annot, | ||
MutableArrayRef< Expr * > | Args | ||
) |
AddAnnotationAttr - Adds an annotation Annot with Args arguments to D.
void Sema::AddArgumentDependentLookupCandidates | ( | DeclarationName | Name, |
SourceLocation | Loc, | ||
ArrayRef< Expr * > | Args, | ||
TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | PartialOverloading = false |
||
) |
Add function candidates found via argument-dependent lookup to the set of overloading candidates.
This routine performs argument-dependent name lookup based on the given function name (which may also be an operator name) and adds all of the overload candidates found by ADL to the overload candidate set (C++ [basic.lookup.argdep]).
Definition at line 10140 of file SemaOverload.cpp.
Referenced by AddOverloadedCallCandidates(), CreateOverloadedUnaryOp(), and LookupOverloadedBinOp().
void clang::Sema::AddAssumeAlignedAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E, | ||
Expr * | OE | ||
) |
AddAssumeAlignedAttr - Adds an assume_aligned attribute to a particular declaration.
void Sema::AddBuiltinCandidate | ( | QualType * | ParamTys, |
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | IsAssignmentOperator = false , |
||
unsigned | NumContextualBoolArguments = 0 |
||
) |
AddBuiltinCandidate - Add a candidate for a built-in operator.
ResultTy and ParamTys are the result and parameter types of the built-in candidate, respectively. Args and NumArgs are the arguments being passed to the candidate. IsAssignmentOperator should be true when this built-in candidate is an assignment operator. NumContextualBoolArguments is the number of arguments (at the beginning of the argument list) that will be contextually converted to bool.
Definition at line 8473 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), clang::AS_none, clang::ASTContext::BoolTy, clang::OverloadCandidate::BuiltinParamTypes, Context, clang::OverloadCandidate::Conversions, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, getLangOpts(), clang::OverloadCandidate::IgnoreObjectArgument, clang::OverloadCandidate::IsSurrogate, clang::DeclAccessPair::make(), clang::ovl_fail_bad_conversion, TryContextuallyConvertToBool(), TryCopyInitialization(), clang::Unevaluated, Unevaluated, and clang::OverloadCandidate::Viable.
void Sema::AddBuiltinOperatorCandidates | ( | OverloadedOperatorKind | Op, |
SourceLocation | OpLoc, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet | ||
) |
AddBuiltinOperatorCandidates - Add the appropriate built-in operator overloads to the candidate set (C++ [over.built]), based on the operator Op
and the arguments given.
For example, if the operator is a binary '+', this routine might add "int operator+(int, int)" to cover integer addition.
Definition at line 9935 of file SemaOverload.cpp.
References clang::QualifiersAndAtomic::addAtomic(), clang::QualifiersAndAtomic::addConst(), CollectVRQualifiers(), Context, clang::NUM_OVERLOADED_OPERATORS, and clang::OO_None.
Referenced by CreateOverloadedArraySubscriptExpr(), CreateOverloadedUnaryOp(), and LookupOverloadedBinOp().
void Sema::AddConversionCandidate | ( | CXXConversionDecl * | Conversion, |
DeclAccessPair | FoundDecl, | ||
CXXRecordDecl * | ActingContext, | ||
Expr * | From, | ||
QualType | ToType, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | AllowObjCConversionOnExplicit, | ||
bool | AllowExplicit, | ||
bool | AllowResultConversion = true |
||
) |
AddConversionCandidate - Add a C++ conversion function as a candidate in the candidate set (C++ [over.match.conv], C++ [over.match.copy]).
From is the expression we're converting from, and ToType is the type that we're eventually trying to convert to (which may or may not be the same type as the type that the conversion function produces).
Definition at line 7974 of file SemaOverload.cpp.
void Sema::addExternalSource | ( | ExternalSemaSource * | E | ) |
void Sema::AddFunctionCandidates | ( | const UnresolvedSetImpl & | Functions, |
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
TemplateArgumentListInfo * | ExplicitTemplateArgs = nullptr , |
||
bool | SuppressUserConversions = false , |
||
bool | PartialOverloading = false , |
||
bool | FirstArgumentIsBase = false |
||
) |
Add all of the function declarations in the given function set to the overload candidate set.
Definition at line 7425 of file SemaOverload.cpp.
References AddMethodCandidate(), AddMethodTemplateCandidate(), AddOverloadCandidate(), AddTemplateOverloadCandidate(), clang::UnresolvedSetImpl::begin(), clang::Expr::Classify(), Context, clang::UnresolvedSetImpl::end(), clang::Decl::getDeclContext(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Expr::getType(), clang::NamedDecl::getUnderlyingDecl(), clang::QualType::isNull(), clang::Type::isPointerType(), and clang::Expr::Classification::makeSimpleLValue().
void Sema::AddImplicitlyDeclaredMembersToClass | ( | CXXRecordDecl * | ClassDecl | ) |
AddImplicitlyDeclaredMembersToClass - Adds any implicitly-declared special functions, such as the default constructor, copy constructor, or destructor, to the given C++ class (C++ [special]p1).
This routine can only be executed just before the definition of the class is complete.
Definition at line 10602 of file SemaDeclCXX.cpp.
References Context, clang::CPlusPlus11, clang::CPlusPlus20, DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitEqualityComparison(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), findImplicitlyDeclaredEqualityComparisons(), getASTContext(), clang::TargetInfo::getCXXABI(), getLangOpts(), clang::ASTContext::getTargetInfo(), clang::CXXRecordDecl::hasInheritedAssignment(), clang::CXXRecordDecl::hasInheritedConstructor(), clang::CXXRecordDecl::hasUserDeclaredMoveAssignment(), clang::CXXRecordDecl::hasUserDeclaredMoveConstructor(), inTemplateInstantiation(), clang::TagDecl::isDependentType(), clang::CXXRecordDecl::isDynamicClass(), clang::TargetCXXABI::isMicrosoft(), clang::CXXRecordDecl::needsImplicitCopyAssignment(), clang::CXXRecordDecl::needsImplicitCopyConstructor(), clang::CXXRecordDecl::needsImplicitDefaultConstructor(), clang::CXXRecordDecl::needsImplicitDestructor(), clang::CXXRecordDecl::needsImplicitMoveAssignment(), clang::CXXRecordDecl::needsImplicitMoveConstructor(), clang::CXXRecordDecl::needsOverloadResolutionForCopyAssignment(), clang::CXXRecordDecl::needsOverloadResolutionForCopyConstructor(), clang::CXXRecordDecl::needsOverloadResolutionForDestructor(), clang::CXXRecordDecl::needsOverloadResolutionForMoveAssignment(), clang::CXXRecordDecl::needsOverloadResolutionForMoveConstructor(), clang::ASTContext::NumImplicitCopyAssignmentOperators, clang::ASTContext::NumImplicitCopyConstructors, clang::ASTContext::NumImplicitDefaultConstructors, clang::ASTContext::NumImplicitDestructors, clang::ASTContext::NumImplicitMoveAssignmentOperators, and clang::ASTContext::NumImplicitMoveConstructors.
void Sema::AddImplicitMSFunctionNoBuiltinAttr | ( | FunctionDecl * | FD | ) |
Only called on function definitions; if there is a pragma in scope with the effect of a range-based no_builtin, consider marking the function with attribute no_builtin.
Definition at line 1205 of file SemaAttr.cpp.
References clang::Decl::addAttr(), Context, MSFunctionNoBuiltins, and V.
void Sema::addImplicitTypedef | ( | StringRef | Name, |
QualType | T | ||
) |
Definition at line 276 of file Sema.cpp.
Referenced by Initialize().
void Sema::addInitCapture | ( | sema::LambdaScopeInfo * | LSI, |
VarDecl * | Var, | ||
bool | ByRef | ||
) |
Add an init-capture to a lambda scope.
Definition at line 875 of file SemaLambda.cpp.
References clang::sema::CapturingScopeInfo::addCapture(), clang::Decl::getLocation(), clang::ValueDecl::getType(), and clang::VarDecl::isInitCapture().
AddInitializerToDecl - Adds the initializer Init to the declaration dcl.
If DirectInit is true, this is C++ direct initialization rather than copy initialization.
Definition at line 13539 of file SemaDecl.cpp.
References Array, clang::Expr::containsErrors(), Diag(), clang::DirectInit, clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasExternalStorage(), clang::Type::isDependentType(), clang::Decl::isInvalidDecl(), clang::VarDecl::isLocalVarDecl(), clang::VarDecl::isStaticDataMember(), clang::Type::isUndeducedType(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::VarDecl::setInit(), and clang::Decl::setInvalidDecl().
Referenced by clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), buildCoroutineParameterMoves(), FinishForRangeVarDecl(), and InstantiateVariableInitializer().
void clang::Sema::AddIntelReqdSubGroupSize | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void Sema::AddKnownFunctionAttributes | ( | FunctionDecl * | FD | ) |
Adds any function attributes that we know a priori based on the declaration of this function.
These attributes can apply both to implicitly-declared builtins (like __builtin___printf_chk) or to library-declared functions like NSLog or printf.
We need to check for duplicate attributes both here and where user-written attributes are applied to declarations.
Definition at line 16800 of file SemaDecl.cpp.
References clang::FunctionDecl::getBuiltinID(), and clang::Decl::isInvalidDecl().
void Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction | ( | FunctionDecl * | FD | ) |
If this function is a C++ replaceable global allocation function (C++2a [basic.stc.dynamic.allocation], C++2a [new.delete]), adds any function attributes that we know a priori based on the standard.
We need to check for duplicate attributes both here and where user-written attributes are applied to declarations.
Definition at line 16722 of file SemaDecl.cpp.
References clang::Decl::addAttr(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), clang::Decl::hasAttr(), clang::Decl::isInvalidDecl(), and clang::FunctionDecl::isReplaceableGlobalAllocationFunction().
void clang::Sema::AddLaunchBoundsAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | MaxThreads, | ||
Expr * | MinBlocks, | ||
Expr * | MaxBlocks | ||
) |
AddLaunchBoundsAttr - Adds a launch_bounds attribute to a particular declaration.
void Sema::AddMemberOperatorCandidates | ( | OverloadedOperatorKind | Op, |
SourceLocation | OpLoc, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
OverloadCandidateParamOrder | PO = {} |
||
) |
Add overload candidates for overloaded operators that are member functions.
Add the overloaded operator candidates that are member functions for the operator Op that was used in an operator expression such as "x Op y". , Args/NumArgs provides the operator arguments, and CandidateSet will store the added overload candidates. (C++ [over.match.oper]).
Definition at line 8417 of file SemaOverload.cpp.
References AddMethodCandidate(), clang::LookupResult::begin(), Context, clang::ASTContext::DeclarationNames, clang::LookupResult::end(), clang::Type::getAs(), clang::DeclarationNameTable::getCXXOperatorName(), clang::OverloadCandidateSet::getRewriteInfo(), isCompleteType(), LookupOrdinaryName, LookupQualifiedName(), clang::Reversed, clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed(), and clang::LookupResult::suppressAccessDiagnostics().
Referenced by CreateOverloadedArraySubscriptExpr(), CreateOverloadedUnaryOp(), and LookupOverloadedBinOp().
void Sema::AddMethodCandidate | ( | CXXMethodDecl * | Method, |
DeclAccessPair | FoundDecl, | ||
CXXRecordDecl * | ActingContext, | ||
QualType | ObjectType, | ||
Expr::Classification | ObjectClassification, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | SuppressUserConversions = false , |
||
bool | PartialOverloading = false , |
||
ConversionSequenceList | EarlyConversions = std::nullopt , |
||
OverloadCandidateParamOrder | PO = {} |
||
) |
AddMethodCandidate - Adds the given C++ member function to the set of candidate functions, using the given function call arguments and the object argument (Object
).
For example, in a call o.f(a1,a2)
, Object
will contain o
and Args
will contain both a1
and a2
. If SuppressUserConversions
, then don't allow user-defined conversions via constructors or conversion operators.
Definition at line 7529 of file SemaOverload.cpp.
void Sema::AddMethodCandidate | ( | DeclAccessPair | FoundDecl, |
QualType | ObjectType, | ||
Expr::Classification | ObjectClassification, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | SuppressUserConversion = false , |
||
OverloadCandidateParamOrder | PO = {} |
||
) |
AddMethodCandidate - Adds a named decl (which is some kind of method) as a method candidate to the given overload set.
Definition at line 7495 of file SemaOverload.cpp.
Referenced by AddFunctionCandidates(), and AddMemberOperatorCandidates().
void Sema::AddMethodTemplateCandidate | ( | FunctionTemplateDecl * | MethodTmpl, |
DeclAccessPair | FoundDecl, | ||
CXXRecordDecl * | ActingContext, | ||
TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
QualType | ObjectType, | ||
Expr::Classification | ObjectClassification, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | SuppressUserConversions = false , |
||
bool | PartialOverloading = false , |
||
OverloadCandidateParamOrder | PO = {} |
||
) |
Add a C++ member function template as a candidate to the candidate set, using template argument deduction to produce an appropriate member function template specialization.
Definition at line 7695 of file SemaOverload.cpp.
Referenced by AddFunctionCandidates().
void clang::Sema::AddModeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
IdentifierInfo * | Name, | ||
bool | InInstantiation = false |
||
) |
AddModeAttr - Adds a mode attribute to a particular declaration.
void Sema::AddMsStructLayoutForRecord | ( | RecordDecl * | RD | ) |
AddMsStructLayoutForRecord - Adds ms_struct layout attribute to record.
Definition at line 89 of file SemaAttr.cpp.
References clang::Decl::addAttr(), Context, clang::Sema::PragmaStack< ValueType >::CurrentValue, getLangOpts(), MSStructPragmaOn, and VtorDispStack.
void Sema::AddNonMemberOperatorCandidates | ( | const UnresolvedSetImpl & | Functions, |
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
TemplateArgumentListInfo * | ExplicitTemplateArgs = nullptr |
||
) |
Add all of the non-member operator function declarations in the given function set to the overload candidate set.
Definition at line 8369 of file SemaOverload.cpp.
References AddOverloadCandidate(), AddTemplateOverloadCandidate(), clang::UnresolvedSetImpl::begin(), clang::UnresolvedSetImpl::end(), clang::OverloadCandidateSet::getRewriteInfo(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::NamedDecl::getUnderlyingDecl(), clang::OverloadCandidateSet::OperatorRewriteInfo::isAcceptableCandidate(), clang::CallExpr::NotADL, clang::Reversed, and clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed().
Referenced by BuildLiteralOperatorCall(), CreateOverloadedUnaryOp(), and LookupOverloadedBinOp().
void Sema::AddOptnoneAttributeIfNoConflicts | ( | FunctionDecl * | FD, |
SourceLocation | Loc | ||
) |
Adds the 'optnone' attribute to the function declaration if there are no conflicts; Loc represents the location causing the 'optnone' attribute to be added (usually because of a pragma).
Definition at line 1191 of file SemaAttr.cpp.
References clang::Decl::addAttr(), Context, clang::Decl::hasAttr(), and Loc.
Referenced by AddRangeBasedOptnone(), and ModifyFnAttributesMSPragmaOptimize().
void Sema::AddOverloadCandidate | ( | FunctionDecl * | Function, |
DeclAccessPair | FoundDecl, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | SuppressUserConversions = false , |
||
bool | PartialOverloading = false , |
||
bool | AllowExplicit = true , |
||
bool | AllowExplicitConversions = false , |
||
ADLCallKind | IsADLCandidate = ADLCallKind::NotADL , |
||
ConversionSequenceList | EarlyConversions = std::nullopt , |
||
OverloadCandidateParamOrder | PO = {} , |
||
bool | AggregateCandidateDeduction = false |
||
) |
AddOverloadCandidate - Adds the given function to the set of candidate functions, using the given function call arguments.
If SuppressUserConversions
, then don't allow user-defined conversions via constructors or conversion operators.
PartialOverloading | true if we are performing "partial" overloading based on an incomplete set of function arguments. This feature is used by code completion. |
FIXME: Currently, the semantics of linkage in clang is slightly different from the semantics in C++ spec. In C++ spec, only names have linkage. So that all entities of the same should share one linkage. But in clang, different entities of the same could have different linkage.
Definition at line 6925 of file SemaOverload.cpp.
Referenced by AddFunctionCandidates(), and AddNonMemberOperatorCandidates().
void Sema::AddOverloadedCallCandidates | ( | LookupResult & | R, |
TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet | ||
) |
Add the call candidates from the given set of lookup results to the given overload set.
Non-function lookup results are ignored.
Definition at line 13714 of file SemaOverload.cpp.
References AddOverloadedCallCandidate(), clang::LookupResult::begin(), and clang::LookupResult::end().
void Sema::AddOverloadedCallCandidates | ( | UnresolvedLookupExpr * | ULE, |
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | PartialOverloading = false |
||
) |
Add the overload candidates named by callee and/or found by argument dependent lookup to the given overload set.
Definition at line 13658 of file SemaOverload.cpp.
References AddArgumentDependentLookupCandidates(), AddOverloadedCallCandidate(), clang::OverloadExpr::copyTemplateArgumentsInto(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), clang::Expr::getExprLoc(), clang::OverloadExpr::getName(), clang::OverloadExpr::hasExplicitTemplateArgs(), and clang::UnresolvedLookupExpr::requiresADL().
Referenced by DiagnoseTwoPhaseLookup().
bool Sema::AddOverriddenMethods | ( | CXXRecordDecl * | DC, |
CXXMethodDecl * | MD | ||
) |
AddOverriddenMethods - See if a method overrides any in the base classes, and if so, check that it's a valid override and remember it.
Definition at line 9072 of file SemaDecl.cpp.
void clang::Sema::AddParameterABIAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
ParameterABI | ABI | ||
) |
Referenced by InstantiateAttrs().
Adds the attributes that have been specified using the '#pragma clang attribute push' directives to the given declaration.
Definition at line 1093 of file SemaAttr.cpp.
Referenced by ActOnStartNamespaceDef().
void Sema::AddPushedVisibilityAttribute | ( | Decl * | RD | ) |
AddPushedVisibilityAttribute - If '#pragma GCC visibility' was used, add an appropriate visibility attribute.
Definition at line 1215 of file SemaAttr.cpp.
References clang::NamedDecl::getExplicitVisibility(), VisContext, and clang::NamedDecl::VisibilityForValue.
void Sema::AddRangeBasedOptnone | ( | FunctionDecl * | FD | ) |
Only called on function definitions; if there is a pragma in scope with the effect of a range-based optnone, consider marking the function with attribute optnone.
Definition at line 1161 of file SemaAttr.cpp.
References AddOptnoneAttributeIfNoConflicts(), clang::SourceLocation::isValid(), and OptimizeOffPragmaLocation.
void Sema::AddSectionMSAllocText | ( | FunctionDecl * | FD | ) |
Only called on function definitions; if there is a #pragma alloc_text
that decides which code section the function should be in, add attribute section to the function.
Definition at line 1168 of file SemaAttr.cpp.
References clang::NamedDecl::getIdentifier().
void Sema::AddSurrogateCandidate | ( | CXXConversionDecl * | Conversion, |
DeclAccessPair | FoundDecl, | ||
CXXRecordDecl * | ActingContext, | ||
const FunctionProtoType * | Proto, | ||
Expr * | Object, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet | ||
) |
AddSurrogateCandidate - Adds a "surrogate" candidate function that converts the given Object
to a function pointer via the conversion function Conversion
, and then attempts to call it with the given arguments (C++ [over.call.object]p2-4).
Proto is the type of function that we'll eventually be calling.
Definition at line 8241 of file SemaOverload.cpp.
void clang::Sema::AddSYCLAddIRAnnotationsMemberAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
MutableArrayRef< Expr * > | Args | ||
) |
void clang::Sema::AddSYCLAddIRAttributesFunctionAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
MutableArrayRef< Expr * > | Args | ||
) |
void clang::Sema::AddSYCLAddIRAttributesGlobalVariableAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
MutableArrayRef< Expr * > | Args | ||
) |
void clang::Sema::AddSYCLAddIRAttributesKernelParameterAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
MutableArrayRef< Expr * > | Args | ||
) |
void clang::Sema::AddSYCLDeviceHasAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr ** | Exprs, | ||
unsigned | Size | ||
) |
void clang::Sema::AddSYCLIntelBankBitsAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr ** | Exprs, | ||
unsigned | Size | ||
) |
void clang::Sema::AddSYCLIntelBankWidthAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelESimdVectorizeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelForcePow2DepthAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelInitiationIntervalAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelLoopFuseAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelMaxConcurrencyAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
AddSYCLIntelMaxConcurrencyAttr - Adds a max_concurrency attribute to a particular declaration.
void clang::Sema::AddSYCLIntelMaxGlobalWorkDimAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelMaxReplicatesAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelMaxWorkGroupSizeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | XDim, | ||
Expr * | YDim, | ||
Expr * | ZDim | ||
) |
void clang::Sema::AddSYCLIntelMaxWorkGroupsPerMultiprocessorAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelMinWorkGroupsPerComputeUnitAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelNoGlobalWorkOffsetAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelNumBanksAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelNumSimdWorkItemsAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::addSYCLIntelPipeIOAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | ID | ||
) |
addSYCLIntelPipeIOAttr - Adds a pipe I/O attribute to a particular declaration.
void clang::Sema::AddSYCLIntelPrivateCopiesAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLIntelSchedulerTargetFmaxMhzAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
void clang::Sema::AddSYCLReqdWorkGroupSizeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | XDim, | ||
Expr * | YDim, | ||
Expr * | ZDim | ||
) |
void clang::Sema::AddSYCLUsesAspectsAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr ** | Exprs, | ||
unsigned | Size | ||
) |
void clang::Sema::AddSYCLWorkGroupSizeHintAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | XDim, | ||
Expr * | YDim, | ||
Expr * | ZDim | ||
) |
void Sema::AddTemplateConversionCandidate | ( | FunctionTemplateDecl * | FunctionTemplate, |
DeclAccessPair | FoundDecl, | ||
CXXRecordDecl * | ActingContext, | ||
Expr * | From, | ||
QualType | ToType, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | AllowObjCConversionOnExplicit, | ||
bool | AllowExplicit, | ||
bool | AllowResultConversion = true |
||
) |
Adds a conversion function template specialization candidate to the overload set, using template argument deduction to deduce the template arguments of the conversion function template from the type that we are converting to (C++ [temp.deduct.conv]).
Definition at line 8183 of file SemaOverload.cpp.
void Sema::AddTemplateOverloadCandidate | ( | FunctionTemplateDecl * | FunctionTemplate, |
DeclAccessPair | FoundDecl, | ||
TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
bool | SuppressUserConversions = false , |
||
bool | PartialOverloading = false , |
||
bool | AllowExplicit = true , |
||
ADLCallKind | IsADLCandidate = ADLCallKind::NotADL , |
||
OverloadCandidateParamOrder | PO = {} , |
||
bool | AggregateCandidateDeduction = false |
||
) |
Add a C++ function template specialization as a candidate in the candidate set, using template argument deduction to produce an appropriate function template specialization.
Definition at line 7770 of file SemaOverload.cpp.
Referenced by AddFunctionCandidates(), and AddNonMemberOperatorCandidates().
void Sema::AddTemplateParametersToLambdaCallOperator | ( | CXXMethodDecl * | CallOperator, |
CXXRecordDecl * | Class, | ||
TemplateParameterList * | TemplateParams | ||
) |
Definition at line 997 of file SemaLambda.cpp.
References clang::FunctionTemplateDecl::Create().
void clang::Sema::AddXConsumedAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
RetainOwnershipKind | K, | ||
bool | IsTemplateInstantiation | ||
) |
Referenced by InstantiateAttrs().
QualType Sema::adjustCCAndNoReturn | ( | QualType | ArgFunctionType, |
QualType | FunctionType, | ||
bool | AdjustExceptionSpec = false |
||
) |
Adjust the type ArgFunctionType
to match the calling convention, noreturn, and optionally the exception specification of FunctionType
.
Deduction often wants to ignore these properties when matching function types.
Definition at line 4630 of file SemaTemplateDeduction.cpp.
References clang::Type::castAs(), Context, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::getReturnType(), clang::FunctionProtoType::hasExceptionSpec(), and clang::QualType::isNull().
Referenced by DeduceTemplateArguments().
|
static |
Adjust the DeclContext
for a function or variable that might be a function-local external declaration.
Definition at line 7380 of file SemaDecl.cpp.
References clang::DeclContext::getParent(), clang::DeclContext::isDependentContext(), clang::DeclContext::isFileContext(), and clang::DeclContext::isFunctionOrMethod().
Referenced by clang::TemplateDeclInstantiator::VisitFunctionDecl().
TemplateDecl * Sema::AdjustDeclIfTemplate | ( | Decl *& | D | ) |
AdjustDeclIfTemplate - If the given decl happens to be a template, reset the parameter D to reference the templated declaration and return a pointer to the template declaration.
Otherwise, do nothing to D and return null.
Definition at line 885 of file SemaTemplate.cpp.
Referenced by ActOnBaseSpecifier(), ActOnBaseSpecifiers(), ActOnMemInitializers(), ActOnReenterTemplateScope(), clang::SemaCodeCompletion::CodeCompleteConstructorInitializer(), and SetDeclDeleted().
void Sema::AdjustDestructorExceptionSpec | ( | CXXDestructorDecl * | Destructor | ) |
Build an exception spec for destructors that don't have one.
C++11 says that user-defined destructors with no exception spec get one that looks as if the destructor was implicitly declared.
Definition at line 14462 of file SemaDeclCXX.cpp.
References Context, clang::CPlusPlus11, clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::ASTContext::getFunctionType(), getLangOpts(), clang::FunctionProtoType::ExceptionSpecInfo::SourceDecl, clang::FunctionProtoType::ExceptionSpecInfo::Type, and clang::ASTContext::VoidTy.
Referenced by clang::TemplateDeclInstantiator::InitMethodInstantiation().
void Sema::adjustMemberFunctionCC | ( | QualType & | T, |
bool | HasThisPointer, | ||
bool | IsCtorOrDtor, | ||
SourceLocation | Loc | ||
) |
Adjust the calling convention of a method to be the ABI default if it wasn't specified explicitly.
This handles method types formed from function type typedefs and typename template arguments.
Definition at line 8006 of file SemaType.cpp.
References clang::ASTContext::adjustFunctionType(), clang::CC_X86StdCall, ConstructorDestructor, Context, clang::SemaBase::Diag(), clang::ASTContext::getAdjustedType(), clang::FunctionType::getCallConv(), clang::TargetInfo::getCXXABI(), clang::ASTContext::getDefaultCallingConvention(), clang::FunctionType::getExtInfo(), clang::FunctionType::getNameForCallConv(), clang::ASTContext::getTargetInfo(), hasExplicitCallingConv(), int, clang::TargetCXXABI::isMicrosoft(), Loc, clang::T, and clang::FunctionType::ExtInfo::withCallingConv().
Referenced by BuildMemberPointerType().
bool clang::Sema::AllWorkGroupSizesSame | ( | const Expr * | LHSXDim, |
const Expr * | LHSYDim, | ||
const Expr * | LHSZDim, | ||
const Expr * | RHSXDim, | ||
const Expr * | RHSYDim, | ||
const Expr * | RHSZDim | ||
) |
|
virtual |
This virtual key function only exists to limit the emission of debug info describing the Sema class.
GCC and Clang only emit debug info for a class with a vtable when the vtable is emitted. Sema is final and not polymorphic, but the debug info size savings are so significant that it is worth adding a vtable just to take advantage of this optimization.
Definition at line 7662 of file SemaExpr.cpp.
References clang::AltiVecBool, clang::AltiVecPixel, clang::AltiVecVector, clang::Type::castAs(), clang::VectorType::getVectorKind(), and clang::Type::isVectorType().
bool clang::Sema::AnyWorkGroupSizesDiffer | ( | const Expr * | LHSXDim, |
const Expr * | LHSYDim, | ||
const Expr * | LHSZDim, | ||
const Expr * | RHSXDim, | ||
const Expr * | RHSYDim, | ||
const Expr * | RHSZDim | ||
) |
void Sema::applyFunctionAttributesBeforeParsingBody | ( | Decl * | FD | ) |
Definition at line 15957 of file SemaDecl.cpp.
References clang::Decl::hasAttr(), clang::Decl::isInvalidDecl(), and clang::FPOptionsOverride::setDisallowOptimizations().
bool Sema::AreConstraintExpressionsEqual | ( | const NamedDecl * | Old, |
const Expr * | OldConstr, | ||
const TemplateCompareNewDeclInfo & | New, | ||
const Expr * | NewConstr | ||
) |
Definition at line 840 of file SemaConcept.cpp.
References clang::Sema::TemplateCompareNewDeclInfo::ContainsDecl(), clang::Decl::getLexicalDeclContext(), clang::Sema::TemplateCompareNewDeclInfo::getLexicalDeclContext(), clang::Sema::TemplateCompareNewDeclInfo::isInvalid(), clang::Stmt::Profile(), and SubstituteConstraintExpressionWithoutSatisfaction().
Referenced by IsOverloadOrOverrideImpl().
Are the two types lax-compatible vector types? That is, given that one of them is a vector, do they have equal storage sizes, where the storage size is the number of elements times the element size?
This will also return false if either of the types is neither a vector nor a real type.
Definition at line 7692 of file SemaExpr.cpp.
References clang::Type::isExtVectorType(), clang::Type::isScalarType(), and clang::Type::isVectorType().
Are the two types matrix types and do they have the same dimensions i.e.
do they have the same number of rows and the same number of columns?
Definition at line 7631 of file SemaExpr.cpp.
References clang::Type::getAs(), clang::ConstantMatrixType::getNumColumns(), clang::ConstantMatrixType::getNumRows(), and clang::Type::isMatrixType().
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 | ||
) |
Checks if the variant/multiversion functions are compatible.
Definition at line 11330 of file SemaDecl.cpp.
Definition at line 7642 of file SemaExpr.cpp.
References breakDownVectorType(), and clang::Type::isVectorType().
void Sema::ArgumentDependentLookup | ( | DeclarationName | Name, |
SourceLocation | Loc, | ||
ArrayRef< Expr * > | Args, | ||
ADLResult & | Functions | ||
) |
Definition at line 3944 of file SemaLookup.cpp.
bool Sema::AttachBaseSpecifiers | ( | CXXRecordDecl * | Class, |
MutableArrayRef< CXXBaseSpecifier * > | Bases | ||
) |
Performs the actual work of attaching the given base class specifiers to a C++ class.
Definition at line 2869 of file SemaDeclCXX.cpp.
References clang::AS_public, clang::Class, Context, clang::ASTContext::Deallocate(), clang::SemaBase::Diag(), clang::CXXBaseSpecifier::getAccessSpecifier(), clang::Type::getAs(), clang::CXXBaseSpecifier::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::QualType::getLocalUnqualifiedType(), getRecordDiagFromTagKind(), clang::TagDecl::getSourceRange(), clang::TagDecl::getTagKind(), clang::CXXBaseSpecifier::getType(), clang::CanQual< T >::getUnqualifiedType(), clang::Decl::hasAttr(), clang::Type::isDependentType(), clang::CXXRecordDecl::isInterfaceLike(), and NoteIndirectBases().
Referenced by ActOnBaseSpecifiers(), and SubstBaseSpecifiers().
bool Sema::AttachTypeConstraint | ( | AutoTypeLoc | TL, |
NonTypeTemplateParmDecl * | NewConstrainedParm, | ||
NonTypeTemplateParmDecl * | OrigConstrainedParm, | ||
SourceLocation | EllipsisLoc | ||
) |
Definition at line 1254 of file SemaTemplate.cpp.
References clang::Auto, Diag(), formImmediatelyDeclaredConstraint(), clang::ActionResult< PtrTy, Compress >::get(), clang::AutoTypeLoc::getAutoKeyword(), clang::TypeLoc::getBeginLoc(), clang::AutoTypeLoc::getConceptNameInfo(), clang::AutoTypeLoc::getFoundDecl(), clang::AutoTypeLoc::getLAngleLoc(), clang::Decl::getLocation(), clang::AutoTypeLoc::getNamedConcept(), clang::AutoTypeLoc::getNestedNameSpecifierLoc(), clang::AutoTypeLoc::getRAngleLoc(), clang::TypeLoc::getSourceRange(), clang::ValueDecl::getType(), clang::TypeLoc::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::NonTypeTemplateParmDecl::setPlaceholderTypeConstraint(), and clang::VK_PRValue.
bool Sema::AttachTypeConstraint | ( | NestedNameSpecifierLoc | NS, |
DeclarationNameInfo | NameInfo, | ||
ConceptDecl * | NamedConcept, | ||
NamedDecl * | FoundDecl, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
TemplateTypeParmDecl * | ConstrainedParameter, | ||
SourceLocation | EllipsisLoc | ||
) |
Attach a type-constraint to a template parameter.
Definition at line 1214 of file SemaTemplate.cpp.
Referenced by SubstTypeConstraint().
QualType Sema::BuildAddressSpaceAttr | ( | QualType & | T, |
Expr * | AddrSpace, | ||
SourceLocation | AttrLoc | ||
) |
Same as above, but constructs the AddressSpace index if not provided.
Definition at line 6507 of file SemaType.cpp.
References BuildAddressSpaceAttr(), BuildAddressSpaceIndex(), and clang::T.
QualType Sema::BuildAddressSpaceAttr | ( | QualType & | T, |
LangAS | ASIdx, | ||
Expr * | AddrSpace, | ||
SourceLocation | AttrLoc | ||
) |
BuildAddressSpaceAttr - Builds a DependentAddressSpaceType if an expression is uninstantiated.
If instantiated it will apply the appropriate address space to the type. This function allows dependent template variables to be used in conjunction with the address_space attribute
Definition at line 6484 of file SemaType.cpp.
References Context, clang::SemaBase::Diag(), DiagnoseMultipleAddrSpaceAttributes(), clang::ASTContext::getAddrSpaceQualType(), clang::Type::getAs(), clang::ASTContext::getDependentAddressSpaceType(), clang::Expr::isValueDependent(), and clang::T.
Referenced by BuildAddressSpaceAttr(), and clang::TreeTransform< Derived >::RebuildDependentAddressSpaceType().
Decl * Sema::BuildAnonymousStructOrUnion | ( | Scope * | S, |
DeclSpec & | DS, | ||
AccessSpecifier | AS, | ||
RecordDecl * | Record, | ||
const PrintingPolicy & | Policy | ||
) |
BuildAnonymousStructOrUnion - Handle the declaration of an anonymous structure or union.
Anonymous unions are a C++ feature (C++ [class.union]) and a C11 feature; anonymous structures are a C11 feature and GNU C++ extension.
Definition at line 5591 of file SemaDecl.cpp.
ExprResult Sema::BuildAnonymousStructUnionMemberReference | ( | const CXXScopeSpec & | SS, |
SourceLocation | nameLoc, | ||
IndirectFieldDecl * | indirectField, | ||
DeclAccessPair | FoundDecl = DeclAccessPair::make(nullptr, AS_none) , |
||
Expr * | baseObjectExpr = nullptr , |
||
SourceLocation | opLoc = SourceLocation() |
||
) |
Definition at line 849 of file SemaExprMember.cpp.
References BuildDeclarationNameExpr(), BuildFieldReferenceExpr(), clang::IndirectFieldDecl::chain_begin(), clang::IndirectFieldDecl::chain_end(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getAccess(), clang::NamedDecl::getDeclName(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::IndirectFieldDecl::getVarDecl(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), clang::Type::isRecordType(), and clang::DeclAccessPair::make().
QualType Sema::BuildArrayType | ( | QualType | T, |
ArraySizeModifier | ASM, | ||
Expr * | ArraySize, | ||
unsigned | Quals, | ||
SourceRange | Brackets, | ||
DeclarationName | Entity | ||
) |
Build an array type.
T | The type of each element in the array. |
ASM | C99 array size modifier (e.g., '*', 'static'). |
ArraySize | Expression describing the size of the array. |
Brackets | The range from the opening '[' to the closing ']'. |
Entity | The name of the entity that involves the array type, if known. |
Definition at line 2100 of file SemaType.cpp.
References checkArrayElementAlignment(), checkArraySize(), CheckPlaceholderExpr(), Context, clang::CPlusPlus, clang::CPlusPlus11, CUDA(), DefaultLvalueConversion(), clang::SemaBase::Diag(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::ASTContext::getConstantArrayType(), getCurFunction(), clang::TargetInfo::getCXXABI(), clang::ASTContext::getDependentSizedArrayType(), clang::ASTContext::getIncompleteArrayType(), getLangOpts(), clang::ConstantArrayType::getMaxSizeBits(), clang::ConstantArrayType::getNumAddressingBits(), getPrintableNameForEntity(), clang::ASTContext::getSizeType(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVariableArrayType(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isArrayType(), clang::Type::isBlockPointerType(), isCompleteType(), clang::Type::isConstantSizeType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isImageType(), clang::Type::isIncompleteArrayType(), clang::Type::isIncompleteType(), clang::SemaOpenMP::isInOpenMPTaskUntiedContext(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::TargetCXXABI::isMicrosoft(), clang::Type::isObjCObjectType(), clang::Type::isPipeType(), clang::Expr::isPRValue(), clang::Type::isReferenceType(), clang::Type::isSamplerT(), isSFINAEContext(), clang::Type::isSizelessType(), clang::Expr::isTypeDependent(), clang::Type::isUndeducedType(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Expr::isValueDependent(), clang::Type::isVariableArrayType(), clang::Type::isVariablyModifiedType(), clang::TargetInfo::isVLASupported(), clang::Type::isVoidType(), Loc, clang::Normal, clang::OpenCL, OpenMP(), RequireCompleteSizedType(), RequireNonAbstractType(), clang::Star, clang::T, targetDiag(), and clang::threadSafety::sx::toString().
Referenced by clang::TreeTransform< Derived >::RebuildArrayType().
ExprResult Sema::BuildArrayTypeTrait | ( | ArrayTypeTrait | ATT, |
SourceLocation | KWLoc, | ||
TypeSourceInfo * | TSInfo, | ||
Expr * | DimExpr, | ||
SourceLocation | RParen | ||
) |
Definition at line 6240 of file SemaExprCXX.cpp.
References Context, EvaluateArrayTypeTrait(), clang::ASTContext::getSizeType(), clang::TypeSourceInfo::getType(), clang::Type::isDependentType(), and clang::T.
Referenced by ActOnArrayTypeTrait().
ExprResult Sema::BuildAsTypeExpr | ( | Expr * | E, |
QualType | DestTy, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RParenLoc | ||
) |
Create a new AsTypeExpr node (bitcast) from the arguments.
Definition at line 6783 of file SemaExpr.cpp.
References clang::Expr::getType(), clang::Type::isDependentType(), clang::OK_Ordinary, and clang::VK_PRValue.
ExprResult Sema::BuildAtomicExpr | ( | SourceRange | CallRange, |
SourceRange | ExprRange, | ||
SourceLocation | RParenLoc, | ||
MultiExprArg | Args, | ||
AtomicExpr::AtomicOp | Op, | ||
AtomicArgumentOrder | ArgOrder = AtomicArgumentOrder::API |
||
) |
Definition at line 6960 of file SemaChecking.cpp.
References clang::Type::castAs(), clang::Copy, Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isAtomicType(), clang::QualType::isConstQualified(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::interp::Load(), clang::opencl_constant, and clang::ast_matchers::pointerType.
QualType Sema::BuildAtomicType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Definition at line 9843 of file SemaType.cpp.
References clang::C23, Context, clang::CPlusPlus, clang::SemaBase::Diag(), clang::ASTContext::getAtomicType(), getLangOpts(), clang::Type::isArrayType(), clang::Type::isAtomicType(), clang::Type::isBitIntType(), isDependentOrGNUAutoType(), clang::Type::isFunctionType(), clang::Type::isReferenceType(), clang::Type::isSizelessType(), clang::Type::isUndeducedAutoType(), Loc, RequireCompleteType(), and clang::T.
Referenced by BuildQualifiedType(), and clang::TreeTransform< Derived >::RebuildAtomicType().
StmtResult Sema::BuildAttributedStmt | ( | SourceLocation | AttrsLoc, |
ArrayRef< const Attr * > | Attrs, | ||
Stmt * | SubStmt | ||
) |
Definition at line 608 of file SemaStmt.cpp.
References clang::AttributedStmt::Create().
Referenced by clang::TreeTransform< Derived >::RebuildAttributedStmt().
MemInitResult Sema::BuildBaseInitializer | ( | QualType | BaseType, |
TypeSourceInfo * | BaseTInfo, | ||
Expr * | Init, | ||
CXXRecordDecl * | ClassDecl, | ||
SourceLocation | EllipsisLoc | ||
) |
Definition at line 4759 of file SemaDeclCXX.cpp.
References ActOnFinishFullExpr(), BuildDelegatingInitializer(), clang::Type::containsUnexpandedParameterPack(), Context, clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), CreateRecoveryExpr(), CurContext, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), DiscardCleanupsInEvaluationContext(), FindBaseInitializer(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::SourceRange::getBegin(), clang::TypeLoc::getBeginLoc(), clang::SourceRange::getEnd(), clang::TypeLoc::getLocalSourceRange(), clang::TypeLoc::getSourceRange(), clang::ASTContext::getTypeDeclType(), clang::TypeDecl::getTypeForDecl(), clang::TypeSourceInfo::getTypeLoc(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::ASTContext::hasSameUnqualifiedType(), clang::InitializedEntity::InitializeBase(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isRecordType(), clang::SourceLocation::isValid(), clang::CXXBaseSpecifier::isVirtual(), clang::InitializationSequence::Perform(), and UPPC_Initializer.
Referenced by InstantiateMemInitializers().
void Sema::BuildBasePathArray | ( | const CXXBasePaths & | Paths, |
CXXCastPath & | BasePath | ||
) |
Definition at line 3053 of file SemaDeclCXX.cpp.
ExprResult Sema::BuildBinOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
BinaryOperatorKind | Opc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) |
QualType Sema::BuildBitIntType | ( | bool | IsUnsigned, |
Expr * | BitWidth, | ||
SourceLocation | Loc | ||
) |
Build a bit-precise integer type.
IsUnsigned | Boolean representing the signedness of the type. |
BitWidth | Size of this int type in bits, or an expression representing that. |
Loc | Location of the keyword. |
Definition at line 1972 of file SemaType.cpp.
References AllowFold, Context, clang::SemaBase::Diag(), getASTContext(), clang::ASTContext::getAuxTargetInfo(), clang::ASTContext::getBitIntType(), clang::ASTContext::getDependentBitIntType(), clang::TargetInfo::getMaxBitIntWidth(), clang::Expr::isInstantiationDependent(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, max(), and VerifyIntegerConstantExpression().
Referenced by clang::TreeTransform< Derived >::RebuildBitIntType(), and clang::TreeTransform< Derived >::RebuildDependentBitIntType().
ExprResult Sema::BuildBlockForLambdaConversion | ( | SourceLocation | CurrentLocation, |
SourceLocation | ConvLocation, | ||
CXXConversionDecl * | Conv, | ||
Expr * | Src | ||
) |
Definition at line 2283 of file SemaLambda.cpp.
References clang::CXXMethodDecl::getParent(), and clang::DeclContext::lookup().
Referenced by DefineImplicitLambdaToBlockPointerConversion().
QualType Sema::BuildBlockPointerType | ( | QualType | T, |
SourceLocation | Loc, | ||
DeclarationName | Entity | ||
) |
Build a block pointer type.
T | The type to which we'll be building a block pointer. |
Loc | The source location, used for diagnostics. |
Entity | The name of the entity that involves the block pointer type, if known. |
Definition at line 2803 of file SemaType.cpp.
References checkQualifiedFunction(), Context, deduceOpenCLPointeeAddrSpace(), clang::SemaBase::Diag(), clang::ASTContext::getBlockPointerType(), getLangOpts(), clang::Type::isFunctionType(), Loc, clang::OpenCL, and clang::T.
Referenced by clang::TreeTransform< Derived >::RebuildBlockPointerType().
ExprResult Sema::BuildBuiltinBitCastExpr | ( | SourceLocation | KWLoc, |
TypeSourceInfo * | TSI, | ||
Expr * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 399 of file SemaCast.cpp.
References Context, clang::ExprError(), clang::TypeLoc::getBeginLoc(), clang::TypeLoc::getEndLoc(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), and clang::Type::isDependentType().
Referenced by ActOnBuiltinBitCastExpr().
Expr * Sema::BuildBuiltinCallExpr | ( | SourceLocation | Loc, |
Builtin::ID | Id, | ||
MultiExprArg | CallArgs | ||
) |
BuildBuiltinCallExpr - Create a call to a builtin function specified by Id.
Definition at line 6750 of file SemaExpr.cpp.
ExprResult Sema::BuildBuiltinOffsetOf | ( | SourceLocation | BuiltinLoc, |
TypeSourceInfo * | TInfo, | ||
ArrayRef< OffsetOfComponent > | Components, | ||
SourceLocation | RParenLoc | ||
) |
__builtin_offsetof(type, a.b[123][456].c)
Definition at line 15884 of file SemaExpr.cpp.
ExprResult Sema::BuildCallExpr | ( | Scope * | Scope, |
Expr * | Fn, | ||
SourceLocation | LParenLoc, | ||
MultiExprArg | ArgExprs, | ||
SourceLocation | RParenLoc, | ||
Expr * | ExecConfig = nullptr , |
||
bool | IsExecConfig = false , |
||
bool | AllowRecovery = false |
||
) |
BuildCallExpr - Handle a call to Fn with the specified array of arguments.
This provides the location of the left/right parens and a list of comma locations.
Definition at line 6548 of file SemaExpr.cpp.
References clang::CPlusPlus, clang::CallExpr::Create(), clang::FixItHint::CreateRemoval(), Diag(), clang::ExprError(), and clang::Stmt::getBeginLoc().
Referenced by EvaluateStaticAssertMessageAsString().
ExprResult Sema::BuildCallToMemberFunction | ( | Scope * | S, |
Expr * | MemExprE, | ||
SourceLocation | LParenLoc, | ||
MultiExprArg | Args, | ||
SourceLocation | RParenLoc, | ||
Expr * | ExecConfig = nullptr , |
||
bool | IsExecConfig = false , |
||
bool | AllowRecovery = false |
||
) |
BuildCallToMemberFunction - Build a call to a member function.
MemExpr is the expression that refers to the member function (and includes the object parameter), Args/NumArgs are the arguments to the function call (not including the object parameter). The caller needs to validate that the member expression refers to a non-static member function or an overloaded member function.
Definition at line 15418 of file SemaOverload.cpp.
ExprResult Sema::BuildCallToObjectOfClassType | ( | Scope * | S, |
Expr * | Object, | ||
SourceLocation | LParenLoc, | ||
MultiExprArg | Args, | ||
SourceLocation | RParenLoc | ||
) |
BuildCallToObjectOfClassType - Build a call to an object of class type (C++ [over.call.object]), which can end up invoking an overloaded function call operator (operator()
) or performing a user-defined conversion on the object argument.
Definition at line 15748 of file SemaOverload.cpp.
FieldDecl * Sema::BuildCaptureField | ( | RecordDecl * | RD, |
const sema::Capture & | Capture | ||
) |
Build a FieldDecl suitable to hold the given capture.
Create a field within the lambda class or captured statement record for the given capture.
Definition at line 2003 of file SemaLambda.cpp.
References clang::sema::Capture::getCaptureType(), clang::sema::Capture::getLocation(), clang::NamedDecl::getName(), clang::sema::Capture::getVariable(), Id, clang::sema::Capture::isVariableCapture(), and Loc.
ExprResult Sema::BuildCaptureInit | ( | const sema::Capture & | Capture, |
SourceLocation | ImplicitCaptureLoc, | ||
bool | IsOpenMPMapping = false |
||
) |
Initialize the given capture with a suitable expression.
Definition at line 1866 of file SemaLambda.cpp.
References clang::sema::Capture::getLocation(), clang::sema::Capture::getVariable(), clang::sema::Capture::isInitCapture(), clang::SourceLocation::isValid(), clang::sema::Capture::isVLATypeCapture(), and Loc.
CodeAlignAttr * Sema::BuildCodeAlignAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 763 of file SemaStmtAttr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::AttributeCommonInfo::getLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isValueDependent().
ExprResult Sema::BuildCompoundLiteralExpr | ( | SourceLocation | LParenLoc, |
TypeSourceInfo * | TInfo, | ||
SourceLocation | RParenLoc, | ||
Expr * | LiteralExpr | ||
) |
Definition at line 7141 of file SemaExpr.cpp.
References clang::TypeSourceInfo::getType(), and clang::Type::isArrayType().
ExprResult Sema::BuildConvertedConstantExpression | ( | Expr * | From, |
QualType | T, | ||
CCEKind | CCE, | ||
NamedDecl * | Dest = nullptr |
||
) |
Definition at line 6292 of file SemaOverload.cpp.
References BuildConvertedConstantExpression(), and clang::T.
Referenced by EvaluateStaticAssertMessageAsString().
StmtResult Sema::BuildCoreturnStmt | ( | SourceLocation | KwLoc, |
Expr * | E, | ||
bool | IsImplicit = false |
||
) |
Definition at line 977 of file SemaCoroutine.cpp.
References buildPromiseCall(), checkCoroutineContext(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isVoidType(), Loc, and clang::StmtError().
StmtResult Sema::BuildCoroutineBodyStmt | ( | CoroutineBodyStmt::CtorArgs | Args | ) |
Definition at line 1916 of file SemaCoroutine.cpp.
References Context, clang::CoroutineBodyStmt::Create(), and clang::StmtError().
bool Sema::buildCoroutineParameterMoves | ( | SourceLocation | Loc | ) |
Definition at line 1864 of file SemaCoroutine.cpp.
References ActOnDeclStmt(), AddInitializerToDecl(), BuildDeclRefExpr(), buildVarDecl(), castForMoving(), ConvertDeclToDeclGroup(), CurContext, clang::ActionResult< PtrTy, Compress >::get(), getCurFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, and clang::VK_LValue.
VarDecl * Sema::buildCoroutinePromise | ( | SourceLocation | Loc | ) |
Definition at line 478 of file SemaCoroutine.cpp.
References clang::Type::isDependentType(), and clang::T.
When the resulting expression is invalid, we still create the AST using the original count expression for the sake of AST dump.
Definition at line 9440 of file SemaType.cpp.
References BuildTypeCoupledDecls(), Context, clang::ASTContext::getCountAttributedType(), clang::Type::isIncompleteArrayType(), and clang::Type::isPointerType().
ExprResult Sema::BuildCoyieldExpr | ( | SourceLocation | KwLoc, |
Expr * | E | ||
) |
Definition at line 933 of file SemaCoroutine.cpp.
References checkCoroutineContext(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
ExprResult Sema::BuildCStyleCastExpr | ( | SourceLocation | LParenLoc, |
TypeSourceInfo * | Ty, | ||
SourceLocation | RParenLoc, | ||
Expr * | Op | ||
) |
Definition at line 3361 of file SemaCast.cpp.
References Context, clang::CPlusPlus, clang::CStyleCastExpr::Create(), CurFPFeatureOverrides(), DiagnoseCastQual(), clang::ExprError(), clang::Stmt::getEndLoc(), getLangOpts(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), and clang::TypeSourceInfo::getTypeLoc().
Referenced by buildDistanceFunc().
ExprResult Sema::BuildCXXAssumeExpr | ( | Expr * | Assumption, |
const IdentifierInfo * | AttrName, | ||
SourceRange | Range | ||
) |
Definition at line 1272 of file SemaStmtAttr.cpp.
References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::HasSideEffects(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
ExprResult Sema::BuildCXXConstructExpr | ( | SourceLocation | ConstructLoc, |
QualType | DeclInitType, | ||
CXXConstructorDecl * | Constructor, | ||
bool | Elidable, | ||
MultiExprArg | Exprs, | ||
bool | HadMultipleCandidates, | ||
bool | IsListInitialization, | ||
bool | IsStdInitListInitialization, | ||
bool | RequiresZeroInit, | ||
CXXConstructionKind | ConstructKind, | ||
SourceRange | ParenRange | ||
) |
Build a CXXConstructExpr whose constructor has already been resolved if it denotes an inherited constructor.
BuildCXXConstructExpr - Creates a complete call to a constructor, including handling of its default argument expressions.
Definition at line 16157 of file SemaDeclCXX.cpp.
References CheckForImmediateInvocation(), Context, clang::CXXConstructExpr::Create(), CUDA(), clang::declaresSameEntity(), clang::ExprError(), clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), getLangOpts(), and MarkFunctionReferenced().
ExprResult Sema::BuildCXXConstructExpr | ( | SourceLocation | ConstructLoc, |
QualType | DeclInitType, | ||
NamedDecl * | FoundDecl, | ||
CXXConstructorDecl * | Constructor, | ||
bool | Elidable, | ||
MultiExprArg | Exprs, | ||
bool | HadMultipleCandidates, | ||
bool | IsListInitialization, | ||
bool | IsStdInitListInitialization, | ||
bool | RequiresZeroInit, | ||
CXXConstructionKind | ConstructKind, | ||
SourceRange | ParenRange | ||
) |
Definition at line 16134 of file SemaDeclCXX.cpp.
ExprResult Sema::BuildCXXConstructExpr | ( | SourceLocation | ConstructLoc, |
QualType | DeclInitType, | ||
NamedDecl * | FoundDecl, | ||
CXXConstructorDecl * | Constructor, | ||
MultiExprArg | Exprs, | ||
bool | HadMultipleCandidates, | ||
bool | IsListInitialization, | ||
bool | IsStdInitListInitialization, | ||
bool | RequiresZeroInit, | ||
CXXConstructionKind | ConstructKind, | ||
SourceRange | ParenRange | ||
) |
BuildCXXConstructExpr - Creates a complete call to a constructor, including handling of its default argument expressions.
ConstructKind | - a CXXConstructExpr::ConstructionKind |
Definition at line 16092 of file SemaDeclCXX.cpp.
Referenced by PerformImplicitConversion().
ExprResult Sema::BuildCXXDefaultArgExpr | ( | SourceLocation | CallLoc, |
FunctionDecl * | FD, | ||
ParmVarDecl * | Param, | ||
Expr * | Init = nullptr |
||
) |
BuildCXXDefaultArgExpr - Creates a CXXDefaultArgExpr, instantiating the default expr if needed.
Definition at line 5588 of file SemaExpr.cpp.
References clang::CXXDefaultArgExpr::Create(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::VarDecl::getInit(), clang::ParmVarDecl::hasDefaultArg(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), clang::ParmVarDecl::hasUnparsedDefaultArg(), clang::FunctionDecl::isImmediateFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::runWithSufficientStackSpace(), and V.
ExprResult Sema::BuildCXXDefaultInitExpr | ( | SourceLocation | Loc, |
FieldDecl * | Field | ||
) |
Definition at line 5661 of file SemaExpr.cpp.
References clang::CXXDefaultInitExpr::Create(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::CXXRecordDecl::getTemplateInstantiationPattern(), clang::FieldDecl::hasInClassInitializer(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::isTemplateInstantiation(), clang::ActionResult< PtrTy, Compress >::isUsable(), Loc, clang::DeclContext::lookup(), clang::runWithSufficientStackSpace(), clang::interp::This(), and V.
Referenced by CollectFieldInitializer().
ExprResult Sema::BuildCXXFoldExpr | ( | UnresolvedLookupExpr * | Callee, |
SourceLocation | LParenLoc, | ||
Expr * | LHS, | ||
BinaryOperatorKind | Operator, | ||
SourceLocation | EllipsisLoc, | ||
Expr * | RHS, | ||
SourceLocation | RParenLoc, | ||
std::optional< unsigned > | NumExpansions | ||
) |
Definition at line 1346 of file SemaTemplateVariadic.cpp.
References Context, and clang::ASTContext::DependentTy.
StmtResult Sema::BuildCXXForRangeStmt | ( | SourceLocation | ForLoc, |
SourceLocation | CoawaitLoc, | ||
Stmt * | InitStmt, | ||
SourceLocation | ColonLoc, | ||
Stmt * | RangeDecl, | ||
Stmt * | Begin, | ||
Stmt * | End, | ||
Expr * | Cond, | ||
Expr * | Inc, | ||
Stmt * | LoopVarDecl, | ||
SourceLocation | RParenLoc, | ||
BuildForRangeKind | Kind, | ||
ArrayRef< MaterializeTemporaryExpr * > | LifetimeExtendTemps = {} |
||
) |
BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement.
Definition at line 2617 of file SemaStmt.cpp.
ExprResult Sema::BuildCXXFunctionalCastExpr | ( | TypeSourceInfo * | TInfo, |
QualType | Type, | ||
SourceLocation | LParenLoc, | ||
Expr * | CastExpr, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 3387 of file SemaCast.cpp.
References Context, clang::CXXFunctionalCastExpr::Create(), CurFPFeatureOverrides(), DiagnoseCastQual(), clang::ExprError(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getTypeLoc(), and clang::SourceLocation::isValid().
Referenced by BuildCXXTypeConstructExpr().
ExprResult Sema::BuildCXXMemberCallExpr | ( | Expr * | Exp, |
NamedDecl * | FoundDecl, | ||
CXXConversionDecl * | Method, | ||
bool | HadMultipleCandidates | ||
) |
Definition at line 14254 of file SemaOverload.cpp.
Referenced by diagnoseNoViableConversion(), and recordConversion().
ExprResult Sema::BuildCXXNamedCast | ( | SourceLocation | OpLoc, |
tok::TokenKind | Kind, | ||
TypeSourceInfo * | Ty, | ||
Expr * | E, | ||
SourceRange | AngleBrackets, | ||
SourceRange | Parens | ||
) |
Definition at line 301 of file SemaCast.cpp.
References Context, clang::CXXStaticCastExpr::Create(), clang::CXXDynamicCastExpr::Create(), clang::CXXReinterpretCastExpr::Create(), clang::CXXAddrspaceCastExpr::Create(), clang::CXXConstCastExpr::Create(), CurFPFeatureOverrides(), clang::SemaBase::Diag(), DiscardMisalignedMemberAddress(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::TypeSourceInfo::getType(), clang::QualType::getTypePtr(), clang::Type::isDependentType(), clang::Expr::isTypeDependent(), and clang::Parens.
Referenced by ActOnCXXNamedCast(), and CastForMoving().
bool Sema::BuildCXXNestedNameSpecifier | ( | Scope * | S, |
NestedNameSpecInfo & | IdInfo, | ||
bool | EnteringContext, | ||
CXXScopeSpec & | SS, | ||
NamedDecl * | ScopeLookupResult, | ||
bool | ErrorRecoveryLookup, | ||
bool * | IsCorrectedToColon = nullptr , |
||
bool | OnlyNamespace = false |
||
) |
Build a new nested-name-specifier for "identifier::", as described by ActOnCXXNestedNameSpecifier.
S | Scope in which the nested-name-specifier occurs. |
IdInfo | Parser information about an identifier in the nested-name-spec. |
EnteringContext | If true, enter the context specified by the nested-name-specifier. |
SS | Optional nested name specifier preceding the identifier. |
ScopeLookupResult | Provides the result of name lookup within the scope of the nested-name-specifier that was computed at template definition time. |
ErrorRecoveryLookup | Specifies if the method is called to improve error recovery and what kind of recovery is performed. |
IsCorrectedToColon | If not null, suggestion of replace '::' -> ':' are allowed. The bool value pointed by this parameter is set to 'true' if the identifier is treated as if it was followed by ':', not '::'. |
OnlyNamespace | If true, only considers namespaces in lookup. |
This routine differs only slightly from ActOnCXXNestedNameSpecifier, in that it contains an extra parameter ScopeLookupResult
, which provides the result of name lookup within the scope of the nested-name-specifier that was computed at template definition time.
If ErrorRecoveryLookup is true, then this call is used to improve error recovery. This means that it should not emit diagnostics, it should just return true on failure. It also means it should only return a valid scope if it knows that the result is correct. It should not return in a dependent context, for example. Nor will it extend SS
with the scope specifier.
Definition at line 473 of file SemaCXXScopeSpec.cpp.
Referenced by clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc().
ExprResult Sema::BuildCXXNew | ( | SourceRange | Range, |
bool | UseGlobal, | ||
SourceLocation | PlacementLParen, | ||
MultiExprArg | PlacementArgs, | ||
SourceLocation | PlacementRParen, | ||
SourceRange | TypeIdParens, | ||
QualType | AllocType, | ||
TypeSourceInfo * | AllocTypeInfo, | ||
std::optional< Expr * > | ArraySize, | ||
SourceRange | DirectInitRange, | ||
Expr * | Initializer | ||
) |
Definition at line 2063 of file SemaExprCXX.cpp.
References clang::Braces, clang::SourceRange::getBegin(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getTypeLoc(), clang::Initializer, clang::SourceRange::isValid(), clang::None, clang::Parens, and Range.
ExprResult Sema::BuildCXXNoexceptExpr | ( | SourceLocation | KeyLoc, |
Expr * | Operand, | ||
SourceLocation | RParen | ||
) |
Definition at line 8389 of file SemaExprCXX.cpp.
References clang::ASTContext::BoolTy, canThrow(), CanThrow(), CheckPlaceholderExpr(), CheckUnevaluatedOperand(), Context, clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), inTemplateInstantiation(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
Referenced by ActOnNoexceptExpr(), and clang::TreeTransform< Derived >::RebuildCXXNoexceptExpr().
Expr * Sema::BuildCXXThisExpr | ( | SourceLocation | Loc, |
QualType | Type, | ||
bool | IsImplicit | ||
) |
Build a CXXThisExpr and mark it referenced in the current context.
Definition at line 1463 of file SemaExprCXX.cpp.
References Context, clang::CXXThisExpr::Create(), Loc, MarkThisReferenced(), and clang::interp::This().
Referenced by ActOnCXXThis(), FixOverloadedFunctionReference(), and clang::SemaOpenMP::isOpenMPCapturedDecl().
ExprResult Sema::BuildCXXThrow | ( | SourceLocation | OpLoc, |
Expr * | Ex, | ||
bool | IsThrownVarInScope | ||
) |
Definition at line 870 of file SemaExprCXX.cpp.
References clang::T.
ExprResult Sema::BuildCXXTypeConstructExpr | ( | TypeSourceInfo * | Type, |
SourceLocation | LParenLoc, | ||
MultiExprArg | Exprs, | ||
SourceLocation | RParenLoc, | ||
bool | ListInitialization | ||
) |
Definition at line 1555 of file SemaExprCXX.cpp.
References clang::AlreadyDiagnosed, BuildCXXFunctionalCastExpr(), Context, clang::CPlusPlus23, clang::CXXUnresolvedConstructExpr::Create(), clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), clang::InitializationKind::CreateValue(), DeduceAutoType(), DeduceTemplateSpecializationFromInitializer(), clang::SemaBase::Diag(), clang::ExprError(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::TypeLoc::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::Type::getContainedDeducedType(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Expr::hasAnyTypeDependentArguments(), clang::InitializedEntity::InitializeTemporary(), clang::Type::isArrayType(), clang::DeducedType::isDeduced(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::QualType::isNull(), clang::Type::isVoidType(), clang::InitializationSequence::Perform(), RequireCompleteType(), and clang::Success.
Referenced by ActOnCXXTypeConstructExpr().
ExprResult Sema::BuildCXXTypeId | ( | QualType | TypeInfoType, |
SourceLocation | TypeidLoc, | ||
Expr * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Build a C++ typeid expression with an expression operand.
Definition at line 575 of file SemaExprCXX.cpp.
References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Expr::isGLValue(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXRecordDecl::isPolymorphic(), clang::Expr::isTypeDependent(), and clang::T.
ExprResult Sema::BuildCXXTypeId | ( | QualType | TypeInfoType, |
SourceLocation | TypeidLoc, | ||
TypeSourceInfo * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Build a C++ typeid expression with a type operand.
Definition at line 547 of file SemaExprCXX.cpp.
References clang::T.
ExprResult Sema::BuildCXXUuidof | ( | QualType | TypeInfoType, |
SourceLocation | TypeidLoc, | ||
Expr * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Build a Microsoft __uuidof expression with an expression operand.
Definition at line 770 of file SemaExprCXX.cpp.
References clang::Expr::getType(), clang::Type::isDependentType(), and clang::Expr::isNullPointerConstant().
ExprResult Sema::BuildCXXUuidof | ( | QualType | TypeInfoType, |
SourceLocation | TypeidLoc, | ||
TypeSourceInfo * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Build a Microsoft __uuidof expression with a type operand.
Definition at line 750 of file SemaExprCXX.cpp.
References Diag(), clang::ExprError(), and getUuidAttrOfType().
ExprResult Sema::BuildDeclarationNameExpr | ( | const CXXScopeSpec & | SS, |
const DeclarationNameInfo & | NameInfo, | ||
NamedDecl * | D, | ||
NamedDecl * | FoundD = nullptr , |
||
const TemplateArgumentListInfo * | TemplateArgs = nullptr , |
||
bool | AcceptInvalidDecl = false |
||
) |
Complete semantic analysis for a reference to the given declaration.
Definition at line 3339 of file SemaExpr.cpp.
References CheckDeclInExpr(), clang::CPlusPlus, Diag(), clang::ExprError(), clang::DeclarationNameInfo::getBeginLoc(), clang::DeclarationNameInfo::getEndLoc(), clang::Decl::getKind(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::CXXScopeSpec::getRange(), clang::QualType::isNull(), Loc, clang::ast_matchers::type, clang::VK_LValue, and clang::VK_PRValue.
ExprResult Sema::BuildDeclarationNameExpr | ( | const CXXScopeSpec & | SS, |
LookupResult & | R, | ||
bool | NeedsADL, | ||
bool | AcceptInvalidDecl = false |
||
) |
Definition at line 3301 of file SemaExpr.cpp.
References CheckDeclInExpr(), clang::UnresolvedLookupExpr::Create(), clang::ExprError(), clang::LookupResult::getAsSingle(), clang::LookupResult::getFoundDecl(), clang::LookupResult::getLookupNameInfo(), clang::LookupResult::getNameLoc(), clang::LookupResult::getRepresentativeDecl(), clang::LookupResult::isSingleResult(), ShouldLookupResultBeMultiVersionOverload(), and clang::LookupResult::suppressDiagnostics().
Referenced by attemptRecovery(), and BuildAnonymousStructUnionMemberReference().
Sema::DeclGroupPtrTy Sema::BuildDeclaratorGroup | ( | MutableArrayRef< Decl * > | Group | ) |
BuildDeclaratorGroup - convert a list of declarations into a declaration group, performing any necessary semantic checking.
Definition at line 15085 of file SemaDecl.cpp.
References clang::Type::getContainedDeducedType(), clang::DeducedType::getDeducedType(), clang::ValueDecl::getType(), clang::Decl::isInvalidDecl(), and clang::QualType::isNull().
Referenced by clang::SemaObjC::ActOnFinishObjCImplementation().
DeclRefExpr * Sema::BuildDeclRefExpr | ( | ValueDecl * | D, |
QualType | Ty, | ||
ExprValueKind | VK, | ||
const DeclarationNameInfo & | NameInfo, | ||
const CXXScopeSpec * | SS = nullptr , |
||
NamedDecl * | FoundD = nullptr , |
||
SourceLocation | TemplateKWLoc = SourceLocation() , |
||
const TemplateArgumentListInfo * | TemplateArgs = nullptr |
||
) |
Definition at line 2285 of file SemaExpr.cpp.
References clang::CXXScopeSpec::getWithLocInContext().
DeclRefExpr * Sema::BuildDeclRefExpr | ( | ValueDecl * | D, |
QualType | Ty, | ||
ExprValueKind | VK, | ||
const DeclarationNameInfo & | NameInfo, | ||
NestedNameSpecifierLoc | NNS, | ||
NamedDecl * | FoundD = nullptr , |
||
SourceLocation | TemplateKWLoc = SourceLocation() , |
||
const TemplateArgumentListInfo * | TemplateArgs = nullptr |
||
) |
BuildDeclRefExpr - Build an expression that references a declaration that does not require a closure capture.
Definition at line 2356 of file SemaExpr.cpp.
References clang::DeclRefExpr::Create(), and clang::DeclarationNameInfo::getLoc().
DeclRefExpr * Sema::BuildDeclRefExpr | ( | ValueDecl * | D, |
QualType | Ty, | ||
ExprValueKind | VK, | ||
SourceLocation | Loc, | ||
const CXXScopeSpec * | SS = nullptr |
||
) |
Definition at line 2277 of file SemaExpr.cpp.
References clang::NamedDecl::getDeclName(), and Loc.
Referenced by clang::SemaOpenMP::ActOnOpenMPCanonicalLoop(), buildCoroutineParameterMoves(), buildDistanceFunc(), buildLoopVarFunc(), CheckConditionVariable(), DefineImplicitLambdaToFunctionPointerConversion(), FixOverloadedFunctionReference(), and clang::SemaOpenMP::getOpenMPCapturedExpr().
If AsUnevaluated is false, E is treated as though it were an evaluated context, such as when building a type for decltype(auto).
Definition at line 9528 of file SemaType.cpp.
References CodeSynthesisContexts, Context, clang::SemaBase::Diag(), getDecltypeForExpr(), clang::ASTContext::getDecltypeType(), clang::Expr::getExprLoc(), clang::Expr::hasPlaceholderType(), clang::Expr::HasSideEffects(), and clang::Expr::isInstantiationDependent().
Referenced by ActOnCXXNestedNameSpecifierDecltype(), and clang::TreeTransform< Derived >::RebuildDecltypeType().
MemInitResult Sema::BuildDelegatingInitializer | ( | TypeSourceInfo * | TInfo, |
Expr * | Init, | ||
CXXRecordDecl * | ClassDecl | ||
) |
Definition at line 4696 of file SemaDeclCXX.cpp.
References ActOnFinishFullExpr(), clang::Expr::containsErrors(), Context, clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), CreateRecoveryExpr(), CurContext, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::TypeLoc::getSourceRange(), clang::TypeDecl::getTypeForDecl(), clang::TypeSourceInfo::getTypeLoc(), clang::InitializedEntity::InitializeDelegation(), clang::DeclContext::isDependentContext(), clang::ActionResult< PtrTy, Compress >::isInvalid(), LangOpts, and clang::InitializationSequence::Perform().
Referenced by BuildBaseInitializer(), and InstantiateMemInitializers().
ExprResult Sema::BuildDependentDeclRefExpr | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
const DeclarationNameInfo & | NameInfo, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) |
Definition at line 749 of file SemaTemplate.cpp.
References clang::DependentScopeDeclRefExpr::Create(), clang::CXXScopeSpec::getBeginLoc(), clang::DeclarationNameInfo::getEndLoc(), clang::TemplateArgumentListInfo::getRAngleLoc(), and clang::CXXScopeSpec::isValid().
ExprResult Sema::BuildEmptyCXXFoldExpr | ( | SourceLocation | EllipsisLoc, |
BinaryOperatorKind | Operator | ||
) |
Definition at line 1357 of file SemaTemplateVariadic.cpp.
References ActOnCXXBoolLiteral(), Context, clang::SemaBase::Diag(), clang::BinaryOperator::getOpcodeStr(), clang::ASTContext::getTrivialTypeSourceInfo(), and clang::ASTContext::VoidTy.
VarDecl * Sema::BuildExceptionDeclaration | ( | Scope * | S, |
TypeSourceInfo * | TInfo, | ||
SourceLocation | StartLoc, | ||
SourceLocation | IdLoc, | ||
const IdentifierInfo * | Id | ||
) |
Perform semantic analysis for the variable declaration that occurs within a C++ catch clause, returning the newly-created variable.
Definition at line 16945 of file SemaDeclCXX.cpp.
ExprResult Sema::BuildExpressionFromDeclTemplateArgument | ( | const TemplateArgument & | Arg, |
QualType | ParamType, | ||
SourceLocation | Loc, | ||
NamedDecl * | TemplateParam = nullptr |
||
) |
Given a non-type template argument that refers to a declaration and the type of its corresponding non-type template parameter, produce an expression that properly refers to that declaration.
Definition at line 8576 of file SemaTemplate.cpp.
References clang::Type::isArrayType().
ExprResult Sema::BuildExpressionFromNonTypeTemplateArgument | ( | const TemplateArgument & | Arg, |
SourceLocation | Loc | ||
) |
Definition at line 8822 of file SemaTemplate.cpp.
References BuildExpressionFromIntegralTemplateArgumentValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsIntegral(), clang::TemplateArgument::getAsStructuralValue(), clang::TemplateArgument::getIntegralType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getNonTypeTemplateArgumentType(), clang::TemplateArgument::getStructuralValueType(), clang::TemplateArgument::Integral, Loc, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::StructuralValue, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
ExprResult Sema::BuildExpressionTrait | ( | ExpressionTrait | OET, |
SourceLocation | KWLoc, | ||
Expr * | Queried, | ||
SourceLocation | RParen | ||
) |
Definition at line 6284 of file SemaExprCXX.cpp.
References clang::ASTContext::BoolTy, CheckPlaceholderExpr(), Context, EvaluateExpressionTrait(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::hasPlaceholderType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isTypeDependent().
Referenced by ActOnExpressionTrait().
concepts::ExprRequirement * Sema::BuildExprRequirement | ( | concepts::Requirement::SubstitutionDiagnostic * | ExprSubstDiag, |
bool | IsSatisfied, | ||
SourceLocation | NoexceptLoc, | ||
concepts::ExprRequirement::ReturnTypeRequirement | ReturnTypeRequirement | ||
) |
Definition at line 9378 of file SemaExprCXX.cpp.
References Context.
concepts::ExprRequirement * Sema::BuildExprRequirement | ( | Expr * | E, |
bool | IsSatisfied, | ||
SourceLocation | NoexceptLoc, | ||
concepts::ExprRequirement::ReturnTypeRequirement | ReturnTypeRequirement | ||
) |
Definition at line 9326 of file SemaExprCXX.cpp.
Referenced by ActOnCompoundRequirement(), ActOnSimpleRequirement(), and clang::TreeTransform< Derived >::RebuildExprRequirement().
QualType Sema::BuildExtVectorType | ( | QualType | T, |
Expr * | ArraySize, | ||
SourceLocation | AttrLoc | ||
) |
Build an ext-vector type.
Run the required checks for the extended vector type.
Definition at line 2443 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Type::castAs(), Context, clang::SemaBase::Diag(), clang::ASTContext::getDependentSizedExtVectorType(), clang::ASTContext::getExtVectorType(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Type::isBitIntType(), clang::Type::isBooleanType(), clang::Type::isDependentType(), clang::Type::isIntegerType(), clang::Type::isRealFloatingType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::T.
Referenced by clang::TreeTransform< Derived >::RebuildDependentSizedExtVectorType(), and clang::TreeTransform< Derived >::RebuildExtVectorType().
ExprResult Sema::BuildFieldReferenceExpr | ( | Expr * | BaseExpr, |
bool | IsArrow, | ||
SourceLocation | OpLoc, | ||
const CXXScopeSpec & | SS, | ||
FieldDecl * | Field, | ||
DeclAccessPair | FoundDecl, | ||
const DeclarationNameInfo & | MemberNameInfo | ||
) |
Definition at line 1849 of file SemaExprMember.cpp.
Referenced by BuildAnonymousStructUnionMemberReference().
Sema::ForRangeStatus Sema::BuildForRangeBeginEndCall | ( | SourceLocation | Loc, |
SourceLocation | RangeLoc, | ||
const DeclarationNameInfo & | NameInfo, | ||
LookupResult & | MemberLookup, | ||
OverloadCandidateSet * | CandidateSet, | ||
Expr * | Range, | ||
ExprResult * | CallExpr | ||
) |
Build a call to 'begin' or 'end' for a C++11 for-range statement.
If the given LookupResult is non-empty, it is assumed to describe a member which will be invoked. Otherwise, the function will be found via argument dependent lookup. CallExpr is set to a valid expression and FRS_Success returned on success, otherwise CallExpr is set to ExprError() and some non-success value is returned.
Definition at line 16237 of file SemaOverload.cpp.
Referenced by BuildNonArrayForRange().
QualType Sema::BuildFunctionType | ( | QualType | T, |
MutableArrayRef< QualType > | ParamTypes, | ||
SourceLocation | Loc, | ||
DeclarationName | Entity, | ||
const FunctionProtoType::ExtProtoInfo & | EPI | ||
) |
Build a function type.
This routine checks the function type according to C++ rules and under the assumption that the result type and parameter types have just been instantiated from a template. It therefore duplicates some of the behavior of GetTypeForDeclarator, but in a much simpler form that is only suitable for this narrow use case.
T | The return type of the function. |
ParamTypes | The parameter types of the function. This array will be modified to account for adjustments to the types of the function parameters. |
Loc | The location of the entity whose type involves this function type or, if there is no such entity, the location of the type that will have function type. |
Entity | The name of the entity that involves the function type, if known. |
EPI | Extra information about the function type. Usually this will be taken from an existing function with the same prototype. |
Definition at line 2682 of file SemaType.cpp.
References clang::TargetInfo::allowHalfArgsAndReturns(), checkExtParameterInfos(), CheckFunctionReturnType(), checkNSReturnsRetainedReturnType(), Context, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::ASTContext::getAdjustedParameterType(), clang::ASTContext::getFunctionType(), getLangOpts(), clang::FunctionType::ExtInfo::getProducesResult(), clang::ASTContext::getTargetInfo(), clang::Type::isHalfType(), clang::Type::isVoidType(), clang::QualType::isVolatileQualified(), clang::Type::isWebAssemblyTableType(), Loc, and clang::T.
Referenced by clang::TreeTransform< Derived >::RebuildFunctionProtoType().
StmtResult Sema::BuildIfStmt | ( | SourceLocation | IfLoc, |
IfStatementKind | StatementKind, | ||
SourceLocation | LParenLoc, | ||
Stmt * | InitStmt, | ||
ConditionResult | Cond, | ||
SourceLocation | RParenLoc, | ||
Stmt * | ThenVal, | ||
SourceLocation | ElseLoc, | ||
Stmt * | ElseVal | ||
) |
Definition at line 983 of file SemaStmt.cpp.
References clang::IfStmt::Create(), clang::Sema::ConditionResult::get(), clang::Sema::ConditionResult::isInvalid(), clang::Ordinary, and clang::StmtError().
ExprResult Sema::BuildImplicitMemberExpr | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
LookupResult & | R, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
bool | IsKnownInstance, | ||
const Scope * | S | ||
) |
Builds an implicit member access expression.
The current context is known to be an instance method, and the given unqualified lookup set is known to contain only instance members, at least one of which is from an appropriate type.
Definition at line 1935 of file SemaExprMember.cpp.
ExprResult Sema::BuildInitList | ( | SourceLocation | LBraceLoc, |
MultiExprArg | InitArgList, | ||
SourceLocation | RBraceLoc | ||
) |
Definition at line 7341 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
Referenced by clang::TreeTransform< Derived >::RebuildInitList().
ExprResult Sema::BuildLambdaExpr | ( | SourceLocation | StartLoc, |
SourceLocation | EndLoc, | ||
sema::LambdaScopeInfo * | LSI | ||
) |
Complete a lambda-expression having processed and attached the lambda body.
Definition at line 2064 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::CallOperator, clang::sema::LambdaScopeInfo::CaptureDefaultLoc, clang::sema::CapturingScopeInfo::Captures, clang::Class, clang::sema::LambdaScopeInfo::Cleanup, clang::sema::LambdaScopeInfo::ContainsUnexpandedParameterPack, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), Diag(), clang::sema::LambdaScopeInfo::ExplicitCaptureRanges, clang::sema::LambdaScopeInfo::ExplicitParams, clang::ExprError(), clang::SourceRange::getBegin(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::sema::Capture::getEllipsisLoc(), clang::SourceRange::getEnd(), clang::sema::Capture::getLocation(), clang::sema::Capture::getVariable(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::if(), clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::sema::LambdaScopeInfo::IntroducerRange, clang::sema::Capture::isBlockCapture(), clang::sema::Capture::isCopyCapture(), clang::sema::Capture::isInitCapture(), clang::sema::Capture::isInvalid(), clang::sema::Capture::isNonODRUsed(), clang::sema::Capture::isODRUsed(), clang::sema::Capture::isThisCapture(), clang::SourceRange::isValid(), clang::sema::Capture::isVariableCapture(), clang::sema::Capture::isVLATypeCapture(), clang::sema::LambdaScopeInfo::Lambda, clang::LCD_ByCopy, clang::LCD_None, clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_StarThis, clang::LCK_This, clang::LCK_VLAType, mapImplicitCaptureStyle(), clang::sema::LambdaScopeInfo::NumExplicitCaptures, and clang::Decl::setLexicalDeclContext().
QualType Sema::buildLambdaInitCaptureInitialization | ( | SourceLocation | Loc, |
bool | ByRef, | ||
SourceLocation | EllipsisLoc, | ||
std::optional< unsigned > | NumExpansions, | ||
IdentifierInfo * | Id, | ||
bool | DirectInit, | ||
Expr *& | Init | ||
) |
Definition at line 783 of file SemaLambda.cpp.
Referenced by actOnLambdaInitCaptureInitialization().
void Sema::buildLambdaScope | ( | sema::LambdaScopeInfo * | LSI, |
CXXMethodDecl * | CallOperator, | ||
SourceRange | IntroducerRange, | ||
LambdaCaptureDefault | CaptureDefault, | ||
SourceLocation | CaptureDefaultLoc, | ||
bool | ExplicitParams, | ||
bool | Mutable | ||
) |
Endow the lambda scope info with the relevant properties.
Definition at line 522 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::CallOperator, clang::sema::LambdaScopeInfo::CaptureDefaultLoc, clang::sema::LambdaScopeInfo::ExplicitParams, clang::CXXMethodDecl::getParent(), clang::sema::CapturingScopeInfo::ImpCap_LambdaByref, clang::sema::CapturingScopeInfo::ImpCap_LambdaByval, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::sema::LambdaScopeInfo::IntroducerRange, clang::sema::LambdaScopeInfo::Lambda, clang::LCD_ByCopy, clang::LCD_ByRef, and clang::sema::LambdaScopeInfo::Mutable.
ExprResult Sema::BuildLiteralOperatorCall | ( | LookupResult & | R, |
DeclarationNameInfo & | SuffixInfo, | ||
ArrayRef< Expr * > | Args, | ||
SourceLocation | LitEndLoc, | ||
TemplateArgumentListInfo * | ExplicitTemplateArgs = nullptr |
||
) |
BuildLiteralOperatorCall - Build a UserDefinedLiteral by creating a call to a literal operator described by the provided lookup results.
Definition at line 16154 of file SemaOverload.cpp.
References AddNonMemberOperatorCandidates(), clang::LookupResult::asUnresolvedSet(), clang::OverloadCandidateSet::BestViableFunction(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), Context, clang::UserDefinedLiteral::Create(), CreateFunctionRefExpr(), clang::OverloadCandidateSet::CSK_Normal, CurFPFeatureOverrides(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::DeclarationNameInfo::getCXXLiteralOperatorNameLoc(), clang::DeclarationNameInfo::getInfo(), clang::DeclarationNameInfo::getLoc(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::QualType::getNonLValueExprType(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getReturnType(), clang::Expr::getValueKindForType(), clang::InitializedEntity::InitializeParameter(), clang::ActionResult< PtrTy, Compress >::isInvalid(), MaybeBindToTemporary(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, PDiag(), PerformCopyInitialization(), and clang::OverloadCandidateSet::size().
LoopUnrollHintAttr * Sema::BuildLoopUnrollHintAttr | ( | const AttributeCommonInfo & | A, |
Expr * | E | ||
) |
Definition at line 1099 of file SemaStmtAttr.cpp.
References CheckLoopUnrollAttrExpr().
QualType Sema::BuildMatrixType | ( | QualType | T, |
Expr * | NumRows, | ||
Expr * | NumColumns, | ||
SourceLocation | AttrLoc | ||
) |
Definition at line 2503 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, Context, clang::SemaBase::Diag(), clang::ASTContext::getConstantMatrixType(), clang::ASTContext::getDependentSizedMatrixType(), clang::Expr::getIntegerConstantExpr(), clang::ASTContext::getLangOpts(), clang::Stmt::getSourceRange(), clang::Type::isDependentType(), clang::ConstantMatrixType::isDimensionValid(), clang::Expr::isTypeDependent(), clang::MatrixType::isValidElementType(), and clang::Expr::isValueDependent().
Referenced by clang::TreeTransform< Derived >::RebuildDependentSizedMatrixType().
MemberExpr * Sema::BuildMemberExpr | ( | Expr * | Base, |
bool | IsArrow, | ||
SourceLocation | OpLoc, | ||
NestedNameSpecifierLoc | NNS, | ||
SourceLocation | TemplateKWLoc, | ||
ValueDecl * | Member, | ||
DeclAccessPair | FoundDecl, | ||
bool | HadMultipleCandidates, | ||
const DeclarationNameInfo & | MemberNameInfo, | ||
QualType | Ty, | ||
ExprValueKind | VK, | ||
ExprObjectKind | OK, | ||
const TemplateArgumentListInfo * | TemplateArgs = nullptr |
||
) |
Definition at line 942 of file SemaExprMember.cpp.
Referenced by FixOverloadedFunctionReference(), and clang::SemaOpenMP::isOpenMPCapturedDecl().
MemInitResult Sema::BuildMemberInitializer | ( | ValueDecl * | Member, |
Expr * | Init, | ||
SourceLocation | IdLoc | ||
) |
Definition at line 4613 of file SemaDeclCXX.cpp.
References ActOnFinishFullExpr(), Context, clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), CreateRecoveryExpr(), DiagnoseUnexpandedParameterPack(), DiscardCleanupsInEvaluationContext(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::InitializedEntity::InitializeMember(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Member, clang::InitializationSequence::Perform(), and UPPC_Initializer.
Referenced by InstantiateMemInitializers().
QualType Sema::BuildMemberPointerType | ( | QualType | T, |
QualType | Class, | ||
SourceLocation | Loc, | ||
DeclarationName | Entity | ||
) |
Build a member pointer type T
Class::*.
T | the type to which the member pointer refers. |
Class | the class type into which the member pointer points. |
Loc | the location where this type begins |
Entity | the name of the entity that will have this member pointer type |
Definition at line 2740 of file SemaType.cpp.
References adjustMemberFunctionCC(), CheckDistantExceptionSpec(), clang::Class, Context, clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXDestructorName, clang::SemaBase::Diag(), getLangOpts(), clang::ASTContext::getMemberPointerType(), clang::DeclarationName::getNameKind(), getOpenCLOptions(), getPrintableNameForEntity(), HLSL(), clang::Type::isFunctionType(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), clang::Type::isVoidType(), Loc, clang::OpenCL, and clang::T.
Referenced by clang::TreeTransform< Derived >::RebuildMemberPointerType().
ExprResult Sema::BuildMemberReferenceExpr | ( | Expr * | Base, |
QualType | BaseType, | ||
SourceLocation | OpLoc, | ||
bool | IsArrow, | ||
const CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
NamedDecl * | FirstQualifierInScope, | ||
LookupResult & | R, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
const Scope * | S, | ||
bool | SuppressQualifierCheck = false , |
||
ActOnMemberAccessExtraArgs * | ExtraArgs = nullptr |
||
) |
Definition at line 984 of file SemaExprMember.cpp.
ExprResult Sema::BuildMemberReferenceExpr | ( | Expr * | Base, |
QualType | BaseType, | ||
SourceLocation | OpLoc, | ||
bool | IsArrow, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
NamedDecl * | FirstQualifierInScope, | ||
const DeclarationNameInfo & | NameInfo, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
const Scope * | S, | ||
ActOnMemberAccessExtraArgs * | ExtraArgs = nullptr |
||
) |
MemInitResult Sema::BuildMemInitializer | ( | Decl * | ConstructorD, |
Scope * | S, | ||
CXXScopeSpec & | SS, | ||
IdentifierInfo * | MemberOrBase, | ||
ParsedType | TemplateTypeTy, | ||
const DeclSpec & | DS, | ||
SourceLocation | IdLoc, | ||
Expr * | Init, | ||
SourceLocation | EllipsisLoc | ||
) |
Handle a C++ member initializer.
Definition at line 4420 of file SemaDeclCXX.cpp.
Decl * Sema::BuildMicrosoftCAnonymousStruct | ( | Scope * | S, |
DeclSpec & | DS, | ||
RecordDecl * | Record | ||
) |
BuildMicrosoftCAnonymousStruct - Handle the declaration of an Microsoft C anonymous structure.
Ref: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx Example:
struct A { int a; }; struct B { struct A; int b; };
void foo() { B var; var.a = 3; }
Definition at line 5880 of file SemaDecl.cpp.
void Sema::BuildModuleInclude | ( | SourceLocation | DirectiveLoc, |
Module * | Mod | ||
) |
Definition at line 725 of file SemaModule.cpp.
References clang::ImportDecl::CreateImplicit(), clang::Decl::getTranslationUnitDecl(), and clang::TU_ClangModule.
StmtResult Sema::BuildMSDependentExistsStmt | ( | SourceLocation | KeywordLoc, |
bool | IsIfExists, | ||
NestedNameSpecifierLoc | QualifierLoc, | ||
DeclarationNameInfo | NameInfo, | ||
Stmt * | Nested | ||
) |
Definition at line 4464 of file SemaStmt.cpp.
concepts::NestedRequirement * Sema::BuildNestedRequirement | ( | Expr * | E | ) |
Definition at line 9403 of file SemaExprCXX.cpp.
References CheckConstraintSatisfaction(), Context, clang::Stmt::getSourceRange(), and clang::Expr::isInstantiationDependent().
Referenced by ActOnNestedRequirement(), and clang::TreeTransform< Derived >::RebuildNestedRequirement().
concepts::NestedRequirement * Sema::BuildNestedRequirement | ( | StringRef | InvalidConstraintEntity, |
const ASTConstraintSatisfaction & | Satisfaction | ||
) |
Definition at line 9414 of file SemaExprCXX.cpp.
References Context, and clang::ASTConstraintSatisfaction::Rebuild().
OpenCLUnrollHintAttr * Sema::BuildOpenCLLoopUnrollHintAttr | ( | const AttributeCommonInfo & | A, |
Expr * | E | ||
) |
Definition at line 1107 of file SemaStmtAttr.cpp.
References CheckLoopUnrollAttrExpr().
ExprResult Sema::BuildOperatorCoawaitCall | ( | SourceLocation | Loc, |
Expr * | E, | ||
UnresolvedLookupExpr * | Lookup | ||
) |
Build a call to 'operator co_await' if there is a suitable operator for the given expression.
Definition at line 252 of file SemaCoroutine.cpp.
References clang::UnresolvedSetImpl::append(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), and Loc.
ExprResult Sema::BuildOperatorCoawaitLookupExpr | ( | Scope * | S, |
SourceLocation | Loc | ||
) |
Definition at line 811 of file SemaCoroutine.cpp.
ExprResult Sema::BuildOverloadedArrowExpr | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | OpLoc, | ||
bool * | NoArrowOperatorFound = nullptr |
||
) |
BuildOverloadedArrowExpr - Build a call to an overloaded operator->
(if one exists), where Base
is an expression of class type and Member
is the name of the member we're trying to find.
Definition at line 16023 of file SemaOverload.cpp.
Referenced by clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
ExprResult Sema::BuildOverloadedCallExpr | ( | Scope * | S, |
Expr * | Fn, | ||
UnresolvedLookupExpr * | ULE, | ||
SourceLocation | LParenLoc, | ||
MultiExprArg | Args, | ||
SourceLocation | RParenLoc, | ||
Expr * | ExecConfig, | ||
bool | AllowTypoCorrection = true , |
||
bool | CalleesAddressIsTaken = false |
||
) |
BuildOverloadedCallExpr - Given the call expression that calls Fn (which eventually refers to the declaration Func) and the call arguments Args/NumArgs, attempt to resolve the function call down to a specific function.
If overload resolution succeeds, returns the call expression produced by overload resolution. Otherwise, emits diagnostics and returns ExprError.
Definition at line 14198 of file SemaOverload.cpp.
bool Sema::buildOverloadedCallSet | ( | Scope * | S, |
Expr * | Fn, | ||
UnresolvedLookupExpr * | ULE, | ||
MultiExprArg | Args, | ||
SourceLocation | RParenLoc, | ||
OverloadCandidateSet * | CandidateSet, | ||
ExprResult * | Result | ||
) |
Constructs and populates an OverloadedCandidateSet from the given function.
Definition at line 13980 of file SemaOverload.cpp.
ExprResult Sema::BuildPackIndexingExpr | ( | Expr * | PackExpression, |
SourceLocation | EllipsisLoc, | ||
Expr * | IndexExpr, | ||
SourceLocation | RSquareLoc, | ||
ArrayRef< Expr * > | ExpandedExprs = {} , |
||
bool | EmptyPack = false |
||
) |
Definition at line 1108 of file SemaTemplateVariadic.cpp.
QualType Sema::BuildPackIndexingType | ( | QualType | Pattern, |
Expr * | IndexExpr, | ||
SourceLocation | Loc, | ||
SourceLocation | EllipsisLoc, | ||
bool | FullySubstituted = false , |
||
ArrayRef< QualType > | Expansions = {} |
||
) |
Definition at line 9560 of file SemaType.cpp.
Referenced by ActOnPackIndexingType(), and clang::TreeTransform< Derived >::RebuildPackIndexingType().
Build a paren type including T
.
Definition at line 1657 of file SemaType.cpp.
References Context, clang::ASTContext::getParenType(), and clang::T.
Referenced by clang::TreeTransform< Derived >::RebuildParenType().
ParmVarDecl * Sema::BuildParmVarDeclForTypedef | ( | DeclContext * | DC, |
SourceLocation | Loc, | ||
QualType | T | ||
) |
Synthesizes a variable for a parameter arising from a typedef.
Definition at line 15333 of file SemaDecl.cpp.
References clang::ParmVarDecl::Create().
Referenced by clang::TemplateDeclInstantiator::SubstFunctionType().
QualType Sema::BuildPointerType | ( | QualType | T, |
SourceLocation | Loc, | ||
DeclarationName | Entity | ||
) |
Build a pointer type.
T | The type to which we'll be building a pointer. |
Loc | The location of the entity whose type involves this pointer type or, if there is no such entity, the location of the type that will have pointer type. |
Entity | The name of the entity that involves the pointer type, if known. |
Definition at line 1800 of file SemaType.cpp.
References checkQualifiedFunction(), Context, deduceOpenCLPointeeAddrSpace(), clang::SemaBase::Diag(), getASTContext(), getLangOpts(), getOpenCLOptions(), clang::ASTContext::getPointerType(), getPrintableNameForEntity(), clang::Type::getUnqualifiedDesugaredType(), HLSL(), inferARCLifetimeForPointee(), clang::Type::isFunctionType(), clang::Type::isObjCObjectType(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), clang::Type::isWebAssemblyTableType(), Loc, clang::OpenCL, and clang::T.
Referenced by BuiltinAddPointer(), and clang::TreeTransform< Derived >::RebuildPointerType().
ExprResult Sema::BuildPossibleImplicitMemberExpr | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
LookupResult & | R, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
const Scope * | S | ||
) |
Builds an expression which might be an implicit member expression.
Definition at line 306 of file SemaExprMember.cpp.
Referenced by attemptRecovery().
ExprResult Sema::BuildPredefinedExpr | ( | SourceLocation | Loc, |
PredefinedIdentKind | IK | ||
) |
Definition at line 3605 of file SemaExpr.cpp.
References Diag(), getPredefinedExprDecl(), and Loc.
ExprResult Sema::BuildPseudoDestructorExpr | ( | Expr * | Base, |
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
const CXXScopeSpec & | SS, | ||
TypeSourceInfo * | ScopeType, | ||
SourceLocation | CCLoc, | ||
SourceLocation | TildeLoc, | ||
PseudoDestructorTypeStorage | DestroyedType | ||
) |
Definition at line 8081 of file SemaExprCXX.cpp.
References canRecoverDotPseudoDestructorCallsOnPointerObjects(), CheckArrow(), Context, clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::ExprError(), clang::SourceRange::getBegin(), clang::TypeLoc::getBeginLoc(), getLangOpts(), clang::QualType::getObjCLifetime(), clang::Type::getPointeeType(), clang::TypeLoc::getSourceRange(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::PseudoDestructorTypeStorage::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isDependentType(), clang::Type::isPointerType(), clang::Type::isScalarType(), clang::Type::isVectorType(), clang::Type::isVoidType(), and clang::Qualifiers::OCL_None.
Referenced by clang::TreeTransform< Derived >::RebuildCXXPseudoDestructorExpr().
ExprResult Sema::BuildQualifiedDeclarationNameExpr | ( | CXXScopeSpec & | SS, |
const DeclarationNameInfo & | NameInfo, | ||
bool | IsAddressOfOperand, | ||
TypeSourceInfo ** | RecoveryTSI = nullptr |
||
) |
BuildQualifiedDeclarationNameExpr - Build a C++ qualified declaration name, generally during template instantiation.
There's a large number of things which don't need to be done along this path.
Definition at line 2988 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), Diag(), clang::LookupResult::empty(), clang::ExprError(), clang::LookupResult::getAsSingle(), clang::DeclarationName::getAsString(), clang::CXXScopeSpec::getBeginLoc(), clang::DeclarationNameInfo::getEndLoc(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::LookupResult::isAmbiguous(), clang::CXXScopeSpec::isInvalid(), Loc, and clang::LookupResult::wasNotFoundInCurrentInstantiation().
ExprResult Sema::BuildQualifiedTemplateIdExpr | ( | CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
const DeclarationNameInfo & | NameInfo, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
bool | IsAddressOfOperand | ||
) |
Definition at line 5735 of file SemaTemplate.cpp.
References Diag(), clang::LookupResult::empty(), clang::ExprError(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getRange(), clang::LookupResult::isAmbiguous(), clang::CXXScopeSpec::isInvalid(), clang::SourceLocation::isValid(), and clang::LookupResult::wasNotFoundInCurrentInstantiation().
QualType Sema::BuildQualifiedType | ( | QualType | T, |
SourceLocation | Loc, | ||
Qualifiers | Qs, | ||
const DeclSpec * | DS = nullptr |
||
) |
Definition at line 1562 of file SemaType.cpp.
References Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::Type::getPointeeType(), clang::ASTContext::getQualifiedType(), clang::DeclSpec::getRestrictSpecLoc(), clang::Qualifiers::hasRestrict(), clang::Type::isAnyPointerType(), isDependentOrGNUAutoType(), clang::Type::isIncompleteOrObjectType(), clang::Type::isMemberPointerType(), clang::Type::isObjCObjectPointerType(), clang::Type::isReferenceType(), Loc, clang::Qualifiers::removeConst(), clang::Qualifiers::removeRestrict(), clang::Qualifiers::removeVolatile(), and clang::T.
Referenced by BuildQualifiedType(), and clang::TreeTransform< Derived >::RebuildQualifiedType().
QualType Sema::BuildQualifiedType | ( | QualType | T, |
SourceLocation | Loc, | ||
unsigned | CVRA, | ||
const DeclSpec * | DS = nullptr |
||
) |
Definition at line 1612 of file SemaType.cpp.
References BuildAtomicType(), BuildQualifiedType(), clang::Qualifiers::fromCVRMask(), clang::DeclSpec::getAtomicSpecLoc(), clang::Type::isAtomicType(), clang::Type::isReferenceType(), Loc, clang::Qualifiers::setUnaligned(), clang::T, clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_unaligned, and clang::DeclSpec::TQ_volatile.
QualType Sema::BuildReadPipeType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Build a Read-only Pipe type.
T | The type to which we'll be building a Pipe. |
Loc | We do not use it for now. |
Definition at line 1948 of file SemaType.cpp.
References Context, clang::ASTContext::getReadPipeType(), and clang::T.
Referenced by clang::TreeTransform< Derived >::RebuildPipeType().
QualType Sema::BuildReferenceType | ( | QualType | T, |
bool | SpelledAsLValue, | ||
SourceLocation | Loc, | ||
DeclarationName | Entity | ||
) |
Build a reference type.
T | The type to which we'll be building a reference. |
Loc | The location of the entity whose type involves this reference type or, if there is no such entity, the location of the type that will have reference type. |
Entity | The name of the entity that involves the reference type, if known. |
Definition at line 1865 of file SemaType.cpp.
References checkQualifiedFunction(), Context, deduceOpenCLPointeeAddrSpace(), clang::SemaBase::Diag(), clang::Type::getAs(), getASTContext(), clang::ASTContext::getCanonicalType(), getLangOpts(), clang::ASTContext::getLValueReferenceType(), getOpenCLOptions(), clang::ASTContext::getRValueReferenceType(), HLSL(), inferARCLifetimeForPointee(), clang::Type::isFunctionType(), clang::SourceLocation::isValid(), clang::Type::isVoidType(), clang::Type::isWebAssemblyTableType(), Loc, clang::OpenCL, clang::ASTContext::OverloadTy, and clang::T.
Referenced by BuiltinAddReference(), CastForMoving(), and clang::TreeTransform< Derived >::RebuildReferenceType().
ExprResult Sema::BuildResolvedCallExpr | ( | Expr * | Fn, |
NamedDecl * | NDecl, | ||
SourceLocation | LParenLoc, | ||
ArrayRef< Expr * > | Args, | ||
SourceLocation | RParenLoc, | ||
Expr * | Config = nullptr , |
||
bool | IsExecConfig = false , |
||
ADLCallKind | UsesADL = ADLCallKind::NotADL |
||
) |
BuildResolvedCallExpr - Build a call to a resolved expression, i.e.
an expression not of OverloadTy
. The expression should unary-convert to an expression of function-pointer or block-pointer type.
NDecl | the declaration being called, if available |
Definition at line 6816 of file SemaExpr.cpp.
References Diag(), clang::ExprError(), clang::FunctionDecl::getBuiltinID(), clang::Expr::getExprLoc(), and clang::Decl::hasAttr().
ExprResult Sema::BuildResolvedCoawaitExpr | ( | SourceLocation | KwLoc, |
Expr * | Operand, | ||
Expr * | Awaiter, | ||
bool | IsImplicit = false |
||
) |
Definition at line 870 of file SemaCoroutine.cpp.
References checkCoroutineContext(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
StmtResult Sema::BuildReturnStmt | ( | SourceLocation | ReturnLoc, |
Expr * | RetValExp, | ||
bool | AllowRecovery = false |
||
) |
Definition at line 3850 of file SemaStmt.cpp.
References CheckSimplerImplicitMovesMSVCWorkaround(), Diag(), clang::Decl::getAttrs(), clang::Stmt::getBeginLoc(), clang::QualType::getCanonicalType(), clang::RecordType::getDecl(), clang::FunctionDecl::getReturnType(), clang::Stmt::getSourceRange(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), clang::FunctionDecl::isMain(), clang::FunctionDecl::isNoReturn(), clang::RecordDecl::isOrContainsUnion(), and clang::StmtError().
Referenced by DefineImplicitCopyAssignment(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), and DefineImplicitMoveAssignment().
ExprResult Sema::BuildSourceLocExpr | ( | SourceLocIdentKind | Kind, |
QualType | ResultTy, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RPLoc, | ||
DeclContext * | ParentContext | ||
) |
Definition at line 16741 of file SemaExpr.cpp.
Decl * Sema::BuildStaticAssertDeclaration | ( | SourceLocation | StaticAssertLoc, |
Expr * | AssertExpr, | ||
Expr * | AssertMessageExpr, | ||
SourceLocation | RParenLoc, | ||
bool | Failed | ||
) |
Definition at line 17480 of file SemaDeclCXX.cpp.
References ActOnFinishFullExpr(), clang::DeclContext::addDecl(), AllowFold, CheckConstraintSatisfaction(), Context, clang::CPlusPlus, clang::StaticAssertDecl::Create(), CurContext, clang::SemaBase::Diag(), DiagnoseStaticAssertDetails(), DiagnoseUnsatisfiedConstraint(), EvaluateStaticAssertMessageAsString(), findFailedBooleanCondition(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), getLangOpts(), clang::Stmt::getSourceRange(), clang::DeclContext::isDependentContext(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isInvalid(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), NoFold, PerformContextuallyConvertToBool(), PrintContextStack(), and VerifyIntegerConstantExpression().
Referenced by ActOnStaticAssertDeclaration().
QualType Sema::BuildStdInitializerList | ( | QualType | Element, |
SourceLocation | Loc | ||
) |
Looks for the std::initializer_list template and instantiates it with Element, or emits an error if it's not found.
Definition at line 12105 of file SemaDeclCXX.cpp.
Referenced by DeduceAutoType().
ExprResult Sema::BuildStmtExpr | ( | SourceLocation | LPLoc, |
Stmt * | SubStmt, | ||
SourceLocation | RPLoc, | ||
unsigned | TemplateDepth | ||
) |
Definition at line 15814 of file SemaExpr.cpp.
SYCLIntelInitiationIntervalAttr * Sema::BuildSYCLIntelInitiationIntervalAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 107 of file SemaStmtAttr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isValueDependent().
SYCLIntelIVDepAttr * Sema::BuildSYCLIntelIVDepAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | Expr1, | ||
Expr * | Expr2 | ||
) |
Definition at line 282 of file SemaStmtAttr.cpp.
References Array, Dependent, Diag(), clang::Expr::getExprLoc(), HandleIVDepAttrExpr(), Invalid, Null, and SafeLen.
SYCLIntelLoopCoalesceAttr * Sema::BuildSYCLIntelLoopCoalesceAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 164 of file SemaStmtAttr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isValueDependent().
SYCLIntelLoopCountAttr * Sema::BuildSYCLIntelLoopCountAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 426 of file SemaStmtAttr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isValueDependent().
SYCLIntelMaxConcurrencyAttr * Sema::BuildSYCLIntelMaxConcurrencyAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 78 of file SemaStmtAttr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isValueDependent().
SYCLIntelMaxInterleavingAttr * Sema::BuildSYCLIntelMaxInterleavingAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 136 of file SemaStmtAttr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isValueDependent().
SYCLIntelMaxReinvocationDelayAttr * Sema::BuildSYCLIntelMaxReinvocationDelayAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 459 of file SemaStmtAttr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isValueDependent().
SYCLIntelSpeculatedIterationsAttr * Sema::BuildSYCLIntelSpeculatedIterationsAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 193 of file SemaStmtAttr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isValueDependent().
ExprResult Sema::BuildSynthesizedThreeWayComparison | ( | SourceLocation | OpLoc, |
const UnresolvedSetImpl & | Fns, | ||
Expr * | LHS, | ||
Expr * | RHS, | ||
FunctionDecl * | DefaultedFn | ||
) |
Definition at line 15089 of file SemaOverload.cpp.
References clang::ASTContext::CompCategories, Context, CreateOverloadedBinOp(), clang::ast_matchers::Eq, clang::ExprError(), clang::Expr::getExprLoc(), clang::Expr::getObjectKind(), clang::FunctionDecl::getReturnType(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::Greater, clang::Expr::isGLValue(), clang::ComparisonCategoryInfo::isPartial(), clang::Less, and clang::ComparisonCategories::lookupInfoForType().
Referenced by CreateOverloadedBinOp().
ExprResult Sema::BuildTemplateIdExpr | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
LookupResult & | R, | ||
bool | RequiresADL, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) |
Definition at line 5673 of file SemaTemplate.cpp.
References clang::UnresolvedLookupExpr::Create(), clang::ExprError(), clang::LookupResult::getAsSingle(), clang::LookupResult::getLookupNameInfo(), clang::LookupResult::getNameLoc(), clang::LookupResult::getRepresentativeDecl(), clang::LookupResult::isAmbiguous(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUsable(), and clang::LookupResult::suppressDiagnostics().
bool Sema::BuildTypeConstraint | ( | const CXXScopeSpec & | SS, |
TemplateIdAnnotation * | TypeConstraint, | ||
TemplateTypeParmDecl * | ConstrainedParameter, | ||
SourceLocation | EllipsisLoc, | ||
bool | AllowUnexpandedPack | ||
) |
Definition at line 1126 of file SemaTemplate.cpp.
References clang::TemplateArgumentListInfo::arguments(), clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateName::getAsUsingShadowDecl(), clang::CXXScopeSpec::getWithLocInContext(), clang::SourceLocation::isInvalid(), clang::CXXScopeSpec::isSet(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, makeTemplateArgumentListInfo(), clang::TemplateIdAnnotation::Name, clang::TemplateIdAnnotation::Template, and clang::TemplateIdAnnotation::TemplateNameLoc.
Referenced by ActOnCompoundRequirement().
QualType Sema::BuildTypeofExprType | ( | Expr * | E, |
TypeOfKind | Kind | ||
) |
Definition at line 9417 of file SemaType.cpp.
References Context, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), clang::Type::getAs(), clang::Expr::getExprLoc(), getLangOpts(), clang::Expr::getType(), clang::ASTContext::getTypeOfExprType(), clang::Expr::hasPlaceholderType(), clang::Expr::isTypeDependent(), clang::Expr::refersToBitField(), clang::T, and clang::Unqualified.
Referenced by clang::TreeTransform< Derived >::RebuildTypeOfExprType().
concepts::TypeRequirement * Sema::BuildTypeRequirement | ( | concepts::Requirement::SubstitutionDiagnostic * | SubstDiag | ) |
Definition at line 9393 of file SemaExprCXX.cpp.
References Context.
concepts::TypeRequirement * Sema::BuildTypeRequirement | ( | TypeSourceInfo * | Type | ) |
Definition at line 9388 of file SemaExprCXX.cpp.
References Context.
Referenced by ActOnTypeRequirement(), and clang::TreeTransform< Derived >::RebuildTypeRequirement().
ExprResult Sema::BuildTypeTrait | ( | TypeTrait | Kind, |
SourceLocation | KWLoc, | ||
ArrayRef< TypeSourceInfo * > | Args, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 5922 of file SemaExprCXX.cpp.
References Bool, CheckTypeTraitArity(), CheckUnaryTypeTraitTypeCompleteness(), Context, clang::TypeTraitExpr::Create(), EvaluateBooleanTypeTrait(), clang::ExprError(), clang::ASTContext::getLogicalOperationType(), GetReturnType(), clang::getTypeTraitArity(), and clang::UTT_Last.
Referenced by ActOnTypeTrait().
ExprResult Sema::BuildUnaryOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
UnaryOperatorKind | Opc, | ||
Expr * | Input, | ||
bool | IsAfterAmp = false |
||
) |
Definition at line 15730 of file SemaExpr.cpp.
Referenced by clang::SemaOpenMP::ActOnOpenMPCanonicalLoop(), buildDistanceFunc(), and buildLoopVarFunc().
QualType Sema::BuildUnaryTransformType | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9787 of file SemaType.cpp.
References BuiltinAddPointer(), BuiltinAddReference(), BuiltinChangeCVRQualifiers(), BuiltinChangeSignedness(), BuiltinDecay(), BuiltinEnumUnderlyingType(), BuiltinRemoveExtent(), BuiltinRemovePointer(), BuiltinRemoveReference(), Context, clang::ASTContext::getUnaryTransformType(), clang::Type::isDependentType(), and Loc.
Referenced by clang::TreeTransform< Derived >::RebuildUnaryTransformType().
ExprResult Sema::BuildUnresolvedCoawaitExpr | ( | SourceLocation | KwLoc, |
Expr * | Operand, | ||
UnresolvedLookupExpr * | Lookup | ||
) |
Definition at line 830 of file SemaCoroutine.cpp.
References checkCoroutineContext(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
NamedDecl * Sema::BuildUsingDeclaration | ( | Scope * | S, |
AccessSpecifier | AS, | ||
SourceLocation | UsingLoc, | ||
bool | HasTypenameKeyword, | ||
SourceLocation | TypenameLoc, | ||
CXXScopeSpec & | SS, | ||
DeclarationNameInfo | NameInfo, | ||
SourceLocation | EllipsisLoc, | ||
const ParsedAttributesView & | AttrList, | ||
bool | IsInstantiation, | ||
bool | IsUsingIfExists | ||
) |
Builds a using declaration.
IsInstantiation | - Whether this call arises from an instantiation of an unresolved using declaration. We treat the lookup differently for these declarations. |
Definition at line 12874 of file SemaDeclCXX.cpp.
NamedDecl * Sema::BuildUsingEnumDeclaration | ( | Scope * | S, |
AccessSpecifier | AS, | ||
SourceLocation | UsingLoc, | ||
SourceLocation | EnumLoc, | ||
SourceLocation | NameLoc, | ||
TypeSourceInfo * | EnumType, | ||
EnumDecl * | ED | ||
) |
In class scope, check if this is a duplicate, for better a diagnostic.
Definition at line 13128 of file SemaDeclCXX.cpp.
NamedDecl * Sema::BuildUsingPackDecl | ( | NamedDecl * | InstantiatedFrom, |
ArrayRef< NamedDecl * > | Expansions | ||
) |
Definition at line 13184 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), Context, clang::UsingPackDecl::Create(), CurContext, and clang::Decl::getAccess().
UsingShadowDecl * Sema::BuildUsingShadowDecl | ( | Scope * | S, |
BaseUsingDecl * | BUD, | ||
NamedDecl * | Target, | ||
UsingShadowDecl * | PrevDecl | ||
) |
Builds a shadow declaration corresponding to a 'using' declaration.
Definition at line 12655 of file SemaDeclCXX.cpp.
Referenced by clang::TemplateDeclInstantiator::VisitBaseUsingDecls().
ExprResult Sema::BuildVAArgExpr | ( | SourceLocation | BuiltinLoc, |
Expr * | E, | ||
TypeSourceInfo * | TInfo, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 16467 of file SemaExpr.cpp.
References clang::CUDA, clang::Device, Diag(), clang::ExprError(), clang::Stmt::getBeginLoc(), clang::Global, clang::HostDevice, and clang::T.
void Sema::BuildVariableInstantiation | ( | VarDecl * | NewVar, |
VarDecl * | OldVar, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
LateInstantiatedAttrVec * | LateAttrs, | ||
DeclContext * | Owner, | ||
LocalInstantiationScope * | StartingScope, | ||
bool | InstantiatingVarTemplate = false , |
||
VarTemplateSpecializationDecl * | PrevDeclForVarTemplateSpecialization = nullptr |
||
) |
BuildVariableInstantiation - Used after a new variable has been created.
Sets basic variable data and decides whether to postpone the variable instantiation.
Definition at line 5830 of file SemaTemplateInstantiateDecl.cpp.
References clang::DeclContext::addHiddenDecl(), CheckVariableDeclaration(), Context, CurrentInstantiationScope, DiagnoseUnusedDecl(), FindInstantiatedDecl(), ForExternalRedeclaration, forRedeclarationInCurContext(), clang::Decl::getAccess(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::VarDecl::getDescribedVarTemplate(), clang::VarDecl::getInitStyle(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::ASTContext::getManglingNumber(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::ASTContext::getStaticLocalNumber(), clang::VarDecl::getTSCSpec(), clang::ValueDecl::getType(), clang::NamedDecl::hasLinkage(), InstantiateAttrs(), clang::LocalInstantiationScope::InstantiatedLocal(), InstantiateVariableInitializer(), clang::VarDecl::isConstexpr(), clang::VarDecl::isCXXForRangeDecl(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::DeclContext::isFunctionOrMethod(), clang::VarDecl::isInitCapture(), clang::VarDecl::isInline(), clang::Decl::isInvalidDecl(), clang::Decl::isLocalExternDecl(), clang::VarDecl::isObjCForDecl(), clang::VarDecl::isOutOfLine(), clang::VarDecl::isPreviousDeclInSameBlockScope(), clang::Decl::isReferenced(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::isThisDeclarationADefinition(), clang::Type::isUndeducedType(), clang::Decl::isUsed(), LookupOrdinaryName, LookupQualifiedName(), LookupRedeclarationWithLinkage, clang::DeclContext::makeDeclVisibleInContext(), Previous, clang::Decl::setAccess(), clang::VarDecl::setConstexpr(), clang::VarDecl::setCXXForRangeDecl(), clang::VarDecl::setInitCapture(), clang::VarDecl::setInitStyle(), clang::VarDecl::setInstantiationOfStaticDataMember(), clang::Decl::setIsUsed(), clang::Decl::setLexicalDeclContext(), clang::Decl::setLocalExternDecl(), clang::ASTContext::setManglingNumber(), clang::VarDecl::setObjCForDecl(), clang::VarDecl::setPreviousDeclInSameBlockScope(), clang::Decl::setReferenced(), clang::ASTContext::setStaticLocalNumber(), clang::VarDecl::setTSCSpec(), clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.
Referenced by clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization().
VarTemplateSpecializationDecl * Sema::BuildVarTemplateInstantiation | ( | VarTemplateDecl * | VarTemplate, |
VarDecl * | FromVar, | ||
const TemplateArgumentList * | PartialSpecArgs, | ||
const TemplateArgumentListInfo & | TemplateArgsInfo, | ||
SmallVectorImpl< TemplateArgument > & | Converted, | ||
SourceLocation | PointOfInstantiation, | ||
LateInstantiatedAttrVec * | LateAttrs = nullptr , |
||
LocalInstantiationScope * | StartingScope = nullptr |
||
) |
Definition at line 5743 of file SemaTemplateInstantiateDecl.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::SemaSYCL::addSyclVarDecl(), clang::TemplateArgumentList::asArray(), clang::Decl::getDeclContext(), clang::VarDecl::getDescribedVarTemplate(), clang::Redeclarable< decl_type >::getFirstDecl(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::RedeclarableTemplateDecl::isMemberSpecialization(), SYCL(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
ExprResult Sema::BuildVectorLiteral | ( | SourceLocation | LParenLoc, |
SourceLocation | RParenLoc, | ||
Expr * | E, | ||
TypeSourceInfo * | TInfo | ||
) |
Build an altivec or OpenCL literal.
Definition at line 7918 of file SemaExpr.cpp.
References clang::Type::castAs(), Diag(), clang::ExprError(), clang::Generic, clang::VectorType::getElementType(), clang::Expr::getExprLoc(), clang::VectorType::getNumElements(), clang::Stmt::getSourceRange(), clang::TypeSourceInfo::getType(), clang::VectorType::getVectorKind(), clang::Type::isVectorType(), and clang::OpenCL.
QualType Sema::BuildVectorType | ( | QualType | T, |
Expr * | VecSize, | ||
SourceLocation | AttrLoc | ||
) |
Definition at line 2369 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, Context, clang::SemaBase::Diag(), clang::Generic, clang::Type::getAs(), clang::ASTContext::getDependentVectorType(), clang::Expr::getIntegerConstantExpr(), clang::Stmt::getSourceRange(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::Type::isArrayType(), clang::Type::isBitIntType(), clang::Type::isBooleanType(), clang::Type::isBuiltinType(), clang::Type::isDependentType(), clang::Type::isIntegerType(), clang::Type::isRealFloatingType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and max().
Referenced by clang::TreeTransform< Derived >::RebuildDependentVectorType().
QualType Sema::BuildWritePipeType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Build a Write-only Pipe type.
T | The type to which we'll be building a Pipe. |
Loc | We do not use it for now. |
Definition at line 1960 of file SemaType.cpp.
References Context, clang::ASTContext::getWritePipeType(), and clang::T.
Referenced by clang::TreeTransform< Derived >::RebuildPipeType().
QualType Sema::BuiltinAddPointer | ( | QualType | BaseType, |
SourceLocation | Loc | ||
) |
Definition at line 9623 of file SemaType.cpp.
References BuildPointerType(), clang::QualType::getNonReferenceType(), clang::QualType::isReferenceable(), clang::Type::isVoidType(), and Loc.
Referenced by BuildUnaryTransformType(), and BuiltinDecay().
QualType Sema::BuiltinAddReference | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9656 of file SemaType.cpp.
References BuildReferenceType(), clang::QualType::isReferenceable(), LangOpts, and Loc.
Referenced by BuildUnaryTransformType().
QualType Sema::BuiltinChangeCVRQualifiers | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9694 of file SemaType.cpp.
References Context, clang::ASTContext::getQualifiedType(), clang::ASTContext::getUnqualifiedArrayType(), clang::Type::isFunctionType(), clang::Type::isReferenceType(), clang::Qualifiers::removeConst(), clang::Qualifiers::removeRestrict(), and clang::Qualifiers::removeVolatile().
Referenced by BuildUnaryTransformType().
QualType Sema::BuiltinChangeSignedness | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9761 of file SemaType.cpp.
References ChangeIntegralSignedness(), Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::ASTContext::getCorrespondingSignedType(), clang::ASTContext::getCorrespondingUnsignedType(), clang::BitIntType::getNumBits(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::Type::isBitIntType(), clang::Type::isBooleanType(), clang::Type::isChar16Type(), clang::Type::isChar32Type(), clang::Type::isEnumeralType(), clang::Type::isIntegerType(), clang::QualType::isNull(), clang::Type::isWideCharType(), and Loc.
Referenced by BuildUnaryTransformType().
bool Sema::BuiltinConstantArg | ( | CallExpr * | TheCall, |
int | ArgNum, | ||
llvm::APSInt & | Result | ||
) |
BuiltinConstantArg - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression.
Definition at line 8839 of file SemaChecking.cpp.
References clang::CallExpr::getArg(), clang::CallExpr::getCallee(), clang::DeclRefExpr::getDecl(), clang::Expr::getIntegerConstantExpr(), clang::Expr::IgnoreParenCasts(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
Referenced by clang::SemaX86::CheckBuiltinGatherScatterScale(), clang::SemaX86::CheckBuiltinRoundingOrSAE(), and clang::SemaX86::CheckBuiltinTileDuplicate().
BuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression is a multiple of Num.
Definition at line 8890 of file SemaChecking.cpp.
References Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
BuiltinConstantArgPower2 - Check if argument ArgNum of TheCall is a constant expression representing a power of 2.
Definition at line 8912 of file SemaChecking.cpp.
References Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
bool Sema::BuiltinConstantArgRange | ( | CallExpr * | TheCall, |
int | ArgNum, | ||
int | Low, | ||
int | High, | ||
bool | RangeIsError = true |
||
) |
BuiltinConstantArgRange - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression in the range [Low, High].
Definition at line 8857 of file SemaChecking.cpp.
References Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::threadSafety::sx::toString().
Referenced by clang::SemaX86::CheckBuiltinFunctionCall(), and clang::SemaX86::CheckBuiltinTileArgumentsRange().
BuiltinConstantArgShiftedByte - Check if argument ArgNum of TheCall is a constant expression representing an arbitrary byte value shifted left by a multiple of 8 bits.
Definition at line 8958 of file SemaChecking.cpp.
References Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), IsShiftedByte(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
BuiltinConstantArgShiftedByteOr0xFF - Check if argument ArgNum of TheCall is a constant expression representing either a shifted byte value, or a value of the form 0x??FF (i.e.
a member of the arithmetic progression 0x00FF, 0x01FF, ..., 0xFFFF). This strange range check is needed for some Arm MVE intrinsics.
Definition at line 8987 of file SemaChecking.cpp.
References Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), IsShiftedByte(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
QualType Sema::BuiltinDecay | ( | QualType | BaseType, |
SourceLocation | Loc | ||
) |
Definition at line 9640 of file SemaType.cpp.
References BuiltinAddPointer(), Context, clang::ASTContext::getDecayedType(), clang::QualType::getNonReferenceType(), clang::ASTContext::getQualifiedType(), clang::QualType::getSplitUnqualifiedType(), clang::Type::isArrayType(), clang::Type::isFunctionType(), and Loc.
Referenced by BuildUnaryTransformType().
QualType Sema::BuiltinEnumUnderlyingType | ( | QualType | BaseType, |
SourceLocation | Loc | ||
) |
Definition at line 9604 of file SemaType.cpp.
References clang::SemaBase::Diag(), GetEnumUnderlyingType(), clang::Decl::getLocation(), clang::Type::isEnumeralType(), clang::Type::isIncompleteType(), and Loc.
Referenced by BuildUnaryTransformType().
QualType Sema::BuiltinRemoveExtent | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9668 of file SemaType.cpp.
References Context, clang::ASTContext::getAsArrayType(), and clang::ASTContext::getBaseElementType().
Referenced by BuildUnaryTransformType().
QualType Sema::BuiltinRemovePointer | ( | QualType | BaseType, |
SourceLocation | Loc | ||
) |
Definition at line 9632 of file SemaType.cpp.
References clang::Type::getPointeeType(), clang::Type::isAnyPointerType(), and clang::Type::isObjCIdType().
Referenced by BuildUnaryTransformType().
QualType Sema::BuiltinRemoveReference | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9679 of file SemaType.cpp.
References Context, clang::QualType::getNonReferenceType(), clang::ASTContext::getQualifiedType(), clang::ASTContext::getUnqualifiedArrayType(), LangOpts, clang::Qualifiers::removeConst(), clang::Qualifiers::removeVolatile(), and clang::T.
Referenced by BuildUnaryTransformType().
ExprResult Sema::BuiltinShuffleVector | ( | CallExpr * | TheCall | ) |
BuiltinShuffleVector - Handle __builtin_shufflevector.
Definition at line 8506 of file SemaChecking.cpp.
References clang::Type::castAs(), Diag(), clang::ExprError(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::CallExpr::getDirectCallee(), clang::CallExpr::getEndLoc(), clang::Stmt::getEndLoc(), clang::CallExpr::getNumArgs(), clang::VectorType::getNumElements(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::hasIntegerRepresentation(), clang::Expr::isTypeDependent(), and clang::Type::isVectorType().
Definition at line 18426 of file SemaChecking.cpp.
References checkMathBuiltinElementType(), Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::QualType::getCanonicalType(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), and clang::CallExpr::setArg().
Definition at line 18413 of file SemaChecking.cpp.
References clang::Type::getAs(), and clang::Expr::setType().
ExprResult Sema::CallExprUnaryConversions | ( | Expr * | E | ) |
CallExprUnaryConversions - a special case of an unary conversion performed on a function designator of a call expression.
Definition at line 845 of file SemaExpr.cpp.
References clang::Expr::getType(), and clang::Type::isFunctionType().
|
static |
Definition at line 16099 of file SemaDecl.cpp.
References methodHasName().
Referenced by visitLifetimeBoundArguments().
|
static |
Definition at line 16103 of file SemaDecl.cpp.
References clang::FunctionDecl::isStatic(), and methodHasName().
|
static |
Determine whether the callee of a particular function call can throw.
E, D and Loc are all optional.
Definition at line 1017 of file SemaExceptionSpec.cpp.
Referenced by clang::canVarDeclThrow().
bool Sema::canDelayFunctionBody | ( | const Declarator & | D | ) |
Determine whether we can delay parsing the body of a function or function template until it is used, assuming we don't care about emitting code for that function.
This will be false
if we may need the body of the function in the middle of parsing an expression (where it's impractical to switch to parsing a different function), for instance, if it's constexpr in C++11 or has an 'auto' return type in C++14. These cases are essentially bugs.
Definition at line 15994 of file SemaDecl.cpp.
References clang::DeclaratorChunk::Function, clang::Declarator::getDeclSpec(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::DeclSpec::hasAutoTypeSpec(), clang::DeclSpec::hasConstexprSpecifier(), clang::QualType::isNull(), and clang::Type::isUndeducedType().
bool Sema::canFullyTypeCheckRedeclaration | ( | ValueDecl * | NewD, |
ValueDecl * | OldD, | ||
QualType | NewT, | ||
QualType | OldT | ||
) |
Determines if we can perform a correct type check for D
as a redeclaration of PrevDecl
.
If not, we can generally still perform a best-effort check.
NewD | The new declaration. |
OldD | The old declaration. |
NewT | The portion of the type of the new declaration to check. |
OldT | The portion of the type of the old declaration to check. |
Definition at line 11158 of file SemaDecl.cpp.
References clang::Decl::getFriendObjectKind(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), and clang::Decl::isLocalExternDecl().
bool Sema::CanPerformAggregateInitializationForOverloadResolution | ( | const InitializedEntity & | Entity, |
InitListExpr * | From | ||
) |
Determine whether we can perform aggregate initialization for the purposes of overload resolution.
Definition at line 3335 of file SemaInit.cpp.
References clang::InitializedEntity::getType().
bool Sema::CanPerformCopyInitialization | ( | const InitializedEntity & | Entity, |
ExprResult | Init | ||
) |
Definition at line 10663 of file SemaInit.cpp.
References clang::InitializationKind::CreateCopy(), clang::Stmt::getBeginLoc(), and clang::Seq.
Determine whether we can skip parsing the body of a function definition, assuming we don't care about analyzing its body or emitting code for that function.
This will be false
only if we may need the body of the function in order to parse the rest of the program (for instance, if it is constexpr
in C++11 or has an 'auto' return type in C++14).
Definition at line 16018 of file SemaDecl.cpp.
References clang::Decl::getAsFunction().
CanThrowResult clang::Sema::canThrow | ( | const Stmt * | E | ) |
Definition at line 1134 of file SemaExceptionSpec.cpp.
Referenced by BuildCXXNoexceptExpr().
Determine whether the use of this declaration is valid, without emitting diagnostics.
Definition at line 73 of file SemaExpr.cpp.
References clang::AR_Unavailable, clang::CPlusPlus14, and clang::Decl::getAvailability().
Referenced by canRecoverDotPseudoDestructorCallsOnPointerObjects().
bool Sema::CaptureHasSideEffects | ( | const sema::Capture & | From | ) |
Does copying/destroying the captured variable have side effects?
Definition at line 1952 of file SemaLambda.cpp.
References clang::sema::Capture::getVariable(), and clang::sema::Capture::isInitCapture().
QualType Sema::CheckAdditionOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc, | ||
QualType * | CompLHSTy = nullptr |
||
) |
Definition at line 11037 of file SemaExpr.cpp.
References checkArithmeticNull(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), clang::Type::isAnyPointerType(), clang::Type::isArithmeticType(), clang::Type::isConstantMatrixType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isNullPointerConstant(), clang::Type::isObjCObjectPointerType(), isObjCPointer(), clang::Type::isPointerType(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), and Loc.
bool Sema::checkAddressOfFunctionIsAvailable | ( | const FunctionDecl * | Function, |
bool | Complain = false , |
||
SourceLocation | Loc = SourceLocation() |
||
) |
Returns whether the given function's address can be taken or not, optionally emitting a diagnostic if the address can't be taken.
Returns false if taking the address of the function is illegal.
Definition at line 11156 of file SemaOverload.cpp.
References checkAddressOfFunctionIsAvailable(), clang::Function, and Loc.
Referenced by resolveAddressOfSingleOverloadCandidate().
Sema::AccessResult Sema::CheckAddressOfMemberAccess | ( | Expr * | OvlExpr, |
DeclAccessPair | FoundDecl | ||
) |
Definition at line 1874 of file SemaAccess.cpp.
References AR_accessible, clang::AS_none, clang::AS_public, clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::DeclAccessPair::getAccess(), and clang::OverloadExpr::getNamingClass().
Referenced by ResolveAddressOfOverloadedFunction(), and resolveAndFixAddressOfSingleOverloadCandidate().
QualType Sema::CheckAddressOfOperand | ( | ExprResult & | OrigOp, |
SourceLocation | OpLoc | ||
) |
CheckAddressOfOperand - The operand of & must be either a function designator or an lvalue designating an object.
If it is an lvalue, the object cannot be declared with storage class register or be a bit field. Note: The usual conversions are not applied to the operand of the & operator (C99 6.3.2.1p[2-4]), and its result is never an lvalue. In C++, the operand might be an overloaded function name, in which case we allow the '&' but retain the overloaded-function type.
Definition at line 14171 of file SemaExpr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and clang::Expr::IgnoreParens().
bool Sema::CheckAlignasTypeArgument | ( | StringRef | KWName, |
TypeSourceInfo * | TInfo, | ||
SourceLocation | OpLoc, | ||
SourceRange | R | ||
) |
Definition at line 4814 of file SemaExpr.cpp.
References clang::TypeSourceInfo::getType().
void clang::Sema::CheckAlignasUnderalignment | ( | Decl * | D | ) |
bool Sema::CheckAllocatedType | ( | QualType | AllocType, |
SourceLocation | Loc, | ||
SourceRange | R | ||
) |
Checks that a type is suitable as the allocated type in a new-expression.
Definition at line 2555 of file SemaExprCXX.cpp.
References Context, clang::Default, clang::SemaBase::Diag(), clang::QualType::getAddressSpace(), clang::Qualifiers::getAddressSpaceAttributePrintValue(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getBaseElementType(), getLangOpts(), clang::QualType::getObjCLifetime(), clang::QualType::getQualifiers(), clang::QualType::getUnqualifiedType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isObjCLifetimeType(), clang::Type::isReferenceType(), clang::Type::isVariablyModifiedType(), Loc, clang::Qualifiers::OCL_None, RequireCompleteSizedType(), and RequireNonAbstractType().
Sema::AccessResult Sema::CheckAllocationAccess | ( | SourceLocation | OperatorLoc, |
SourceRange | PlacementRange, | ||
CXXRecordDecl * | NamingClass, | ||
DeclAccessPair | FoundDecl, | ||
bool | Diagnose = true |
||
) |
Checks access to an overloaded operator new or delete.
Definition at line 1751 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, and clang::DeclAccessPair::getAccess().
bool Sema::CheckAltivecInitFromScalar | ( | SourceRange | R, |
QualType | VecTy, | ||
QualType | SrcTy | ||
) |
Definition at line 2724 of file SemaCast.cpp.
References clang::SemaBase::Diag(), clang::LangOptionsBase::GCC, clang::SourceRange::getBegin(), and getLangOpts().
bool Sema::CheckAlwaysInlineAttr | ( | const Stmt * | OrigSt, |
const Stmt * | CurSt, | ||
const AttributeCommonInfo & | A | ||
) |
Definition at line 695 of file SemaStmtAttr.cpp.
Check whether the given statement can have musttail applied to it, issuing a diagnostic and returning false if not.
In the success case, the statement is rewritten to remove implicit nodes from the return value.
Definition at line 637 of file SemaStmt.cpp.
References clang::ReturnStmt::getRetValue(), clang::IgnoreElidableImplicitConstructorSingleStep(), clang::IgnoreExprNodes(), clang::IgnoreImplicitAsWrittenSingleStep(), clang::Expr::isInstantiationDependent(), and clang::ReturnStmt::setRetValue().
Checks that a call expression's argument count is the desired number.
This is useful when doing custom type-checking. Returns true on error.
Definition at line 162 of file SemaChecking.cpp.
References Diag(), clang::SourceRange::getBegin(), and Range.
Checks that a call expression's argument count is at least the desired number.
This is useful when doing custom type-checking on a variadic function. Returns true on error.
Definition at line 129 of file SemaChecking.cpp.
References Diag().
Checks that a call expression's argument count is at most the desired number.
This is useful when doing custom type-checking on a variadic function. Returns true on error.
Definition at line 142 of file SemaChecking.cpp.
References Diag().
Checks that a call expression's argument count is in the desired range.
This is useful when doing custom type-checking on a variadic function. Returns true on error.
Definition at line 154 of file SemaChecking.cpp.
bool Sema::CheckArgsForPlaceholders | ( | MultiExprArg | args | ) |
Check an argument list for placeholders that we won't try to handle later.
Definition at line 6277 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and isPlaceholderToRemoveAsArg().
bool Sema::checkArrayElementAlignment | ( | QualType | EltTy, |
SourceLocation | Loc | ||
) |
Definition at line 2068 of file SemaType.cpp.
References Context, clang::SemaBase::Diag(), clang::ASTContext::getBaseElementType(), clang::CharUnits::getQuantity(), clang::ASTContext::getTypeAlignInChars(), clang::ASTContext::getTypeSizeInChars(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isUndeducedType(), and Loc.
Referenced by BuildArrayType().
Sema::AssignConvertType Sema::CheckAssignmentConstraints | ( | QualType | LHSType, |
ExprResult & | RHS, | ||
CastKind & | Kind, | ||
bool | ConvertRHS = true |
||
) |
Check assignment constraints and optionally prepare for a conversion of the RHS to the LHS type.
CheckAssignmentConstraints (C99 6.5.16) - This routine currently has code to accommodate several GCC extensions when type checking pointers.
The conversion is prepared for if ConvertRHS is true.
Here are some objectionable examples that GCC considers warnings:
int a, *pint; short *pshort; struct foo *pfoo;
pint = pshort; // warning: assignment from incompatible pointer type a = pint; // warning: assignment makes integer from pointer without a cast pint = a; // warning: assignment makes pointer from integer without a cast pint = pfoo; // warning: assignment from incompatible pointer type
As a result, the code for dealing with pointers is more complex than the C99 spec dictates.
Sets 'Kind' for any result kind except Incompatible.
Definition at line 9310 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), and clang::Expr::getType().
Sema::AssignConvertType Sema::CheckAssignmentConstraints | ( | SourceLocation | Loc, |
QualType | LHSType, | ||
QualType | RHSType | ||
) |
CheckAssignmentConstraints - Perform type checking for assignment, argument passing, variable initialization, and function return values.
C99 6.5.16.
Definition at line 9271 of file SemaExpr.cpp.
References Loc, and clang::VK_PRValue.
Referenced by PerformImplicitConversion().
QualType Sema::CheckAssignmentOperands | ( | Expr * | LHSExpr, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
QualType | CompoundType, | ||
BinaryOperatorKind | Opc | ||
) |
Definition at line 13724 of file SemaExpr.cpp.
References CheckForModifiableLvalue(), CheckIdentityFieldAssignment(), Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Expr::hasPlaceholderType(), clang::Type::isHalfType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isWebAssemblyTableType(), Loc, and clang::OpenCL.
bool clang::Sema::CheckAttrNoArgs | ( | const ParsedAttr & | CurrAttr | ) |
bool clang::Sema::CheckAttrTarget | ( | const ParsedAttr & | CurrAttr | ) |
Sema::AccessResult Sema::CheckBaseClassAccess | ( | SourceLocation | AccessLoc, |
QualType | Base, | ||
QualType | Derived, | ||
const CXXBasePath & | Path, | ||
unsigned | DiagID, | ||
bool | ForceCheck = false , |
||
bool | ForceUnprivileged = false |
||
) |
Checks access for a hierarchy conversion.
ForceCheck | true if this check should be performed even if access control is disabled; some things rely on this for semantics |
ForceUnprivileged | true if this check should proceed as if the context had no special privileges |
Definition at line 1898 of file SemaAccess.cpp.
References clang::CXXBasePath::Access, AR_accessible, clang::AS_public, clang::Type::castAs(), and clang::RecordType::getDecl().
CXXBaseSpecifier * Sema::CheckBaseSpecifier | ( | CXXRecordDecl * | Class, |
SourceRange | SpecifierRange, | ||
bool | Virtual, | ||
AccessSpecifier | Access, | ||
TypeSourceInfo * | TInfo, | ||
SourceLocation | EllipsisLoc | ||
) |
ActOnBaseSpecifier - Parsed a base specifier.
Check the validity of a C++ base class specifier.
Definition at line 2664 of file SemaDeclCXX.cpp.
References clang::AS_none, clang::AS_public, clang::Class, computeDeclContext(), clang::Type::containsErrors(), clang::Type::containsUnexpandedParameterPack(), Context, clang::SemaBase::Diag(), clang::TypeLoc::getBeginLoc(), clang::TargetInfo::getCXXABI(), clang::getDLLAttr(), getLangOpts(), clang::TypeLoc::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), HLSL(), clang::Type::isDependentType(), clang::TargetCXXABI::isMicrosoft(), clang::SourceLocation::isValid(), propagateDLLAttrToBaseClassTemplate(), RequireCompleteType(), and clang::Virtual.
Referenced by ActOnBaseSpecifier(), and SubstBaseSpecifiers().
|
inline |
Definition at line 13113 of file SemaExpr.cpp.
References checkArithmeticNull(), diagnoseLogicalNotOnLHSofCheck(), diagnoseXorMisusedAsPow(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), clang::Type::hasIntegerRepresentation(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isLegalBoolVectorBinaryOp(), clang::QualType::isNull(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), and Loc.
ExprResult Sema::CheckBooleanCondition | ( | SourceLocation | Loc, |
Expr * | E, | ||
bool | IsConstexpr = false |
||
) |
CheckBooleanCondition - Diagnose problems involving the use of the given expression as a boolean condition (e.g.
in an if statement). Also performs the standard function and array decays, possibly changing the input variable.
Loc | - A location associated with the condition, e.g. the 'if' keyword. |
Definition at line 20279 of file SemaExpr.cpp.
References CheckBoolLikeConversion(), clang::CPlusPlus, Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isScalarType(), clang::Expr::isTypeDependent(), Loc, and clang::T.
Referenced by clang::SemaOpenMP::ActOnOpenMPFinalClause(), clang::SemaOpenMP::ActOnOpenMPIfClause(), clang::SemaOpenMP::ActOnOpenMPNocontextClause(), clang::SemaOpenMP::ActOnOpenMPNovariantsClause(), and CheckConditionVariable().
void Sema::checkCall | ( | NamedDecl * | FDecl, |
const FunctionProtoType * | Proto, | ||
const Expr * | ThisArg, | ||
ArrayRef< const Expr * > | Args, | ||
bool | IsMemberFunction, | ||
SourceLocation | Loc, | ||
SourceRange | Range, | ||
VariadicCallType | CallType | ||
) |
Handles the checks for format strings, non-POD arguments to vararg functions, NULL arguments passed to non-NULL parameters, diagnose_if attributes and AArch64 SME attributes.
Definition at line 6566 of file SemaChecking.cpp.
References CheckNonNullArguments(), clang::Expr::containsErrors(), clang::FunctionDecl::getBuiltinID(), clang::Decl::getFunctionType(), clang::FunctionProtoType::getNumParams(), clang::FunctionType::getReturnType(), clang::Type::isSizelessVectorType(), Loc, Range, and clang::Decl::specific_attrs().
Referenced by clang::SemaObjC::CheckObjCMethodCall(), and CreateOverloadedBinOp().
bool clang::Sema::CheckCallingConvAttr | ( | const ParsedAttr & | attr, |
CallingConv & | CC, | ||
const FunctionDecl * | FD = nullptr , |
||
CUDAFunctionTarget | CFT = CUDAFunctionTarget::InvalidTarget |
||
) |
Check validaty of calling convention attribute attr
.
If FD
is not null pointer, use FD
to determine the CUDA/HIP host/device target. Otherwise, it is specified by CFT
.
bool Sema::CheckCallReturnType | ( | QualType | ReturnType, |
SourceLocation | Loc, | ||
CallExpr * | CE, | ||
FunctionDecl * | FD | ||
) |
CheckCallReturnType - Checks that a call expression's return type is complete.
Returns true on failure. The location passed in is the location that best represents the call.
Definition at line 20151 of file SemaExpr.cpp.
References clang::Type::isIncompleteType(), and clang::Type::isVoidType().
Referenced by ActOnDecltypeExpression(), BuildLiteralOperatorCall(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), and CreateOverloadedUnaryOp().
Definition at line 21057 of file SemaExpr.cpp.
References clang::Expr::isIntegerConstantExpr(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
void Sema::CheckCastAlign | ( | Expr * | Op, |
QualType | T, | ||
SourceRange | TRange | ||
) |
CheckCastAlign - Implements -Wcast-align, which warns when a pointer cast increases the alignment requirements.
Definition at line 17131 of file SemaChecking.cpp.
References clang::Type::getAs(), clang::SourceRange::getBegin(), clang::PointerType::getPointeeType(), clang::Expr::getType(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), and clang::T.
void Sema::checkClassLevelCodeSegAttribute | ( | CXXRecordDecl * | Class | ) |
Definition at line 6509 of file SemaDeclCXX.cpp.
References clang::Class, and getImplicitCodeSegOrSectionAttrForFunction().
void Sema::checkClassLevelDLLAttribute | ( | CXXRecordDecl * | Class | ) |
Check class-level dllimport/dllexport attribute.
The caller must ensure that referenceDLLExportedClassMethods is called some point later when all outer classes of Class are complete.
Definition at line 6520 of file SemaDeclCXX.cpp.
References clang::Decl::addAttr(), clang::Class, clang::Attr::clone(), Context, DelayedDllExportClasses, clang::SemaBase::Diag(), clang::Decl::FOK_None, ForceDeclarationOfImplicitMembers(), getASTContext(), clang::TargetInfo::getCXXABI(), clang::getDLLAttr(), clang::Decl::getFriendObjectKind(), clang::Attr::getKind(), getLangOpts(), clang::Attr::getLocation(), clang::CXXMethodDecl::getMostRecentDecl(), clang::Decl::getPreviousDecl(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::FunctionDecl::isDeleted(), clang::isExternallyVisible(), clang::Attr::isInherited(), clang::FunctionDecl::isInlined(), clang::TargetCXXABI::isMicrosoft(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::CXXConstructorDecl::isMoveConstructor(), clang::FunctionDecl::isTrivial(), clang::Member, clang::LangOptionsBase::MSVC2015, clang::InheritableAttr::setInherited(), clang::TargetInfo::shouldDLLImportComdatSymbols(), clang::TSK_ExplicitInstantiationDeclaration, and clang::TSK_ExplicitInstantiationDefinition.
Referenced by propagateDLLAttrToBaseClassTemplate().
DeclResult Sema::CheckClassTemplate | ( | Scope * | S, |
unsigned | TagSpec, | ||
TagUseKind | TUK, | ||
SourceLocation | KWLoc, | ||
CXXScopeSpec & | SS, | ||
IdentifierInfo * | Name, | ||
SourceLocation | NameLoc, | ||
const ParsedAttributesView & | Attr, | ||
TemplateParameterList * | TemplateParams, | ||
AccessSpecifier | AS, | ||
SourceLocation | ModulePrivateLoc, | ||
SourceLocation | FriendLoc, | ||
unsigned | NumOuterTemplateParamLists, | ||
TemplateParameterList ** | OuterTemplateParamLists, | ||
SkipBodyInfo * | SkipBody = nullptr |
||
) |
Definition at line 1836 of file SemaTemplate.cpp.
bool Sema::checkCommonAttributeFeatures | ( | const Decl * | D, |
const ParsedAttr & | A, | ||
bool | SkipArgCountCheck = false |
||
) |
Handles semantic checking for features that are common to all attributes, such as checking whether a parameter was properly specified, or the correct number of arguments were passed, etc.
Returns true if the attribute has been diagnosed.
Definition at line 1454 of file SemaAttr.cpp.
References checkCommonAttributeFeatures().
bool Sema::checkCommonAttributeFeatures | ( | const Stmt * | S, |
const ParsedAttr & | A, | ||
bool | SkipArgCountCheck = false |
||
) |
Definition at line 1458 of file SemaAttr.cpp.
QualType Sema::CheckCompareOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc | ||
) |
Definition at line 12215 of file SemaExpr.cpp.
References checkArithmeticNull(), checkArithmeticOrEnumeralCompare(), clang::CPlusPlus, diagnoseLogicalNotOnLHSofCheck(), diagnoseTautologicalComparison(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Type::isArithmeticType(), clang::Type::isEnumeralType(), clang::BinaryOperator::isEqualityOp(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMemberPointerType(), clang::Expr::isNullPointerConstant(), clang::Type::isPointerType(), clang::BinaryOperator::isRelationalOp(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), clang::QualType::isWebAssemblyReferenceType(), and Loc.
QualType Sema::CheckComparisonCategoryType | ( | ComparisonCategoryType | Kind, |
SourceLocation | Loc, | ||
ComparisonCategoryUsage | Usage | ||
) |
Lookup the specified comparison category types in the standard library, an check the VarDecls possibly returned by the operator<=> builtins for that type.
Definition at line 11880 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::ASTContext::CompCategories, Context, clang::CPlusPlus, clang::NestedNameSpecifier::Create(), clang::SemaBase::Diag(), distance(), clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::ComparisonCategories::getCategoryString(), clang::CXXRecordDecl::getDefinition(), clang::ASTContext::getElaboratedType(), getLangOpts(), clang::ComparisonCategories::getPossibleResultsForType(), clang::ComparisonCategories::getResultString(), getStdNamespace(), clang::ComparisonCategoryInfo::getType(), clang::CXXRecordDecl::hasDefinition(), clang::ComparisonCategoryInfo::ValueInfo::hasValidIntValue(), int, clang::VarDecl::isStaticDataMember(), clang::CXXRecordDecl::isTriviallyCopyable(), clang::VarDecl::isUsableInConstantExpressions(), clang::ComparisonCategoryInfo::Kind, Loc, clang::ComparisonCategories::lookupInfo(), MarkVariableReferenced(), clang::None, clang::ComparisonCategoryInfo::Record, RequireCompleteType(), and clang::ComparisonCategoryInfo::ValueInfo::VD.
void Sema::CheckCompatibleReinterpretCast | ( | QualType | SrcType, |
QualType | DestType, | ||
bool | IsDereference, | ||
SourceRange | Range | ||
) |
Definition at line 2046 of file SemaCast.cpp.
References Context, clang::SemaBase::Diag(), Diags, clang::Type::getAs(), clang::SourceRange::getBegin(), clang::Type::getPointeeType(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isAnyCharacterType(), clang::DiagnosticsEngine::isIgnored(), clang::Type::isSignedIntegerType(), clang::Type::isUnsignedIntegerType(), clang::Type::isVoidType(), and Range.
void Sema::CheckCompletedCoroutineBody | ( | FunctionDecl * | FD, |
Stmt *& | Body | ||
) |
Definition at line 1090 of file SemaCoroutine.cpp.
References clang::sema::FunctionScopeInfo::AddrLabels, clang::sema::FunctionScopeInfo::CoroutinePromise, Diag(), clang::sema::FunctionScopeInfo::FirstCoroutineStmtLoc, clang::sema::FunctionScopeInfo::FirstReturnLoc, clang::sema::FunctionScopeInfo::FirstVLALoc, clang::AddrLabelExpr::getBeginLoc(), clang::sema::FunctionScopeInfo::getFirstCoroutineStmtKeyword(), clang::Decl::getLocation(), clang::Decl::hasAttr(), clang::sema::FunctionScopeInfo::isCoroutine(), clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), and clang::Decl::setInvalidDecl().
void Sema::CheckCompletedCXXClass | ( | Scope * | S, |
CXXRecordDecl * | Record | ||
) |
Perform semantic checks on a class definition that has been completing, introducing implicitly-declared members, checking for abstract types, etc.
S | The scope in which the class was parsed. Null if we didn't just parse a class definition. |
Record | The completed class. |
Definition at line 6988 of file SemaDeclCXX.cpp.
void Sema::CheckCompleteDecompositionDeclaration | ( | DecompositionDecl * | DD | ) |
Definition at line 1542 of file SemaDeclCXX.cpp.
References clang::DecompositionDecl::bindings(), checkArrayDecomposition(), checkComplexDecomposition(), checkMemberDecomposition(), checkTupleLikeDecomposition(), checkVectorDecomposition(), Context, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::serialized_diags::Error, clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::Type::isDependentType(), isTupleLike(), clang::TagDecl::isUnion(), and clang::Decl::setInvalidDecl().
void Sema::CheckCompleteDestructorVariant | ( | SourceLocation | CurrentLocation, |
CXXDestructorDecl * | Dtor | ||
) |
Do semantic checks to allow the complete destructor variant to be emitted when the destructor is defined in another translation unit.
In the Itanium C++ ABI, destructor variants are emitted together. In the MS C++ ABI, they can be emitted in separate TUs. To emit the complete variant, run a subset of the checks performed when emitting a regular destructor.
Definition at line 14399 of file SemaDeclCXX.cpp.
References Context, clang::TargetInfo::getCXXABI(), clang::CXXRecordDecl::getNumVBases(), clang::ASTContext::getTargetInfo(), clang::TargetCXXABI::isMicrosoft(), and MarkVirtualBaseDestructorsReferenced().
void Sema::CheckCompleteVariableDeclaration | ( | VarDecl * | VD | ) |
Definition at line 14482 of file SemaDecl.cpp.
References clang::CUDA, Diag(), clang::QualType::DK_nontrivial_c_struct, clang::Redeclarable< decl_type >::getPreviousDecl(), clang::isTemplateInstantiation(), clang::VarDecl::isThisDeclarationADefinition(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::OpenCL, clang::SC_Register, and clang::dataflow::var().
void Sema::CheckConceptRedefinition | ( | ConceptDecl * | NewDecl, |
LookupResult & | Previous, | ||
bool & | AddToScope | ||
) |
Definition at line 9900 of file SemaTemplate.cpp.
References Diag(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), and Previous.
ExprResult Sema::CheckConceptTemplateId | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
const DeclarationNameInfo & | ConceptNameInfo, | ||
NamedDecl * | FoundDecl, | ||
ConceptDecl * | NamedConcept, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) |
Definition at line 5625 of file SemaTemplate.cpp.
QualType Sema::CheckConditionalOperands | ( | ExprResult & | Cond, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
ExprValueKind & | VK, | ||
ExprObjectKind & | OK, | ||
SourceLocation | QuestionLoc | ||
) |
Note that LHS is not null here, even if this is the gnu "x ?: y" extension.
In that case, LHS = cond. C99 6.5.15
Definition at line 8516 of file SemaExpr.cpp.
References clang::CPlusPlus, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OK_Ordinary, and clang::VK_PRValue.
ExprResult Sema::CheckConditionVariable | ( | VarDecl * | ConditionVar, |
SourceLocation | StmtLoc, | ||
ConditionKind | CK | ||
) |
Check the use of the given variable as a C++ condition in an if, while, do-while, or switch statement.
Definition at line 4095 of file SemaExprCXX.cpp.
References Boolean, BuildDeclRefExpr(), CheckBooleanCondition(), CheckSwitchCondition(), clang::Condition, ConstexprIf, clang::SemaBase::Diag(), clang::ExprError(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::VarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::Decl::isInvalidDecl(), Switch, clang::T, and clang::VK_LValue.
Referenced by ActOnConditionVariable().
Definition at line 2011 of file SemaChecking.cpp.
References clang::Expr::getIntegerConstantExpr().
bool Sema::CheckConstexprFunctionDefinition | ( | const FunctionDecl * | FD, |
CheckConstexprKind | Kind | ||
) |
Definition at line 1817 of file SemaDeclCXX.cpp.
References clang::CXXMethodDecl::begin_overridden_methods(), CheckConstexprDestructorSubobjects(), CheckConstexprFunctionBody(), CheckConstexprParameterTypes(), CheckConstexprReturnType(), CheckValid, clang::CPlusPlus20, clang::CPlusPlus23, clang::SemaBase::Diag(), Diagnose, clang::FunctionDecl::getBody(), clang::CXXMethodDecl::getCanonicalDecl(), getLangOpts(), clang::Decl::getLocation(), clang::CXXRecordDecl::getNumVBases(), clang::CXXMethodDecl::getParent(), getRecordDiagFromTagKind(), clang::TagDecl::getTagKind(), clang::CXXMethodDecl::isInstance(), clang::CXXMethodDecl::isVirtual(), clang::FunctionDecl::isVirtualAsWritten(), and clang::CXXRecordDecl::vbases().
void Sema::CheckConstrainedAuto | ( | const AutoType * | AutoT, |
SourceLocation | Loc | ||
) |
Definition at line 6760 of file SemaChecking.cpp.
References clang::AutoType::getTypeConstraintConcept(), and Loc.
Referenced by ActOnTypeName().
bool Sema::CheckConstraintExpression | ( | const Expr * | CE, |
Token | NextToken = Token() , |
||
bool * | PossibleNonPrimary = nullptr , |
||
bool | IsTrailingRequiresClause = false |
||
) |
Check whether the given expression is a valid constraint expression.
A diagnostic is emitted if it is not, false is returned, and PossibleNonPrimary will be set to true if the failure might be due to a non-primary expression being used as an atomic constraint.
Definition at line 91 of file SemaConcept.cpp.
References clang::CPlusPlus11, clang::getBinOpPrecedence(), clang::Token::getKind(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Token::is(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isSpecificBuiltinType(), clang::Expr::isTypeDependent(), and clang::prec::LogicalAnd.
Referenced by clang::Parser::ParseConstraintExpression(), and clang::Parser::ParseConstraintLogicalAndExpression().
bool Sema::CheckConstraintSatisfaction | ( | const Expr * | ConstraintExpr, |
ConstraintSatisfaction & | Satisfaction | ||
) |
Check whether the given non-dependent constraint expression is satisfied.
Returns false and updates Satisfaction with the satisfaction verdict if successful, emits a diagnostic and returns true if an error occurred and satisfaction could not be determined.
Definition at line 538 of file SemaConcept.cpp.
References calculateConstraintSatisfaction(), and isInvalid().
|
inline |
Check whether the given list of constraint expressions are satisfied (as if in a 'conjunction') given template arguments.
Template | the template-like entity that triggered the constraints check (either a concept or a constrained entity). |
ConstraintExprs | a list of constraint expressions, treated as if they were 'AND'ed together. |
TemplateArgLists | the list of template arguments to substitute into the constraint expression. |
TemplateIDRange | The source range of the template id that caused the constraints check. |
Satisfaction | if true is returned, will contain details of the satisfaction, with enough information to diagnose an unsatisfied expression. |
Definition at line 11366 of file Sema.h.
Referenced by BuildNestedRequirement(), and BuildStaticAssertDeclaration().
bool Sema::CheckConstraintSatisfaction | ( | const NamedDecl * | Template, |
ArrayRef< const Expr * > | ConstraintExprs, | ||
llvm::SmallVectorImpl< Expr * > & | ConvertedConstraints, | ||
const MultiLevelTemplateArgumentList & | TemplateArgList, | ||
SourceRange | TemplateIDRange, | ||
ConstraintSatisfaction & | Satisfaction | ||
) |
Check whether the given list of constraint expressions are satisfied (as if in a 'conjunction') given template arguments.
Additionally, takes an empty list of Expressions which is populated with the instantiated versions of the ConstraintExprs.
Template | the template-like entity that triggered the constraints check (either a concept or a constrained entity). |
ConstraintExprs | a list of constraint expressions, treated as if they were 'AND'ed together. |
ConvertedConstraints | a out parameter that will get populated with the instantiated version of the ConstraintExprs if we successfully checked satisfaction. |
TemplateArgList | the multi-level list of template arguments to substitute into the constraint expression. This should be relative to the top-level (hence multi-level), since we need to instantiate fully at the time of checking. |
TemplateIDRange | The source range of the template id that caused the constraints check. |
Satisfaction | if true is returned, will contain details of the satisfaction, with enough information to diagnose an unsatisfied expression. |
Definition at line 475 of file SemaConcept.cpp.
References CheckConstraintSatisfaction(), and clang::ConstraintSatisfaction::IsSatisfied.
void Sema::CheckConstructor | ( | CXXConstructorDecl * | Constructor | ) |
CheckConstructor - Checks a fully-formed constructor for well-formedness, issuing any diagnostics required.
Returns true if the constructor declarator is invalid.
Definition at line 10933 of file SemaDeclCXX.cpp.
References Context, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::ASTContext::getCanonicalType(), clang::ASTContext::getTagDeclType(), clang::CanQual< T >::getUnqualifiedType(), and clang::TSK_ImplicitInstantiation.
Sema::AccessResult Sema::CheckConstructorAccess | ( | SourceLocation | Loc, |
CXXConstructorDecl * | D, | ||
DeclAccessPair | FoundDecl, | ||
const InitializedEntity & | Entity, | ||
bool | IsCopyBindingRefToTemp = false |
||
) |
Checks access to a constructor.
Definition at line 1662 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, clang::InitializedEntity::EK_Base, clang::InitializedEntity::EK_LambdaCapture, clang::InitializedEntity::EK_Member, clang::InitializedEntity::EK_ParenAggInitMember, clang::DeclAccessPair::getAccess(), clang::InitializedEntity::getBaseSpecifier(), clang::InitializedEntity::getCapturedVarName(), clang::InitializedEntity::getDecl(), clang::InitializedEntity::getKind(), clang::CXXBaseSpecifier::getType(), clang::InitializedEntity::getType(), and clang::InitializedEntity::isInheritedVirtualBase().
Sema::AccessResult Sema::CheckConstructorAccess | ( | SourceLocation | Loc, |
CXXConstructorDecl * | D, | ||
DeclAccessPair | FoundDecl, | ||
const InitializedEntity & | Entity, | ||
const PartialDiagnostic & | PDiag | ||
) |
Checks access to a constructor.
Definition at line 1709 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, clang::InitializedEntity::EK_Base, clang::InitializedEntity::EK_Delegating, clang::DeclAccessPair::getAccess(), clang::DeclAccessPair::getDecl(), clang::InitializedEntity::getKind(), clang::DeclContext::getParent(), and clang::InitializedEntity::getParent().
QualType Sema::CheckConstructorDeclarator | ( | Declarator & | D, |
QualType | R, | ||
StorageClass & | SC | ||
) |
CheckConstructorDeclarator - Called by ActOnDeclarator to check the well-formedness of the constructor declarator D
with type R
.
If there are any errors in the declarator, this routine will emit diagnostics and set the invalid bit to true. In any case, the type will be updated to reflect a well-formed type for the constructor and returned.
Definition at line 10870 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), checkMethodTypeQualifiers(), Context, clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), diagnoseIgnoredQualifiers(), clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getConstSpecLoc(), clang::Declarator::getDeclSpec(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::Declarator::getFunctionTypeInfo(), clang::Declarator::getIdentifierLoc(), clang::FunctionProtoType::getParamTypes(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::DeclSpec::getRestrictSpecLoc(), clang::FunctionType::getReturnType(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getVirtualSpecLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::Declarator::isInvalidType(), clang::DeclSpec::isVirtualSpecified(), clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::RQ_None, clang::SC_None, clang::SC_Static, clang::Declarator::setInvalidType(), clang::FunctionProtoType::ExtProtoInfo::TypeQuals, and clang::ASTContext::VoidTy.
void Sema::CheckConversionDeclarator | ( | Declarator & | D, |
QualType & | R, | ||
StorageClass & | SC | ||
) |
CheckConversionDeclarator - Called by ActOnDeclarator to check the well-formednes of the conversion function declarator D
with type R
.
If there are any errors in the declarator, this routine will emit diagnostics and return true. Otherwise, it will return false. Either way, the type R
will be updated to reflect a well-formed type for the conversion operator.
Definition at line 11145 of file SemaDeclCXX.cpp.
References clang::frontend::After, clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::Type::castAs(), Context, clang::UnqualifiedId::ConversionFunctionId, clang::CPlusPlus11, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateInsertionFromRange(), clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), extendLeft(), extendRight(), clang::First, clang::DeclaratorChunk::Function, clang::SourceRange::getBegin(), clang::Declarator::getDeclSpec(), clang::TypeLoc::getEndLoc(), clang::DeclSpec::getExplicitSpecLoc(), clang::DeclSpec::getExplicitSpecRange(), clang::ASTContext::getFunctionType(), clang::Declarator::getFunctionTypeInfo(), clang::Declarator::getIdentifierLoc(), getLangOpts(), getLocForEndOfToken(), clang::Declarator::getName(), clang::ASTContext::getPointerType(), clang::TypeLoc::getSourceRange(), clang::UnqualifiedId::getSourceRange(), clang::DeclSpec::getStorageClassSpecLoc(), clang::CharSourceRange::getTokenRange(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclSpec::hasExplicitSpecifier(), clang::DeclSpec::hasTypeSpecifier(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::Declarator::isInvalidType(), clang::SourceRange::isValid(), Loc, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, clang::SC_None, clang::SC_Static, clang::Declarator::setInvalidType(), and clang::Declarator::type_objects().
ExprResult Sema::CheckConvertedConstantExpression | ( | Expr * | From, |
QualType | T, | ||
APValue & | Value, | ||
CCEKind | CCE, | ||
NamedDecl * | Dest = nullptr |
||
) |
Definition at line 6300 of file SemaOverload.cpp.
References CheckConvertedConstantExpression(), and clang::T.
ExprResult Sema::CheckConvertedConstantExpression | ( | Expr * | From, |
QualType | T, | ||
llvm::APSInt & | Value, | ||
CCEKind | CCE | ||
) |
Definition at line 6307 of file SemaOverload.cpp.
References clang::Type::isIntegralOrEnumerationType(), clang::T, and V.
Referenced by ActOnCXXNew(), ActOnNoexceptSpec(), and tryResolveExplicitSpecifier().
void Sema::CheckCoroutineWrapper | ( | FunctionDecl * | FD | ) |
Definition at line 16108 of file SemaDecl.cpp.
References Diag(), clang::Type::getAsRecordDecl(), clang::Decl::getLocation(), clang::FunctionDecl::getReturnType(), clang::NamedDecl::getUnderlyingDecl(), and clang::Decl::hasAttr().
ExprResult Sema::CheckCXXBooleanCondition | ( | Expr * | CondExpr, |
bool | IsConstexpr = false |
||
) |
CheckCXXBooleanCondition - Returns true if conversion to bool is invalid.
CheckCXXBooleanCondition - Returns true if a conversion to bool is invalid.
Definition at line 4133 of file SemaExprCXX.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isValueDependent(), PerformContextuallyConvertToBool(), and VerifyIntegerConstantExpression().
Referenced by CXXCheckConditionalOperands().
bool Sema::CheckCXXDefaultArgExpr | ( | SourceLocation | CallLoc, |
FunctionDecl * | FD, | ||
ParmVarDecl * | Param, | ||
Expr * | Init = nullptr , |
||
bool | SkipImmediateInvocations = true |
||
) |
Instantiate or parse a C++ default argument expression as necessary.
Return true on error.
Definition at line 5449 of file SemaExpr.cpp.
References Diag(), clang::DeclaratorDecl::getBeginLoc(), clang::Decl::getDeclContext(), clang::VarDecl::getInit(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), clang::ParmVarDecl::hasUnparsedDefaultArg(), clang::FunctionDecl::isImmediateFunction(), clang::runWithSufficientStackSpace(), and clang::Decl::setInvalidDecl().
Referenced by InstantiateDefaultCtorDefaultArgs().
void Sema::CheckCXXDefaultArguments | ( | FunctionDecl * | FD | ) |
Helpers for dealing with blocks and functions.
CheckCXXDefaultArguments - Verify that the default arguments for a function declaration are well-formed according to C++ [dcl.fct.default].
Definition at line 1656 of file SemaDeclCXX.cpp.
References CurrentInstantiationScope, clang::SemaBase::Diag(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::NamedDecl::getIdentifier(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::ParmVarDecl::hasDefaultArg(), clang::Decl::isInvalidDecl(), clang::LocalInstantiationScope::isLocalPackExpansion(), clang::VarDecl::isParameterPack(), and clang::TSK_ExplicitSpecialization.
bool Sema::CheckCXXThisCapture | ( | SourceLocation | Loc, |
bool | Explicit = false , |
||
bool | BuildAndDiagnose = true , |
||
const unsigned *const | FunctionScopeIndexToStopAt = nullptr , |
||
bool | ByCopy = false |
||
) |
Make sure the value of 'this' is actually available in the current context, if it is a potentially evaluated context.
Loc | The location at which the capture of 'this' occurs. |
Explicit | Whether 'this' is explicitly captured in a lambda capture list. |
FunctionScopeIndexToStopAt | If non-null, it points to the index of the FunctionScopeInfo stack beyond which we do not attempt to capture. This is useful when enclosing lambdas must speculatively capture 'this' that may or may not be used in certain specializations of a nested generic lambda (depending on whether the name resolves to a non-static member function or a static function). |
Definition at line 1312 of file SemaExprCXX.cpp.
References clang::sema::CapturingScopeInfo::addThisCapture(), buildLambdaThisCaptureFixit(), clang::sema::LambdaScopeInfo::CallOperator, clang::SemaBase::Diag(), FunctionScopes, getCurrentThisType(), clang::Type::getPointeeType(), clang::sema::CapturingScopeInfo::ImpCap_Block, clang::sema::CapturingScopeInfo::ImpCap_CapturedRegion, clang::sema::CapturingScopeInfo::ImpCap_LambdaByref, clang::sema::CapturingScopeInfo::ImpCap_LambdaByval, clang::isGenericLambdaCallOperatorSpecialization(), isUnevaluatedContext(), Loc, and clang::Decl::setInvalidDecl().
Referenced by MarkThisReferenced(), and clang::SemaOpenMP::tryCaptureOpenMPLambdas().
bool Sema::CheckCXXThisType | ( | SourceLocation | Loc, |
QualType | Type | ||
) |
Check whether the type of 'this' is valid in the current context.
Definition at line 1437 of file SemaExprCXX.cpp.
References CurContext, clang::SemaBase::Diag(), getFunctionLevelDeclContext(), clang::isLambdaCallWithExplicitObjectParameter(), and Loc.
Referenced by ActOnCXXThis().
bool Sema::CheckCXXThrowOperand | ( | SourceLocation | ThrowLoc, |
QualType | ThrowTy, | ||
Expr * | E | ||
) |
CheckCXXThrowOperand - Validate the operand of a throw.
Definition at line 995 of file SemaExprCXX.cpp.
References Diag(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::Expr::getExprLoc(), clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::CXXRecordDecl::hasIrrelevantDestructor(), clang::Type::isSizelessType(), clang::Type::isVoidType(), and clang::QualType::isWebAssemblyReferenceType().
bool Sema::CheckDeductionGuideDeclarator | ( | Declarator & | D, |
QualType & | R, | ||
StorageClass & | SC | ||
) |
Check the validity of a declarator that we parsed for a deduction-guide.
These aren't actually declarators in the grammar, so we need to check that the user didn't specify any pieces that are not part of the deduction-guide grammar. Return true on invalid deduction-guide.
Definition at line 11497 of file SemaDeclCXX.cpp.
References Context, CurContext, clang::SemaBase::Diag(), clang::DeclContext::Equals(), clang::DeclaratorChunk::Function, clang::OpaquePtr< PtrTy >::get(), clang::UnionOpaquePtr< T >::get(), clang::TypeLoc::getAsAdjusted(), clang::TemplateName::getAsTemplateDecl(), clang::TypeLoc::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::UnqualifiedId::getBeginLoc(), clang::Decl::getDeclContext(), clang::Declarator::getDeclSpec(), clang::Declarator::getIdentifierLoc(), clang::TemplateName::getKind(), clang::Declarator::getMutableDeclSpec(), clang::Declarator::getName(), clang::DeclContext::getRedeclContext(), clang::TypeLoc::getSourceRange(), clang::Declarator::getSourceRange(), clang::TypeSourceInfo::getType(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::QualType::hasQualifiers(), clang::ASTContext::hasSameTemplateName(), clang::Type::isDependentType(), clang::Declarator::isFunctionDefinition(), clang::Declarator::isInvalidType(), NoteTemplateLocation(), clang::DeclaratorChunk::Paren, clang::SC_None, clang::TemplateName::Template, clang::UnqualifiedId::TemplateName, clang::Declarator::type_objects(), and clang::TemplateName::UsingTemplate.
void Sema::CheckDeductionGuideTemplate | ( | FunctionTemplateDecl * | TD | ) |
Definition at line 5216 of file SemaTemplate.cpp.
References Diag(), clang::Decl::getLocation(), clang::TemplateDecl::getTemplateParameters(), and noteNonDeducibleParameters().
void Sema::CheckDelayedMemberExceptionSpecs | ( | ) |
Definition at line 9243 of file SemaDeclCXX.cpp.
References CheckEquivalentExceptionSpec(), CheckOverridingFunctionExceptionSpec(), DelayedEquivalentExceptionSpecChecks, DelayedOverridingExceptionSpecChecks, and clang::Equivalent.
Referenced by ActOnEndOfTranslationUnit(), and ActOnFinishDelayedMemberInitializers().
void Sema::CheckDelegatingCtorCycles | ( | ) |
Definition at line 18892 of file SemaDeclCXX.cpp.
Referenced by ActOnEndOfTranslationUnit().
bool Sema::CheckDependentFunctionTemplateSpecialization | ( | FunctionDecl * | FD, |
const TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
LookupResult & | Previous | ||
) |
Perform semantic analysis for the given dependent function template specialization.
The only possible way to get a dependent function template specialization is with a friend declaration, like so:
There really isn't any useful analysis we can do here, so we just store the information.
Definition at line 10173 of file SemaTemplate.cpp.
References Diag(), clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::Decl::FOK_None, clang::Decl::getDeclContext(), clang::Decl::getFriendObjectKind(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), clang::NamedDecl::getUnderlyingDecl(), clang::LookupResult::Filter::hasNext(), clang::DeclContext::InEnclosingNamespaceSetOf(), clang::LookupResult::Filter::next(), P, Previous, and clang::FunctionDecl::setDependentTemplateSpecialization().
void Sema::CheckDeprecatedSYCLAttributeSpelling | ( | const ParsedAttr & | A, |
StringRef | NewName = "" |
||
) |
Diagnoses an attribute in the 'intelfpga' namespace and suggests using the attribute in the 'intel' namespace instead.
Definition at line 337 of file SemaDeclAttr.cpp.
References clang::AttributeCommonInfo::getAttrName(), clang::ParsedAttr::getKind(), and clang::IdentifierInfo::isStr().
bool Sema::CheckDerivedToBaseConversion | ( | QualType | Derived, |
QualType | Base, | ||
SourceLocation | Loc, | ||
SourceRange | Range, | ||
CXXCastPath * | BasePath = nullptr , |
||
bool | IgnoreAccess = false |
||
) |
Definition at line 3154 of file SemaDeclCXX.cpp.
Referenced by CheckOverridingFunctionReturnType(), CheckPointerToMemberOperands(), MarkVirtualBaseDestructorsReferenced(), and PerformImplicitConversion().
bool Sema::CheckDerivedToBaseConversion | ( | QualType | Derived, |
QualType | Base, | ||
unsigned | InaccessibleBaseID, | ||
unsigned | AmbiguousBaseConvID, | ||
SourceLocation | Loc, | ||
SourceRange | Range, | ||
DeclarationName | Name, | ||
CXXCastPath * | BasePath, | ||
bool | IgnoreAccess = false |
||
) |
CheckDerivedToBaseConversion - Check whether the Derived-to-Base conversion (where Derived and Base are class types) is well-formed, meaning that the conversion is unambiguous (and that all of the base classes are accessible).
Returns true and emits a diagnostic if the code is ill-formed, returns false otherwise. Loc is the location where this routine should point to if there is an error, and Range is the source range to highlight if there is an error.
If either InaccessibleBaseID or AmbiguousBaseConvID are 0, then the diagnostic for the respective type of error will be suppressed, but the check for ill-formed code will still be performed.
Definition at line 3072 of file SemaDeclCXX.cpp.
bool Sema::CheckDestructor | ( | CXXDestructorDecl * | Destructor | ) |
CheckDestructor - Checks a fully-formed destructor definition for well-formedness, issuing any diagnostics required.
Returns true on error.
Definition at line 10968 of file SemaDeclCXX.cpp.
References AA_Passing, ActOnCXXThis(), clang::declaresSameEntity(), clang::SemaBase::Diag(), DiagnoseUseOfDecl(), FindDeallocationFunctionForDestructor(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getLocation(), Loc, MarkFunctionReferenced(), PerformImplicitConversion(), and clang::interp::This().
Referenced by DefineImplicitDestructor(), and MarkVTableUsed().
Sema::AccessResult Sema::CheckDestructorAccess | ( | SourceLocation | Loc, |
CXXDestructorDecl * | Dtor, | ||
const PartialDiagnostic & | PDiag, | ||
QualType | objectType = QualType() |
||
) |
Definition at line 1638 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, clang::Decl::getAccess(), clang::CXXMethodDecl::getParent(), and clang::QualType::isNull().
Referenced by ActOnDecltypeExpression(), checkDestructorReference(), FinalizeVarWithDestructor(), MarkBaseAndMemberDestructorsReferenced(), MarkVirtualBaseDestructorsReferenced(), and MaybeBindToTemporary().
QualType Sema::CheckDestructorDeclarator | ( | Declarator & | D, |
QualType | R, | ||
StorageClass & | SC | ||
) |
CheckDestructorDeclarator - Called by ActOnDeclarator to check the well-formednes of the destructor declarator D
with type R
.
If there are any errors in the declarator, this routine will emit diagnostics and set the declarator to invalid. Even if this happens, will be updated to reflect a well-formed type for the destructor and returned.
Definition at line 11023 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), checkMethodTypeQualifiers(), Context, clang::FixItHint::CreateRemoval(), clang::UnqualifiedId::DestructorName, clang::SemaBase::Diag(), diagnoseIgnoredQualifiers(), clang::DeclaratorChunk::FunctionTypeInfo::freeParams(), clang::FTIHasNonVoidParameters(), clang::Type::getAs(), clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getConstSpecLoc(), clang::Declarator::getDeclSpec(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::Declarator::getFunctionTypeInfo(), clang::Declarator::getIdentifierLoc(), clang::Declarator::getName(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclSpec::getStorageClassSpecLoc(), GetTypeFromParser(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclSpec::hasTypeSpecifier(), clang::Declarator::isInvalidType(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::RQ_None, clang::SC_None, clang::SC_Static, clang::Declarator::setInvalidType(), clang::FunctionProtoType::ExtProtoInfo::Variadic, and clang::ASTContext::VoidTy.
CheckDistantExceptionSpec - Check if the given type is a pointer or pointer to member to a function with an exception specification.
This means that it is invalid to add another level of indirection.
Definition at line 195 of file SemaExceptionSpec.cpp.
References clang::CPlusPlus17, clang::Type::getAs(), getLangOpts(), clang::Type::getPointeeType(), clang::FunctionProtoType::hasExceptionSpec(), and clang::T.
Referenced by BuildMemberPointerType().
EnableIfAttr * Sema::CheckEnableIf | ( | FunctionDecl * | Function, |
SourceLocation | CallLoc, | ||
ArrayRef< Expr * > | Args, | ||
bool | MissingImplicitThis = false |
||
) |
Check the enable_if expressions on the given function.
Returns the first failing attribute, or NULL if they were all successful.
Definition at line 7322 of file SemaOverload.cpp.
References Context, convertArgsForAvailabilityChecks(), and clang::Function.
EnumConstantDecl * Sema::CheckEnumConstant | ( | EnumDecl * | Enum, |
EnumConstantDecl * | LastEnumConst, | ||
SourceLocation | IdLoc, | ||
IdentifierInfo * | Id, | ||
Expr * | val | ||
) |
Definition at line 19756 of file SemaDecl.cpp.
Referenced by clang::TemplateDeclInstantiator::InstantiateEnumDefinition().
bool Sema::CheckEnumRedeclaration | ( | SourceLocation | EnumLoc, |
bool | IsScoped, | ||
QualType | EnumUnderlyingTy, | ||
bool | IsFixed, | ||
const EnumDecl * | Prev | ||
) |
Check whether this is a valid redeclaration of a previous enumeration.
Definition at line 17072 of file SemaDecl.cpp.
References Diag(), clang::EnumDecl::getIntegerType(), clang::Decl::getLocation(), clang::Type::isDependentType(), clang::EnumDecl::isFixed(), and clang::EnumDecl::isScoped().
bool Sema::CheckEnumUnderlyingType | ( | TypeSourceInfo * | TI | ) |
Check that this is a valid underlying type for an enum declaration.
Definition at line 17053 of file SemaDecl.cpp.
References Diag(), clang::Type::getAs(), clang::TypeLoc::getBeginLoc(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Type::isBitIntType(), clang::Type::isDependentType(), and clang::T.
bool clang::Sema::CheckEquivalentExceptionSpec | ( | const FunctionProtoType * | Old, |
SourceLocation | OldLoc, | ||
const FunctionProtoType * | New, | ||
SourceLocation | NewLoc | ||
) |
CheckEquivalentExceptionSpec - Check if the two types have equivalent exception specifications.
Exception specifications are equivalent if they allow exactly the same set of exception types. It does not matter how that is achieved. See C++ [except.spec]p2.
Definition at line 498 of file SemaExceptionSpec.cpp.
References clang::CheckEquivalentExceptionSpecImpl(), getLangOpts(), and PDiag().
bool clang::Sema::CheckEquivalentExceptionSpec | ( | const PartialDiagnostic & | DiagID, |
const PartialDiagnostic & | NoteID, | ||
const FunctionProtoType * | Old, | ||
SourceLocation | OldLoc, | ||
const FunctionProtoType * | New, | ||
SourceLocation | NewLoc | ||
) |
Definition at line 674 of file SemaExceptionSpec.cpp.
References clang::CheckEquivalentExceptionSpecImpl(), and getLangOpts().
bool clang::Sema::CheckEquivalentExceptionSpec | ( | FunctionDecl * | Old, |
FunctionDecl * | New | ||
) |
Definition at line 299 of file SemaExceptionSpec.cpp.
References clang::Type::castAs(), clang::CheckEquivalentExceptionSpecImpl(), Context, clang::CPlusPlus11, clang::CPlusPlus17, clang::FixItHint::CreateInsertion(), DelayedEquivalentExceptionSpecChecks, clang::SemaBase::Diag(), clang::EST_BasicNoexcept, clang::EST_DependentNoexcept, clang::EST_Dynamic, clang::EST_DynamicNone, clang::EST_MSAny, clang::EST_NoexceptFalse, clang::EST_NoexceptTrue, clang::EST_None, clang::EST_NoThrow, clang::EST_Unevaluated, clang::EST_Uninstantiated, clang::EST_Unparsed, clang::FunctionProtoType::ExceptionSpecInfo::Exceptions, clang::exceptionSpecNotKnownYet(), clang::Type::getAs(), clang::TypeLoc::getAs(), clang::FunctionDecl::getBuiltinID(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), clang::ASTContext::getFunctionType(), getLangOpts(), clang::Decl::getLocation(), getLocForEndOfToken(), getPrintingPolicy(), clang::ASTContext::getSourceManager(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::hasImplicitExceptionSpec(), clang::TypeLoc::IgnoreParens(), clang::isDynamicExceptionSpec(), clang::FunctionDecl::isExternC(), clang::SourceManager::isInSystemHeader(), clang::SourceLocation::isInvalid(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::SourceLocation::isValid(), PDiag(), clang::Decl::setInvalidDecl(), and clang::ValueDecl::setType().
Referenced by CheckDelayedMemberExceptionSpecs(), and MergeVarDeclExceptionSpecs().
Definition at line 929 of file SemaExceptionSpec.cpp.
References CheckExceptionSpecSubset(), clang::CPlusPlus17, clang::SourceRange::getBegin(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::GetUnderlyingFunction(), clang::FunctionProtoType::hasDependentExceptionSpec(), and PDiag().
Referenced by PerformImplicitConversion().
void Sema::checkExceptionSpecification | ( | bool | IsTopLevel, |
ExceptionSpecificationType | EST, | ||
ArrayRef< ParsedType > | DynamicExceptions, | ||
ArrayRef< SourceRange > | DynamicExceptionRanges, | ||
Expr * | NoexceptExpr, | ||
SmallVectorImpl< QualType > & | Exceptions, | ||
FunctionProtoType::ExceptionSpecInfo & | ESI | ||
) |
Check the given exception-specification and update the exception specification information with the results.
Definition at line 19047 of file SemaDeclCXX.cpp.
References clang::ASTContext::BoolTy, CheckSpecifiedExceptionType(), collectUnexpandedParameterPacks(), Context, DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::EST_BasicNoexcept, clang::EST_Dynamic, clang::FunctionProtoType::ExceptionSpecInfo::Exceptions, clang::Type::getCanonicalTypeUnqualified(), clang::Expr::getType(), GetTypeFromParser(), clang::isComputedNoexcept(), clang::Expr::isTypeDependent(), clang::FunctionProtoType::ExceptionSpecInfo::NoexceptExpr, clang::FunctionProtoType::ExceptionSpecInfo::Type, and UPPC_ExceptionType.
Referenced by actOnDelayedExceptionSpecification().
bool clang::Sema::CheckExceptionSpecSubset | ( | const PartialDiagnostic & | DiagID, |
const PartialDiagnostic & | NestedDiagID, | ||
const PartialDiagnostic & | NoteID, | ||
const PartialDiagnostic & | NoThrowDiagID, | ||
const FunctionProtoType * | Superset, | ||
bool | SkipSupersetFirstParameter, | ||
SourceLocation | SuperLoc, | ||
const FunctionProtoType * | Subset, | ||
bool | SkipSubsetFirstParameter, | ||
SourceLocation | SubLoc | ||
) |
CheckExceptionSpecSubset - Check whether the second function type's exception specification is a subset (or equivalent) of the first function type.
This is used by override and pointer assignment checks.
Definition at line 773 of file SemaExceptionSpec.cpp.
References clang::FunctionProtoType::canThrow(), CheckParamExceptionSpec(), clang::CT_Can, clang::CT_Cannot, clang::SemaBase::Diag(), clang::EST_DependentNoexcept, clang::EST_Dynamic, clang::EST_NoThrow, clang::FunctionProtoType::exceptions(), clang::Type::getAs(), clang::PartialDiagnostic::getDiagID(), clang::FunctionProtoType::getExceptionSpecType(), getLangOpts(), handlerCanCatch(), clang::isUnresolvedExceptionSpec(), clang::SourceLocation::isValid(), and ResolveExceptionSpec().
Referenced by CheckExceptionSpecCompatibility(), and CheckOverridingFunctionExceptionSpec().
bool Sema::CheckExplicitlyDefaultedComparison | ( | Scope * | S, |
FunctionDecl * | MD, | ||
DefaultedComparisonKind | DCK | ||
) |
Definition at line 8816 of file SemaDeclCXX.cpp.
Referenced by SetDeclDefaulted().
void Sema::CheckExplicitlyDefaultedFunction | ( | Scope * | S, |
FunctionDecl * | MD | ||
) |
Definition at line 7656 of file SemaDeclCXX.cpp.
bool Sema::CheckExplicitlyDefaultedSpecialMember | ( | CXXMethodDecl * | MD, |
CXXSpecialMemberKind | CSM, | ||
SourceLocation | DefaultLoc | ||
) |
Definition at line 7676 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), clang::Consteval, clang::Constexpr, Context, clang::CopyAssignment, clang::CopyConstructor, clang::CPlusPlus14, clang::CPlusPlus20, clang::FixItHint::CreateReplacement(), clang::DefaultConstructor, defaultedSpecialMemberIsConstexpr(), clang::Destructor, clang::SemaBase::Diag(), clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::First, clang::Qualifiers::getAddressSpace(), clang::ASTContext::getAddrSpaceQualType(), clang::DeclaratorDecl::getBeginLoc(), clang::CXXMethodDecl::getCanonicalDecl(), clang::ASTContext::getElaboratedType(), clang::CXXMethodDecl::getFunctionObjectParameterType(), clang::ASTContext::getFunctionType(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getLValueReferenceType(), clang::QualType::getNonReferenceType(), clang::CXXMethodDecl::getNumExplicitParams(), clang::CXXRecordDecl::getNumVBases(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::ASTContext::getRecordType(), clang::FunctionDecl::getSourceRange(), clang::FunctionDecl::getTemplatedKind(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), clang::CXXRecordDecl::implicitCopyAssignmentHasConstParam(), clang::CXXRecordDecl::implicitCopyConstructorHasConstParam(), inTemplateInstantiation(), clang::Invalid, clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::QualType::isConstQualified(), clang::TagDecl::isDependentType(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Type::isReferenceType(), clang::FunctionDecl::isTemplateInstantiation(), clang::SourceLocation::isValid(), clang::FunctionDecl::isVariadic(), clang::QualType::isVolatileQualified(), clang::MoveAssignment, clang::None, clang::FunctionDecl::setConstexprKind(), SetDeclDeleted(), clang::ValueDecl::setType(), ShouldDeleteSpecialMember(), clang::FunctionProtoType::ExceptionSpecInfo::SourceDecl, clang::FunctionDecl::TK_NonTemplate, clang::FunctionProtoType::ExceptionSpecInfo::Type, clang::Unspecified, clang::CXXRecordDecl::vbases(), and clang::ASTContext::VoidTy.
Referenced by SetDeclDefaulted().
void Sema::CheckExplicitObjectLambda | ( | Declarator & | D | ) |
Definition at line 11380 of file SemaDeclCXX.cpp.
References CheckExplicitObjectMemberFunction().
void Sema::CheckExplicitObjectMemberFunction | ( | Declarator & | D, |
DeclarationName | Name, | ||
QualType | R, | ||
bool | IsLambda, | ||
DeclContext * | DC = nullptr |
||
) |
Definition at line 11384 of file SemaDeclCXX.cpp.
Referenced by CheckExplicitObjectLambda().
void Sema::CheckExplicitObjectMemberFunction | ( | DeclContext * | DC, |
Declarator & | D, | ||
DeclarationName | Name, | ||
QualType | R | ||
) |
Definition at line 11375 of file SemaDeclCXX.cpp.
bool Sema::CheckExplicitObjectOverride | ( | CXXMethodDecl * | New, |
const CXXMethodDecl * | Old | ||
) |
Definition at line 18377 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), clang::DeclaratorDecl::getBeginLoc(), clang::Decl::getLocation(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getSourceRange(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), and clang::Decl::setInvalidDecl().
void Sema::CheckExtraCXXDefaultArguments | ( | Declarator & | D | ) |
CheckExtraCXXDefaultArguments - Check for any extra default arguments in the declarator, which is not a function declaration or definition and therefore is not permitted to have default arguments.
This routine should be invoked for every declarator that is not a function declaration or definition.
Definition at line 419 of file SemaDeclCXX.cpp.
References clang::DeclaratorChunk::ParamInfo::DefaultArgTokens, clang::SemaBase::Diag(), clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::ParmVarDecl::getDefaultArg(), clang::Decl::getLocation(), clang::Declarator::getNumTypeObjects(), clang::Stmt::getSourceRange(), clang::Declarator::getTypeObject(), clang::ParmVarDecl::hasUnparsedDefaultArg(), clang::Declarator::isFunctionDeclarationContext(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::Paren, clang::ParmVarDecl::setDefaultArg(), and UnparsedDefaultArgLocs.
Referenced by ActOnCXXNamedCast(), and ActOnTypeName().
ExprResult Sema::CheckExtVectorCast | ( | SourceRange | R, |
QualType | DestTy, | ||
Expr * | CastExpr, | ||
CastKind & | Kind | ||
) |
Definition at line 7810 of file SemaExpr.cpp.
References clang::Expr::getType(), clang::Type::isExtVectorType(), clang::Type::isVectorType(), and clang::OpenCL.
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 = nullptr |
||
) |
Build a new FieldDecl and check its well-formedness.
This routine builds a new FieldDecl given the fields name, type, record, etc. PrevDecl
should refer to any previous declaration with the same name and in the same scope as the field to be created.
Definition at line 18707 of file SemaDecl.cpp.
Check that the expression co_await promise.final_suspend() shall not be potentially-throwing.
Definition at line 669 of file SemaCoroutine.cpp.
References checkNoThrow(), Diag(), and clang::Decl::getEndLoc().
void Sema::CheckFloatComparison | ( | SourceLocation | Loc, |
Expr * | LHS, | ||
Expr * | RHS, | ||
BinaryOperatorKind | Opcode | ||
) |
Check for comparisons of floating-point values using == and !=.
Issue a warning if the comparison is not likely to do what the programmer intended.
Definition at line 13099 of file SemaChecking.cpp.
References clang::Type::getAs(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::FloatingLiteral::getValue(), clang::Expr::IgnoreParens(), clang::BinaryOperator::isEqualityOp(), and clang::BuiltinType::isFloatingPoint().
bool Sema::CheckForConstantInitializer | ( | Expr * | Init, |
unsigned | DiagID = diag::err_init_element_not_constant |
||
) |
type checking declaration initializers (C99 6.7.8)
Definition at line 12717 of file SemaDecl.cpp.
References clang::interp::Init().
void Sema::CheckForFunctionRedefinition | ( | FunctionDecl * | FD, |
const FunctionDecl * | EffectiveDefinition = nullptr , |
||
SkipBodyInfo * | SkipBody = nullptr |
||
) |
Definition at line 15624 of file SemaDecl.cpp.
References canRedefineFunction(), clang::declaresSameEntity(), Diag(), clang::Decl::FOK_None, clang::FunctionDecl::getInstantiatedFromMemberFunction(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::GNUMode, clang::Internal, clang::FunctionDecl::isDefined(), clang::SkipBodyInfo::Previous, clang::SC_Extern, clang::Decl::setInvalidDecl(), and clang::SkipBodyInfo::ShouldSkip.
ExprResult Sema::CheckForImmediateInvocation | ( | ExprResult | E, |
FunctionDecl * | Decl | ||
) |
Wrap the expression in a ConstantExpr if it is a potential immediate invocation.
Opportunistically remove the callee from ReferencesToConsteval if we can. It's OK if this fails; we'll also remove this in HandleImmediateInvocations, but catching it here allows us to avoid walking the AST looking for it in simple cases.
Value-dependent constant expressions should not be immediately evaluated until they are instantiated.
Definition at line 17436 of file SemaExpr.cpp.
References clang::ExprWithCleanups::Create(), clang::ConstantExpr::Create(), clang::Expr::EvalStatus::Diag, clang::Expr::EvaluateAsConstantExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::ConstantExpr::getStorageKind(), clang::APValue::hasValue(), clang::Expr::IgnoreImplicit(), clang::Expr::ImmediateInvocation, clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Expr::isValueDependent(), clang::ConstantExpr::MoveIntoResult(), and clang::Expr::EvalResult::Val.
Referenced by BuildCXXConstructExpr(), BuildLiteralOperatorCall(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), and CreateOverloadedUnaryOp().
Sema::AccessResult Sema::CheckFriendAccess | ( | NamedDecl * | D | ) |
Checks access to the target of a friend declaration.
Definition at line 1843 of file SemaAccess.cpp.
References clang::transformer::access(), AR_accessible, and clang::AS_public.
Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
bool Sema::CheckFunctionCall | ( | FunctionDecl * | FDecl, |
CallExpr * | TheCall, | ||
const FunctionProtoType * | Proto | ||
) |
CheckFunctionCall - Check a direct function call for various correctness and safety properties not strictly enforced by the C type system.
Definition at line 6786 of file SemaChecking.cpp.
References clang::CallExpr::getArgs(), clang::CallExpr::getCallee(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::Type::isPointerType(), clang::Type::isReferenceType(), and clang::FunctionDecl::isStatic().
Referenced by BuildLiteralOperatorCall(), CreateOverloadedArraySubscriptExpr(), and CreateOverloadedUnaryOp().
bool Sema::CheckFunctionConstraints | ( | const FunctionDecl * | FD, |
ConstraintSatisfaction & | Satisfaction, | ||
SourceLocation | UsageLoc = SourceLocation() , |
||
bool | ForOverloadResolution = false |
||
) |
Check whether the given function decl's trailing requires clause is satisfied, if any.
Returns false and updates Satisfaction with the satisfaction verdict if successful, emits a diagnostic and returns true if an error occurred and satisfaction could not be determined.
Definition at line 679 of file SemaConcept.cpp.
References CheckConstraintSatisfaction(), clang::Decl::getLocation(), clang::DeclContext::getNonTransparentContext(), clang::DeclContext::getParent(), clang::FunctionDecl::getTemplatedKind(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::DeclContext::isDependentContext(), clang::isLambdaCallOperator(), clang::isLambdaConversionOperator(), clang::ConstraintSatisfaction::IsSatisfied, clang::DeclContext::isTransparentContext(), clang::SourceLocation::isValid(), and clang::FunctionDecl::TK_FunctionTemplateSpecialization.
Referenced by InstantiateClassMembers().
bool Sema::CheckFunctionDeclaration | ( | Scope * | S, |
FunctionDecl * | NewFD, | ||
LookupResult & | Previous, | ||
bool | IsMemberSpecialization, | ||
bool | DeclIsDefn | ||
) |
Perform semantic checking of a new function declaration.
Performs semantic analysis of the new function declaration NewFD. This routine performs all semantic checking that does not require the actual declarator involved in the declaration, and is used both for the declaration of functions as they are parsed (called via ActOnDeclarator) and for the declaration of functions that have been instantiated via C++ template instantiation (called via InstantiateDecl).
IsMemberSpecialization | whether this new function declaration is a member specialization (that replaces any definition provided by the previous declaration). |
This sets NewFD->isInvalidDecl() to true if there was an error.
Definition at line 12083 of file SemaDecl.cpp.
Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
void Sema::CheckFunctionOrTemplateParamDeclarator | ( | Scope * | S, |
Declarator & | D | ||
) |
Common checks for a parameter-declaration that should apply to both function parameters and non-type template parameters.
Definition at line 15162 of file SemaDecl.cpp.
bool Sema::CheckFunctionReturnType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Definition at line 2579 of file SemaType.cpp.
References clang::TargetInfo::allowHalfArgsAndReturns(), checkNonTrivialCUnion(), Context, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::Default, clang::SemaBase::Diag(), getLangOpts(), clang::ASTContext::getTargetInfo(), HLSL(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::Type::isHalfType(), clang::Type::isObjCObjectType(), Loc, NTCUC_FunctionReturn, NTCUK_Copy, NTCUK_Destruct, and clang::T.
Referenced by BuildFunctionType().
bool Sema::CheckFunctionTemplateSpecialization | ( | FunctionDecl * | FD, |
TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
LookupResult & | Previous, | ||
bool | QualifiedFriend = false |
||
) |
Perform semantic analysis for the given function template specialization.
This routine performs all of the semantic analysis required for an explicit function template specialization. On successful completion, the function declaration FD
will become a function template specialization.
FD | the function declaration, which will be updated to become a function template specialization. |
ExplicitTemplateArgs | the explicitly-provided template arguments, if any. Note that this may be valid info even when 0 arguments are explicitly provided as in, e.g., void sort<>(char*, char*); as it anyway contains info on the angle brackets locations. |
Previous | the set of declarations that may be specialized by this function specialization. |
QualifiedFriend | whether this is a lookup for a qualified friend declaration with no explicit template argument list that might be befriending a function template specialization. |
Definition at line 10237 of file SemaTemplate.cpp.
References clang::Qualifiers::addConst(), clang::Type::castAs(), clang::Decl::getDeclContext(), clang::FunctionProtoType::getExtProtoInfo(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), clang::ValueDecl::getType(), clang::NamedDecl::getUnderlyingDecl(), clang::DeclContext::InEnclosingNamespaceSetOf(), Previous, and clang::FunctionProtoType::ExtProtoInfo::TypeQuals.
Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
Definition at line 5648 of file SemaChecking.cpp.
References CheckAllArgsHaveFloatRepresentation(), CheckFloatOrHalfRepresentations(), CheckNoDoubleVectors(), CheckVectorElementCallArgs(), clang::CallExpr::getArg(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), and SetElementTypeAsReturnType().
bool Sema::CheckIfFunctionSpecializationIsImmediate | ( | FunctionDecl * | FD, |
SourceLocation | Loc | ||
) |
Definition at line 5453 of file SemaTemplateDeduction.cpp.
References clang::FunctionDecl::getDescribedFunctionTemplate(), clang::CXXRecordDecl::getLambdaCallOperator(), clang::DeclContext::getParent(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::FunctionDecl::getTemplateSpecializationArgs(), InstantiateFunctionDeclaration(), InstantiateFunctionDefinition(), clang::FunctionDecl::isImmediateEscalating(), clang::Decl::isInvalidDecl(), clang::isLambdaConversionOperator(), Loc, and runWithSufficientStackSpace().
Referenced by DeduceTemplateArguments().
bool Sema::CheckIfOverriddenFunctionIsMarkedFinal | ( | const CXXMethodDecl * | New, |
const CXXMethodDecl * | Old | ||
) |
CheckForFunctionMarkedFinal - Checks whether a virtual member function overrides a virtual member function marked 'final', according to C++11 [class.virtual]p4.
CheckIfOverriddenFunctionIsMarkedFinal - Checks whether a virtual member function overrides a virtual member function marked 'final', according to C++11 [class.virtual]p4.
Definition at line 3318 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::NamedDecl::getDeclName(), and clang::Decl::getLocation().
void Sema::checkIllFormedTrivialABIStruct | ( | CXXRecordDecl & | RD | ) |
Check that the C++ class annoated with "trivial_abi" satisfies all the conditions that are needed for the attribute to have an effect.
Definition at line 10460 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::CXXRecordDecl::ctors(), clang::CXXRecordDecl::defaultedCopyConstructorIsDeleted(), clang::CXXRecordDecl::defaultedMoveConstructorIsDeleted(), clang::SemaBase::Diag(), clang::Decl::dropAttr(), clang::RecordDecl::fields(), clang::Type::getAs(), clang::Decl::getAttr(), clang::Type::getBaseElementTypeUnsafe(), clang::QualType::getObjCLifetime(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), clang::TagDecl::isDependentType(), clang::CXXRecordDecl::isPolymorphic(), clang::isTemplateInstantiation(), clang::CXXRecordDecl::needsImplicitCopyConstructor(), clang::CXXRecordDecl::needsImplicitMoveConstructor(), and clang::Qualifiers::OCL_Weak.
bool Sema::CheckImmediateEscalatingFunctionDefinition | ( | FunctionDecl * | FD, |
const sema::FunctionScopeInfo * | FSI | ||
) |
Definition at line 2491 of file SemaDeclCXX.cpp.
References clang::CPlusPlus20, clang::SemaBase::Diag(), DiagnoseImmediateEscalatingReason(), clang::sema::FunctionScopeInfo::FoundImmediateEscalatingExpression, clang::FunctionDecl::getCanonicalDecl(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isImmediateEscalating(), clang::FunctionDecl::isImmediateFunction(), clang::FunctionDecl::setBodyContainsImmediateEscalatingExpressions(), and UndefinedButUsed.
bool Sema::CheckImplicitNullabilityTypeSpecifier | ( | QualType & | Type, |
NullabilityKind | Nullability, | ||
SourceLocation | DiagLoc, | ||
bool | AllowArrayTypes, | ||
bool | OverrideExisting | ||
) |
Check whether a nullability type specifier can be added to the given type through some means not written in source (e.g.
API notes).
Type | The type to which the nullability specifier will be added. On success, this type will be updated appropriately. |
Nullability | The nullability specifier to add. |
DiagLoc | The location to use for diagnostics. |
AllowArrayTypes | Whether to accept nullability specifiers on an array type (e.g., because it will decay to a pointer). |
OverrideExisting | Whether to override an existing, locally-specified nullability specifier rather than complaining about the conflict. |
Definition at line 7391 of file SemaType.cpp.
References CheckNullabilityTypeSpecifier().
void Sema::CheckImplicitSpecialMemberDeclaration | ( | Scope * | S, |
FunctionDecl * | FD | ||
) |
Check a completed declaration of an implicit special member.
Definition at line 13959 of file SemaDeclCXX.cpp.
Additional checks for a using declaration referring to a constructor name.
Definition at line 13198 of file SemaDeclCXX.cpp.
References CurContext, clang::SemaBase::Diag(), findDirectBaseWithType(), clang::NestedNameSpecifier::getAsType(), clang::UsingDecl::getNameInfo(), clang::UsingDecl::getQualifier(), clang::DeclarationNameInfo::getSourceRange(), clang::UsingDecl::getUsingLoc(), clang::UsingDecl::hasTypename(), and clang::Decl::setInvalidDecl().
void Sema::checkInitializerLifetime | ( | const InitializedEntity & | Entity, |
Expr * | Init | ||
) |
Check that the lifetime of the initializer (and its subobjects) is sufficient for initializing the entity, and perform lifetime extension (when permitted) if not.
Definition at line 8133 of file SemaInit.cpp.
References clang::InitializedEntity::allocateManglingNumber(), clang::CPlusPlus26, clang::SemaBase::Diag(), Extend, clang::SourceRange::getBegin(), clang::InitializedEntity::getDecl(), clang::NamedDecl::getDeclName(), getDiagnostics(), getEntityLifetime(), getLangOpts(), clang::Decl::getLocation(), clang::InitializedEntity::getParent(), clang::ValueDecl::getType(), clang::InitializedEntity::getType(), clang::DiagnosticsEngine::isIgnored(), clang::Decl::isImplicit(), clang::ValueDecl::isInitCapture(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), clang::LCK_ByRef, clang::Member, nextPathEntryRange(), NoExtend, pathContainsInit(), pathOnlyInitializesGslPointer(), shouldLifetimeExtendThroughPath(), visitLocalsRetainedByInitializer(), and visitLocalsRetainedByReferenceBinding().
Referenced by CollectFieldInitializer().
bool Sema::CheckInstantiatedFunctionTemplateConstraints | ( | SourceLocation | PointOfInstantiation, |
FunctionDecl * | Decl, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
ConstraintSatisfaction & | Satisfaction | ||
) |
Definition at line 917 of file SemaConcept.cpp.
References CheckConstraintSatisfaction(), clang::TemplateDecl::getAssociatedConstraints(), and clang::ConstraintSatisfaction::IsSatisfied.
bool Sema::CheckLiteralOperatorDeclaration | ( | FunctionDecl * | FnDecl | ) |
CheckLiteralOperatorDeclaration - Check whether the declaration of this literal operator function is well-formed.
If so, returns false; otherwise, emits appropriate diagnostics and returns true.
Definition at line 16687 of file SemaDeclCXX.cpp.
References clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::Char8Ty, clang::ASTContext::CharTy, checkLiteralOperatorTemplateParameterList(), Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::DeclarationName::getCXXLiteralIdentifier(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::DeclContext::getExternCContext(), clang::Decl::getLocation(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::PointerType::getPointeeType(), clang::FunctionDecl::getPrimaryTemplate(), clang::ASTContext::getSizeType(), clang::ParmVarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), clang::QualType::isConstQualified(), clang::FunctionDecl::isExternC(), clang::Type::isIntegerType(), clang::Type::isRealFloatingType(), clang::Type::isSpecificBuiltinType(), clang::QualType::isVolatileQualified(), clang::ASTContext::LongDoubleTy, clang::FunctionDecl::param_begin(), clang::FunctionDecl::param_size(), clang::FunctionDecl::parameters(), clang::ASTContext::UnsignedLongLongTy, and clang::ASTContext::WideCharTy.
bool Sema::checkLiteralOperatorId | ( | const CXXScopeSpec & | SS, |
const UnqualifiedId & | Id, | ||
bool | IsUDSuffix | ||
) |
Definition at line 497 of file SemaExprCXX.cpp.
|
inline |
Definition at line 13177 of file SemaExpr.cpp.
References Diag(), clang::Expr::EvaluateAsInt(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Type::isBooleanType(), clang::Type::isIntegerType(), clang::SourceLocation::isMacroID(), clang::Expr::isValueDependent(), clang::Type::isVectorType(), and Loc.
void Sema::CheckLookupAccess | ( | const LookupResult & | R | ) |
Checks access to all the declarations in the given result set.
Definition at line 1933 of file SemaAccess.cpp.
References clang::AS_public, clang::LookupResult::begin(), clang::LookupResult::end(), and clang::LookupResult::getNamingClass().
bool Sema::CheckLoopHintExpr | ( | Expr * | E, |
SourceLocation | Loc, | ||
bool | AllowZero | ||
) |
Definition at line 3756 of file SemaExpr.cpp.
References Diag(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Type::isBooleanType(), clang::Type::isCharType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isValueDependent(), and clang::threadSafety::sx::toString().
ExprResult Sema::CheckLValueToRValueConversionOperand | ( | Expr * | E | ) |
Definition at line 19507 of file SemaExpr.cpp.
References clang::ExprError(), clang::Type::getAs(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), clang::QualType::isVolatileQualified(), clang::NOUR_Constant, NTCUC_LValueToRValueVolatile, and rebuildPotentialResultsAsNonOdrUsed().
void Sema::CheckMain | ( | FunctionDecl * | FD, |
const DeclSpec & | D | ||
) |
Definition at line 12503 of file SemaDecl.cpp.
References clang::Type::castAs(), clang::CC_C, clang::CPlusPlus, clang::FixItHint::CreateRemoval(), Diag(), clang::FunctionType::getCallConv(), clang::DeclSpec::getConstexprSpecLoc(), clang::DeclSpec::getInlineSpecLoc(), clang::Decl::getLocation(), clang::DeclSpec::getNoreturnSpecLoc(), clang::FunctionDecl::getStorageClass(), clang::DeclSpec::getStorageClassSpecLoc(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::Type::isFunctionType(), clang::FunctionDecl::isInlineSpecified(), clang::DeclSpec::isNoreturnSpecified(), clang::OpenCL, clang::SC_Static, clang::FunctionDecl::setConstexprKind(), clang::Decl::setInvalidDecl(), clang::T, and clang::Unspecified.
bool Sema::CheckMatrixCast | ( | SourceRange | R, |
QualType | DestTy, | ||
QualType | SrcTy, | ||
CastKind & | Kind | ||
) |
Definition at line 7736 of file SemaExpr.cpp.
References Diag(), clang::SourceRange::getBegin(), and clang::Type::isMatrixType().
QualType Sema::CheckMatrixElementwiseOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign | ||
) |
Type checking for matrix binary operators.
Definition at line 13016 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
QualType Sema::CheckMatrixMultiplyOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign | ||
) |
Definition at line 13062 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ConstantMatrixType::getNumRows(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
bool clang::Sema::CheckMaxAllowedWorkGroupSize | ( | const Expr * | RWGSXDim, |
const Expr * | RWGSYDim, | ||
const Expr * | RWGSZDim, | ||
const Expr * | MWGSXDim, | ||
const Expr * | MWGSYDim, | ||
const Expr * | MWGSZDim | ||
) |
Sema::AccessResult Sema::CheckMemberAccess | ( | SourceLocation | UseLoc, |
CXXRecordDecl * | NamingClass, | ||
DeclAccessPair | Found | ||
) |
Checks access to a member.
Definition at line 1771 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, and clang::DeclAccessPair::getAccess().
Sema::AccessResult Sema::CheckMemberOperatorAccess | ( | SourceLocation | Loc, |
Expr * | ObjectExpr, | ||
ArrayRef< Expr * > | ArgExprs, | ||
DeclAccessPair | FoundDecl | ||
) |
Definition at line 1829 of file SemaAccess.cpp.
Sema::AccessResult Sema::CheckMemberOperatorAccess | ( | SourceLocation | Loc, |
Expr * | ObjectExpr, | ||
const SourceRange & | Range, | ||
DeclAccessPair | FoundDecl | ||
) |
Definition at line 1801 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, clang::Type::castAs(), clang::DeclAccessPair::getAccess(), clang::RecordType::getDecl(), and clang::Expr::getType().
Referenced by CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), diagnoseNoViableConversion(), and recordConversion().
Sema::AccessResult Sema::CheckMemberOperatorAccess | ( | SourceLocation | Loc, |
Expr * | ObjectExpr, | ||
Expr * | ArgExpr, | ||
DeclAccessPair | FoundDecl | ||
) |
Checks access to an overloaded member operator, including conversion operators.
Definition at line 1820 of file SemaAccess.cpp.
References clang::Stmt::getSourceRange().
bool Sema::CheckMemberPointerConversion | ( | Expr * | From, |
QualType | ToType, | ||
CastKind & | Kind, | ||
CXXCastPath & | BasePath, | ||
bool | IgnoreBaseAccess | ||
) |
CheckMemberPointerConversion - Check the member pointer conversion from the expression From to the type ToType.
This routine checks for ambiguous or virtual or inaccessible base-to-derived member pointer conversions for which IsMemberPointerConversion has already returned true. It returns true and produces a diagnostic if there was an error, or returns false otherwise.
Definition at line 3493 of file SemaOverload.cpp.
References clang::Type::getAs(), clang::Expr::getType(), and clang::Expr::isNullPointerConstant().
Referenced by PerformImplicitConversion().
bool Sema::CheckMemberSpecialization | ( | NamedDecl * | Member, |
LookupResult & | Previous | ||
) |
Perform semantic analysis for the given non-template member specialization.
This routine performs all of the semantic analysis required for an explicit member function specialization. On successful completion, the function declaration FD
will become a member function specialization.
Member | the member declaration, which will be updated to become a specialization. |
Previous | the set of declarations, one of which may be specialized by this function specialization; the set will be modified to contain the redeclared member. |
Definition at line 10512 of file SemaTemplate.cpp.
References clang::Function, clang::ValueDecl::getType(), clang::Member, and Previous.
Sema::IfExistsResult Sema::CheckMicrosoftIfExistsSymbol | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
const DeclarationNameInfo & | TargetNameInfo | ||
) |
Definition at line 9194 of file SemaExprCXX.cpp.
Sema::IfExistsResult Sema::CheckMicrosoftIfExistsSymbol | ( | Scope * | S, |
SourceLocation | KeywordLoc, | ||
bool | IsIfExists, | ||
CXXScopeSpec & | SS, | ||
UnqualifiedId & | Name | ||
) |
Definition at line 9229 of file SemaExprCXX.cpp.
bool clang::Sema::checkMSInheritanceAttrOnDefinition | ( | CXXRecordDecl * | RD, |
SourceRange | Range, | ||
bool | BestCase, | ||
MSInheritanceModel | SemanticSpelling | ||
) |
void Sema::CheckMSVCRTEntryPoint | ( | FunctionDecl * | FD | ) |
Definition at line 12682 of file SemaDecl.cpp.
References clang::Type::castAs(), clang::CC_X86StdCall, clang::FunctionType::getCallConv(), clang::NamedDecl::getName(), clang::FunctionType::getReturnType(), clang::ValueDecl::getType(), clang::Type::isAnyPointerType(), isDefaultStdCall(), clang::Type::isFunctionType(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isNullPtrType(), clang::FunctionDecl::setHasImplicitReturnZero(), and clang::T.
QualType Sema::CheckMultiplyDivideOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign, | ||
bool | IsDivide | ||
) |
Definition at line 10680 of file SemaExpr.cpp.
References checkArithmeticNull(), DiagnoseBadDivideOrRemainderValues(), DiagnoseDivisionSizeofPointerOrArray(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Type::isArithmeticType(), clang::Type::isConstantMatrixType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), and Loc.
bool Sema::CheckNoInlineAttr | ( | const Stmt * | OrigSt, |
const Stmt * | CurSt, | ||
const AttributeCommonInfo & | A | ||
) |
Definition at line 690 of file SemaStmtAttr.cpp.
bool Sema::CheckNonDependentConversions | ( | FunctionTemplateDecl * | FunctionTemplate, |
ArrayRef< QualType > | ParamTypes, | ||
ArrayRef< Expr * > | Args, | ||
OverloadCandidateSet & | CandidateSet, | ||
ConversionSequenceList & | Conversions, | ||
bool | SuppressUserConversions, | ||
CXXRecordDecl * | ActingContext = nullptr , |
||
QualType | ObjectType = QualType() , |
||
Expr::Classification | ObjectClassification = {} , |
||
OverloadCandidateParamOrder | PO = {} |
||
) |
Check that implicit conversion sequences can be formed for each argument whose corresponding parameter has a non-dependent type, per DR1391's [temp.deduct.call]p10.
Definition at line 7853 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::allocateConversionSequences(), getLangOpts(), clang::OverloadCandidateSet::getLocation(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::Type::isDependentType(), clang::QualType::isNull(), min(), Offset, clang::Reversed, TryCopyInitialization(), TryObjectArgumentInitialization(), clang::Unevaluated, and Unevaluated.
void Sema::checkNonTrivialCUnion | ( | QualType | QT, |
SourceLocation | Loc, | ||
NonTrivialCUnionContext | UseContext, | ||
unsigned | NonTrivialKind | ||
) |
Emit diagnostics if a non-trivial C union type or a struct that contains a non-trivial C union is used in an invalid context.
Definition at line 13515 of file SemaDecl.cpp.
References clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), Loc, and clang::DefaultInitializedTypeVisitor< Derived, RetTy >::visit().
Referenced by CheckFunctionReturnType().
void Sema::checkNonTrivialCUnionInInitializer | ( | const Expr * | Init, |
SourceLocation | Loc | ||
) |
Emit diagnostics if the initializer or any of its explicit or implicitly-generated subexpressions require copying or default-initializing a type that is or contains a C union type that is non-trivial to copy or default-initialize.
Definition at line 13263 of file SemaDecl.cpp.
References clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::SourceLocation::isValid(), and Loc.
Definition at line 18897 of file SemaDecl.cpp.
References clang::CPlusPlus, clang::ValueDecl::getType(), clang::Type::isDependentType(), and clang::Decl::isInvalidDecl().
QualType Sema::CheckNonTypeTemplateParameterType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Definition at line 1414 of file SemaTemplate.cpp.
References Diag(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isLValueReferenceType(), clang::Type::isMemberPointerType(), clang::Type::isNullPtrType(), clang::Type::isPointerType(), clang::Type::isUndeducedType(), clang::Type::isVariablyModifiedType(), Loc, and clang::T.
QualType Sema::CheckNonTypeTemplateParameterType | ( | TypeSourceInfo *& | TSI, |
SourceLocation | Loc | ||
) |
Check that the type of a non-type template parameter is well-formed.
Definition at line 1298 of file SemaTemplate.cpp.
References clang::TypeSourceInfo::getType(), clang::Type::isUndeducedType(), and Loc.
bool clang::Sema::checkNSReturnsRetainedReturnType | ( | SourceLocation | loc, |
QualType | type | ||
) |
Referenced by BuildFunctionType().
Sema::OverloadKind Sema::CheckOverload | ( | Scope * | S, |
FunctionDecl * | New, | ||
const LookupResult & | Old, | ||
NamedDecl *& | Match, | ||
bool | NewIsUsingDecl | ||
) |
Determine whether the given New declaration is an overload of the declarations in Old.
This routine returns Ovl_Match or Ovl_NonFunction if New and Old cannot be overloaded, e.g., if New has the same signature as some function in Old (C++ 1.3.10) or if the Old declarations aren't functions (or function templates) at all. When it does return Ovl_Match or Ovl_NonFunction, MatchedDecl will point to the decl that New cannot be overloaded with. This decl may be a UsingShadowDecl on top of the underlying declaration.
Example: Given the following input:
void f(int, float); // #1 void f(int, int); // #2 int f(int, int); // #3
When we process #1, there is no previous declaration of "f", so IsOverload will not be used.
When we process #2, Old contains only the FunctionDecl for #1. By comparing the parameter types, we see that #1 and #2 are overloaded (since they have different signatures), so this routine returns Ovl_Overload; MatchedDecl is unchanged.
When we process #3, Old is an overload set containing #1 and #2. We compare the signatures of #3 to #1 (they're overloaded, so we do nothing) and then #3 to #2. Since the signatures of #3 and #2 are identical (return types of functions are not part of the signature), IsOverload returns Ovl_Match and MatchedDecl will be set to point to the FunctionDecl for #2.
'NewIsUsingShadowDecl' indicates that 'New' is being introduced into a class by a using declaration. The rules for whether to hide shadow declarations ignore some properties which otherwise figure into a function template's signature.
Definition at line 1184 of file SemaOverload.cpp.
Referenced by CheckUsingShadowDecl().
bool Sema::CheckOverloadedOperatorDeclaration | ( | FunctionDecl * | FnDecl | ) |
CheckOverloadedOperatorDeclaration - Check whether the declaration of this overloaded operator is well-formed.
If so, returns false; otherwise, emits appropriate diagnostics and returns true.
Definition at line 16460 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeclaration(), clang::SemaBase::Diag(), clang::NamedDecl::getDeclName(), clang::ParmVarDecl::getDefaultArgRange(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::Type::isDependentType(), clang::Type::isEnumeralType(), clang::FunctionDecl::isOverloadedOperator(), clang::Type::isRecordType(), clang::Type::isSpecificBuiltinType(), LangOpts, clang::NUM_OVERLOADED_OPERATORS, and clang::FunctionDecl::parameters().
void Sema::CheckOverrideControl | ( | NamedDecl * | D | ) |
CheckOverrideControl - Check C++11 override control semantics.
Definition at line 3212 of file SemaDeclCXX.cpp.
References clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), clang::Decl::dropAttr(), FindHiddenVirtualMethods(), clang::Decl::getAttr(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::ValueDecl::getType(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::Decl::hasAttr(), clang::Type::isDependentType(), clang::CXXMethodDecl::isInstance(), clang::Decl::isInvalidDecl(), clang::CXXMethodDecl::isVirtual(), NoteHiddenVirtualMethods(), clang::Decl::setInvalidDecl(), and clang::CXXMethodDecl::size_overridden_methods().
Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
bool Sema::CheckOverridingFunctionAttributes | ( | const CXXMethodDecl * | New, |
const CXXMethodDecl * | Old | ||
) |
Definition at line 18321 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::FunctionType::getCallConv(), clang::NamedDecl::getDeclName(), clang::FunctionProtoType::getExtParameterInfo(), clang::Decl::getLocation(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getStorageClass(), clang::ValueDecl::getType(), clang::FunctionProtoType::hasExtParameterInfos(), IsInvalidSMECallConversion(), clang::FunctionType::ExtParameterInfo::isNoEscape(), and clang::SC_Static.
bool clang::Sema::CheckOverridingFunctionExceptionSpec | ( | const CXXMethodDecl * | New, |
const CXXMethodDecl * | Old | ||
) |
CheckOverridingFunctionExceptionSpec - Checks whether the exception spec is a subset of base spec.
Definition at line 970 of file SemaExceptionSpec.cpp.
References clang::Type::castAs(), CheckExceptionSpecSubset(), DelayedOverridingExceptionSpecChecks, clang::EST_Unparsed, clang::exceptionSpecNotKnownYet(), clang::FunctionProtoType::getExceptionSpecType(), getLangOpts(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::TagDecl::isDependentType(), and PDiag().
Referenced by actOnDelayedExceptionSpecification(), and CheckDelayedMemberExceptionSpecs().
bool Sema::CheckOverridingFunctionReturnType | ( | const CXXMethodDecl * | New, |
const CXXMethodDecl * | Old | ||
) |
CheckOverridingFunctionReturnType - Checks whether the return types are covariant, according to C++ [class.virtual]p5.
Both types must be pointers or references to classes.
Definition at line 18391 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), CheckDerivedToBaseConversion(), Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::NamedDecl::getDeclName(), clang::QualType::getLocalCVRQualifiers(), clang::Decl::getLocation(), clang::Type::getPointeeType(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isDependentType(), IsDerivedFrom(), clang::QualType::isMoreQualifiedThan(), clang::QualType::isNull(), and RequireCompleteType().
ExprResult Sema::CheckPackExpansion | ( | Expr * | Pattern, |
SourceLocation | EllipsisLoc, | ||
std::optional< unsigned > | NumExpansions | ||
) |
Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion.
Pattern | The expression preceding the ellipsis, which will become the pattern of the pack expansion. |
EllipsisLoc | The location of the ellipsis. |
Definition at line 668 of file SemaTemplateVariadic.cpp.
References clang::Expr::containsUnexpandedParameterPack(), Context, CorrectDelayedTyposInExpr(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::ExprError(), and clang::Stmt::getSourceRange().
QualType Sema::CheckPackExpansion | ( | QualType | Pattern, |
SourceRange | PatternRange, | ||
SourceLocation | EllipsisLoc, | ||
std::optional< unsigned > | NumExpansions | ||
) |
Construct a pack expansion type from the pattern of the pack expansion.
Definition at line 643 of file SemaTemplateVariadic.cpp.
References clang::Type::containsUnexpandedParameterPack(), Context, clang::SemaBase::Diag(), clang::Type::getContainedDeducedType(), and clang::ASTContext::getPackExpansionType().
TypeSourceInfo * Sema::CheckPackExpansion | ( | TypeSourceInfo * | Pattern, |
SourceLocation | EllipsisLoc, | ||
std::optional< unsigned > | NumExpansions | ||
) |
Construct a pack expansion type from the pattern of the pack expansion.
Definition at line 626 of file SemaTemplateVariadic.cpp.
References Context, clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushFullCopy(), and clang::PackExpansionTypeLoc::setEllipsisLoc().
Referenced by ActOnPackExpansion(), and SubstParmVarDecl().
ParmVarDecl * Sema::CheckParameter | ( | DeclContext * | DC, |
SourceLocation | StartLoc, | ||
SourceLocation | NameLoc, | ||
const IdentifierInfo * | Name, | ||
QualType | T, | ||
TypeSourceInfo * | TSInfo, | ||
StorageClass | SC | ||
) |
Definition at line 15388 of file SemaDecl.cpp.
Referenced by SubstParmVarDecl().
bool Sema::CheckParameterPacksForExpansion | ( | SourceLocation | EllipsisLoc, |
SourceRange | PatternRange, | ||
ArrayRef< UnexpandedParameterPack > | Unexpanded, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool & | ShouldExpand, | ||
bool & | RetainExpansion, | ||
std::optional< unsigned > & | NumExpansions | ||
) |
Determine whether we could expand a pack expansion with the given set of parameter packs into separate arguments by repeatedly transforming the pattern.
EllipsisLoc | The location of the ellipsis that identifies the pack expansion. |
PatternRange | The source range that covers the entire pattern of the pack expansion. |
Unexpanded | The set of unexpanded parameter packs within the pattern. |
ShouldExpand | Will be set to true if the transformer should expand the corresponding pack expansions into separate arguments. When set, NumExpansions must also be set. |
RetainExpansion | Whether the caller should add an unexpanded pack expansion after all of the expanded arguments. This is used when extending explicitly-specified template argument packs per C++0x [temp.arg.explicit]p9. |
NumExpansions | The number of separate arguments that will be in the expanded form of the corresponding pack expansion. This is both an input and an output parameter, which can be set by the caller if the number of expansions is known a priori (e.g., due to a prior substitution) and will be set by the callee when the number of expansions is known. The callee must set this value when ShouldExpand is true ; it may set this value in other cases. |
ShouldExpand
(and possibly NumExpansions
) must be set. Definition at line 689 of file SemaTemplateVariadic.cpp.
References Depth.
Referenced by InstantiateMemInitializers(), and SubstBaseSpecifiers().
bool clang::Sema::CheckParamExceptionSpec | ( | const PartialDiagnostic & | DiagID, |
const PartialDiagnostic & | NoteID, | ||
const FunctionProtoType * | Target, | ||
bool | SkipTargetFirstParameter, | ||
SourceLocation | TargetLoc, | ||
const FunctionProtoType * | Source, | ||
bool | SkipSourceFirstParameter, | ||
SourceLocation | SourceLoc | ||
) |
CheckParamExceptionSpec - Check if the parameter and return types of the two functions have equivalent exception specs.
This is part of the assignment and override compatibility check. We do not check the parameters of parameter function pointers recursively, as no sane programmer would even be able to write such a function type.
Definition at line 898 of file SemaExceptionSpec.cpp.
References clang::CheckSpecForTypesEquivalent(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::FunctionType::getReturnType(), and PDiag().
Referenced by CheckExceptionSpecSubset().
bool Sema::CheckParmsForFunctionDef | ( | ArrayRef< ParmVarDecl * > | Parameters, |
bool | CheckParameterNames | ||
) |
CheckParmsForFunctionDef - Check that the parameters of the given function are appropriate for the definition of a function.
This takes care of any checks that cannot be performed on the declaration itself, e.g., that the types of each of the function parameters are complete.
Definition at line 16798 of file SemaChecking.cpp.
References clang::C23, clang::CPlusPlus, Diag(), diagnoseArrayStarInParamType(), clang::Type::getAsCXXRecordDecl(), and clang::Attr::getSpelling().
ExprResult Sema::CheckPlaceholderExpr | ( | Expr * | E | ) |
Check for operands with placeholder types and complain if found.
Returns ExprError() if there was an error and no recovery was possible.
Definition at line 20867 of file SemaExpr.cpp.
Referenced by ActOnDecltypeExpression(), ActOnFinishFullExpr(), BuildArrayType(), BuildCXXNoexceptExpr(), BuildExpressionTrait(), CreateOverloadedBinOp(), DeduceAutoType(), IgnoredValueConversions(), PerformContextualImplicitConversion(), PerformImplicitConversion(), PerformMemberExprBaseConversion(), clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr(), and clang::TreeTransform< Derived >::TransformExprRequirement().
bool Sema::CheckPointerConversion | ( | Expr * | From, |
QualType | ToType, | ||
CastKind & | Kind, | ||
CXXCastPath & | BasePath, | ||
bool | IgnoreBaseAccess, | ||
bool | Diagnose = true |
||
) |
CheckPointerConversion - Check the pointer conversion from the expression From to the type ToType.
This routine checks for ambiguous or inaccessible derived-to-base pointer conversions for which IsPointerConversion has already returned true. It returns true and produces a diagnostic if there was an error, or returns false otherwise.
Definition at line 3365 of file SemaOverload.cpp.
References clang::Expr::getType(), clang::Type::isAnyPointerType(), and clang::Expr::isNullPointerConstant().
Referenced by PerformImplicitConversion().
QualType Sema::CheckPointerToMemberOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
ExprValueKind & | VK, | ||
SourceLocation | OpLoc, | ||
bool | isIndirect | ||
) |
Definition at line 6302 of file SemaExprCXX.cpp.
References clang::ASTContext::BoundMemberTy, CheckDerivedToBaseConversion(), clang::Class, clang::Expr::Classify(), Context, clang::CPlusPlus20, clang::FixItHint::CreateReplacement(), DefaultLvalueConversion(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::MemberPointerType::getClass(), clang::ASTContext::getCVRQualifiedType(), clang::QualType::getCVRQualifiers(), clang::Stmt::getEndLoc(), getLangOpts(), clang::Type::getPointeeType(), clang::MemberPointerType::getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::Expr::hasPlaceholderType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::IgnoreParens(), ImpCastExprToType(), int, IsDerivedFrom(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::Classification::isLValue(), clang::Expr::isPRValue(), clang::Expr::Classification::isRValue(), Loc, RequireCompleteType(), clang::RQ_LValue, clang::RQ_None, clang::RQ_RValue, TemporaryMaterializationConversion(), clang::VK_LValue, and clang::VK_PRValue.
void Sema::CheckPtrComparisonWithNullChar | ( | ExprResult & | E, |
ExprResult & | NullE | ||
) |
Definition at line 12188 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Type::isAnyPointerType(), and clang::Expr::isNullPointerConstant().
bool Sema::CheckPureMethod | ( | CXXMethodDecl * | Method, |
SourceRange | InitRange | ||
) |
Mark the given method pure.
Method | the method to be marked pure. |
InitRange | the source range that covers the "0" initializer. |
Definition at line 18502 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), clang::NamedDecl::getDeclName(), clang::SourceRange::getEnd(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::DeclContext::isDependentContext(), clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), clang::CXXMethodDecl::isVirtual(), clang::FunctionDecl::setIsPureVirtual(), and clang::FunctionDecl::setRangeEnd().
Referenced by ActOnPureSpecifier(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
bool Sema::CheckQualifiedFunctionForTypeId | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Definition at line 1766 of file SemaType.cpp.
References clang::SemaBase::Diag(), clang::Qualifiers::empty(), clang::Type::getAs(), getFunctionQualifiersAsString(), clang::FunctionProtoType::getMethodQuals(), clang::FunctionProtoType::getRefQualifier(), Loc, clang::RQ_None, and clang::T.
bool Sema::CheckQualifiedMemberReference | ( | Expr * | BaseExpr, |
QualType | BaseType, | ||
const CXXScopeSpec & | SS, | ||
const LookupResult & | R | ||
) |
Definition at line 628 of file SemaExprMember.cpp.
References clang::LookupResult::begin(), DiagnoseQualifiedMemberReference(), clang::LookupResult::end(), clang::CXXRecordDecl::getCanonicalDecl(), clang::LookupResult::getLookupNameInfo(), clang::DeclContext::getNonTransparentContext(), clang::LookupResult::getRepresentativeDecl(), clang::Type::isDependentType(), clang::CXXRecordDecl::isProvablyNotDerivedFrom(), and clang::DeclContext::isRecord().
Definition at line 1229 of file SemaStmtAttr.cpp.
References CheckRedundantSYCLIntelIVDepAttrs().
Referenced by clang::TreeTransform< Derived >::RebuildAttributedStmt().
Definition at line 1239 of file SemaStmtAttr.cpp.
Referenced by clang::TreeTransform< Derived >::RebuildAttributedStmt().
Definition at line 1693 of file SemaDecl.cpp.
References clang::NamedDecl::getFormalLinkage(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::getNonTransparentContext(), clang::DeclContext::isFileContext(), and clang::Decl::isInExportDeclContext().
Definition at line 1732 of file SemaDecl.cpp.
We've determined that New
is a redeclaration of Old
.
Check that they have compatible owning modules.
Definition at line 1630 of file SemaDecl.cpp.
References Diag(), clang::Decl::getFriendObjectKind(), clang::Module::getFullModuleName(), clang::Decl::getLocation(), clang::Decl::getOwningModule(), clang::Decl::getOwningModuleForLinkage(), clang::Module::getPrimaryModuleInterfaceName(), clang::Module::isModuleImplementation(), clang::Module::isModulePartition(), clang::Module::isNamedModule(), clang::Module::isPrivateModule(), clang::Module::Parent, clang::Decl::setInvalidDecl(), and clang::Decl::setLocalOwningModule().
bool clang::Sema::CheckRegparmAttr | ( | const ParsedAttr & | attr, |
unsigned & | value | ||
) |
QualType Sema::CheckRemainderOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign = false |
||
) |
Definition at line 10719 of file SemaExpr.cpp.
References checkArithmeticNull(), DiagnoseBadDivideOrRemainderValues(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Type::hasIntegerRepresentation(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), and Loc.
bool clang::Sema::checkSectionName | ( | SourceLocation | LiteralLoc, |
StringRef | Str | ||
) |
void Sema::CheckShadow | ( | NamedDecl * | D, |
NamedDecl * | ShadowedDecl, | ||
const LookupResult & | R | ||
) |
Diagnose variable or built-in function shadowing.
Implements -Wshadow.
This method is called whenever a VarDecl is added to a "useful" scope.
ShadowedDecl | the declaration that is shadowed by the given variable |
R | the lookup of the name |
Definition at line 8405 of file SemaDecl.cpp.
References clang::DeclContext::Encloses(), clang::DeclContext::Equals(), getCaptureLocation(), clang::Decl::getDeclContext(), clang::getLambdaAwareParentOfDeclContext(), clang::DeclContext::getLexicalParent(), clang::DeclContext::getParent(), clang::DeclContext::getRedeclContext(), clang::SourceLocation::isInvalid(), clang::isLambdaCallOperator(), clang::NamedDecl::isPlaceholderVar(), clang::DeclContext::isRecord(), and clang::LCD_None.
Referenced by ActOnStartRequiresExpr().
Check -Wshadow without the advantage of a previous lookup.
Definition at line 8551 of file SemaDecl.cpp.
void Sema::CheckShadowingDeclModification | ( | Expr * | E, |
SourceLocation | Loc | ||
) |
Warn if 'E', which is an expression that is about to be modified, refers to a shadowing declaration.
Check if 'E', which is an expression that is about to be modified, refers to a constructor parameter that shadows a field.
Definition at line 8565 of file SemaDecl.cpp.
References clang::CPlusPlus, Diag(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::Expr::IgnoreParenImpCasts(), and Loc.
QualType Sema::CheckShiftOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc, | ||
bool | IsCompAssign = false |
||
) |
Definition at line 11585 of file SemaExpr.cpp.
References checkArithmeticNull(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Type::isVectorType(), and Loc.
Sema::AssignConvertType Sema::CheckSingleAssignmentConstraints | ( | QualType | LHSType, |
ExprResult & | RHS, | ||
bool | Diagnose = true , |
||
bool | DiagnoseCFAudited = false , |
||
bool | ConvertRHS = true |
||
) |
Check assignment constraints for an assignment of RHS to LHSType.
LHSType | The destination type for the assignment. |
RHS | The source expression for the assignment. |
Diagnose | If true , diagnostics may be produced when checking for assignability. If a diagnostic is produced, RHS will be set to ExprError(). Note that this function may still return without producing a diagnostic, even for an invalid assignment. |
DiagnoseCFAudited | If true , the target is a function parameter in an audited Core Foundation API and does not need to be checked for ARC retain issues. |
ConvertRHS | If true , RHS will be updated to model the conversions necessary to perform the assignment. If false , Diagnose must also be false . |
Definition at line 9745 of file SemaExpr.cpp.
References clang::CPlusPlus, Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Type::isAtomicType(), clang::ImplicitConversionSequence::isFailure(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isRecordType(), clang::XRayInstrKind::None, and TryImplicitConversion().
QualType Sema::CheckSizelessVectorCompareOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc | ||
) |
Definition at line 12828 of file SemaExpr.cpp.
References Diag(), diagnoseTautologicalComparison(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), clang::QualType::isNull(), clang::BuiltinType::isSVEBool(), and Loc.
QualType Sema::CheckSizelessVectorConditionalTypes | ( | ExprResult & | Cond, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | QuestionLoc | ||
) |
Definition at line 6737 of file SemaExprCXX.cpp.
References ACK_Conditional, clang::Type::castAs(), CheckSizelessVectorOperands(), Context, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::ASTContext::BuiltinVectorTypeInfo::EC, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getBuiltinVectorTypeInfo(), clang::QualType::getCanonicalType(), clang::ASTContext::getScalableVectorType(), clang::Type::getSveEltType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), ImpCastExprToType(), clang::Type::isEnumeralType(), clang::Type::isSveVLSBuiltinType(), and UsualArithmeticConversions().
Referenced by CXXCheckConditionalOperands().
QualType Sema::CheckSizelessVectorOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign, | ||
ArithConvKind | OperationKind | ||
) |
Definition at line 10505 of file SemaExpr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::BuiltinType::isSVEBool(), and Loc.
Referenced by CheckSizelessVectorConditionalTypes().
bool Sema::CheckSpecializationInstantiationRedecl | ( | SourceLocation | NewLoc, |
TemplateSpecializationKind | NewTSK, | ||
NamedDecl * | PrevDecl, | ||
TemplateSpecializationKind | PrevTSK, | ||
SourceLocation | PrevPointOfInstantiation, | ||
bool & | HasNoEffect | ||
) |
Diagnose cases where we have an explicit template specialization before/after an explicit template instantiation, producing diagnostics for those cases where they are required and determining whether the new specialization/instantiation will have any effect.
NewLoc | the location of the new explicit specialization or instantiation. |
NewTSK | the kind of the new explicit specialization or instantiation. |
PrevDecl | the previous declaration of the entity. |
PrevTSK | the kind of the old explicit specialization or instantiatin. |
PrevPointOfInstantiation | if valid, indicates where the previous declaration was instantiated (either implicitly or explicitly). |
HasNoEffect | will be set to true to indicate that the new specialization or instantiation has no effect and should be ignored. |
Definition at line 9993 of file SemaTemplate.cpp.
References clang::SourceLocation::isInvalid(), StripImplicitInstantiation(), clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by InstantiateClassMembers(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
void Sema::checkSpecializationReachability | ( | SourceLocation | Loc, |
NamedDecl * | Spec | ||
) |
Definition at line 12484 of file SemaTemplate.cpp.
void Sema::checkSpecializationVisibility | ( | SourceLocation | Loc, |
NamedDecl * | Spec | ||
) |
We've found a use of a templated declaration that would trigger an implicit instantiation.
Check that any relevant explicit specializations and partial specializations are visible/reachable, and diagnose if not.
Definition at line 12475 of file SemaTemplate.cpp.
Referenced by DoMarkVarDeclReferenced().
bool clang::Sema::CheckSpecifiedExceptionType | ( | QualType & | T, |
SourceRange | Range | ||
) |
CheckSpecifiedExceptionType - Check if the given type is valid in an exception specification.
Incomplete types, or pointers to incomplete types other than void are not allowed.
[in,out] | T | The exception type. This will be decayed to a pointer type when the input is an array or a function type. |
Definition at line 121 of file SemaExceptionSpec.cpp.
References clang::Type::castAs(), Context, clang::SemaBase::Diag(), clang::ASTContext::getArrayDecayedType(), clang::Type::getAs(), getLangOpts(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::Type::isArrayType(), clang::TagType::isBeingDefined(), clang::Type::isFunctionType(), clang::Type::isRecordType(), clang::Type::isSizelessType(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), Range, RequireCompleteType(), and clang::T.
Referenced by checkExceptionSpecification(), and clang::TreeTransform< Derived >::TransformExceptionSpec().
void Sema::CheckStaticArrayArgument | ( | SourceLocation | CallLoc, |
ParmVarDecl * | Param, | ||
const Expr * | ArgExpr | ||
) |
CheckStaticArrayArgument - If the given argument corresponds to a static array parameter, check that it is non-null, and that if it is formed by array-to-pointer decay, the underlying array is sufficiently large.
C99 6.7.5.3p7: If the keyword static also appears within the [ and ] of the array type derivation, then for each call to the function, the value of the corresponding actual argument shall provide access to the first element of an array with at least as many elements as specified by the size expression.
Definition at line 6151 of file SemaExpr.cpp.
References clang::CPlusPlus, and clang::ParmVarDecl::getOriginalType().
void Sema::CheckStaticLocalForDllExport | ( | VarDecl * | VD | ) |
Check if VD needs to be dllexport/dllimport due to being in a dllexport/import function.
Definition at line 14794 of file SemaDecl.cpp.
References clang::Decl::addAttr(), clang::Decl::getAttr(), clang::getDLLAttr(), clang::Decl::getParentFunctionOrMethod(), clang::Decl::hasAttr(), and clang::VarDecl::isStaticLocal().
bool clang::Sema::checkStringLiteralArgumentAttr | ( | const AttributeCommonInfo & | CI, |
const Expr * | E, | ||
StringRef & | Str, | ||
SourceLocation * | ArgLocation = nullptr |
||
) |
bool clang::Sema::checkStringLiteralArgumentAttr | ( | const ParsedAttr & | Attr, |
unsigned | ArgNum, | ||
StringRef & | Str, | ||
SourceLocation * | ArgLocation = nullptr |
||
) |
Sema::AccessResult Sema::CheckStructuredBindingMemberAccess | ( | SourceLocation | UseLoc, |
CXXRecordDecl * | DecomposedClass, | ||
DeclAccessPair | Field | ||
) |
Checks implicit access to a member in a structured binding.
Definition at line 1787 of file SemaAccess.cpp.
References AR_accessible, and clang::AS_public.
QualType Sema::CheckSubtractionOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
QualType * | CompLHSTy = nullptr |
||
) |
Definition at line 11152 of file SemaExpr.cpp.
References checkArithmeticNull(), checkArithmeticOnObjCPointer(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), clang::Type::isAnyPointerType(), clang::Type::isArithmeticType(), clang::Type::isConstantMatrixType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isNullPointerConstant(), clang::Type::isObjCObjectPointerType(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), and Loc.
ExprResult Sema::CheckSwitchCondition | ( | SourceLocation | SwitchLoc, |
Expr * | Cond | ||
) |
Definition at line 1059 of file SemaStmt.cpp.
Referenced by CheckConditionVariable().
void clang::Sema::CheckSYCLAddIRAttributesFunctionAttrConflicts | ( | Decl * | D | ) |
Referenced by clang::SemaSYCL::MarkDevices().
bool clang::Sema::checkTargetAttr | ( | SourceLocation | LiteralLoc, |
StringRef | Str | ||
) |
bool clang::Sema::checkTargetClonesAttrString | ( | SourceLocation | LiteralLoc, |
StringRef | Str, | ||
const StringLiteral * | Literal, | ||
Decl * | D, | ||
bool & | HasDefault, | ||
bool & | HasCommas, | ||
bool & | HasNotDefault, | ||
SmallVectorImpl< SmallString< 64 >> & | StringsBuffer | ||
) |
bool clang::Sema::checkTargetVersionAttr | ( | SourceLocation | LiteralLoc, |
Decl * | D, | ||
StringRef & | Str, | ||
bool & | isDefault | ||
) |
void Sema::CheckTCBEnforcement | ( | const SourceLocation | CallExprLoc, |
const NamedDecl * | Callee | ||
) |
Enforce the bounds of a TCB CheckTCBEnforcement - Enforces that every function in a named TCB only directly calls other functions in the same TCB as marked by the enforce_tcb and enforce_tcb_leaf attributes.
Definition at line 18955 of file SemaChecking.cpp.
References Diag(), clang::Decl::hasAttr(), and clang::Decl::specific_attrs().
Referenced by clang::SemaObjC::CheckObjCMethodCall().
bool Sema::CheckTemplateArgument | ( | NamedDecl * | Param, |
TemplateArgumentLoc & | Arg, | ||
NamedDecl * | Template, | ||
SourceLocation | TemplateLoc, | ||
SourceLocation | RAngleLoc, | ||
unsigned | ArgumentPackIndex, | ||
SmallVectorImpl< TemplateArgument > & | SugaredConverted, | ||
SmallVectorImpl< TemplateArgument > & | CanonicalConverted, | ||
CheckTemplateArgumentKind | CTAK | ||
) |
Check that the given template argument corresponds to the given template parameter.
Param | The template parameter against which the argument will be checked. |
Arg | The template argument, which may be updated due to conversions. |
Template | The template in which the template argument resides. |
TemplateLoc | The location of the template name for the template whose argument list we're matching. |
RAngleLoc | The location of the right angle bracket ('>') that closes the template argument list. |
ArgumentPackIndex | The index into the argument pack where this argument will be placed. Only valid if the parameter is a parameter pack. |
Converted | The checked, converted argument will be added to the end of this small vector. |
CTAK | Describes how we arrived at this particular template argument: explicitly written, deduced, etc. |
Definition at line 6313 of file SemaTemplate.cpp.
References clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::ActionResult< PtrTy, Compress >::get(), clang::TemplateArgumentLoc::getArgument(), clang::Type::getAs(), clang::TemplateArgument::getAsExpr(), clang::Decl::getDeclContext(), clang::TemplateArgument::getKind(), clang::TemplateArgument::Integral, clang::DeclContext::isDependentContext(), clang::Type::isInstantiationDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::QualType::isNull(), clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, and clang::TemplateArgument::StructuralValue.
ExprResult Sema::CheckTemplateArgument | ( | NonTypeTemplateParmDecl * | Param, |
QualType | ParamType, | ||
Expr * | Arg, | ||
TemplateArgument & | SugaredConverted, | ||
TemplateArgument & | CanonicalConverted, | ||
CheckTemplateArgumentKind | CTAK | ||
) |
Check a template argument against its corresponding non-type template parameter.
This routine implements the semantics of C++ [temp.arg.nontype]. If an error occurred, it returns ExprError(); otherwise, it returns the converted template argument. ParamType
is the type of the non-type template parameter after it has been instantiated.
Definition at line 7831 of file SemaTemplate.cpp.
References clang::CPlusPlus17, clang::Stmt::getBeginLoc(), clang::Type::getContainedDeducedType(), clang::DeducedType::isDeduced(), and clang::Expr::isTypeDependent().
bool Sema::CheckTemplateArgument | ( | TypeSourceInfo * | ArgInfo | ) |
Check a template argument against its corresponding template type parameter.
This routine implements the semantics of C++ [temp.arg.type]. It returns true if an error occurred, and false otherwise.
Definition at line 7222 of file SemaTemplate.cpp.
References clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), and clang::TypeSourceInfo::getTypeLoc().
bool Sema::CheckTemplateArgumentList | ( | TemplateDecl * | Template, |
SourceLocation | TemplateLoc, | ||
TemplateArgumentListInfo & | TemplateArgs, | ||
bool | PartialTemplateArgs, | ||
SmallVectorImpl< TemplateArgument > & | SugaredConverted, | ||
SmallVectorImpl< TemplateArgument > & | CanonicalConverted, | ||
bool | UpdateArgsWithConversions = true , |
||
bool * | ConstraintsNotSatisfied = nullptr , |
||
bool | PartialOrderingTTP = false |
||
) |
Check that the given template arguments can be provided to the given template, converting the arguments along the way.
Check that the given template argument list is well-formed for specializing the given template.
Template | The template to which the template arguments are being provided. |
TemplateLoc | The location of the template name in the source. |
TemplateArgs | The list of template arguments. If the template is a template template parameter, this function may extend the set of template arguments to also include substituted, defaulted template arguments. |
PartialTemplateArgs | True if the list of template arguments is intentionally partial, e.g., because we're checking just the initial set of template arguments. |
Converted | Will receive the converted, canonicalized template arguments. |
UpdateArgsWithConversions | If true , update TemplateArgs to contain the converted forms of the template arguments as written. Otherwise, TemplateArgs will not be modified. |
ConstraintsNotSatisfied | If provided, and an error occurred, will receive true if the cause for the error is the associated constraints of the template not being satisfied by the template arguments. |
PartialOrderingTTP | If true, assume these template arguments are the injected template arguments for a template template parameter. This will relax the requirement that all its possible uses are valid: TTP checking is loose, and assumes that invalid uses will be diagnosed during instantiation. |
Definition at line 6602 of file SemaTemplate.cpp.
References clang::TemplateParameterList::begin(), clang::ConstraintsNotSatisfied, clang::TemplateArgument::CreatePackCopy(), clang::TemplateParameterList::end(), clang::getExpandedPackSize(), clang::TemplateArgumentListInfo::getRAngleLoc(), GetTemplateParameterList(), and clang::TemplateArgumentListInfo::size().
Referenced by clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
bool Sema::CheckTemplateDeclScope | ( | Scope * | S, |
TemplateParameterList * | TemplateParams | ||
) |
Check whether a template can be declared within this scope.
If the template declaration is valid in this scope, returns false. Otherwise, issues a diagnostic and returns true.
Definition at line 9148 of file SemaTemplate.cpp.
QualType Sema::CheckTemplateIdType | ( | TemplateName | Template, |
SourceLocation | TemplateLoc, | ||
TemplateArgumentListInfo & | TemplateArgs | ||
) |
Definition at line 4581 of file SemaTemplate.cpp.
Referenced by FindInstantiatedDecl(), and clang::TreeTransform< Derived >::RebuildTemplateSpecializationType().
bool Sema::CheckTemplateParameterList | ( | TemplateParameterList * | NewParams, |
TemplateParameterList * | OldParams, | ||
TemplateParamListContext | TPC, | ||
SkipBodyInfo * | SkipBody = nullptr |
||
) |
Checks the validity of a template parameter list, possibly considering the template parameter list from a previous declaration.
If an "old" template parameter list is provided, it must be equivalent (per TemplateParameterListsAreEqual) to the "new" template parameter list.
NewParams | Template parameter list for a new template declaration. This template parameter list will be updated with any default arguments that are carried through from the previous template parameter list. |
OldParams | If provided, template parameter list from a previous declaration of the same template. Default template arguments will be merged from the old template parameter list to the new template parameter list. |
TPC | Describes the context in which we are checking the given template parameter list. |
SkipBody | If we might have already made a prior merged definition of this template visible, the corresponding body-skipping information. Default argument redefinition is not an error when skipping such a body, because (under the ODR) we can assume the default arguments are the same as the prior merged definition. |
Definition at line 3538 of file SemaTemplate.cpp.
References clang::TemplateParameterList::begin(), DiagnoseDefaultTemplateArgument(), clang::TemplateParameterList::end(), clang::TemplateTypeParmDecl::getDefaultArgumentLoc(), clang::Module::getFullModuleName(), clang::Decl::getImportedOwningModule(), clang::Decl::getOwningModule(), clang::TemplateTypeParmDecl::hasDefaultArgument(), and clang::SkipBodyInfo::ShouldSkip.
Referenced by clang::TemplateDeclInstantiator::VisitFunctionDecl().
void Sema::CheckTemplatePartialSpecialization | ( | ClassTemplatePartialSpecializationDecl * | Partial | ) |
Definition at line 5206 of file SemaTemplate.cpp.
References checkTemplatePartialSpecialization().
Referenced by clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), and clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization().
void Sema::CheckTemplatePartialSpecialization | ( | VarTemplatePartialSpecializationDecl * | Partial | ) |
Definition at line 5211 of file SemaTemplate.cpp.
References checkTemplatePartialSpecialization().
bool Sema::CheckTemplatePartialSpecializationArgs | ( | SourceLocation | TemplateNameLoc, |
TemplateDecl * | PrimaryTemplate, | ||
unsigned | NumExplicit, | ||
ArrayRef< TemplateArgument > | TemplateArgs | ||
) |
Check the non-type template arguments of a class template partial specialization according to C++ [temp.class.spec]p9.
TemplateNameLoc | the location of the template name. |
PrimaryTemplate | the template parameters of the primary class template. |
NumExplicit | the number of explicitly-specified template arguments. |
TemplateArgs | the template arguments of the class template partial specialization. |
true
if there was an error, false
otherwise. Definition at line 9426 of file SemaTemplate.cpp.
References CheckNonTypeTemplatePartialSpecializationArgs(), clang::Decl::getDeclContext(), clang::TemplateParameterList::getParam(), clang::TemplateDecl::getTemplateParameters(), clang::DeclContext::isDependentContext(), and clang::TemplateParameterList::size().
Referenced by clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), and clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization().
bool Sema::CheckTemplateTemplateArgument | ( | TemplateTemplateParmDecl * | Param, |
TemplateParameterList * | Params, | ||
TemplateArgumentLoc & | Arg, | ||
bool | IsDeduced | ||
) |
Check a template argument against its corresponding template template parameter.
This routine implements the semantics of C++ [temp.arg.template]. It returns true if an error occurred, and false otherwise.
Definition at line 8443 of file SemaTemplate.cpp.
bool Sema::CheckTemplateTypeArgument | ( | TemplateTypeParmDecl * | Param, |
TemplateArgumentLoc & | Arg, | ||
SmallVectorImpl< TemplateArgument > & | SugaredConverted, | ||
SmallVectorImpl< TemplateArgument > & | CanonicalConverted | ||
) |
Definition at line 5907 of file SemaTemplate.cpp.
References clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateArgumentLoc::getTypeSourceInfo(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
bool Sema::checkThisInStaticMemberFunctionAttributes | ( | CXXMethodDecl * | Method | ) |
Check whether 'this' shows up in the attributes of the given static member function.
Definition at line 19000 of file SemaDeclCXX.cpp.
bool Sema::checkThisInStaticMemberFunctionExceptionSpec | ( | CXXMethodDecl * | Method | ) |
Whether this' shows up in the exception specification of a static member function.
Definition at line 18958 of file SemaDeclCXX.cpp.
References clang::TypeLoc::getAs(), clang::TypeSourceInfo::getTypeLoc(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by actOnDelayedExceptionSpecification().
bool Sema::checkThisInStaticMemberFunctionType | ( | CXXMethodDecl * | Method | ) |
Check whether 'this' shows up in the type of a static member function after the (naturally empty) cv-qualifier-seq would be.
Definition at line 18921 of file SemaDeclCXX.cpp.
References clang::TypeLoc::getAs(), clang::TypeSourceInfo::getTypeLoc(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), and clang::DeclaratorDecl::getTypeSourceInfo().
void Sema::CheckThreadLocalForLargeAlignment | ( | VarDecl * | VD | ) |
Definition at line 14831 of file SemaDecl.cpp.
References clang::VarDecl::getTLSKind().
Sema::AssignConvertType Sema::CheckTransparentUnionArgumentConstraints | ( | QualType | ArgType, |
ExprResult & | RHS | ||
) |
Definition at line 9693 of file SemaExpr.cpp.
References clang::Type::castAs(), clang::RecordDecl::fields(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsUnionType(), clang::RecordType::getDecl(), clang::PointerType::getPointeeType(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::interp::InitField(), clang::Expr::isNullPointerConstant(), clang::Type::isPointerType(), and clang::Type::isVoidType().
Referenced by PerformImplicitConversion().
bool Sema::CheckTypeConstraint | ( | TemplateIdAnnotation * | TypeConstraint | ) |
Definition at line 1092 of file SemaTemplate.cpp.
References Diag(), clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateParameterList::getMinRequiredArguments(), clang::TemplateDecl::getTemplateParameters(), clang::ConceptDecl::isTypeConcept(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, clang::TemplateIdAnnotation::Template, and clang::TemplateIdAnnotation::TemplateNameLoc.
void Sema::CheckTypedefForVariablyModifiedType | ( | Scope * | S, |
TypedefNameDecl * | D | ||
) |
Definition at line 6853 of file SemaDecl.cpp.
QualType Sema::CheckTypenameType | ( | ElaboratedTypeKeyword | Keyword, |
SourceLocation | KeywordLoc, | ||
NestedNameSpecifierLoc | QualifierLoc, | ||
const IdentifierInfo & | II, | ||
SourceLocation | IILoc, | ||
bool | DeducedTSTContext = true |
||
) |
Build the type that describes a C++ typename specifier, e.g., "typename T::type".
Definition at line 11911 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::Adopt(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), and clang::NestedNameSpecifier::isDependent().
QualType Sema::CheckTypenameType | ( | ElaboratedTypeKeyword | Keyword, |
SourceLocation | KeywordLoc, | ||
NestedNameSpecifierLoc | QualifierLoc, | ||
const IdentifierInfo & | II, | ||
SourceLocation | IILoc, | ||
TypeSourceInfo ** | TSI, | ||
bool | DeducedTSTContext | ||
) |
Definition at line 11880 of file SemaTemplate.cpp.
References clang::T.
Referenced by ActOnTypeRequirement(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
void Sema::checkTypeSupport | ( | QualType | Ty, |
SourceLocation | Loc, | ||
ValueDecl * | D = nullptr |
||
) |
Check if the type is allowed to be used for the current target.
Definition at line 2020 of file Sema.cpp.
References clang::QualType::isNull().
bool Sema::CheckTypeTraitArity | ( | unsigned | Arity, |
SourceLocation | Loc, | ||
size_t | N | ||
) |
Definition at line 5899 of file SemaExprCXX.cpp.
References clang::SemaBase::Diag(), int, and Loc.
Referenced by BuildTypeTrait().
bool Sema::CheckUnaryExprOrTypeTraitOperand | ( | Expr * | E, |
UnaryExprOrTypeTrait | ExprKind | ||
) |
Check the constraints on expression operands to unary type expression and type traits.
Completes any types necessary and validates the constraints on the operand expression. The logic mostly mirrors the type-based overload, but may modify the expression as it completes the type for that expression through template instantiation, etc.
Definition at line 4330 of file SemaExpr.cpp.
References clang::Expr::getType(), clang::Expr::HasSideEffects(), clang::Expr::isInstantiationDependent(), clang::Type::isReferenceType(), and clang::Type::isVariableArrayType().
bool Sema::CheckUnaryExprOrTypeTraitOperand | ( | QualType | ExprType, |
SourceLocation | OpLoc, | ||
SourceRange | ExprRange, | ||
UnaryExprOrTypeTrait | ExprKind, | ||
StringRef | KWName | ||
) |
Check the constraints on operands to unary expression and type traits.
This will complete any types necessary, and validate the various constraints on those operands.
The UsualUnaryConversions() function is not called by this routine. C99 6.3.2.1p[2-4] all state: Except when it is the operand of the sizeof operator ...
C++ [expr.sizeof]p4 The lvalue-to-rvalue, array-to-pointer, and function-to-pointer standard conversions are not applied to the operand of sizeof.
This policy is followed for all of the unary trait expressions.
Definition at line 4636 of file SemaExpr.cpp.
References clang::Type::getAs(), clang::Type::getPointeeType(), and clang::Type::isDependentType().
ExprResult Sema::CheckUnevaluatedOperand | ( | Expr * | E | ) |
Definition at line 8543 of file SemaExprCXX.cpp.
References CheckUnusedVolatileAssignment().
Referenced by ActOnDecltypeExpression(), and BuildCXXNoexceptExpr().
ExprResult Sema::checkUnknownAnyArg | ( | SourceLocation | callLoc, |
Expr * | result, | ||
QualType & | paramType | ||
) |
Type-check an expression that's being passed to an __unknown_anytype parameter.
Definition at line 20799 of file SemaExpr.cpp.
References std::arg(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::ExplicitCastExpr::getTypeAsWritten(), clang::InitializedEntity::InitializeParameter(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
ExprResult Sema::checkUnknownAnyCast | ( | SourceRange | TypeRange, |
QualType | CastType, | ||
Expr * | CastExpr, | ||
CastKind & | CastKind, | ||
ExprValueKind & | VK, | ||
CXXCastPath & | Path | ||
) |
Check a cast of an unknown-any type.
We intentionally only trigger this for C-style casts.
Definition at line 20775 of file SemaExpr.cpp.
References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::Expr::getValueKind(), and clang::ActionResult< PtrTy, Compress >::isUsable().
Sema::AccessResult Sema::CheckUnresolvedLookupAccess | ( | UnresolvedLookupExpr * | E, |
DeclAccessPair | FoundDecl | ||
) |
Definition at line 1579 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, clang::DeclAccessPair::getAccess(), and clang::UnresolvedLookupExpr::getNamingClass().
Sema::AccessResult Sema::CheckUnresolvedMemberAccess | ( | UnresolvedMemberExpr * | E, |
DeclAccessPair | FoundDecl | ||
) |
Perform access-control checking on a previously-unresolved member access which has now been resolved to a member.
Definition at line 1595 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, clang::Type::castAs(), clang::DeclAccessPair::getAccess(), clang::UnresolvedMemberExpr::getBaseType(), and clang::UnresolvedMemberExpr::isArrow().
bool Sema::checkUnsafeAssigns | ( | SourceLocation | Loc, |
QualType | LHS, | ||
Expr * | RHS | ||
) |
checkUnsafeAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained type.
Definition at line 17480 of file SemaChecking.cpp.
References checkUnsafeAssignObject(), clang::QualType::getObjCLifetime(), Loc, LT, clang::Qualifiers::OCL_ExplicitNone, and clang::Qualifiers::OCL_Weak.
void Sema::checkUnsafeExprAssigns | ( | SourceLocation | Loc, |
Expr * | LHS, | ||
Expr * | RHS | ||
) |
checkUnsafeExprAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained expression.
Definition at line 17493 of file SemaChecking.cpp.
References clang::cast(), checkUnsafeAssignObject(), Diag(), clang::ObjCPropertyRefExpr::getExplicitProperty(), clang::QualType::getObjCLifetime(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyDecl::getPropertyAttributesAsWritten(), clang::Stmt::getSourceRange(), clang::ObjCPropertyDecl::getType(), clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::ObjCPropertyRefExpr::isImplicitProperty(), clang::QualType::isNull(), clang::Type::isObjCRetainableType(), clang::ObjCPropertyAttribute::kind_assign, clang::ObjCPropertyAttribute::kind_weak, Loc, LT, clang::Qualifiers::OCL_None, and clang::Qualifiers::OCL_Weak.
void clang::Sema::checkUnusedDeclAttributes | ( | Declarator & | D | ) |
Referenced by ActOnTypeName().
void Sema::CheckUnusedVolatileAssignment | ( | Expr * | E | ) |
Check whether E, which is either a discarded-value expression or an unevaluated operand, is a simple-assignment to a volatlie-qualified lvalue, and if so, remove it from the list of volatile-qualified assignments that we are going to warn are deprecated.
Definition at line 17400 of file SemaExpr.cpp.
References clang::CPlusPlus20, clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), and clang::QualType::isVolatileQualified().
Referenced by CheckUnevaluatedOperand(), and IgnoredValueConversions().
bool Sema::CheckUseOfCXXMethodAsAddressOfOperand | ( | SourceLocation | OpLoc, |
const Expr * | Op, | ||
const CXXMethodDecl * | MD | ||
) |
Definition at line 14136 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), Diag(), clang::NamedDecl::getName(), clang::CXXMethodDecl::getParent(), clang::Stmt::getSourceRange(), and clang::Expr::IgnoreParens().
Referenced by FixOverloadedFunctionReference().
bool Sema::CheckUsingDeclQualifier | ( | SourceLocation | UsingLoc, |
bool | HasTypename, | ||
const CXXScopeSpec & | SS, | ||
const DeclarationNameInfo & | NameInfo, | ||
SourceLocation | NameLoc, | ||
const LookupResult * | R = nullptr , |
||
const UsingDecl * | UD = nullptr |
||
) |
Checks that the given nested-name qualifier used in a using decl in the current context is appropriately related to the current scope.
If an error is found, diagnoses it and returns true. R is nullptr, if the caller has not (yet) done a lookup, otherwise it's the result of that lookup. UD is likewise nullptr, except when we have an already-populated UsingDecl whose shadow decls contain the same information (i.e. we're instantiating a UsingDecl with non-dependent scope).
Definition at line 13310 of file SemaDeclCXX.cpp.
References computeDeclContext(), clang::CPlusPlus11, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), CurContext, clang::SemaBase::Diag(), clang::frontend::FixIt, clang::LookupResult::getAsSingle(), clang::DeclarationName::getAsString(), clang::SourceRange::getBegin(), clang::CXXScopeSpec::getBeginLoc(), clang::DeclarationNameInfo::getEndLoc(), getLangOpts(), getLocForEndOfToken(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), clang::CXXScopeSpec::getScopeRep(), clang::UsingShadowDecl::getTargetDecl(), clang::DeclContext::isDependentContext(), isProvablyNotDerivedFrom(), clang::DeclContext::isRecord(), RequireCompleteDeclContext(), clang::BaseUsingDecl::shadow_begin(), and clang::BaseUsingDecl::shadow_size().
bool Sema::CheckUsingDeclRedeclaration | ( | SourceLocation | UsingLoc, |
bool | HasTypenameKeyword, | ||
const CXXScopeSpec & | SS, | ||
SourceLocation | NameLoc, | ||
const LookupResult & | Prev | ||
) |
Checks that the given using declaration is not an invalid redeclaration.
Note that this is checking only for the using decl itself, not for any ill-formedness among the UsingShadowDecls.
Definition at line 13228 of file SemaDeclCXX.cpp.
References clang::LookupResult::begin(), Context, CurContext, clang::SemaBase::Diag(), clang::LookupResult::end(), clang::ASTContext::getCanonicalNestedNameSpecifier(), clang::Decl::getLocation(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), clang::CXXScopeSpec::getScopeRep(), clang::NestedNameSpecifier::isDependent(), and clang::DeclContext::isRecord().
bool Sema::CheckUsingShadowDecl | ( | BaseUsingDecl * | BUD, |
NamedDecl * | Target, | ||
const LookupResult & | PreviousDecls, | ||
UsingShadowDecl *& | PrevShadow | ||
) |
Determines whether to create a using shadow decl for a particular decl, given the set of decls existing prior to this using lookup.
Definition at line 12472 of file SemaDeclCXX.cpp.
References CheckOverload(), Context, clang::CPlusPlus11, CurContext, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), clang::Decl::getAsFunction(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::Decl::getLocation(), clang::DeclContext::getParent(), clang::RecordDecl::isAnonymousStructOrUnion(), IsEquivalentForUsingDecl(), isEquivalentInternalLinkageDeclaration(), clang::RecordDecl::isInjectedClassName(), isProvablyNotDerivedFrom(), clang::DeclContext::isRecord(), isVisible(), Ovl_Match, Ovl_NonFunction, Ovl_Overload, Previous, and clang::Decl::setInvalidDecl().
Referenced by clang::TemplateDeclInstantiator::VisitBaseUsingDecls().
We've just determined that Old
and New
both appear to be definitions of the same variable.
Either diagnose or fix the problem.
Definition at line 4884 of file SemaDecl.cpp.
References clang::VarDecl::demoteThisDefinitionToDeclaration(), Diag(), clang::Decl::getDeclContext(), clang::VarDecl::getDescribedVarTemplate(), clang::NamedDecl::getFormalLinkage(), clang::Decl::getLocation(), clang::DeclaratorDecl::getNumTemplateParameterLists(), clang::Internal, clang::DeclContext::isDependentContext(), clang::VarDecl::isInline(), and clang::Decl::setInvalidDecl().
bool Sema::CheckVariableDeclaration | ( | VarDecl * | NewVD, |
LookupResult & | Previous | ||
) |
Perform semantic checking on a newly-created variable declaration.
This routine performs all of the type-checking required for a variable declaration once it has been built. It is used both to check variables after they have been parsed and their declarators have been translated into a declaration, and to check variables that have been instantiated from a template.
Sets NewVD->isInvalidDecl() if an error was encountered.
Returns true if the variable declaration is a redeclaration.
Definition at line 9050 of file SemaDecl.cpp.
References checkForConflictWithNonVisibleExternC(), clang::Decl::isInvalidDecl(), and Previous.
Referenced by BuildVariableInstantiation().
void Sema::CheckVariableDeclarationType | ( | VarDecl * | NewVD | ) |
Definition at line 8736 of file SemaDecl.cpp.
References clang::FixItHint::CreateInsertion(), Diag(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Decl::hasAttrs(), clang::Decl::isInvalidDecl(), clang::Type::isObjCObjectType(), clang::Type::isUndeducedType(), and clang::T.
void Sema::checkVariadicArgument | ( | const Expr * | E, |
VariadicCallType | CT | ||
) |
Check to see if the given expression is a valid argument to a variadic function, issuing a diagnostic if not.
Definition at line 1070 of file SemaExpr.cpp.
References clang::CPlusPlus11, Diag(), clang::QualType::DK_nontrivial_c_struct, clang::Stmt::getBeginLoc(), clang::Expr::getType(), clang::QualType::isDestructedType(), clang::Type::isObjCObjectType(), and clang::Type::isRecordType().
ExprResult Sema::CheckVarTemplateId | ( | const CXXScopeSpec & | SS, |
const DeclarationNameInfo & | NameInfo, | ||
VarTemplateDecl * | Template, | ||
NamedDecl * | FoundD, | ||
SourceLocation | TemplateLoc, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) |
Form a reference to the specialization of the given variable template corresponding to the specified argument list, or a null-but-valid result if the arguments are dependent.
Definition at line 5593 of file SemaTemplate.cpp.
References clang::ExprError(), clang::DeclarationNameInfo::getLoc(), clang::VarDecl::getTemplateSpecializationKind(), clang::VarDecl::setTemplateSpecializationKind(), and clang::TSK_ImplicitInstantiation.
DeclResult Sema::CheckVarTemplateId | ( | VarTemplateDecl * | Template, |
SourceLocation | TemplateLoc, | ||
SourceLocation | TemplateNameLoc, | ||
const TemplateArgumentListInfo & | TemplateArgs | ||
) |
Get the specialization of the given variable template corresponding to the specified argument list, or a null-but-valid result if the arguments are dependent.
Definition at line 5442 of file SemaTemplate.cpp.
References clang::TemplateSpecCandidateSet::addCandidate(), clang::TemplateSpecializationType::anyDependentTemplateArguments(), clang::AS_public, DeduceTemplateArguments(), clang::VarTemplateDecl::findSpecialization(), clang::Decl::getDeclContext(), clang::TemplateSpecCandidateSet::getLocation(), clang::VarTemplateDecl::getPartialSpecializations(), clang::VarTemplateDecl::getTemplatedDecl(), clang::DeclContext::isDependentContext(), clang::DeclAccessPair::make(), clang::MakeDeductionFailureInfo(), clang::TemplateSpecCandidate::set(), and clang::Success.
Definition at line 4493 of file SemaExpr.cpp.
References clang::Expr::IgnoreParens(), and clang::Expr::isTypeDependent().
bool Sema::CheckVectorCast | ( | SourceRange | R, |
QualType | VectorTy, | ||
QualType | Ty, | ||
CastKind & | Kind | ||
) |
Definition at line 7757 of file SemaExpr.cpp.
References clang::Type::isIntegralType(), and clang::Type::isVectorType().
QualType Sema::CheckVectorCompareOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc | ||
) |
CheckVectorCompareOperands - vector comparisons are a clang extension that operates on extended vector types.
Instead of producing an IntTy result, like a scalar comparison, a vector comparison produces a vector of integer types.
Definition at line 12767 of file SemaExpr.cpp.
References clang::AltiVecVector, clang::Type::castAs(), Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::VectorType::getVectorKind(), clang::QualType::isNull(), Loc, and clang::LangOptionsBase::Mixed.
QualType Sema::CheckVectorConditionalTypes | ( | ExprResult & | Cond, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | QuestionLoc | ||
) |
Definition at line 6648 of file SemaExprCXX.cpp.
References ACK_Conditional, clang::Type::castAs(), CheckVectorOperands(), Context, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::Generic, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getCommonSugaredType(), clang::ASTContext::getExtVectorType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::QualType::getUnqualifiedType(), clang::ASTContext::getVectorType(), clang::ASTContext::hasSameType(), ImpCastExprToType(), clang::Type::isEnumeralType(), clang::Type::isExtVectorType(), and UsualArithmeticConversions().
Referenced by CXXCheckConditionalOperands().
QualType Sema::CheckVectorLogicalOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc | ||
) |
Definition at line 12991 of file SemaExpr.cpp.
References clang::CPlusPlus, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), clang::QualType::isNull(), Loc, and clang::OpenCL.
QualType Sema::CheckVectorOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign, | ||
bool | AllowBothBool, | ||
bool | AllowBoolConversion, | ||
bool | AllowBoolOperation, | ||
bool | ReportInvalid | ||
) |
type checking for vector binary operators.
Definition at line 10255 of file SemaExpr.cpp.
References clang::AltiVecBool, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::VectorType::getVectorKind(), clang::Type::isExtVectorBoolType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
Referenced by CheckVectorConditionalTypes(), and CXXCheckConditionalOperands().
void Sema::CheckVirtualDtorCall | ( | CXXDestructorDecl * | dtor, |
SourceLocation | Loc, | ||
bool | IsDelete, | ||
bool | CallCanBeVirtual, | ||
bool | WarnOnNonAbstractTypes, | ||
SourceLocation | DtorLoc | ||
) |
Definition at line 4037 of file SemaExprCXX.cpp.
References clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::QualType::getAsStringInternal(), clang::CXXMethodDecl::getFunctionObjectParameterType(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), getPrintingPolicy(), getSourceManager(), clang::Decl::hasAttr(), clang::CXXRecordDecl::isAbstract(), clang::CXXRecordDecl::isPolymorphic(), isUnevaluatedContext(), clang::CXXMethodDecl::isVirtual(), and Loc.
Sema::NameClassification Sema::ClassifyName | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
IdentifierInfo *& | Name, | ||
SourceLocation | NameLoc, | ||
const Token & | NextToken, | ||
CorrectionCandidateCallback * | CCC = nullptr |
||
) |
Perform name lookup on the given name, classifying it based on the results of name lookup and the following token.
This routine is used by the parser to resolve identifiers and help direct parsing. When the identifier cannot be found, this routine will attempt to correct the typo and classify based on the resulting name.
S | The scope in which we're performing name lookup. |
SS | The nested-name-specifier that precedes the name. |
Name | The identifier. If typo correction finds an alternative name, this pointer parameter will be updated accordingly. |
NameLoc | The location of the identifier. |
NextToken | The token following the identifier. Used to help disambiguate the name. |
CCC | The correction callback, if typo correction is desired. |
Definition at line 882 of file SemaDecl.cpp.
void Sema::CleanupVarDeclMarking | ( | ) |
Definition at line 19543 of file SemaExpr.cpp.
References MarkVarDeclODRUsed().
Referenced by clang::SemaOpenMP::EndOpenMPClause(), InstantiateDefaultCtorDefaultArgs(), MaybeCreateExprWithCleanups(), and MaybeCreateStmtWithCleanups().
void Sema::clearDelayedTypo | ( | TypoExpr * | TE | ) |
Clears the state of the given TypoExpr.
Definition at line 5992 of file SemaLookup.cpp.
|
inline |
Definition at line 997 of file Sema.h.
Referenced by clang::Parser::ParseAssignmentExpression(), clang::Parser::ParseConditionalExpression(), and ProduceSignatureHelp().
void Sema::collectUnexpandedParameterPacks | ( | const DeclarationNameInfo & | NameInfo, |
SmallVectorImpl< UnexpandedParameterPack > & | Unexpanded | ||
) |
Collect the set of unexpanded parameter packs within the given name.
NameInfo | The name that will be traversed to find unexpanded parameter packs. |
Definition at line 562 of file SemaTemplateVariadic.cpp.
void Sema::collectUnexpandedParameterPacks | ( | NestedNameSpecifierLoc | NNS, |
SmallVectorImpl< UnexpandedParameterPack > & | Unexpanded | ||
) |
Collect the set of unexpanded parameter packs within the given nested-name-specifier.
NNS | The nested-name-specifier that will be traversed to find unexpanded parameter packs. |
Definition at line 555 of file SemaTemplateVariadic.cpp.
void Sema::collectUnexpandedParameterPacks | ( | QualType | T, |
SmallVectorImpl< UnexpandedParameterPack > & | Unexpanded | ||
) |
Collect the set of unexpanded parameter packs within the given type.
T | The type that will be traversed to find unexpanded parameter packs. |
Definition at line 545 of file SemaTemplateVariadic.cpp.
References clang::T.
void Sema::collectUnexpandedParameterPacks | ( | TemplateArgument | Arg, |
SmallVectorImpl< UnexpandedParameterPack > & | Unexpanded | ||
) |
Collect the set of unexpanded parameter packs within the given template argument.
Arg | The template argument that will be traversed to find unexpanded parameter packs. |
Definition at line 533 of file SemaTemplateVariadic.cpp.
Referenced by checkExceptionSpecification(), InstantiateMemInitializers(), SubstBaseSpecifiers(), clang::TreeTransform< Derived >::TransformExceptionSpec(), and clang::TreeTransform< Derived >::TransformFunctionTypeParams().
void Sema::collectUnexpandedParameterPacks | ( | TemplateArgumentLoc | Arg, |
SmallVectorImpl< UnexpandedParameterPack > & | Unexpanded | ||
) |
Collect the set of unexpanded parameter packs within the given template argument.
Arg | The template argument that will be traversed to find unexpanded parameter packs. |
Definition at line 539 of file SemaTemplateVariadic.cpp.
void Sema::collectUnexpandedParameterPacks | ( | TypeLoc | TL, |
SmallVectorImpl< UnexpandedParameterPack > & | Unexpanded | ||
) |
Collect the set of unexpanded parameter packs within the given type.
TL | The type that will be traversed to find unexpanded parameter packs. |
Definition at line 550 of file SemaTemplateVariadic.cpp.
Sema::ReferenceCompareResult Sema::CompareReferenceRelationship | ( | SourceLocation | Loc, |
QualType | OrigT1, | ||
QualType | OrigT2, | ||
ReferenceConversions * | ConvOut = nullptr |
||
) |
CompareReferenceRelationship - Compare the two types T1 and T2 to determine whether they are reference-compatible, reference-related, or incompatible, for use in C++ initialization by reference (C++ [dcl.ref.init]p4).
Neither type can be a reference type, and the first type (T1) is the pointee type of the reference type being initialized.
Definition at line 4932 of file SemaOverload.cpp.
References clang::ASTContext::canBindObjCObjectType(), Context, clang::ASTContext::getCanonicalType(), clang::ASTContext::getUnqualifiedArrayType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ASTContext::hasSimilarType(), isCompleteType(), IsDerivedFrom(), IsFunctionConversion(), clang::Type::isFunctionType(), clang::Type::isObjCObjectOrInterfaceType(), isQualificationConversionStep(), clang::Type::isReferenceType(), Loc, AttributeLangSupport::ObjC, Ref_Compatible, Ref_Incompatible, Ref_Related, clang::ASTContext::UnwrapSimilarTypes(), and withoutUnaligned().
Referenced by CXXCheckConditionalOperands().
bool Sema::CompleteConstructorCall | ( | CXXConstructorDecl * | Constructor, |
QualType | DeclInitType, | ||
MultiExprArg | ArgsPtr, | ||
SourceLocation | Loc, | ||
SmallVectorImpl< Expr * > & | ConvertedArgs, | ||
bool | AllowExplicit = false , |
||
bool | IsListInitialization = false |
||
) |
Given a constructor and the set of arguments provided for the constructor, convert the arguments and add any required default arguments to form a proper call to this constructor.
Definition at line 16248 of file SemaDeclCXX.cpp.
References DiagnoseSentinelCalls(), GatherArgumentsForCall(), clang::FunctionProtoType::getNumParams(), Loc, VariadicConstructor, and VariadicDoesNotApply.
Referenced by PerformImplicitConversion().
void Sema::completeExprArrayBound | ( | Expr * | E | ) |
Definition at line 8820 of file SemaType.cpp.
References clang::Expr::getExprLoc(), clang::Expr::IgnoreParens(), InstantiateVariableDefinition(), clang::isTemplateInstantiation(), runWithSufficientStackSpace(), clang::Expr::setType(), clang::T, and clang::TSK_ImplicitInstantiation.
Referenced by getCompletedType().
void Sema::CompleteLambdaCallOperator | ( | CXXMethodDecl * | Method, |
SourceLocation | LambdaLoc, | ||
SourceLocation | CallOperatorLoc, | ||
Expr * | TrailingRequiresClause, | ||
TypeSourceInfo * | MethodTyInfo, | ||
ConstexprSpecKind | ConstexprKind, | ||
StorageClass | SC, | ||
ArrayRef< ParmVarDecl * > | Params, | ||
bool | HasExplicitResultType | ||
) |
Definition at line 1008 of file SemaLambda.cpp.
References clang::DeclContext::addDecl(), buildLambdaScopeReturnType(), buildTypeForLambdaCallOperator(), getCurrentLambdaScopeUnsafe(), clang::FunctionDecl::getDescribedFunctionTemplate(), getGenericLambdaTemplateParameterList(), clang::Decl::getLexicalDeclContext(), clang::sema::LambdaScopeInfo::Lambda, P, clang::FunctionDecl::parameters(), clang::FunctionDecl::setConstexprKind(), clang::DeclaratorDecl::setInnerLocStart(), clang::CXXRecordDecl::setLambdaIsGeneric(), clang::CXXRecordDecl::setLambdaTypeInfo(), clang::Decl::setLexicalDeclContext(), clang::Decl::setLocation(), clang::FunctionDecl::setParams(), clang::FunctionDecl::setStorageClass(), clang::DeclaratorDecl::setTrailingRequiresClause(), clang::ValueDecl::setType(), and clang::DeclaratorDecl::setTypeSourceInfo().
void Sema::CompleteMemberSpecialization | ( | NamedDecl * | Member, |
LookupResult & | Previous | ||
) |
Definition at line 10720 of file SemaTemplate.cpp.
References completeMemberSpecializationImpl(), clang::Function, and clang::Member.
Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
VarTemplateSpecializationDecl * Sema::CompleteVarTemplateSpecializationDecl | ( | VarTemplateSpecializationDecl * | VarSpec, |
VarDecl * | PatternDecl, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Instantiates a variable template specialization by completing it with appropriate type information and initializer.
Definition at line 5799 of file SemaTemplateInstantiateDecl.cpp.
References deduceOpenCLAddressSpace(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::TypeSourceInfo::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), InstantiateVariableInitializer(), clang::VarDecl::isThisDeclarationADefinition(), clang::OpenCL, clang::VarTemplateSpecializationDecl::setCompleteDefinition(), clang::ValueDecl::setType(), and SubstType().
Referenced by InstantiateVariableDefinition().
DeclContext * Sema::computeDeclContext | ( | const CXXScopeSpec & | SS, |
bool | EnteringContext = false |
||
) |
Compute the DeclContext that is associated with the given scope specifier.
SS | the C++ scope specifier as it appears in the source |
EnteringContext | when true, we will be entering the context of this scope specifier, so we can retrieve the declaration context of a class template or class template partial specialization even if it is not the current instantiation. |
SS
, or NULL if the declaration context cannot be computed (e.g., because it is dependent and not the current instantiation). Definition at line 74 of file SemaCXXScopeSpec.cpp.
References Context, ContextType, Depth, diagnoseMissingImport(), clang::Type::getAs(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsRecordDecl(), clang::NestedNameSpecifier::getAsType(), clang::ASTContext::getCanonicalType(), getCurrentInstantiationOf(), clang::TagType::getDecl(), clang::TemplateParameterList::getDepth(), clang::NestedNameSpecifier::getKind(), clang::CXXScopeSpec::getLastQualifierNameLoc(), clang::NamespaceAliasDecl::getNamespace(), clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::getTemplateParamLists(), clang::ASTContext::getTranslationUnitDecl(), clang::NestedNameSpecifier::Global, clang::CXXRecordDecl::hasDefinition(), hasReachableDefinition(), clang::ASTContext::hasSameType(), clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::isDependent(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isSet(), isSFINAEContext(), clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, PartialSpecialization, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
DeclContext * Sema::computeDeclContext | ( | QualType | T | ) |
Compute the DeclContext that is associated with the given type.
T | the type for which we are attempting to find a DeclContext. |
Definition at line 53 of file SemaCXXScopeSpec.cpp.
References CurContext, clang::Type::getAs(), getCurrentInstantiationOf(), clang::Type::isDependentType(), and clang::T.
Referenced by CheckBaseSpecifier(), CheckUsingDeclQualifier(), getCurrentClass(), isCurrentClassNameTypo(), isDeclaratorFunctionLike(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
void Sema::computeNRVO | ( | Stmt * | Body, |
sema::FunctionScopeInfo * | Scope | ||
) |
Given the set of return statements within a function body, compute the variables that are subject to the named return value optimization.
Each of the variables that is subject to the named return value optimization will be marked as NRVO variables in the AST, and any return statement that has a marked NRVO variable as its NRVO candidate can use the named return value optimization.
This function applies a very simplistic algorithm for NRVO: if every return statement in the scope of a variable has the same NRVO candidate, that candidate is an NRVO variable.
Definition at line 15983 of file SemaDecl.cpp.
References clang::ReturnStmt::setNRVOCandidate().
|
inlinestatic |
Definition at line 6013 of file Sema.h.
Referenced by ActOnConditionVariable().
bool Sema::ConstantFoldAttrArgs | ( | const AttributeCommonInfo & | CI, |
MutableArrayRef< Expr * > | Args | ||
) |
ConstantFoldAttrArgs - Folds attribute arguments into ConstantExprs (unless they are value dependent or type dependent).
Returns false and emits a diagnostic if one or more of the arguments could not be folded into a constant.
Result means the expression can be folded to a constant. Note.empty() means the expression is a valid constant expression in the current language mode.
Definition at line 400 of file SemaAttr.cpp.
References clang::AANT_ArgumentConstantExpr, Context, clang::ConstantExpr::Create(), clang::ImplicitCastExpr::Create(), clang::Expr::EvalStatus::Diag, clang::SemaBase::Diag(), clang::Expr::EvaluateAsConstantExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::QualType::getNonReferenceType(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::APValue::hasValue(), ImpCastExprToType(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::Expr::isLValue(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Expr::EvalResult::Val, and clang::VK_PRValue.
bool Sema::ConstraintExpressionDependsOnEnclosingTemplate | ( | const FunctionDecl * | Friend, |
unsigned | TemplateDepth, | ||
const Expr * | Constraint | ||
) |
Definition at line 1769 of file SemaTemplate.cpp.
References clang::Friend.
bool Sema::containsUnexpandedParameterPacks | ( | Declarator & | D | ) |
Determine whether the given declarator contains any unexpanded parameter packs.
This routine is used by the parser to disambiguate function declarators with an ellipsis prior to the ')', e.g.,
To determine whether we have an (unnamed) function parameter pack or a variadic function.
Definition at line 877 of file SemaTemplateVariadic.cpp.
References clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::Expr::containsUnexpandedParameterPack(), clang::NestedNameSpecifier::containsUnexpandedParameterPack(), clang::Type::containsUnexpandedParameterPack(), clang::EST_Dynamic, clang::DeclaratorChunk::FunctionTypeInfo::Exceptions, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::OpaquePtr< PtrTy >::get(), clang::Declarator::getDeclSpec(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType(), clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::CXXScopeSpec::getScopeRep(), clang::Declarator::getTrailingRequiresClause(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType(), clang::ValueDecl::getType(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeSpecType(), clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::isComputedNoexcept(), clang::QualType::isNull(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::Mem, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, clang::DeclaratorChunk::MemberPointerTypeInfo::Scope(), clang::T, clang::TST_Accum, clang::TST_atomic, clang::TST_auto, clang::TST_auto_type, clang::TST_BFloat16, clang::TST_bitint, clang::TST_bool, clang::TST_char, clang::TST_char16, clang::TST_char32, clang::TST_char8, clang::TST_class, clang::TST_decimal128, clang::TST_decimal32, clang::TST_decimal64, clang::TST_decltype, clang::TST_decltype_auto, clang::TST_double, clang::TST_enum, clang::TST_error, clang::TST_float, clang::TST_float128, clang::TST_Float16, clang::TST_Fract, clang::TST_half, clang::TST_ibm128, clang::TST_int, clang::TST_int128, clang::TST_interface, clang::TST_struct, clang::TST_typename, clang::TST_typename_pack_indexing, clang::TST_typeof_unqualExpr, clang::TST_typeof_unqualType, clang::TST_typeofExpr, clang::TST_typeofType, clang::TST_union, clang::TST_unknown_anytype, clang::TST_unspecified, clang::TST_void, clang::TST_wchar, and clang::DeclaratorChunk::TypeAndRange::Ty.
bool Sema::ConvertArgumentsForCall | ( | CallExpr * | Call, |
Expr * | Fn, | ||
FunctionDecl * | FDecl, | ||
const FunctionProtoType * | Proto, | ||
ArrayRef< Expr * > | Args, | ||
SourceLocation | RParenLoc, | ||
bool | IsExecConfig = false |
||
) |
ConvertArgumentsForCall - Converts the arguments specified in Args/NumArgs to the parameter types of the function FDecl with function prototype Proto.
Call is the call expression itself, and Fn is the function expression. For a C++ member function, this routine does not attempt to convert the object argument. Returns true if the call is ill-formed.
Definition at line 5891 of file SemaExpr.cpp.
References clang::FunctionDecl::getBuiltinID(), and ID.
Sema::DeclGroupPtrTy Sema::ConvertDeclToDeclGroup | ( | Decl * | Ptr, |
Decl * | OwnedType = nullptr |
||
) |
Definition at line 69 of file SemaDecl.cpp.
References clang::DeclGroupRef::Create().
Referenced by buildCoroutineParameterMoves(), and clang::Parser::ParseTopLevelDecl().
ExprResult Sema::ConvertMemberDefaultInitExpression | ( | FieldDecl * | FD, |
Expr * | InitExpr, | ||
SourceLocation | InitLoc | ||
) |
Definition at line 4199 of file SemaDeclCXX.cpp.
References clang::InitializationKind::CreateCopy(), clang::InitializationKind::CreateDirectList(), clang::Stmt::getBeginLoc(), clang::Stmt::getEndLoc(), clang::FieldDecl::getInClassInitStyle(), clang::ICIS_ListInit, clang::InitializedEntity::InitializeMemberFromDefaultMemberInitializer(), and clang::Seq.
Referenced by ActOnFinishCXXInClassMemberInitializer().
ExprResult Sema::ConvertParamDefaultArgument | ( | ParmVarDecl * | Param, |
Expr * | DefaultArg, | ||
SourceLocation | EqualLoc | ||
) |
Definition at line 284 of file SemaDeclCXX.cpp.
References Context, clang::InitializationKind::CreateCopy(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::InitializedEntity::InitializeParameter(), MaybeCreateExprWithCleanups(), clang::InitializationSequence::Perform(), and RequireCompleteType().
Referenced by ActOnParamDefaultArgument(), and SubstDefaultArgument().
ExprResult Sema::ConvertVectorExpr | ( | Expr * | E, |
TypeSourceInfo * | TInfo, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RParenLoc | ||
) |
ConvertVectorExpr - Handle __builtin_convertvector.
Definition at line 8595 of file SemaChecking.cpp.
References clang::Type::castAs(), Diag(), clang::ExprError(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::Type::isDependentType(), clang::Type::isVectorType(), clang::OK_Ordinary, and clang::VK_PRValue.
Referenced by clang::TreeTransform< Derived >::RebuildConvertVectorExpr().
ExprResult Sema::CorrectDelayedTyposInExpr | ( | Expr * | E, |
VarDecl * | InitDecl = nullptr , |
||
bool | RecoverUncorrectedTypos = false , |
||
llvm::function_ref< ExprResult(Expr *)> | Filter = [](Expr *E) -> ExprResult { return E; } |
||
) |
Process any TypoExprs in the given Expr and its children, generating diagnostics as appropriate and returning a new Expr if there were typos that were all successfully corrected and ExprError if one or more typos could not be corrected.
E | The Expr to check for TypoExprs. |
InitDecl | A VarDecl to avoid because the Expr being corrected is its initializer. |
RecoverUncorrectedTypos | If true, when typo correction fails, it will rebuild the given Expr with all TypoExprs degraded to RecoveryExprs. |
Filter | A function applied to a newly rebuilt Expr to determine if it is an acceptable/usable result from a single combination of typo corrections. As long as the filter returns ExprError, different combinations of corrections will be tried until all are exhausted. |
Definition at line 9061 of file SemaExprCXX.cpp.
References CreateRecoveryExpr(), ExprEvalContexts, clang::tooling::Filter, clang::TypoExpr::getBeginLoc(), clang::TypoExpr::getEndLoc(), clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::SemaBase::SemaRef.
Referenced by ActOnCXXTypeConstructExpr(), ActOnFinishCXXInClassMemberInitializer(), ActOnFinishFullExpr(), ActOnRequiresClause(), CheckPackExpansion(), FinishForRangeVarDecl(), clang::Parser::ParseConstraintExpression(), clang::Parser::ParseConstraintLogicalAndExpression(), clang::Parser::ParseConstraintLogicalOrExpression(), and clang::Parser::ParseOpenMPVarList().
|
inline |
TypoCorrection Sema::CorrectTypo | ( | const DeclarationNameInfo & | TypoName, |
Sema::LookupNameKind | LookupKind, | ||
Scope * | S, | ||
CXXScopeSpec * | SS, | ||
CorrectionCandidateCallback & | CCC, | ||
CorrectTypoKind | Mode, | ||
DeclContext * | MemberContext = nullptr , |
||
bool | EnteringContext = false , |
||
const ObjCObjectPointerType * | OPT = nullptr , |
||
bool | RecordFailure = true |
||
) |
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to the name that was present in the source code.
TypoName | the DeclarationNameInfo structure that contains the name that was present in the source code along with its location. |
LookupKind | the name-lookup criteria used to search for the name. |
S | the scope in which name lookup occurs. |
SS | the nested-name-specifier that precedes the name we're looking for, if present. |
CCC | A CorrectionCandidateCallback object that provides further validation of typo correction candidates. It also provides flags for determining the set of keywords permitted. |
MemberContext | if non-NULL, the context in which to look for a member access expression. |
EnteringContext | whether we're entering the context described by the nested-name-specifier SS. |
OPT | when non-NULL, the search for visible declarations will also walk the protocols in the qualified interfaces of OPT . |
TypoCorrection
containing the corrected name if the typo along with information such as the NamedDecl
where the corrected name was declared, and any additional NestedNameSpecifier
needed to access it (C++ only). The TypoCorrection
is empty if there is no correction. Definition at line 5459 of file SemaLookup.cpp.
Referenced by clang::SemaObjC::FindProtocolDeclaration(), clang::SemaObjC::getObjCInterfaceDecl(), and clang::SemaOpenMP::lookupOpenMPDeclareTargetName().
TypoExpr * Sema::CorrectTypoDelayed | ( | const DeclarationNameInfo & | TypoName, |
Sema::LookupNameKind | LookupKind, | ||
Scope * | S, | ||
CXXScopeSpec * | SS, | ||
CorrectionCandidateCallback & | CCC, | ||
TypoDiagnosticGenerator | TDG, | ||
TypoRecoveryCallback | TRC, | ||
CorrectTypoKind | Mode, | ||
DeclContext * | MemberContext = nullptr , |
||
bool | EnteringContext = false , |
||
const ObjCObjectPointerType * | OPT = nullptr |
||
) |
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to the name that was present in the source code.
TypoName | the DeclarationNameInfo structure that contains the name that was present in the source code along with its location. |
LookupKind | the name-lookup criteria used to search for the name. |
S | the scope in which name lookup occurs. |
SS | the nested-name-specifier that precedes the name we're looking for, if present. |
CCC | A CorrectionCandidateCallback object that provides further validation of typo correction candidates. It also provides flags for determining the set of keywords permitted. |
TDG | A TypoDiagnosticGenerator functor that will be used to print diagnostics when the actual typo correction is attempted. |
TRC | A TypoRecoveryCallback functor that will be used to build an Expr from a typo correction candidate. |
MemberContext | if non-NULL, the context in which to look for a member access expression. |
EnteringContext | whether we're entering the context described by the nested-name-specifier SS. |
OPT | when non-NULL, the search for visible declarations will also walk the protocols in the qualified interfaces of OPT . |
TypoExpr
that will later be replaced in the AST with an Expr representing the result of performing typo correction, or nullptr if typo correction is not possible. If nullptr is returned, no diagnostics will be emitted and it is the responsibility of the caller to emit any that are needed. Definition at line 5594 of file SemaLookup.cpp.
AMDGPUFlatWorkGroupSizeAttr* clang::Sema::CreateAMDGPUFlatWorkGroupSizeAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | Min, | ||
Expr * | Max | ||
) |
Create an AMDGPUWavesPerEUAttr attribute.
AMDGPUMaxNumWorkGroupsAttr* clang::Sema::CreateAMDGPUMaxNumWorkGroupsAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | XExpr, | ||
Expr * | YExpr, | ||
Expr * | ZExpr | ||
) |
Create an AMDGPUMaxNumWorkGroupsAttr attribute.
AMDGPUWavesPerEUAttr* clang::Sema::CreateAMDGPUWavesPerEUAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | Min, | ||
Expr * | Max | ||
) |
Create an AMDGPUWavesPerEUAttr attribute.
FunctionDecl * Sema::CreateBuiltin | ( | IdentifierInfo * | II, |
QualType | Type, | ||
unsigned | ID, | ||
SourceLocation | Loc | ||
) |
Definition at line 2364 of file SemaDecl.cpp.
References Parent.
ExprResult Sema::CreateBuiltinArraySubscriptExpr | ( | Expr * | Base, |
SourceLocation | LLoc, | ||
Expr * | Idx, | ||
SourceLocation | RLoc | ||
) |
Definition at line 5237 of file SemaExpr.cpp.
References clang::CPlusPlus11, clang::ExprError(), clang::Type::getAs(), getDependentArraySubscriptType(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Type::isDependentType(), clang::Type::isSubscriptableVectorType(), clang::OK_Ordinary, clang::VK_LValue, and clang::VK_XValue.
Referenced by CreateOverloadedArraySubscriptExpr().
ExprResult Sema::CreateBuiltinBinOp | ( | SourceLocation | OpLoc, |
BinaryOperatorKind | Opc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) |
CreateBuiltinBinOp - Creates a new built-in binary operation with operator Opc
at location TokLoc
.
This routine only supports built-in operations; ActOnBinOp handles overloaded operators.
Definition at line 14759 of file SemaExpr.cpp.
References CheckCommaOperands(), checkObjCPointerIntrospection(), CorrectDelayedTyposInBinOp(), clang::CPlusPlus, clang::CPlusPlus11, clang::InitializationKind::CreateDirectList(), Diag(), DiagnoseSelfAssignment(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsCXXRecordDecl(), clang::Stmt::getBeginLoc(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), clang::Expr::getObjectKind(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::Expr::IgnoreParens(), clang::InitializedEntity::InitializeTemporary(), clang::Type::isAtomicType(), clang::Type::isBlockPointerType(), clang::Type::isImageType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isPipeType(), clang::Type::isSamplerT(), clang::ActionResult< PtrTy, Compress >::isUsable(), isVector(), clang::OK_ObjCProperty, clang::OK_Ordinary, clang::OpenCL, clang::InitializationSequence::Perform(), RecordModifiableNonNullParam(), and clang::VK_PRValue.
Referenced by CreateOverloadedBinOp(), and clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
ExprResult Sema::CreateBuiltinMatrixSubscriptExpr | ( | Expr * | Base, |
Expr * | RowIdx, | ||
Expr * | ColumnIdx, | ||
SourceLocation | RBLoc | ||
) |
Definition at line 5122 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
ExprResult Sema::CreateBuiltinUnaryOp | ( | SourceLocation | OpLoc, |
UnaryOperatorKind | Opc, | ||
Expr * | InputExpr, | ||
bool | IsAfterAmp = false |
||
) |
Definition at line 15448 of file SemaExpr.cpp.
References Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::HLSL, clang::Type::isAtomicType(), clang::Type::isBlockPointerType(), clang::Type::isImageType(), clang::Type::isPipeType(), clang::Type::isSamplerT(), clang::Type::isSpecificBuiltinType(), clang::Expr::isTypeDependent(), clang::SourceLocation::isValid(), clang::OK_Ordinary, clang::OpenCL, and clang::VK_PRValue.
Referenced by clang::SemaOpenMP::ActOnOpenMPAffinityClause(), clang::SemaOpenMP::ActOnOpenMPDependClause(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), DefineImplicitLambdaToBlockPointerConversion(), FixOverloadedFunctionReference(), and clang::SemaOpenMP::getOpenMPCapturedExpr().
RecordDecl * Sema::CreateCapturedStmtRecordDecl | ( | CapturedDecl *& | CD, |
SourceLocation | Loc, | ||
unsigned | NumParams | ||
) |
Definition at line 4488 of file SemaStmt.cpp.
References clang::CPlusPlus, clang::CXXRecordDecl::Create(), clang::DeclContext::getParent(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), and clang::DeclContext::isRecord().
ExprResult Sema::CreateGenericSelectionExpr | ( | SourceLocation | KeyLoc, |
SourceLocation | DefaultLoc, | ||
SourceLocation | RParenLoc, | ||
bool | PredicateIsExpr, | ||
void * | ControllingExprOrType, | ||
ArrayRef< TypeSourceInfo * > | Types, | ||
ArrayRef< Expr * > | Exprs | ||
) |
ControllingExprOrType is either a TypeSourceInfo * or an Expr *.
FIXME: it'd be better to split this interface into two so we don't take a void *, but see the FIXME on ActOnGenericSelectionExpr as to why that isn't a trivial change.
Definition at line 1746 of file SemaExpr.cpp.
void Sema::createImplicitModuleImportForErrorRecovery | ( | SourceLocation | Loc, |
Module * | Mod | ||
) |
Create an implicit import of the given module at the given source location, for error recovery, if possible.
This routine is typically used when an entity found by name lookup is actually hidden within a module that we know about but the user has forgotten to import.
Definition at line 823 of file SemaModule.cpp.
References clang::DeclContext::addDecl(), clang::Module::AllVisible, clang::ImportDecl::CreateImplicit(), clang::Decl::getTranslationUnitDecl(), and Loc.
Referenced by diagnoseMissingImport().
CXXMethodDecl * Sema::CreateLambdaCallOperator | ( | SourceRange | IntroducerRange, |
CXXRecordDecl * | Class | ||
) |
Definition at line 972 of file SemaLambda.cpp.
CXXRecordDecl * Sema::createLambdaClosureType | ( | SourceRange | IntroducerRange, |
TypeSourceInfo * | Info, | ||
unsigned | LambdaDependencyKind, | ||
LambdaCaptureDefault | CaptureDefault | ||
) |
Create a new lambda closure type.
Definition at line 248 of file SemaLambda.cpp.
References clang::Class, clang::CXXRecordDecl::CreateLambda(), getGenericLambdaTemplateParameterList(), clang::DeclContext::getParent(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), and clang::DeclContext::isRecord().
VarDecl * Sema::createLambdaInitCaptureVarDecl | ( | SourceLocation | Loc, |
QualType | InitCaptureType, | ||
SourceLocation | EllipsisLoc, | ||
IdentifierInfo * | Id, | ||
unsigned | InitStyle, | ||
Expr * | Init, | ||
DeclContext * | DeclCtx | ||
) |
Create a dummy variable within the declcontext of the lambda's call operator, for name lookup purposes for a lambda init capture.
CodeGen handles emission of lambda captures, ignoring these dummy variables appropriately.
Definition at line 849 of file SemaLambda.cpp.
CUDALaunchBoundsAttr* clang::Sema::CreateLaunchBoundsAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | MaxThreads, | ||
Expr * | MinBlocks, | ||
Expr * | MaxBlocks | ||
) |
Create an CUDALaunchBoundsAttr attribute.
MaterializeTemporaryExpr * Sema::CreateMaterializeTemporaryExpr | ( | QualType | T, |
Expr * | Temporary, | ||
bool | BoundToLvalueReference | ||
) |
Definition at line 8529 of file SemaInit.cpp.
References Cleanup, Context, ExprEvalContexts, isInLifetimeExtendingContext(), clang::CleanupInfo::setExprNeedsCleanups(), and clang::T.
Referenced by ImpCastExprToType(), and TemporaryMaterializationConversion().
ExprResult Sema::CreateOverloadedArraySubscriptExpr | ( | SourceLocation | LLoc, |
SourceLocation | RLoc, | ||
Expr * | Base, | ||
MultiExprArg | Args | ||
) |
Definition at line 15220 of file SemaOverload.cpp.
References AA_Passing, AddBuiltinOperatorCandidates(), AddMemberOperatorCandidates(), clang::OverloadCandidateSet::BestViableFunction(), clang::Type::castAs(), checkArgPlaceholdersForOverload(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), CheckMemberOperatorAccess(), Context, clang::CXXOperatorCallExpr::Create(), CreateBuiltinArraySubscriptExpr(), CreateFunctionRefExpr(), CreateUnresolvedLookupExpr(), clang::OverloadCandidateSet::CSK_Operator, CurFPFeatureOverrides(), clang::ASTContext::DeclarationNames, clang::ASTContext::DependentTy, clang::OverloadCandidateSet::empty(), clang::ExprError(), clang::ForBuiltinOverloadedOp, clang::ActionResult< PtrTy, Compress >::get(), clang::DeclarationNameTable::getCXXOperatorName(), clang::DeclarationNameInfo::getInfo(), clang::DeclarationNameInfo::getLoc(), clang::QualType::getNonLValueExprType(), clang::FunctionDecl::getReturnType(), clang::tooling::fixit::internal::getSourceRange(), clang::StringLiteral::getString(), clang::ValueDecl::getType(), clang::Expr::getValueKindForType(), clang::Expr::hasAnyTypeDependentArguments(), InitializeExplicitObjectArgument(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), MaybeBindToTemporary(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, PDiag(), PerformImplicitConversion(), PerformImplicitObjectArgumentInitialization(), PrepareArgumentsForCallToObjectOfClassType(), Range, clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::OverloadCandidateSet::size(), and clang::VK_PRValue.
ExprResult Sema::CreateOverloadedBinOp | ( | SourceLocation | OpLoc, |
BinaryOperatorKind | Opc, | ||
const UnresolvedSetImpl & | Fns, | ||
Expr * | LHS, | ||
Expr * | RHS, | ||
bool | PerformADL = true , |
||
bool | AllowRewrittenCandidates = true , |
||
FunctionDecl * | DefaultedFn = nullptr |
||
) |
Create a binary operation that may resolve to an overloaded operator.
OpLoc | The location of the operator itself (e.g., '+'). |
Opc | The BinaryOperatorKind that describes this operator. |
Fns | The set of non-member functions that will be considered by overload resolution. The caller needs to build this set based on the context using, e.g., LookupOverloadedOperatorName() and ArgumentDependentLookup(). This set should not contain any member functions; those will be added by CreateOverloadedBinOp(). |
LHS | Left-hand argument. |
RHS | Right-hand argument. |
PerformADL | Whether to consider operator candidates found by ADL. |
AllowRewrittenCandidates | Whether to consider candidates found by C++20 operator rewrites. |
DefaultedFn | If we are synthesizing a defaulted operator function, the function in question. Such a function is never a candidate in our overload resolution. This also enables synthesizing a three-way comparison from < and == as described in C++20 [class.spaceship]p1. |
Definition at line 14628 of file SemaOverload.cpp.
References AA_Passing, allowAmbiguity(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), clang::OverloadCandidateSet::BestViableFunction(), clang::ImplicitConversionSequence::Better, BuildSynthesizedThreeWayComparison(), checkCall(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckMemberOperatorAccess(), CheckPlaceholderExpr(), checkPlaceholderForOverload(), CompareImplicitConversionSequences(), clang::OverloadCandidateSet::CompleteCandidates(), Context, clang::CPlusPlus20, clang::IntegerLiteral::Create(), clang::BinaryOperator::Create(), clang::CompoundAssignOperator::Create(), clang::CXXOperatorCallExpr::Create(), CreateBuiltinBinOp(), CreateBuiltinUnaryOp(), CreateFunctionRefExpr(), CreateUnresolvedLookupExpr(), clang::CRK_DifferentOperator, clang::CRK_None, clang::OverloadCandidateSet::CSK_Operator, CurFPFeatureOverrides(), clang::ASTContext::DeclarationNames, clang::declaresSameEntity(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), diagnoseNullableToNonnullConversion(), DiagnoseSelfMove(), DiagnoseTwoPhaseOperatorLookup(), clang::UnresolvedSetImpl::empty(), clang::Sema::CodeSynthesisContext::Entity, clang::OverloadCandidateSet::exclude(), clang::ExprError(), clang::ForBuiltinOverloadedOp, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::DeclarationNameTable::getCXXOperatorName(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), getDefaultedFunctionKind(), getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonLValueExprType(), clang::BinaryOperator::getOpcodeStr(), clang::getOperatorSpelling(), clang::BinaryOperator::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::ASTContext::getPointerType(), clang::FunctionDecl::getReturnType(), clang::OverloadCandidateSet::getRewriteInfo(), clang::Stmt::getSourceRange(), clang::tooling::fixit::internal::getSourceRange(), clang::StringLiteral::getString(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::Expr::getValueKindForType(), clang::ASTContext::hasSameUnqualifiedType(), InitializeExplicitObjectArgument(), clang::InitializedEntity::InitializeParameter(), clang::ASTContext::IntTy, clang::Type::isBooleanType(), clang::Sema::DefaultedFunctionKind::isComparison(), clang::BinaryOperator::isCompoundAssignmentOp(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), isImplicitlyDeleted(), clang::CXXMethodDecl::isImplicitObjectMemberFunction(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), isRecordType(), clang::OverloadCandidateSet::OperatorRewriteInfo::isReversible(), clang::Sema::DefaultedFunctionKind::isSpecialMember(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Sema::CodeSynthesisContext::Kind, LookupOverloadedBinOp(), MaybeBindToTemporary(), clang::OverloadCandidateSet::NoteCandidates(), NoteDeletedFunction(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OK_ObjCProperty, clang::OK_Ordinary, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, PDiag(), PerformCopyInitialization(), PerformImplicitConversion(), PerformImplicitObjectArgumentInitialization(), popCodeSynthesisContext(), pushCodeSynthesisContext(), clang::Sema::CodeSynthesisContext::RewritingOperatorAsSpaceship, clang::OverloadCandidateSet::shouldDeferDiags(), clang::OverloadCandidateSet::size(), VariadicDoesNotApply, clang::VK_LValue, and clang::VK_PRValue.
Referenced by BuildSynthesizedThreeWayComparison(), and clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
ExprResult Sema::CreateOverloadedUnaryOp | ( | SourceLocation | OpLoc, |
UnaryOperatorKind | Opc, | ||
const UnresolvedSetImpl & | Fns, | ||
Expr * | Input, | ||
bool | PerformADL = true |
||
) |
Create a unary operation that may resolve to an overloaded operator.
OpLoc | The location of the operator itself (e.g., '*'). |
Opc | The UnaryOperatorKind that describes this operator. |
Fns | The set of non-member functions that will be considered by overload resolution. The caller needs to build this set based on the context using, e.g., LookupOverloadedOperatorName() and ArgumentDependentLookup(). This set should not contain any member functions; those will be added by CreateOverloadedUnaryOp(). |
Input | The input argument. |
Definition at line 14347 of file SemaOverload.cpp.
References AA_Passing, AddArgumentDependentLookupCandidates(), AddBuiltinOperatorCandidates(), AddMemberOperatorCandidates(), AddNonMemberOperatorCandidates(), clang::OverloadCandidateSet::BestViableFunction(), clang::Type::castAs(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), CheckMemberOperatorAccess(), checkPlaceholderForOverload(), Context, clang::IntegerLiteral::Create(), clang::UnaryOperator::Create(), clang::CXXOperatorCallExpr::Create(), CreateBuiltinUnaryOp(), CreateFunctionRefExpr(), CreateUnresolvedLookupExpr(), clang::OverloadCandidateSet::CSK_Operator, CurFPFeatureOverrides(), clang::ASTContext::DeclarationNames, clang::ASTContext::DependentTy, DiagnoseTwoPhaseOperatorLookup(), clang::UnresolvedSetImpl::empty(), clang::ExprError(), clang::ForBuiltinOverloadedOp, clang::ActionResult< PtrTy, Compress >::get(), clang::DeclarationNameTable::getCXXOperatorName(), clang::QualType::getNonLValueExprType(), clang::UnaryOperator::getOpcodeStr(), clang::UnaryOperator::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getReturnType(), clang::Stmt::getSourceRange(), clang::StringLiteral::getString(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::Expr::getValueKindForType(), InitializeExplicitObjectArgument(), clang::InitializedEntity::InitializeParameter(), clang::ASTContext::IntTy, clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), MaybeBindToTemporary(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OK_Ordinary, clang::OO_None, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, PDiag(), PerformCopyInitialization(), PerformImplicitConversion(), PerformImplicitObjectArgumentInitialization(), clang::OverloadCandidateSet::size(), clang::VK_LValue, and clang::VK_PRValue.
Referenced by clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
ParsedType Sema::CreateParsedType | ( | QualType | T, |
TypeSourceInfo * | TInfo | ||
) |
Package the given type and TSI into a ParsedType.
Create a LocInfoType to hold the given QualType and TypeSourceInfo.
Definition at line 6376 of file SemaType.cpp.
References BumpAlloc, clang::Type::getTypeClass(), clang::OpaquePtr< QualType >::make(), and clang::T.
Referenced by ActOnPackExpansion(), and ActOnTypeName().
ExprResult Sema::CreateRecoveryExpr | ( | SourceLocation | Begin, |
SourceLocation | End, | ||
ArrayRef< Expr * > | SubExprs, | ||
QualType | T = QualType() |
||
) |
Attempts to produce a RecoveryExpr after some AST node cannot be created.
Definition at line 21065 of file SemaExpr.cpp.
Referenced by ActOnCXXTypeConstructExpr(), ActOnParamDefaultArgumentError(), BuildBaseInitializer(), BuildDelegatingInitializer(), BuildMemberInitializer(), CorrectDelayedTyposInExpr(), diagnoseNoViableConversion(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
ExprResult Sema::CreateUnaryExprOrTypeTraitExpr | ( | Expr * | E, |
SourceLocation | OpLoc, | ||
UnaryExprOrTypeTrait | ExprKind | ||
) |
Build a sizeof or alignof expression given an expression operand.
Definition at line 4751 of file SemaExpr.cpp.
References CheckAlignOfExpr(), Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isInvalid(), clang::Expr::isTypeDependent(), clang::Type::isVariableArrayType(), and clang::Expr::refersToBitField().
ExprResult Sema::CreateUnaryExprOrTypeTraitExpr | ( | TypeSourceInfo * | TInfo, |
SourceLocation | OpLoc, | ||
UnaryExprOrTypeTrait | ExprKind, | ||
SourceRange | R | ||
) |
Build a sizeof or alignof expression given a type operand.
Definition at line 4723 of file SemaExpr.cpp.
References clang::ExprError(), clang::getTraitSpelling(), clang::TypeSourceInfo::getType(), clang::Type::isDependentType(), clang::Type::isVariablyModifiedType(), and clang::T.
ExprResult Sema::CreateUnresolvedLookupExpr | ( | CXXRecordDecl * | NamingClass, |
NestedNameSpecifierLoc | NNSLoc, | ||
DeclarationNameInfo | DNI, | ||
const UnresolvedSetImpl & | Fns, | ||
bool | PerformADL = true |
||
) |
Definition at line 14244 of file SemaOverload.cpp.
References clang::UnresolvedSetImpl::begin(), Context, clang::UnresolvedLookupExpr::Create(), and clang::UnresolvedSetImpl::end().
Referenced by CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), and CreateOverloadedUnaryOp().
|
inline |
Definition at line 1002 of file Sema.h.
Referenced by BuildArrayType(), BuildCXXConstructExpr(), clang::SemaBase::Diag(), GetDeclSpecTypeForDeclarator(), InstantiateVariableInitializer(), IsOverloadOrOverrideImpl(), isUsualDeallocationFunction(), MarkVarDeclODRUsed(), and resolveAddressOfSingleOverloadCandidate().
|
inline |
Definition at line 1449 of file Sema.h.
References FpPragmaStack.
Referenced by ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), BuildCStyleCastExpr(), BuildCXXFunctionalCastExpr(), BuildCXXNamedCast(), BuildLiteralOperatorCall(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), FixOverloadedFunctionReference(), ImpCastExprToType(), recordConversion(), and setExceptionMode().
|
inline |
Definition at line 5319 of file Sema.h.
References ExprEvalContexts.
Referenced by clang::SemaCUDA::CheckCall(), isAlwaysConstantEvaluatedContext(), isCheckingDefaultArgumentOrInitializer(), isConstantEvaluatedContext(), isImmediateFunctionContext(), and isUnevaluatedContext().
|
inline |
|
inline |
QualType Sema::CXXCheckConditionalOperands | ( | ExprResult & | Cond, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
ExprValueKind & | VK, | ||
ExprObjectKind & | OK, | ||
SourceLocation | QuestionLoc | ||
) |
Check the operands of ?: under C++ semantics.
See C++ [expr.cond]. Note that LHS is never null, even for the GNU x ?: y extension. In this case, LHS == Cond. (But they're not aliases.)
This function also implements GCC's vector extension and the OpenCL/ext_vector_type extension for conditionals. The vector extensions permit the use of a?b:c where the type of a is that of a integer vector with the same number of elements and size as the vectors of b and c. If one of either b or c is a scalar it is implicitly converted to match the type of the vector. Otherwise the expression is ill-formed. If both b and c are scalars, then b and c are checked and converted to the type of a if possible.
The expressions are evaluated differently for GCC's and OpenCL's extensions. For the GCC extension, the ?: operator is evaluated as (a[0] != 0 ? b[0] : c[0], .. , a[n] != 0 ? b[n] : c[n]). For the OpenCL extensions, the ?: operator is evaluated as (most-significant-bit-set(a[0]) ? b[0] : c[0], .. , most-significant-bit-set(a[n]) ? b[n] : c[n]).
Definition at line 6840 of file SemaExprCXX.cpp.
References ACK_Conditional, CheckCXXBooleanCondition(), CheckSizelessVectorConditionalTypes(), CheckVectorConditionalTypes(), CheckVectorOperands(), CompareReferenceRelationship(), Context, ConvertForConditional(), DefaultFunctionArrayLvalueConversion(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), DiagnoseConditionalForNull(), clang::SemaObjC::FindCompositeObjCPointerType(), FindCompositePointerType(), FindConditionalOverload(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::ASTContext::getCommonSugaredType(), clang::Expr::getObjectKind(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::ASTContext::hasSameType(), clang::Expr::IgnoreParenImpCasts(), ImpCastExprToType(), clang::InitializedEntity::InitializeTemporary(), clang::Type::isArithmeticType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isOrdinaryOrBitFieldObject(), clang::Type::isRecordType(), clang::Expr::isTypeDependent(), isValidSizelessVectorForConditionalCondition(), isValidVectorForConditionalCondition(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::Type::isWebAssemblyTableType(), ObjC(), clang::OK_BitField, clang::OK_Ordinary, PerformCopyInitialization(), PrepareScalarCast(), Ref_Compatible, clang::Expr::refersToBitField(), clang::Expr::refersToVectorElement(), TryClassUnification(), UsualArithmeticConversions(), and clang::VK_PRValue.
FunctionTemplateDecl * Sema::DeclareAggregateDeductionGuideFromInitList | ( | TemplateDecl * | Template, |
MutableArrayRef< QualType > | ParamTypes, | ||
SourceLocation | Loc | ||
) |
Definition at line 3252 of file SemaTemplate.cpp.
References clang::Aggregate, clang::AliasTemplate, clang::Decl::getDeclContext(), clang::CXXRecordDecl::getDefinition(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::TemplateDecl::getTemplatedDecl(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::ClassTemplateDecl::getTemplatedDecl(), ID, clang::DeclContext::isDependentContext(), Loc, clang::Sema::ContextRAII::pop(), clang::FunctionProtoType::Profile(), and clang::T.
void Sema::DeclareGlobalAllocationFunction | ( | DeclarationName | Name, |
QualType | Return, | ||
ArrayRef< QualType > | Params | ||
) |
DeclareGlobalAllocationFunction - Declares a single implicit global allocation function if it doesn't already exist.
Definition at line 3202 of file SemaExprCXX.cpp.
Referenced by DeclareGlobalNewDelete().
void Sema::DeclareGlobalNewDelete | ( | ) |
DeclareGlobalNewDelete - Declare the global forms of operator new and delete.
These are:
Note that the placement and nothrow forms of new are not implicitly declared. Their use requires including <new>.
Definition at line 3071 of file SemaExprCXX.cpp.
References clang::Class, Context, clang::CPlusPlus11, clang::EnumDecl::Create(), clang::CXXRecordDecl::Create(), clang::ASTContext::DeclarationNames, DeclareGlobalAllocationFunction(), clang::IdentifierTable::get(), getCurrentModule(), clang::DeclarationNameTable::getCXXOperatorName(), clang::Preprocessor::getIdentifierTable(), getLangOpts(), getOrCreateStdNamespace(), clang::ASTContext::getPointerType(), clang::ASTContext::getSizeType(), getStdAlignValT(), getStdBadAlloc(), clang::ASTContext::getTypeDeclType(), GlobalNewDeleteDeclared, PP, clang::Decl::ReachableWhenImported, clang::Decl::setImplicit(), clang::Decl::setLocalOwningModule(), clang::Decl::setModuleOwnershipKind(), StdAlignValT, StdBadAlloc, and clang::ASTContext::VoidTy.
Referenced by FindAllocationFunctions().
CXXMethodDecl * Sema::DeclareImplicitCopyAssignment | ( | CXXRecordDecl * | ClassDecl | ) |
Declare the implicit copy assignment operator for the given class.
ClassDecl | The class declaration into which the implicit copy assignment operator will be added. |
Definition at line 14920 of file SemaDeclCXX.cpp.
References clang::Constexpr, Context, clang::CopyAssignment, clang::Default, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getAddrSpaceQualType(), getDefaultCXXMethodAddrSpace(), clang::ASTContext::getElaboratedType(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getTypeDeclType(), clang::CXXRecordDecl::implicitCopyAssignmentHasConstParam(), clang::CXXRecordDecl::needsImplicitCopyAssignment(), clang::None, and clang::QualType::withConst().
Referenced by AddImplicitlyDeclaredMembersToClass().
CXXConstructorDecl * Sema::DeclareImplicitCopyConstructor | ( | CXXRecordDecl * | ClassDecl | ) |
Declare the implicit copy constructor for the given class.
ClassDecl | The class declaration into which the implicit copy constructor will be added. |
Definition at line 15667 of file SemaDeclCXX.cpp.
References clang::Constexpr, Context, clang::CopyConstructor, clang::Default, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getAddrSpaceQualType(), getDefaultCXXMethodAddrSpace(), clang::ASTContext::getElaboratedType(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getTypeDeclType(), clang::CXXRecordDecl::implicitCopyConstructorHasConstParam(), clang::CXXRecordDecl::needsImplicitCopyConstructor(), clang::None, and clang::QualType::withConst().
Referenced by AddImplicitlyDeclaredMembersToClass().
void Sema::DeclareImplicitDeductionGuides | ( | TemplateDecl * | Template, |
SourceLocation | Loc | ||
) |
Declare implicit deduction guides for a class template if we've not already done so.
Definition at line 3318 of file SemaTemplate.cpp.
References clang::AliasTemplate, clang::Copy, clang::Decl::getCanonicalDecl(), clang::Decl::getDeclContext(), clang::CXXRecordDecl::getDefinition(), clang::TemplateDecl::getTemplatedDecl(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::ClassTemplateDecl::getTemplatedDecl(), clang::DeclContext::isDependentContext(), clang::FunctionDecl::isFunctionTemplateSpecialization(), clang::Decl::isImplicit(), clang::Decl::isInvalidDecl(), Loc, P, clang::FunctionDecl::parameters(), and clang::Sema::ContextRAII::pop().
CXXConstructorDecl * Sema::DeclareImplicitDefaultConstructor | ( | CXXRecordDecl * | ClassDecl | ) |
Declare the implicit default constructor for the given class.
ClassDecl | The class declaration into which the implicit default constructor will be added. |
Definition at line 14000 of file SemaDeclCXX.cpp.
References clang::Constexpr, Context, clang::DefaultConstructor, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getCanonicalType(), clang::Decl::getLocation(), clang::ASTContext::getTypeDeclType(), and clang::CXXRecordDecl::needsImplicitDefaultConstructor().
Referenced by AddImplicitlyDeclaredMembersToClass().
CXXDestructorDecl * Sema::DeclareImplicitDestructor | ( | CXXRecordDecl * | ClassDecl | ) |
Declare the implicit destructor for the given class.
ClassDecl | The class declaration into which the implicit destructor will be added. |
Definition at line 14290 of file SemaDeclCXX.cpp.
References clang::Constexpr, Context, defaultedSpecialMemberIsConstexpr(), clang::Destructor, clang::ASTContext::getCanonicalType(), clang::Decl::getLocation(), clang::ASTContext::getTypeDeclType(), and clang::CXXRecordDecl::needsImplicitDestructor().
Referenced by AddImplicitlyDeclaredMembersToClass().
void Sema::DeclareImplicitEqualityComparison | ( | CXXRecordDecl * | RD, |
FunctionDecl * | Spaceship | ||
) |
Definition at line 9147 of file SemaDeclCXX.cpp.
References clang::Sema::CodeSynthesisContext::DeclaringImplicitEqualityComparison, clang::Sema::CodeSynthesisContext::Entity, clang::Sema::CodeSynthesisContext::Kind, clang::Sema::CodeSynthesisContext::PointOfInstantiation, popCodeSynthesisContext(), pushCodeSynthesisContext(), clang::prec::Spaceship, and SubstSpaceshipAsEqualEqual().
Referenced by AddImplicitlyDeclaredMembersToClass().
CXXMethodDecl * Sema::DeclareImplicitMoveAssignment | ( | CXXRecordDecl * | ClassDecl | ) |
Declare the implicit move assignment operator for the given class.
ClassDecl | The Class declaration into which the implicit move assignment operator will be added. |
Definition at line 15277 of file SemaDeclCXX.cpp.
References clang::Constexpr, Context, clang::Default, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getAddrSpaceQualType(), getDefaultCXXMethodAddrSpace(), clang::ASTContext::getElaboratedType(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getRValueReferenceType(), clang::ASTContext::getTypeDeclType(), clang::MoveAssignment, clang::CXXRecordDecl::needsImplicitMoveAssignment(), and clang::None.
Referenced by AddImplicitlyDeclaredMembersToClass().
CXXConstructorDecl * Sema::DeclareImplicitMoveConstructor | ( | CXXRecordDecl * | ClassDecl | ) |
Declare the implicit move constructor for the given class.
ClassDecl | The Class declaration into which the implicit move constructor will be added. |
Definition at line 15818 of file SemaDeclCXX.cpp.
References clang::Constexpr, Context, clang::Default, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getAddrSpaceQualType(), getDefaultCXXMethodAddrSpace(), clang::ASTContext::getElaboratedType(), clang::ASTContext::getRValueReferenceType(), clang::ASTContext::getTypeDeclType(), clang::MoveConstructor, clang::CXXRecordDecl::needsImplicitMoveConstructor(), and clang::None.
Referenced by AddImplicitlyDeclaredMembersToClass().
NamedDecl* clang::Sema::DeclClonePragmaWeak | ( | NamedDecl * | ND, |
const IdentifierInfo * | II, | ||
SourceLocation | Loc | ||
) |
void Sema::DecomposeUnqualifiedId | ( | const UnqualifiedId & | Id, |
TemplateArgumentListInfo & | Buffer, | ||
DeclarationNameInfo & | NameInfo, | ||
const TemplateArgumentListInfo *& | TemplateArgs | ||
) |
Decomposes the given name into a DeclarationNameInfo, its location, and possibly a list of template arguments.
If this produces template arguments, it is permitted to call DecomposeTemplateName.
This actually loses a lot of source location information for non-standard name kinds; we should consider preserving that in some way.
Definition at line 2422 of file SemaExpr.cpp.
References Id, clang::IK_TemplateId, clang::TemplateArgumentListInfo::setLAngleLoc(), and clang::TemplateArgumentListInfo::setRAngleLoc().
TemplateDeductionResult Sema::DeduceAutoType | ( | TypeLoc | Type, |
Expr * | Init, | ||
QualType & | Result, | ||
sema::TemplateDeductionInfo & | Info, | ||
bool | DependentDeduction = false , |
||
bool | IgnoreConstraints = false , |
||
TemplateSpecCandidateSet * | FailedTSC = nullptr |
||
) |
Deduce the type for an auto type-specifier (C++11 [dcl.spec.auto]p6)
Note that this is done even if the initializer is dependent. (This is necessary to support partial ordering of templates using 'auto'.) A dependent type will be produced when deducing from a dependent type.
Type | the type pattern using the auto type-specifier. |
Init | the initializer for the variable whose type is to be deduced. |
Result | if type deduction was successful, this will be set to the deduced type. |
Info | the argument will be updated to provide additional information about template argument deduction. |
DependentDeduction | Set if we should permit deduction in dependent cases. This is necessary for template partial ordering with 'auto' template parameters. The template parameter depth to be used should be specified in the 'Info' parameter. |
IgnoreConstraints | Set if we should not fail if the deduced type does not satisfy the type-constraint in the auto type. |
Definition at line 5147 of file SemaTemplateDeduction.cpp.
References clang::AlreadyDiagnosed, bool, BuildStdInitializerList(), clang::C23, CheckDeducedPlaceholderConstraints(), CheckOriginalCallArgDeduction(), CheckPlaceholderExpr(), Context, clang::CPlusPlus, clang::TemplateTypeParmDecl::Create(), DeduceTemplateArgumentsFromCallArgument(), clang::SemaBase::Diag(), clang::sema::TemplateDeductionInfo::FirstArg, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), getASTContext(), clang::ASTContext::getCommonSugaredType(), clang::Type::getContainedAutoType(), getDecltypeForExpr(), clang::sema::TemplateDeductionInfo::getDeducedDepth(), clang::AutoType::getKeyword(), getKind(), getLangOpts(), clang::sema::TemplateDeductionInfo::getLocation(), clang::TypeDecl::getTypeForDecl(), clang::ASTContext::hasSameType(), clang::Incomplete, clang::Inconsistent, int, clang::Invalid, clang::Type::isArrayType(), clang::AutoType::isConstrained(), clang::AutoType::isDecltypeAuto(), clang::Type::isDependentType(), clang::SourceRange::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isPointerType(), Loc, clang::TemplateArgument::Null, clang::sema::TemplateDeductionInfo::SecondArg, clang::Success, and clang::TemplateArgument::Type.
Referenced by BuildCXXTypeConstructExpr(), and FinishForRangeVarDecl().
void Sema::deduceClosureReturnType | ( | sema::CapturingScopeInfo & | CSI | ) |
Deduce a block or lambda's return type based on the return statements present in the body.
Definition at line 690 of file SemaLambda.cpp.
References clang::CPlusPlus, clang::CPlusPlus14, findCommonEnumForBlockReturns(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::Type::isDependentType(), clang::QualType::isNull(), clang::Type::isUndeducedType(), clang::sema::FunctionScopeInfo::Returns, clang::sema::CapturingScopeInfo::ReturnType, and clang::ASTContext::VoidTy.
bool Sema::DeduceFunctionTypeFromReturnExpr | ( | FunctionDecl * | FD, |
SourceLocation | ReturnLoc, | ||
Expr * | RetExpr, | ||
const AutoType * | AT | ||
) |
Deduce the return type for a function from a returned expression, per C++1y [dcl.spec.auto]p6.
Definition at line 3696 of file SemaStmt.cpp.
References Diag(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::DeducedType::isDeduced(), clang::DeclContext::isDependentContext(), and clang::isLambdaConversionOperator().
void Sema::deduceOpenCLAddressSpace | ( | ValueDecl * | decl | ) |
Definition at line 7007 of file SemaDecl.cpp.
References clang::Type::isSamplerT(), clang::Type::isVoidType(), clang::opencl_global, and clang::opencl_private.
Referenced by CompleteVarTemplateSpecializationDecl().
bool Sema::DeduceReturnType | ( | FunctionDecl * | FD, |
SourceLocation | Loc, | ||
bool | Diagnose = true |
||
) |
Definition at line 5390 of file SemaTemplateDeduction.cpp.
References clang::ASTContext::adjustDeducedFunctionResultType(), clang::Type::castAs(), Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::ASTContext::getBlockPointerType(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::CXXRecordDecl::getLambdaCallOperator(), getLambdaConversionFunctionResultType(), clang::Decl::getLocation(), clang::DeclContext::getParent(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::FunctionDecl::getTemplateSpecializationArgs(), clang::ValueDecl::getType(), InstantiateFunctionDeclaration(), InstantiateFunctionDefinition(), clang::Decl::isInvalidDecl(), clang::isLambdaConversionOperator(), clang::Type::isUndeducedType(), Loc, and runWithSufficientStackSpace().
Referenced by DeduceTemplateArguments().
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | ClassTemplatePartialSpecializationDecl * | Partial, |
ArrayRef< TemplateArgument > | TemplateArgs, | ||
sema::TemplateDeductionInfo & | Info | ||
) |
Definition at line 3336 of file SemaTemplateDeduction.cpp.
References DeduceTemplateArguments().
Referenced by DeduceTemplateArguments(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), ResolveSingleFunctionTemplateSpecialization(), and usesPartialOrExplicitSpecialization().
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | FunctionTemplateDecl * | FunctionTemplate, |
QualType | ObjectType, | ||
Expr::Classification | ObjectClassification, | ||
QualType | ToType, | ||
CXXConversionDecl *& | Specialization, | ||
sema::TemplateDeductionInfo & | Info | ||
) |
Deduce template arguments for a templated conversion function (C++ [temp.deduct.conv]) and, if successful, produce a conversion function template specialization.
Definition at line 4824 of file SemaTemplateDeduction.cpp.
References Context, DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateArgumentsFromCallArgument(), clang::ASTContext::getArrayDecayedType(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::CXXConversionDecl::getConversionType(), getFirstInnerIndex(), clang::sema::TemplateDeductionInfo::getLocation(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::Invalid, clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Decl::isInvalidDecl(), clang::Type::isMemberPointerType(), clang::Type::isPointerType(), clang::Type::isReferenceType(), P, runWithSufficientStackSpace(), clang::TemplateParameterList::size(), clang::Specialization, clang::Success, clang::TDF_ArgWithReferenceType, clang::TDF_IgnoreQualifiers, clang::Unevaluated, and Unevaluated.
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | FunctionTemplateDecl * | FunctionTemplate, |
TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
ArrayRef< Expr * > | Args, | ||
FunctionDecl *& | Specialization, | ||
sema::TemplateDeductionInfo & | Info, | ||
bool | PartialOverloading, | ||
bool | AggregateDeductionCandidate, | ||
QualType | ObjectType, | ||
Expr::Classification | ObjectClassification, | ||
llvm::function_ref< bool(ArrayRef< QualType >)> | CheckNonDependent | ||
) |
Perform template argument deduction from a function call (C++ [temp.deduct.call]).
FunctionTemplate | the function template for which we are performing template argument deduction. |
ExplicitTemplateArgs | the explicit template arguments provided for this call. |
Args | the function call arguments |
Specialization | if template argument deduction was successful, this will be set to the function template specialization produced by template argument deduction. |
Info | the argument will be updated to provide additional information about template argument deduction. |
CheckNonDependent | A callback to invoke to check conversions for non-dependent parameters, between deduction and substitution, per DR1391. If this returns true, substitution will be skipped and we return TemplateDeductionResult::NonDependentConversionFailure. The callback is passed the parameter types (after substituting explicit template arguments). |
Definition at line 4406 of file SemaTemplateDeduction.cpp.
References DeduceTemplateArgumentsFromCallArgument(), clang::Function, getFirstInnerIndex(), clang::sema::TemplateDeductionInfo::getLocation(), clang::PackExpansionType::getNumExpansions(), clang::PackExpansionType::getPattern(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), hasDeducibleTemplateParameters(), clang::Invalid, clang::Decl::isInvalidDecl(), clang::runWithSufficientStackSpace(), clang::TemplateParameterList::size(), clang::Success, clang::TooFewArguments, and clang::TooManyArguments.
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | FunctionTemplateDecl * | FunctionTemplate, |
TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
FunctionDecl *& | Specialization, | ||
sema::TemplateDeductionInfo & | Info, | ||
bool | IsAddressOfFunction = false |
||
) |
Deduce template arguments for a function template when there is nothing to deduce against (C++0x [temp.arg.explicit]p3).
FunctionTemplate | the function template for which we are performing template argument deduction. |
ExplicitTemplateArgs | the explicitly-specified template arguments. |
Specialization | if template argument deduction was successful, this will be set to the function template specialization produced by template argument deduction. |
Info | the argument will be updated to provide additional information about template argument deduction. |
IsAddressOfFunction | If true , we are deducing as part of taking the address of a function template in a context where we do not have a target type, per [over.over]. If false , we are looking up a function template specialization based on its signature, which only happens when deducing a function parameter type from an argument that is a template-id naming a function template specialization. |
Definition at line 4980 of file SemaTemplateDeduction.cpp.
References DeduceTemplateArguments(), and clang::Specialization.
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | FunctionTemplateDecl * | FunctionTemplate, |
TemplateArgumentListInfo * | ExplicitTemplateArgs, | ||
QualType | ArgFunctionType, | ||
FunctionDecl *& | Specialization, | ||
sema::TemplateDeductionInfo & | Info, | ||
bool | IsAddressOfFunction = false |
||
) |
Deduce template arguments when taking the address of a function template (C++ [temp.deduct.funcaddr]) or matching a specialization to a template.
FunctionTemplate | the function template for which we are performing template argument deduction. |
ExplicitTemplateArgs | the explicitly-specified template arguments. |
ArgFunctionType | the function type that will be used as the "argument" type (A) when performing template argument deduction from the function template's function type. This type may be NULL, if there is no argument type to compare against, in C++0x [temp.arg.explicit]p3. |
Specialization | if template argument deduction was successful, this will be set to the function template specialization produced by template argument deduction. |
Info | the argument will be updated to provide additional information about template argument deduction. |
IsAddressOfFunction | If true , we are deducing as part of taking the address of a function template per [temp.deduct.funcaddr] and [over.over]. If false , we are looking up a function template specialization based on its signature, per [temp.deduct.decl]. |
Definition at line 4694 of file SemaTemplateDeduction.cpp.
References adjustCCAndNoReturn(), CheckIfFunctionSpecializationIsImmediate(), Context, clang::CPlusPlus14, clang::CPlusPlus20, DeduceReturnType(), DeduceTemplateArgumentsByTypeMatch(), clang::sema::TemplateDeductionInfo::FirstArg, clang::Function, clang::ASTContext::getCanonicalType(), getLangOpts(), clang::sema::TemplateDeductionInfo::getLocation(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::ASTContext::hasSameFunctionTypeIgnoringExceptionSpec(), clang::Invalid, clang::Decl::isInvalidDecl(), clang::QualType::isNull(), isSameOrCompatibleFunctionType(), clang::MiscellaneousDeductionFailure, clang::NonDeducedMismatch, parentEvaluationContext(), runWithSufficientStackSpace(), clang::sema::TemplateDeductionInfo::SecondArg, clang::TemplateParameterList::size(), clang::Specialization, SubstAutoType(), SubstAutoTypeDependent(), clang::Success, clang::TDF_AllowCompatibleFunctionType, clang::TDF_TopLevelParameterTypeList, clang::Unevaluated, and Unevaluated.
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | TemplateParameterList * | TemplateParams, |
ArrayRef< TemplateArgument > | Ps, | ||
ArrayRef< TemplateArgument > | As, | ||
sema::TemplateDeductionInfo & | Info, | ||
SmallVectorImpl< DeducedTemplateArgument > & | Deduced, | ||
bool | NumberOfArgumentsMustMatch | ||
) |
Definition at line 2637 of file SemaTemplateDeduction.cpp.
References DeduceTemplateArguments().
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | VarTemplatePartialSpecializationDecl * | Partial, |
ArrayRef< TemplateArgument > | TemplateArgs, | ||
sema::TemplateDeductionInfo & | Info | ||
) |
Definition at line 3342 of file SemaTemplateDeduction.cpp.
References DeduceTemplateArguments().
TemplateDeductionResult Sema::DeduceTemplateArgumentsFromType | ( | TemplateDecl * | TD, |
QualType | FromType, | ||
sema::TemplateDeductionInfo & | Info | ||
) |
Deduce the template arguments of the given template from FromType
.
Used to implement the IsDeducible constraint for alias CTAD per C++ [over.match.class.deduct]p4.
It only supports class or type alias templates.
Definition at line 3349 of file SemaTemplateDeduction.cpp.
References clang::Invalid, and clang::Decl::isInvalidDecl().
QualType Sema::DeduceTemplateSpecializationFromInitializer | ( | TypeSourceInfo * | TInfo, |
const InitializedEntity & | Entity, | ||
const InitializationKind & | Kind, | ||
MultiExprArg | Init | ||
) |
Definition at line 10748 of file SemaInit.cpp.
References clang::AliasTemplate, Context, clang::OverloadCandidateSet::CSK_Normal, clang::ASTContext::DeclarationNames, clang::SemaBase::Diag(), clang::TemplateName::getAsTemplateDecl(), clang::TypeLoc::getBeginLoc(), clang::Type::getContainedDeducedType(), clang::DeclarationNameTable::getCXXDeductionGuideName(), clang::Decl::getDeclContext(), clang::TypeLoc::getEndLoc(), clang::TypeLoc::getSourceRange(), getTemplateNameKindForDiagnostics(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Expr::hasAnyTypeDependentArguments(), clang::InitializationKind::IK_Direct, int, clang::TemplateName::isDependent(), clang::ListInit, LookupOrdinaryName, LookupQualifiedName(), NoteTemplateLocation(), SubstAutoTypeDependent(), and clang::LookupResult::suppressDiagnostics().
Referenced by BuildCXXTypeConstructExpr().
Definition at line 13229 of file SemaDecl.cpp.
References clang::DirectInit, clang::NamedDecl::getDeclName(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::VarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Decl::isInvalidDecl(), clang::NamedDecl::isLinkageValid(), clang::OpenCL, clang::Decl::setInvalidDecl(), and clang::ValueDecl::setType().
QualType Sema::deduceVarTypeFromInitializer | ( | VarDecl * | VDecl, |
DeclarationName | Name, | ||
QualType | Type, | ||
TypeSourceInfo * | TSI, | ||
SourceRange | Range, | ||
bool | DirectInit, | ||
Expr * | Init | ||
) |
Definition at line 13081 of file SemaDecl.cpp.
ExprResult Sema::DefaultArgumentPromotion | ( | Expr * | E | ) |
DefaultArgumentPromotion (C99 6.5.2.2p6).
Used for function calls that do not have a prototype. Arguments that have type float or __fp16 are promoted to double. All other argument types are converted by UsualUnaryConversions().
Definition at line 950 of file SemaExpr.cpp.
References clang::ExprError(), clang::RISCV::Float, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::BuiltinType::getKind(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::QualType::isNull().
ExprResult Sema::DefaultFunctionArrayConversion | ( | Expr * | E, |
bool | Diagnose = true |
||
) |
DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4).
Definition at line 597 of file SemaExpr.cpp.
References checkAddressOfFunctionIsAvailable(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenCasts(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::QualType::isNull().
Referenced by IgnoredValueConversions(), and resolveAndFixAddressOfSingleOverloadCandidate().
ExprResult Sema::DefaultFunctionArrayLvalueConversion | ( | Expr * | E, |
bool | Diagnose = true |
||
) |
Definition at line 833 of file SemaExpr.cpp.
References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
Referenced by clang::SemaOpenMP::ActOnOpenMPHasDeviceAddrClause(), clang::SemaOpenMP::ActOnOpenMPUseDeviceAddrClause(), CheckSizelessVectorConditionalTypes(), CheckVectorConditionalTypes(), CXXCheckConditionalOperands(), IgnoredValueConversions(), PerformMemberExprBaseConversion(), and ResolveAndFixSingleFunctionTemplateSpecialization().
ExprResult Sema::DefaultLvalueConversion | ( | Expr * | E | ) |
Definition at line 721 of file SemaExpr.cpp.
References clang::Type::canDecayToPointerType(), clang::CPlusPlus, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Expr::isGLValue(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::T.
Referenced by ActOnCXXDelete(), clang::SemaObjC::ActOnObjCAtSynchronizedOperand(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), BuildArrayType(), CheckPointerToMemberOperands(), finishContextualImplicitConversion(), clang::SemaOpenMP::getOpenMPCapturedExpr(), IgnoredValueConversions(), PerformContextualImplicitConversion(), and PerformImplicitConversion().
ExprResult Sema::DefaultVariadicArgumentPromotion | ( | Expr * | E, |
VariadicCallType | CT, | ||
FunctionDecl * | FDecl | ||
) |
DefaultVariadicArgumentPromotion - Like DefaultArgumentPromotion, but will create a trap if the resulting type is not a POD type.
Definition at line 1117 of file SemaExpr.cpp.
References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::Type::isBlockPointerType(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
Referenced by SelectBestMethod().
void Sema::DefineDefaultedComparison | ( | SourceLocation | Loc, |
FunctionDecl * | FD, | ||
DefaultedComparisonKind | DCK | ||
) |
Definition at line 9161 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), Context, clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::ActionResult< PtrTy, Compress >::get(), getASTMutationListener(), clang::Decl::getEndLoc(), clang::Decl::getLocation(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), clang::Decl::markUsed(), ResolveExceptionSpec(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), and clang::FunctionDecl::willHaveBody().
Referenced by SetDeclDefaulted().
void Sema::DefineImplicitCopyAssignment | ( | SourceLocation | CurrentLocation, |
CXXMethodDecl * | MethodDecl | ||
) |
Defines an implicitly-declared copy assignment operator.
Definition at line 15055 of file SemaDeclCXX.cpp.
References ActOnCompoundStmt(), clang::LookupResult::addDecl(), clang::CXXRecordDecl::bases(), BuildReturnStmt(), buildSingleCopyAssign(), clang::Type::castAs(), Context, clang::Copy, clang::CPlusPlus11, clang::SemaBase::Diag(), diagnoseDeprecatedCopyOperation(), clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::RecordDecl::fields(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Type::getAs(), getASTMutationListener(), clang::ASTContext::getBaseElementType(), getCurrentThisType(), clang::Decl::getEndLoc(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNonObjectParameter(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::ASTContext::getTagDeclType(), clang::ValueDecl::getType(), clang::RecordDecl::hasFlexibleArrayMember(), clang::QualType::isConstQualified(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Decl::isImplicit(), clang::Type::isIncompleteArrayType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::Type::isLValueReferenceType(), clang::FunctionDecl::isOverloadedOperator(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), LangOpts, Loc, LookupMemberName, clang::Decl::markUsed(), clang::Other, ResolveExceptionSpec(), clang::LookupResult::resolveKind(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::interp::This(), clang::VK_LValue, and clang::FunctionDecl::willHaveBody().
void Sema::DefineImplicitCopyConstructor | ( | SourceLocation | CurrentLocation, |
CXXConstructorDecl * | Constructor | ||
) |
DefineImplicitCopyConstructor - Checks for feasibility of defining this constructor as the copy constructor.
Definition at line 15769 of file SemaDeclCXX.cpp.
References ActOnCompoundStmt(), Context, clang::CopyConstructor, clang::CPlusPlus11, diagnoseDeprecatedCopyOperation(), getASTMutationListener(), getLangOpts(), Loc, MarkVTableUsed(), ResolveExceptionSpec(), and SetCtorInitializers().
void Sema::DefineImplicitDefaultConstructor | ( | SourceLocation | CurrentLocation, |
CXXConstructorDecl * | Constructor | ||
) |
DefineImplicitDefaultConstructor - Checks for feasibility of defining this constructor as the default constructor.
Definition at line 14065 of file SemaDeclCXX.cpp.
References Context, getASTMutationListener(), clang::Decl::isInvalidDecl(), Loc, MarkVTableUsed(), ResolveExceptionSpec(), and SetCtorInitializers().
void Sema::DefineImplicitDestructor | ( | SourceLocation | CurrentLocation, |
CXXDestructorDecl * | Destructor | ||
) |
DefineImplicitDestructor - Checks for feasibility of defining this destructor as the default destructor.
Definition at line 14357 of file SemaDeclCXX.cpp.
References CheckDestructor(), Context, getASTMutationListener(), Loc, MarkBaseAndMemberDestructorsReferenced(), MarkVTableUsed(), and ResolveExceptionSpec().
void Sema::DefineImplicitLambdaToBlockPointerConversion | ( | SourceLocation | CurrentLoc, |
CXXConversionDecl * | Conv | ||
) |
Define the "body" of the conversion from a lambda object to a block pointer.
This routine doesn't actually define a sensible body; rather, it fills in the initialization expression needed to copy the lambda object into the block, and IR generation actually generates the real body of the block pointer conversion.
Definition at line 16023 of file SemaDeclCXX.cpp.
References ActOnCXXThis(), BuildBlockForLambdaConversion(), BuildReturnStmt(), Context, clang::CompoundStmt::Create(), clang::ImplicitCastExpr::Create(), CreateBuiltinUnaryOp(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), getASTMutationListener(), getLangOpts(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::Expr::getType(), clang::CXXRecordDecl::isGenericLambda(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::markUsed(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::interp::This(), and clang::VK_PRValue.
void Sema::DefineImplicitLambdaToFunctionPointerConversion | ( | SourceLocation | CurrentLoc, |
CXXConversionDecl * | Conv | ||
) |
Define the "body" of the conversion from a lambda object to a function pointer.
This routine doesn't actually define a sensible body; rather, it fills in the initialization expression needed to copy the lambda object into the block, and IR generation actually generates the real body of the block pointer conversion.
Definition at line 15954 of file SemaDeclCXX.cpp.
References BuildDeclRefExpr(), BuildReturnStmt(), clang::Type::castAs(), Context, clang::CompoundStmt::Create(), clang::ActionResult< PtrTy, Compress >::get(), getASTMutationListener(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::CXXRecordDecl::getLambdaCallOperator(), clang::CXXRecordDecl::getLambdaStaticInvoker(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::getTemplateSpecializationArgs(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), InstantiateFunctionDeclaration(), clang::Decl::isInvalidDecl(), clang::FunctionDecl::isStatic(), clang::Type::isUndeducedType(), MarkFunctionReferenced(), clang::Decl::markUsed(), clang::FunctionDecl::setBody(), clang::Decl::setReferenced(), clang::ValueDecl::setType(), and clang::VK_LValue.
void Sema::DefineImplicitMoveAssignment | ( | SourceLocation | CurrentLocation, |
CXXMethodDecl * | MethodDecl | ||
) |
Defines an implicitly-declared move assignment operator.
Definition at line 15440 of file SemaDeclCXX.cpp.
References ActOnCompoundStmt(), clang::LookupResult::addDecl(), clang::CXXRecordDecl::bases(), BuildReturnStmt(), buildSingleCopyAssign(), clang::Type::castAs(), checkMoveAssignmentForRepeatedMove(), Context, clang::SemaBase::Diag(), clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::RecordDecl::fields(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Type::getAs(), getASTMutationListener(), clang::ASTContext::getBaseElementType(), getCurrentThisType(), clang::Decl::getEndLoc(), clang::Decl::getLocation(), clang::FunctionDecl::getNonObjectParameter(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::ASTContext::getTagDeclType(), clang::ValueDecl::getType(), clang::RecordDecl::hasFlexibleArrayMember(), clang::QualType::isConstQualified(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Type::isIncompleteArrayType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::FunctionDecl::isOverloadedOperator(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), Loc, LookupMemberName, clang::Decl::markUsed(), clang::diff::Move, clang::Other, ResolveExceptionSpec(), clang::LookupResult::resolveKind(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::interp::This(), clang::VK_LValue, clang::VK_XValue, and clang::FunctionDecl::willHaveBody().
void Sema::DefineImplicitMoveConstructor | ( | SourceLocation | CurrentLocation, |
CXXConstructorDecl * | Constructor | ||
) |
DefineImplicitMoveConstructor - Checks for feasibility of defining this constructor as the move constructor.
Definition at line 15908 of file SemaDeclCXX.cpp.
References ActOnCompoundStmt(), Context, getASTMutationListener(), Loc, MarkVTableUsed(), clang::MoveConstructor, ResolveExceptionSpec(), and SetCtorInitializers().
void Sema::DefineInheritingConstructor | ( | SourceLocation | UseLoc, |
CXXConstructorDecl * | Constructor | ||
) |
Define the specified inheriting constructor.
Definition at line 14209 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), Context, clang::Sema::InheritedConstructorInfo::findConstructorForBase(), getASTMutationListener(), clang::Decl::getLocation(), clang::ConstructorUsingShadowDecl::getParent(), clang::ASTContext::getTrivialTypeSourceInfo(), MarkFunctionReferenced(), MarkVTableUsed(), ResolveExceptionSpec(), SetCtorInitializers(), and clang::CXXRecordDecl::vbases().
bool Sema::DefineUsedVTables | ( | ) |
Define all of the vtables that have been used in this translation unit and reference any virtual members used by those vtables.
Definition at line 18694 of file SemaDeclCXX.cpp.
References clang::Class, Consumer, Context, clang::SemaBase::Diag(), clang::ASTContext::getCurrentKeyFunction(), clang::TargetInfo::getCXXABI(), clang::ASTContext::getTargetInfo(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::ASTConsumer::HandleVTable(), clang::FunctionDecl::hasBody(), clang::TargetCXXABI::hasKeyFunctions(), clang::FunctionDecl::isInlined(), LoadExternalVTableUses(), Loc, MarkVirtualMemberExceptionSpecsNeeded(), MarkVirtualMembersReferenced(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ImplicitInstantiation, VTablesUsed, and VTableUses.
Referenced by ActOnEndOfTranslationUnitFragment().
bool Sema::DiagIfReachable | ( | SourceLocation | Loc, |
ArrayRef< const Stmt * > | Stmts, | ||
const PartialDiagnostic & | PD | ||
) |
Conditionally issue a diagnostic based on the statements's reachability analysis.
Emit a diagnostic when statements are reachable.
Stmts | If Stmts is non-empty, delay reporting the diagnostic until the function body is parsed, and then do a basic reachability analysis to determine if the statement is reachable. If it is unreachable, the diagnostic will not be emitted. |
FIXME: check for reachability even in expressions for which we don't build a CFG (eg, in the initializer of a global or in a constant expression). For example, namespace { auto *p = new double[3][false ? (1, 2) : 3]; }
Definition at line 20075 of file SemaExpr.cpp.
DiagnoseAbsenceOfOverrideControl - Diagnose if 'override' keyword was not used in the declaration of an overriding method.
Definition at line 3280 of file SemaDeclCXX.cpp.
References clang::CXXMethodDecl::begin_overridden_methods(), clang::SemaBase::Diag(), Diags, clang::CharSourceRange::getBegin(), clang::NamedDecl::getDeclName(), clang::SourceManager::getImmediateExpansionRange(), clang::Decl::getLocation(), getSourceManager(), clang::SourceManager::getSpellingLoc(), clang::Decl::hasAttr(), clang::Inconsistent, clang::DiagnosticsEngine::isIgnored(), clang::Decl::isImplicit(), clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), Loc, and clang::CXXMethodDecl::size_overridden_methods().
void Sema::DiagnoseAbstractType | ( | const CXXRecordDecl * | RD | ) |
Definition at line 6027 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), Diags, clang::NamedDecl::getDeclName(), clang::CXXRecordDecl::getFinalOverriders(), clang::DiagnosticsEngine::isLastDiagnosticIgnored(), and PureVirtualClassDiagSet.
Referenced by RequireNonAbstractType(), and SetCtorInitializers().
void Sema::DiagnoseAlwaysNonNullPointer | ( | Expr * | E, |
Expr::NullPointerConstantKind | NullKind, | ||
bool | IsEqual, | ||
SourceRange | Range | ||
) |
Diagnose pointers that are always non-null.
E | the expression containing the pointer |
NullKind | NPCK_NotNull if E is a cast to bool, otherwise, E is compared to a null pointer |
IsEqual | True when the comparison is equal to a null pointer |
Range | Extra SourceRange to highlight in the diagnostic |
Definition at line 15597 of file SemaChecking.cpp.
References CheckForReference(), Diag(), clang::SourceRange::getBegin(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::Expr::IgnoreImpCasts(), clang::Expr::IgnoreParens(), IsInAnyMacroBody(), clang::SourceLocation::isMacroID(), clang::Expr::NPCK_NotNull, Range, and SM.
void Sema::DiagnoseAmbiguousLookup | ( | LookupResult & | Result | ) |
Produce a diagnostic describing the ambiguity that resulted from name lookup.
Result | The result of the ambiguous lookup to be diagnosed. |
Definition at line 2900 of file SemaLookup.cpp.
bool Sema::diagnoseArgDependentDiagnoseIfAttrs | ( | const FunctionDecl * | Function, |
const Expr * | ThisArg, | ||
ArrayRef< const Expr * > | Args, | ||
SourceLocation | Loc | ||
) |
Emit diagnostics for the diagnose_if attributes on Function, ignoring any non-ArgDependent DiagnoseIfAttrs.
Argument-dependent diagnose_if attributes should be checked each time a function is used as a direct callee of a function call.
Returns true if any errors were emitted.
Definition at line 7394 of file SemaOverload.cpp.
References Context, diagnoseDiagnoseIfAttrsWith(), clang::Function, and Loc.
bool Sema::diagnoseArgIndependentDiagnoseIfAttrs | ( | const NamedDecl * | ND, |
SourceLocation | Loc | ||
) |
Emit diagnostics for the diagnose_if attributes on Function, ignoring any ArgDependent DiagnoseIfAttrs.
Argument-independent diagnose_if attributes should be checked on every use of a function.
Returns true if any errors were emitted.
Definition at line 7412 of file SemaOverload.cpp.
References Context, diagnoseDiagnoseIfAttrsWith(), EvaluateAsBooleanCondition(), and Loc.
void Sema::DiagnoseAssignmentAsCondition | ( | Expr * | E | ) |
DiagnoseAssignmentAsCondition - Given that an expression is being used as a boolean condition, warn if it's an assignment.
Definition at line 20194 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), Diag(), clang::Stmt::getBeginLoc(), clang::SourceRange::getEnd(), clang::Selector::getNameForSlot(), clang::Stmt::getSourceRange(), clang::Expr::IgnoreParenCasts(), clang::Selector::isUnarySelector(), Loc, and clang::OMF_init.
DiagnoseAssignmentEnum - Warn if assignment to enum is a constant integer not in the range of enum values.
Definition at line 1665 of file SemaStmt.cpp.
References clang::Type::getAs(), and clang::Expr::getExprLoc().
bool Sema::DiagnoseAssignmentResult | ( | AssignConvertType | ConvTy, |
SourceLocation | Loc, | ||
QualType | DstType, | ||
QualType | SrcType, | ||
Expr * | SrcExpr, | ||
AssignmentAction | Action, | ||
bool * | Complained = nullptr |
||
) |
DiagnoseAssignmentResult - Emit a diagnostic, if required, for the assignment conversion type specified by ConvTy.
This returns true if the conversion was invalid or false if the conversion was accepted.
Definition at line 16768 of file SemaExpr.cpp.
References clang::CPlusPlus, clang::QualType::getUnqualifiedType(), clang::Type::isArrayType(), isInvalid(), clang::Type::isObjCObjectPointerType(), and clang::ConversionFixItGenerator::tryToFixConversion().
Referenced by PerformImplicitConversion().
Definition at line 5375 of file SemaTemplateDeduction.cpp.
References clang::SemaBase::Diag(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::ValueDecl::getType(), and clang::VarDecl::isInitCapture().
void Sema::DiagnoseAvailabilityOfDecl | ( | NamedDecl * | D, |
ArrayRef< SourceLocation > | Locs, | ||
const ObjCInterfaceDecl * | UnknownObjCClass, | ||
bool | ObjCPropertyAccess, | ||
bool | AvoidPartialAvailabilityChecks = false , |
||
ObjCInterfaceDecl * | ClassReceiver = nullptr |
||
) |
Definition at line 1018 of file SemaAvailability.cpp.
References clang::AR_Available, clang::AR_NotYetIntroduced, and ShouldDiagnoseAvailabilityOfDecl().
bool Sema::DiagnoseClassNameShadow | ( | DeclContext * | DC, |
DeclarationNameInfo | NameInfo | ||
) |
DiagnoseClassNameShadow - Implement C++ [class.mem]p13: If T is the name of a class, then each of the following shall have a name different from T:
Definition at line 6225 of file SemaDecl.cpp.
Referenced by CheckUsingShadowDecl().
void Sema::DiagnoseCommaOperator | ( | const Expr * | LHS, |
SourceLocation | Loc | ||
) |
Definition at line 13885 of file SemaExpr.cpp.
References clang::Scope::BreakScope, clang::Scope::ContinueScope, clang::Scope::ControlScope, clang::Scope::DeclScope, IgnoreCommaOperand(), clang::SourceLocation::isMacroID(), and Loc.
bool Sema::DiagnoseConditionalForNull | ( | const Expr * | LHSExpr, |
const Expr * | RHSExpr, | ||
SourceLocation | QuestionLoc | ||
) |
Emit a specialized diagnostic when one expression is a null pointer constant and the other is not a pointer.
Returns true if a diagnostic is emitted.
Definition at line 8028 of file SemaExpr.cpp.
References clang::Expr::isNullPointerConstant().
Referenced by CXXCheckConditionalOperands().
void Sema::DiagnoseDeletedDefaultedFunction | ( | FunctionDecl * | FD | ) |
Produce notes explaining why a defaulted function was defined as deleted.
Definition at line 9868 of file SemaDeclCXX.cpp.
References clang::Sema::DefaultedFunctionKind::asComparison(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), getDefaultedFunctionKind(), clang::Decl::getLexicalDeclContext(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::Sema::DefaultedFunctionKind::isSpecialMember(), and ShouldDeleteSpecialMember().
bool Sema::DiagnoseDependentMemberLookup | ( | const LookupResult & | R | ) |
Diagnose a lookup that found results in an enclosing class during error recovery.
This usually indicates that the results were found in a dependent base class that could not be searched as part of a template definition. Always issues a diagnostic (though this may be only a warning in MS compatibility mode).
Return true
if the error is unrecoverable, or false
if the caller should attempt to recover using these lookup results.
Definition at line 2485 of file SemaExpr.cpp.
References clang::LookupResult::begin(), clang::FixItHint::CreateInsertion(), Diag(), clang::DeclContext::Equals(), clang::Decl::getDeclContext(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), clang::DeclContext::getParent(), and clang::LookupResult::getRepresentativeDecl().
void Sema::DiagnoseDeprecatedAttribute | ( | const ParsedAttr & | A, |
StringRef | NewScope, | ||
StringRef | NewName | ||
) |
Emit a diagnostic about the given attribute having a deprecated name, and also emit a fixit hint to generate the new attribute name.
Definition at line 307 of file SemaDeclAttr.cpp.
References clang::FixItHint::CreateReplacement(), Diag(), clang::AttributeCommonInfo::getAttrName(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierInfo::getName(), clang::AttributeCommonInfo::getNormalizedFullName(), clang::AttributeCommonInfo::getRange(), clang::AttributeCommonInfo::getScopeLoc(), clang::AttributeCommonInfo::getScopeName(), and clang::AttributeCommonInfo::hasScope().
bool Sema::DiagnoseEmptyLookup | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
LookupResult & | R, | ||
CorrectionCandidateCallback & | CCC, | ||
TemplateArgumentListInfo * | ExplicitTemplateArgs = nullptr , |
||
ArrayRef< Expr * > | Args = std::nullopt , |
||
DeclContext * | LookupCtx = nullptr , |
||
TypoExpr ** | Out = nullptr |
||
) |
Diagnose an empty lookup.
Definition at line 2547 of file SemaExpr.cpp.
Warn if a for/while loop statement S
, which is followed by PossibleBody
, has a suspicious null statement as a body.
Definition at line 17609 of file SemaChecking.cpp.
void Sema::DiagnoseEmptyStmtBody | ( | SourceLocation | StmtLoc, |
const Stmt * | Body, | ||
unsigned | DiagID | ||
) |
Emit DiagID
if statement located on StmtLoc
has a suspicious null statement as a Body
, and it is located on the same line.
This helps prevent bugs due to typos, such as: if (condition); do_stuff();
Definition at line 17588 of file SemaChecking.cpp.
References Diag(), clang::NullStmt::getSemiLoc(), and ShouldDiagnoseEmptyStmtBody().
void Sema::DiagnoseEqualityWithExtraParens | ( | ParenExpr * | ParenE | ) |
Redundant parentheses over an equality comparison can indicate that the user intended an assignment used as condition.
Definition at line 20252 of file SemaExpr.cpp.
References clang::ParenExpr::getBeginLoc(), clang::Expr::IgnoreParens(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isMacroID(), and clang::Expr::isTypeDependent().
void Sema::diagnoseEquivalentInternalLinkageDeclarations | ( | SourceLocation | Loc, |
const NamedDecl * | D, | ||
ArrayRef< const NamedDecl * > | Equiv | ||
) |
Definition at line 10824 of file SemaOverload.cpp.
References clang::SemaBase::Diag(), clang::Module::getFullModuleName(), clang::Decl::getLocation(), getOwningModule(), and Loc.
void Sema::diagnoseExprIntendedAsTemplateName | ( | Scope * | S, |
ExprResult | TemplateName, | ||
SourceLocation | Less, | ||
SourceLocation | Greater | ||
) |
Definition at line 618 of file SemaTemplate.cpp.
void Sema::DiagnoseFunctionSpecifiers | ( | const DeclSpec & | DS | ) |
Diagnose function specifiers on a declaration of an identifier that does not identify a function.
Definition at line 6789 of file SemaDecl.cpp.
References Diag(), clang::DeclSpec::getExplicitSpecLoc(), clang::DeclSpec::getNoreturnSpecLoc(), clang::DeclSpec::getVirtualSpecLoc(), clang::DeclSpec::hasExplicitSpecifier(), clang::DeclSpec::isNoreturnSpecified(), and clang::DeclSpec::isVirtualSpecified().
void Sema::DiagnoseHiddenVirtualMethods | ( | CXXMethodDecl * | MD | ) |
Diagnose methods which overload virtual methods in a base class without overriding any.
Definition at line 10443 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), Diags, FindHiddenVirtualMethods(), clang::Decl::getLocation(), clang::DiagnosticsEngine::isIgnored(), clang::Decl::isInvalidDecl(), and NoteHiddenVirtualMethods().
void Sema::diagnoseIgnoredQualifiers | ( | unsigned | DiagID, |
unsigned | Quals, | ||
SourceLocation | FallbackLoc, | ||
SourceLocation | ConstQualLoc = SourceLocation() , |
||
SourceLocation | VolatileQualLoc = SourceLocation() , |
||
SourceLocation | RestrictQualLoc = SourceLocation() , |
||
SourceLocation | AtomicQualLoc = SourceLocation() , |
||
SourceLocation | UnalignedQualLoc = SourceLocation() |
||
) |
Definition at line 2940 of file SemaType.cpp.
Referenced by CheckConstructorDeclarator(), and CheckDestructorDeclarator().
void Sema::DiagnoseImmediateEscalatingReason | ( | FunctionDecl * | FD | ) |
Definition at line 2511 of file SemaDeclCXX.cpp.
References clang::CallExpr::arguments(), clang::SemaBase::Diag(), clang::CXXCtorInitializer::getAnyMember(), clang::Stmt::getBeginLoc(), clang::CallExpr::getCallee(), clang::CXXConstructExpr::getConstructor(), clang::DeclRefExpr::getDecl(), clang::CallExpr::getDirectCallee(), clang::Decl::getLocation(), clang::CXXCtorInitializer::getSourceRange(), clang::Stmt::getSourceRange(), clang::FunctionDecl::hasBody(), clang::Expr::IgnoreImplicit(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isImmediateEscalating(), clang::DeclRefExpr::isImmediateEscalating(), clang::CXXConstructExpr::isImmediateEscalating(), clang::CXXCtorInitializer::isWritten(), Loc, Range, clang::SemaBase::SemaRef, and clang::T.
Referenced by CheckImmediateEscalatingFunctionDefinition().
bool Sema::DiagnoseInvalidExplicitObjectParameterInLambda | ( | CXXMethodDecl * | Method, |
SourceLocation | CallLoc | ||
) |
Returns true if the explicit object parameter was invalid.
Definition at line 392 of file SemaLambda.cpp.
References clang::QualType::getDesugaredType(), clang::QualType::getNonReferenceType(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::CXXRecordDecl::isCapturelessLambda(), clang::Type::isDependentType(), and clang::isLambdaCallWithExplicitObjectParameter().
void Sema::DiagnoseInvalidJumps | ( | Stmt * | Body | ) |
Definition at line 1033 of file JumpDiagnostics.cpp.
void Sema::DiagnoseMisalignedMembers | ( | ) |
Diagnoses the current set of gathered accesses.
This typically happens at full expression level. The set is cleared after emitting the diagnostics.
Definition at line 18238 of file SemaChecking.cpp.
References Diag(), clang::NamedDecl::getName(), and clang::Decl::getSourceRange().
void Sema::diagnoseMissingImport | ( | SourceLocation | Loc, |
const NamedDecl * | Decl, | ||
MissingImportKind | MIK, | ||
bool | Recover = true |
||
) |
Diagnose that the specified declaration needs to be visible but isn't, and suggest a module import that would resolve the problem.
Definition at line 5782 of file SemaLookup.cpp.
References Context, getDefinitionToImport(), clang::Decl::getLocation(), clang::ASTContext::getModulesWithMergedDefinition(), getOwningModule(), and Loc.
Referenced by computeDeclContext(), diagnoseTypo(), and RequireCompleteEnumDecl().
void Sema::diagnoseMissingImport | ( | SourceLocation | Loc, |
const NamedDecl * | Decl, | ||
SourceLocation | DeclLoc, | ||
ArrayRef< Module * > | Modules, | ||
MissingImportKind | MIK, | ||
bool | Recover | ||
) |
Definition at line 5812 of file SemaLookup.cpp.
References createImplicitModuleImportForErrorRecovery(), clang::SemaBase::Diag(), getCurrentModule(), clang::SourceManager::getFileEntryForID(), clang::SourceManager::getFileID(), clang::Module::getFullModuleName(), getHeaderNameForHeader(), clang::Preprocessor::getHeaderToIncludeForDiagnostics(), clang::Module::getPrimaryModuleInterfaceName(), clang::Module::getTopLevelModule(), clang::Module::getTopLevelModuleName(), int, clang::Module::isExplicitGlobalModule(), clang::Module::isImplicitGlobalModule(), clang::Module::isModuleMapModule(), clang::Module::isPrivateModule(), PP, and SourceMgr.
void Sema::diagnoseMissingTemplateArguments | ( | TemplateName | Name, |
SourceLocation | Loc | ||
) |
Definition at line 5615 of file SemaTemplate.cpp.
Definition at line 4008 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::CompleteCandidates(), clang::OverloadCandidateSet::CSK_Normal, clang::SemaBase::Diag(), clang::OverloadCandidateSet::empty(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), IsUserDefinedConversion(), None, clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_No_Viable_Function, RequireCompleteType(), and clang::ImplicitConversionSequence::UserDefined.
Referenced by PerformContextuallyConvertToBool().
void Sema::DiagnoseNonDefaultPragmaAlignPack | ( | PragmaAlignPackDiagnoseKind | Kind, |
SourceLocation | IncludeLoc | ||
) |
Definition at line 448 of file SemaAttr.cpp.
References AlignPackIncludeStack, AlignPackStack, ChangedStateAtExit, clang::Sema::AlignPackIncludeState::CurrentPragmaLocation, clang::Sema::AlignPackIncludeState::CurrentValue, clang::SemaBase::Diag(), NonDefaultStateAtInclude, and clang::Sema::AlignPackIncludeState::ShouldWarnOnInclude.
void Sema::DiagnoseNontrivial | ( | const CXXRecordDecl * | Record, |
CXXSpecialMemberKind | CSM | ||
) |
Diagnose why the specified class does not have a trivial special member of the given kind.
Definition at line 10156 of file SemaDeclCXX.cpp.
References checkTrivialSubobjectCall(), Context, clang::CopyAssignment, clang::CopyConstructor, clang::Decl::getLocation(), clang::ASTContext::getRecordType(), TAH_IgnoreTrivialABI, and TSK_CompleteObject.
void Sema::diagnoseNullableToNonnullConversion | ( | QualType | DstType, |
QualType | SrcType, | ||
SourceLocation | Loc | ||
) |
Warn if we're implicitly casting from a _Nullable pointer type to a _Nonnull one.
Definition at line 615 of file Sema.cpp.
References clang::SemaBase::Diag(), clang::Type::getNullability(), Loc, clang::NonNull, clang::Nullable, and clang::NullableResult.
Referenced by CreateOverloadedBinOp(), ImpCastExprToType(), and PerformImplicitConversion().
bool Sema::diagnoseQualifiedDeclaration | ( | CXXScopeSpec & | SS, |
DeclContext * | DC, | ||
DeclarationName | Name, | ||
SourceLocation | Loc, | ||
TemplateIdAnnotation * | TemplateId, | ||
bool | IsMemberSpecialization | ||
) |
Diagnose a declaration whose declarator-id has the given nested-name-specifier.
SS | The nested-name-specifier of the declarator-id. |
DC | The declaration context to which the nested-name-specifier resolves. |
Name | The name of the entity being declared. |
Loc | The location of the name of the entity being declared. |
IsMemberSpecialization | Whether we are declaring a member specialization. |
TemplateId | The template-id, if any. |
Definition at line 6258 of file SemaDecl.cpp.
void Sema::DiagnoseReturnInConstructorExceptionHandler | ( | CXXTryStmt * | TryBlock | ) |
Definition at line 18299 of file SemaDeclCXX.cpp.
References clang::CXXTryStmt::getHandler(), clang::CXXTryStmt::getNumHandlers(), and SearchForReturnInStmt().
void Sema::DiagnoseSelfMove | ( | const Expr * | LHSExpr, |
const Expr * | RHSExpr, | ||
SourceLocation | OpLoc | ||
) |
Warn if a value is moved to itself.
DiagnoseSelfMove - Emits a warning if a value is moved to itself.
Definition at line 17678 of file SemaChecking.cpp.
References clang::FixItHint::CreateInsertion(), Diag(), clang::CallExpr::getArg(), clang::MemberExpr::getBase(), clang::DeclRefExpr::getBeginLoc(), clang::Decl::getCanonicalDecl(), clang::DeclRefExpr::getDecl(), clang::MemberExpr::getMemberDecl(), clang::CallExpr::getNumArgs(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), and clang::CallExpr::isCallToStdMove().
Referenced by CreateOverloadedBinOp().
void Sema::DiagnoseSentinelCalls | ( | const NamedDecl * | D, |
SourceLocation | Loc, | ||
ArrayRef< Expr * > | Args | ||
) |
DiagnoseSentinelCalls - This routine checks whether a call or message-send is to a declaration with the sentinel attribute, and if so, it checks that the requirements of the sentinel are satisfied.
Definition at line 493 of file SemaExpr.cpp.
References clang::Type::castAs(), Diag(), clang::Type::getAs(), clang::Decl::getAttr(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::Type::getPointeeType(), int, clang::Expr::isValueDependent(), and Loc.
Referenced by CompleteConstructorCall().
void Sema::DiagnoseShadowingLambdaDecls | ( | const sema::LambdaScopeInfo * | LSI | ) |
Diagnose shadowing for variables shadowed in the lambda record LambdaRD
when these variables are captured by the lambda.
Definition at line 8523 of file SemaDecl.cpp.
References computeShadowedDeclKind(), Diag(), getCaptureLocation(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::sema::CapturingScopeInfo::isCXXThisCaptured(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), and clang::sema::LambdaScopeInfo::ShadowingDecls.
void Sema::DiagnoseSizeOfParametersAndReturnValue | ( | ArrayRef< ParmVarDecl * > | Parameters, |
QualType | ReturnTy, | ||
NamedDecl * | D | ||
) |
Diagnose whether the size of parameters or return value of a function or obj-c method definition is pass-by-value and larger than a specified threshold.
Definition at line 15362 of file SemaDecl.cpp.
void Sema::DiagnoseStaticAssertDetails | ( | const Expr * | E | ) |
Try to print more useful information about a failed static_assert with expression \E.
Definition at line 17326 of file SemaDeclCXX.cpp.
References Context, ConvertAPValueToString(), clang::SemaBase::Diag(), clang::Expr::EvaluateAsRValue(), clang::Expr::getType(), clang::Type::isBooleanType(), and UsefulToPrintExpr().
Referenced by BuildStaticAssertDeclaration().
bool clang::Sema::DiagnoseSwiftName | ( | Decl * | D, |
StringRef | Name, | ||
SourceLocation | Loc, | ||
const ParsedAttr & | AL, | ||
bool | IsAsync | ||
) |
Do a check to make sure Name
looks like a legal argument for the swift_name attribute applied to decl D
.
Raise a diagnostic if the name is invalid for the given declaration.
AL
is used to provide caret diagnostics in case of a malformed name.
D
, false otherwise. void Sema::DiagnoseTemplateParameterShadow | ( | SourceLocation | Loc, |
Decl * | PrevDecl, | ||
bool | SupportedForCompatibility = false |
||
) |
DiagnoseTemplateParameterShadow - Produce a diagnostic complaining that the template parameter 'PrevDecl' is being shadowed by a new declaration at location Loc.
Returns true to indicate that this is an error, and false otherwise.
Loc | The location of the declaration that shadows a template parameter. |
PrevDecl | The template parameter that the declaration shadows. |
SupportedForCompatibility | Whether to issue the diagnostic as a warning for compatibility with older versions of clang. Ignored when MSVC compatibility is enabled. |
Definition at line 860 of file SemaTemplate.cpp.
References Diag(), clang::Decl::isTemplateParameter(), and Loc.
void Sema::diagnoseTypo | ( | const TypoCorrection & | Correction, |
const PartialDiagnostic & | TypoDiag, | ||
bool | ErrorRecovery = true |
||
) |
Definition at line 5756 of file SemaLookup.cpp.
References PDiag().
Referenced by clang::SemaObjC::FindProtocolDeclaration(), clang::SemaObjC::getObjCInterfaceDecl(), and clang::SemaOpenMP::lookupOpenMPDeclareTargetName().
void Sema::diagnoseTypo | ( | const TypoCorrection & | Correction, |
const PartialDiagnostic & | TypoDiag, | ||
const PartialDiagnostic & | PrevNote, | ||
bool | ErrorRecovery = true |
||
) |
Diagnose a successfully-corrected typo.
Separated from the correction itself to allow external validation of the result, etc.
Correction | The result of performing typo correction. |
TypoDiag | The diagnostic to produce. This will have the corrected string added to it (and usually also a fixit). |
PrevNote | A note to use when indicating the location of the entity to which we are correcting. Will have the correction string added to it. |
ErrorRecovery | If true (the default), the caller is going to recover from the typo as if the corrected string had been typed. In this case, PDiag must be an error, and we will attach a fixit to it. |
Definition at line 5927 of file SemaLookup.cpp.
References clang::FixItHint::CreateReplacement(), Declaration, clang::SemaBase::Diag(), diagnoseMissingImport(), clang::TypoCorrection::getAsString(), clang::SourceRange::getBegin(), clang::TypoCorrection::getCorrectionRange(), clang::PartialDiagnostic::getDiagID(), clang::TypoCorrection::getExtraDiagnostics(), clang::TypoCorrection::getFoundDecl(), getLangOpts(), clang::TypoCorrection::getQuoted(), clang::TypoCorrection::isKeyword(), and clang::TypoCorrection::requiresImport().
void Sema::diagnoseUnavailableAlignedAllocation | ( | const FunctionDecl & | FD, |
SourceLocation | Loc | ||
) |
Produce diagnostics if FD
is an aligned allocation or deallocation function that is unavailable.
Definition at line 2046 of file SemaExprCXX.cpp.
References clang::alignedAllocMinVersion(), clang::SemaBase::Diag(), clang::QualType::getAsString(), getASTContext(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), getPlatformName(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), isUnavailableAlignedAllocationFunction(), Loc, and clang::T.
bool Sema::DiagnoseUnexpandedParameterPack | ( | const CXXScopeSpec & | SS, |
UnexpandedParameterPackContext | UPPC | ||
) |
If the given nested-name-specifier contains an unexpanded parameter pack, diagnose the error.
SS | The nested-name-specifier that is being checked for unexpanded parameter packs. |
Definition at line 453 of file SemaTemplateVariadic.cpp.
References clang::NestedNameSpecifier::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::SourceRange::getBegin(), clang::CXXScopeSpec::getRange(), and clang::CXXScopeSpec::getScopeRep().
bool Sema::DiagnoseUnexpandedParameterPack | ( | const DeclarationNameInfo & | NameInfo, |
UnexpandedParameterPackContext | UPPC | ||
) |
If the given name contains an unexpanded parameter pack, diagnose the error.
NameInfo | The name (with source location information) that is being checked for unexpanded parameter packs. |
Definition at line 470 of file SemaTemplateVariadic.cpp.
References clang::Type::containsUnexpandedParameterPack(), clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDeductionGuideName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationName::CXXUsingDirective, DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::DeclarationName::getCXXNameType(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::DeclarationNameInfo::getNamedTypeInfo(), clang::DeclarationName::getNameKind(), clang::DeclarationName::Identifier, clang::DeclarationName::ObjCMultiArgSelector, clang::DeclarationName::ObjCOneArgSelector, and clang::DeclarationName::ObjCZeroArgSelector.
bool Sema::DiagnoseUnexpandedParameterPack | ( | Expr * | E, |
UnexpandedParameterPackContext | UPPC = UPPC_Expression |
||
) |
If the given expression contains an unexpanded parameter pack, diagnose the error.
E | The expression that is being checked for unexpanded parameter packs. |
Definition at line 409 of file SemaTemplateVariadic.cpp.
References clang::Expr::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::Stmt::getBeginLoc(), and getEnclosingLambda().
bool Sema::DiagnoseUnexpandedParameterPack | ( | SourceLocation | Loc, |
TemplateName | Template, | ||
UnexpandedParameterPackContext | UPPC | ||
) |
If the given template name contains an unexpanded parameter pack, diagnose the error.
Loc | The location of the template name. |
Template | The template name that is being checked for unexpanded parameter packs. |
Definition at line 506 of file SemaTemplateVariadic.cpp.
References clang::TemplateName::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::TemplateName::isNull(), and Loc.
bool Sema::DiagnoseUnexpandedParameterPack | ( | SourceLocation | Loc, |
TypeSourceInfo * | T, | ||
UnexpandedParameterPackContext | UPPC | ||
) |
If the given type contains an unexpanded parameter pack, diagnose the error.
Loc | The source location where a diagnostc should be emitted. |
T | The type that is being checked for unexpanded parameter packs. |
Definition at line 393 of file SemaTemplateVariadic.cpp.
References clang::Type::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), Loc, and clang::T.
Referenced by ActOnBaseSpecifier(), ActOnFinishCXXInClassMemberInitializer(), ActOnFinishFullExpr(), ActOnParamDefaultArgument(), ActOnRequiresClause(), ActOnStaticAssertDeclaration(), BuildBaseInitializer(), BuildMemberInitializer(), checkExceptionSpecification(), and DiagnoseUnexpandedParameterPack().
bool Sema::DiagnoseUnexpandedParameterPack | ( | TemplateArgumentLoc | Arg, |
UnexpandedParameterPackContext | UPPC | ||
) |
If the given template argument contains an unexpanded parameter pack, diagnose the error.
Arg | The template argument that is being checked for unexpanded parameter packs. |
Definition at line 520 of file SemaTemplateVariadic.cpp.
References clang::TemplateArgument::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgumentLoc::getLocation(), and clang::TemplateArgument::isNull().
bool Sema::DiagnoseUnexpandedParameterPackInRequiresExpr | ( | RequiresExpr * | RE | ) |
If the given requirees-expression contains an unexpanded reference to one of its own parameter packs, diagnose the error.
RE | The requiress-expression that is being checked for unexpanded parameter packs. |
Definition at line 430 of file SemaTemplateVariadic.cpp.
References clang::Expr::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::RequiresExpr::getBeginLoc(), clang::RequiresExpr::getLocalParameters(), and UPPC_Requirement.
Referenced by ActOnRequiresExpr().
bool Sema::DiagnoseUnexpandedParameterPacks | ( | SourceLocation | Loc, |
UnexpandedParameterPackContext | UPPC, | ||
ArrayRef< UnexpandedParameterPack > | Unexpanded | ||
) |
Diagnose unexpanded parameter packs.
Diagnose all of the unexpanded parameter packs in the given vector.
Loc | The location at which we should emit the diagnostic. |
UPPC | The context in which we are diagnosing unexpanded parameter packs. |
Unexpanded | the set of unexpanded parameter packs. |
Definition at line 303 of file SemaTemplateVariadic.cpp.
References clang::declaresSameEntity(), clang::Func, FunctionScopes, and getEnclosingLambda().
Referenced by checkExceptionSpecification(), DiagnoseUnexpandedParameterPack(), and DiagnoseUnexpandedParameterPackInRequiresExpr().
void Sema::DiagnoseUnguardedAvailabilityViolations | ( | Decl * | FD | ) |
Issue any -Wunguarded-availability warnings in FD
.
Definition at line 987 of file SemaAvailability.cpp.
References clang::Decl::getAsFunction().
bool Sema::DiagnoseUninstantiableTemplate | ( | SourceLocation | PointOfInstantiation, |
NamedDecl * | Instantiation, | ||
bool | InstantiatedFromMember, | ||
const NamedDecl * | Pattern, | ||
const NamedDecl * | PatternDef, | ||
TemplateSpecializationKind | TSK, | ||
bool | Complain = true |
||
) |
Determine whether we would be unable to instantiate this template (because it either has no definition, or is in the process of being instantiated).
Definition at line 767 of file SemaTemplate.cpp.
References Definition, and clang::Decl::isInvalidDecl().
Referenced by InstantiateClass(), InstantiateEnum(), InstantiateFunctionDefinition(), and InstantiateVariableDefinition().
bool Sema::DiagnoseUnknownTemplateName | ( | const IdentifierInfo & | II, |
SourceLocation | IILoc, | ||
Scope * | S, | ||
const CXXScopeSpec * | SS, | ||
TemplateTy & | SuggestedTemplate, | ||
TemplateNameKind & | SuggestedKind | ||
) |
Definition at line 350 of file SemaTemplate.cpp.
void Sema::DiagnoseUnknownTypeName | ( | IdentifierInfo *& | II, |
SourceLocation | IILoc, | ||
Scope * | S, | ||
CXXScopeSpec * | SS, | ||
ParsedType & | SuggestedType, | ||
bool | IsTemplateName = false |
||
) |
Definition at line 703 of file SemaDecl.cpp.
void Sema::DiagnoseUnsatisfiedConstraint | ( | const ASTConstraintSatisfaction & | Satisfaction, |
bool | First = true |
||
) |
Emit diagnostics explaining why a constraint expression was deemed unsatisfied.
Definition at line 1205 of file SemaConcept.cpp.
References diagnoseUnsatisfiedConstraintExpr(), clang::First, and clang::ASTConstraintSatisfaction::IsSatisfied.
void Sema::DiagnoseUnsatisfiedConstraint | ( | const ConstraintSatisfaction & | Satisfaction, |
bool | First = true |
||
) |
Emit diagnostics explaining why a constraint expression was deemed unsatisfied.
First | whether this is the first time an unsatisfied constraint is diagnosed for this error. |
Definition at line 1195 of file SemaConcept.cpp.
References clang::ConstraintSatisfaction::Details, diagnoseUnsatisfiedConstraintExpr(), clang::First, and clang::ConstraintSatisfaction::IsSatisfied.
Referenced by BuildStaticAssertDeclaration().
void Sema::DiagnoseUnterminatedPragmaAlignPack | ( | ) |
Definition at line 487 of file SemaAttr.cpp.
References AlignPackStack, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::Lexer::findLocationAfterToken(), clang::SourceLocation::isValid(), LangOpts, and SourceMgr.
Referenced by ActOnEndOfTranslationUnit().
void Sema::DiagnoseUnterminatedPragmaAttribute | ( | ) |
Definition at line 1129 of file SemaAttr.cpp.
References clang::SemaBase::Diag(), and PragmaAttributeStack.
Referenced by ActOnEndOfTranslationUnit().
void Sema::DiagnoseUnusedButSetDecl | ( | const VarDecl * | VD, |
DiagReceiverTy | DiagReceiver | ||
) |
If VD is set but not otherwise used, diagnose, for a parameter or a variable.
Definition at line 2158 of file SemaDecl.cpp.
References clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::Decl::hasAttr(), clang::VarDecl::isCXXCondDecl(), clang::NamedDecl::isPlaceholderVar(), and clang::Decl::isReferenced().
void Sema::DiagnoseUnusedDecl | ( | const NamedDecl * | ND | ) |
Definition at line 2125 of file SemaDecl.cpp.
Referenced by BuildVariableInstantiation().
void Sema::DiagnoseUnusedDecl | ( | const NamedDecl * | ND, |
DiagReceiverTy | DiagReceiver | ||
) |
DiagnoseUnusedDecl - Emit warnings about declarations that are not used unless they are marked attr(unused).
Definition at line 2132 of file SemaDecl.cpp.
References GenerateFixForUnusedDecl(), and ShouldDiagnoseUnusedDecl().
DiagnoseUnusedExprResult - If the statement passed in is an expression whose result is unused, warn.
Definition at line 226 of file SemaStmt.cpp.
Referenced by ActOnFinishFullExpr().
bool Sema::DiagnoseUnusedLambdaCapture | ( | SourceRange | CaptureRange, |
const sema::Capture & | From | ||
) |
Diagnose if an explicit lambda capture is unused.
Returns true if a diagnostic is emitted.
Definition at line 1977 of file SemaLambda.cpp.
References clang::FixItHint::CreateRemoval(), Diag(), clang::sema::Capture::getLocation(), clang::sema::Capture::getVariable(), clang::sema::Capture::isInitCapture(), clang::sema::Capture::isNonODRUsed(), clang::NamedDecl::isPlaceholderVar(), clang::sema::Capture::isThisCapture(), and clang::sema::Capture::isVLATypeCapture().
void Sema::DiagnoseUnusedNestedTypedefs | ( | const RecordDecl * | D | ) |
Definition at line 2107 of file SemaDecl.cpp.
void Sema::DiagnoseUnusedNestedTypedefs | ( | const RecordDecl * | D, |
DiagReceiverTy | DiagReceiver | ||
) |
Definition at line 2112 of file SemaDecl.cpp.
References clang::DeclContext::decls(), clang::TypeDecl::getTypeForDecl(), clang::Type::isDependentType(), and clang::T.
void Sema::DiagnoseUnusedParameters | ( | ArrayRef< ParmVarDecl * > | Parameters | ) |
Diagnose any unused parameters in the given sequence of ParmVarDecl pointers.
Definition at line 15346 of file SemaDecl.cpp.
References Diag(), and clang::Parameter.
bool Sema::DiagnoseUseOfDecl | ( | NamedDecl * | D, |
ArrayRef< SourceLocation > | Locs, | ||
const ObjCInterfaceDecl * | UnknownObjCClass = nullptr , |
||
bool | ObjCPropertyAccess = false , |
||
bool | AvoidPartialAvailabilityChecks = false , |
||
ObjCInterfaceDecl * | ClassReceiver = nullptr , |
||
bool | SkipTrailingRequiresClause = false |
||
) |
Determine whether the use of this declaration is valid, and emit any corresponding diagnostics.
This routine diagnoses various problems with referencing declarations that can occur when using a declaration. For example, it might warn if a deprecated or unavailable declaration is being used, or produce an error (and return true) if a C++0x deleted function is being used.
Definition at line 229 of file SemaExpr.cpp.
Referenced by ActOnDecltypeExpression(), BuildTypeofExprType(), CheckDestructor(), checkDestructorReference(), DiagnoseUseOfOverloadedDecl(), diagnoseUseOfProtocols(), FinalizeVarWithDestructor(), clang::SemaObjC::FindProtocolDeclaration(), MarkBaseAndMemberDestructorsReferenced(), MarkVirtualBaseDestructorsReferenced(), MaybeBindToTemporary(), PerformImplicitConversion(), resolveAndFixAddressOfSingleOverloadCandidate(), ResolveAndFixSingleFunctionTemplateSpecialization(), and SetDelegatingInitializer().
void Sema::DiagnoseUseOfDeletedFunction | ( | SourceLocation | Loc, |
SourceRange | Range, | ||
DeclarationName | Name, | ||
OverloadCandidateSet & | CandidateSet, | ||
FunctionDecl * | Fn, | ||
MultiExprArg | Args, | ||
bool | IsMember = false |
||
) |
Definition at line 16523 of file SemaOverload.cpp.
|
inline |
Definition at line 5370 of file Sema.h.
References DiagnoseUseOfDecl(), and Loc.
Warn when implicitly casting 0 to nullptr.
Definition at line 630 of file Sema.cpp.
References CodeSynthesisContexts, clang::CPlusPlus11, clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), Diags, findMacroSpelling(), clang::Stmt::getBeginLoc(), getCurFunctionDecl(), getLangOpts(), clang::Stmt::getSourceRange(), clang::DiagnosticsEngine::getSuppressSystemWarnings(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::FunctionDecl::isDefaulted(), clang::DiagnosticsEngine::isIgnored(), clang::SourceManager::isInSystemMacro(), clang::Type::isNullPtrType(), clang::Sema::CodeSynthesisContext::RewritingOperatorAsSpaceship, and SourceMgr.
Referenced by ImpCastExprToType().
void Sema::DiagPlaceholderFieldDeclDefinitions | ( | RecordDecl * | Record | ) |
Emit diagnostic warnings for placeholder members.
We can only do that after the class is fully constructed, as anonymous union/structs can insert placeholders in their parent scope (which might be a Record).
Definition at line 5434 of file SemaDecl.cpp.
References clang::CPlusPlus, clang::First, clang::Decl::getLocation(), and clang::NamedDecl::isPlaceholderVar().
void Sema::DiagPlaceholderVariableDefinition | ( | SourceLocation | Loc | ) |
Definition at line 736 of file SemaDeclCXX.cpp.
References clang::CPlusPlus26, clang::SemaBase::Diag(), getLangOpts(), and Loc.
bool Sema::DiagRedefinedPlaceholderFieldDecl | ( | SourceLocation | Loc, |
RecordDecl * | ClassDecl, | ||
const IdentifierInfo * | Name | ||
) |
Definition at line 4365 of file SemaDeclCXX.cpp.
bool Sema::DiagRuntimeBehavior | ( | SourceLocation | Loc, |
ArrayRef< const Stmt * > | Stmts, | ||
const PartialDiagnostic & | PD | ||
) |
Similar, but diagnostic is only produced if all the specified statements are reachable.
Emit a diagnostic that describes an effect on the run-time behavior of the program being compiled.
This routine emits the given diagnostic when the code currently being type-checked is "potentially evaluated", meaning that there is a possibility that the code will actually be executable. Code in sizeof() expressions, code used only during overload resolution, etc., are not potentially evaluated. This routine will suppress such diagnostics or, in the absolutely nutty case of potentially potentially evaluated expressions (C++ typeid), queue the diagnostic to potentially emit it later.
This routine should be used for all diagnostics that describe the run-time behavior of a program, such as passing a non-POD value through an ellipsis. Failure to do so will likely result in spurious diagnostics or failures during overload resolution or within sizeof/alignof/typeof/typeid.
Definition at line 20118 of file SemaExpr.cpp.
References Loc.
bool Sema::DiagRuntimeBehavior | ( | SourceLocation | Loc, |
const Stmt * | Statement, | ||
const PartialDiagnostic & | PD | ||
) |
Conditionally issue a diagnostic based on the current evaluation context.
Statement | If Statement is non-null, delay reporting the diagnostic until the function body is parsed, and then do a basic reachability analysis to determine if the statement is reachable. If it is unreachable, the diagnostic will not be emitted. |
Definition at line 20145 of file SemaExpr.cpp.
References Loc.
void Sema::DiscardCleanupsInEvaluationContext | ( | ) |
Definition at line 17818 of file SemaExpr.cpp.
Referenced by clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd(), BuildBaseInitializer(), BuildMemberInitializer(), and MaybeCreateExprWithCleanups().
This function checks if the expression is in the sef of potentially misaligned members and it is converted to some pointer type T with lower or equal alignment requirements.
If so it removes it. This is used when we do not want to diagnose such misaligned access (e.g. in conversions to void*).
Definition at line 18251 of file SemaChecking.cpp.
References clang::Type::getPointeeType(), clang::Expr::IgnoreParens(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), and clang::T.
Referenced by BuildCXXNamedCast().
void Sema::emitAndClearUnusedLocalTypedefWarnings | ( | ) |
Definition at line 1063 of file Sema.cpp.
References clang::SemaBase::Diag(), and UnusedLocalTypedefNameCandidates.
void Sema::EmitCurrentDiagnostic | ( | unsigned | DiagID | ) |
Cause the active diagnostic on the DiagosticsEngine to be emitted.
This is closely coupled to the SemaDiagnosticBuilder class and should not be used elsewhere.
Definition at line 1572 of file Sema.cpp.
References AccessCheckingSFINAE, clang::DiagnosticsEngine::Clear(), Context, clang::CPlusPlus11, clang::SemaBase::Diag(), Diags, clang::DiagnosticsEngine::EmitCurrentDiagnostic(), clang::DiagnosticsEngine::getCurrentDiagID(), clang::DiagnosticsEngine::getCurrentDiagLoc(), clang::ASTContext::getDiagAllocator(), clang::DiagnosticIDs::getDiagnosticSFINAEResponse(), getLangOpts(), clang::Diagnostic::getLocation(), getPrintingPolicy(), clang::DiagnosticIDs::isBuiltinNote(), isSFINAEContext(), Loc, NumSFINAEErrors, PrintContextStack(), clang::DiagnosticsEngine::setLastDiagnosticIgnored(), clang::ASTContext::setPrintingPolicy(), clang::DiagnosticIDs::SFINAE_AccessControl, clang::DiagnosticIDs::SFINAE_Report, clang::DiagnosticIDs::SFINAE_SubstitutionFailure, and clang::DiagnosticIDs::SFINAE_Suppress.
Referenced by clang::SemaBase::ImmediateDiagBuilder::~ImmediateDiagBuilder().
void Sema::emitDeferredDiags | ( | ) |
Definition at line 1911 of file Sema.cpp.
References DeviceDeferredDiags, and LangOpts.
Referenced by ActOnEndOfTranslationUnitFragment().
bool Sema::EnsureTemplateArgumentListConstraints | ( | TemplateDecl * | Template, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
SourceRange | TemplateIDRange | ||
) |
Ensure that the given template arguments satisfy the constraints associated with the given template, emitting a diagnostic if they do not.
Template | The template to which the template arguments are being provided. |
TemplateArgs | The converted, canonicalized template arguments. |
TemplateIDRange | The source range of the template id that caused the constraints check. |
Definition at line 890 of file SemaConcept.cpp.
References CheckConstraintSatisfaction(), Diag(), clang::TemplateDecl::getAssociatedConstraints(), clang::SourceRange::getBegin(), clang::MultiLevelTemplateArgumentList::getInnermost(), clang::TemplateDecl::getTemplateParameters(), int, and clang::ConstraintSatisfaction::IsSatisfied.
void Sema::EnterDeclaratorContext | ( | Scope * | S, |
DeclContext * | DC | ||
) |
EnterDeclaratorContext - Used when we must lookup names in the context of a declarator's nested name specifier.
Definition at line 1367 of file SemaDecl.cpp.
void Sema::EnterTemplatedContext | ( | Scope * | S, |
DeclContext * | DC | ||
) |
Enter a template parameter scope, after it's been associated with a particular DeclContext.
Causes lookup within the scope to chain through enclosing contexts in the correct order.
Definition at line 1415 of file SemaDecl.cpp.
Referenced by ActOnReenterTemplateScope().
ExprResult Sema::EvaluateConvertedConstantExpression | ( | Expr * | E, |
QualType | T, | ||
APValue & | Value, | ||
Sema::CCEKind | CCE, | ||
bool | RequireInt, | ||
const APValue & | PreNarrowingValue | ||
) |
EvaluateConvertedConstantExpression - Evaluate an Expression That is a converted constant expression (which was built with BuildConvertedConstantExpression)
Definition at line 6324 of file SemaOverload.cpp.
References CCEK_TemplateArg, clang::Expr::ClassTemplateArgument, Context, clang::ConstantExpr::Create(), clang::Expr::EvalStatus::Diag, clang::SemaBase::Diag(), clang::Expr::EvaluateAsConstantExpr(), clang::ExprError(), clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), clang::APValue::isAbsent(), clang::APValue::isInt(), clang::Type::isRecordType(), clang::Expr::NonClassTemplateArgument, clang::None, clang::Expr::Normal, clang::T, and clang::Expr::EvalResult::Val.
void Sema::EvaluateImplicitExceptionSpec | ( | SourceLocation | Loc, |
FunctionDecl * | FD | ||
) |
Evaluate the implicit exception specification for a defaulted special member function.
Definition at line 7643 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), computeImplicitExceptionSpec(), clang::EST_Unevaluated, clang::FunctionProtoType::getExceptionSpecType(), clang::ValueDecl::getType(), Loc, and UpdateExceptionSpec().
Referenced by ResolveExceptionSpec().
bool Sema::EvaluateStaticAssertMessageAsString | ( | Expr * | Message, |
std::string & | Result, | ||
ASTContext & | Ctx, | ||
bool | ErrorOnInvalidMessage | ||
) |
Definition at line 17365 of file SemaDeclCXX.cpp.
References BuildCallExpr(), BuildConvertedConstantExpression(), BuildMemberReferenceExpr(), CCEK_StaticAssertMessageData, CCEK_StaticAssertMessageSize, clang::ASTContext::CharTy, Context, clang::OverloadCandidateSet::CSK_Normal, clang::SemaBase::Diag(), Diags, clang::LookupResult::empty(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getConstType(), clang::Preprocessor::getIdentifierInfo(), clang::LookupResult::getNameLoc(), clang::ASTContext::getPointerType(), clang::ASTContext::getSizeType(), clang::DiagnosticsEngine::isIgnored(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), Loc, LookupMemberName, LookupQualifiedName(), clang::Member, PP, clang::T, and TemporaryMaterializationConversion().
Referenced by BuildStaticAssertDeclaration().
void Sema::ExitDeclaratorContext | ( | Scope * | S | ) |
Definition at line 1402 of file SemaDecl.cpp.
Definition at line 2074 of file SemaExpr.cpp.
References getPredefinedExprDecl().
Definition at line 12830 of file SemaOverload.cpp.
References Context, clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::CanQual< T >::getUnqualifiedType(), and clang::interp::Ret().
void Sema::FillInlineAsmIdentifierInfo | ( | Expr * | Res, |
llvm::InlineAsmIdentifierInfo & | Info | ||
) |
Definition at line 750 of file SemaStmtAsm.cpp.
References clang::Expr::EvaluateAsRValue(), clang::Expr::getType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Expr::isPRValue(), and clang::T.
void Sema::FilterAcceptableTemplateNames | ( | LookupResult & | R, |
bool | AllowFunctionTemplates = true , |
||
bool | AllowDependent = true |
||
) |
Definition at line 149 of file SemaTemplate.cpp.
References clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::LookupResult::Filter::hasNext(), clang::LookupResult::makeFilter(), and clang::LookupResult::Filter::next().
void Sema::FilterLookupForScope | ( | LookupResult & | R, |
DeclContext * | Ctx, | ||
Scope * | S, | ||
bool | ConsiderLinkage, | ||
bool | AllowInlineNamespace | ||
) |
Filters out lookup results that don't fall within the given scope as determined by isDeclInScope.
Definition at line 1609 of file SemaDecl.cpp.
Referenced by clang::TemplateDeclInstantiator::VisitFunctionDecl().
void Sema::FilterUsingLookup | ( | Scope * | S, |
LookupResult & | Previous | ||
) |
Remove decls we can't actually see from a lookup being used to declare shadow using decls.
S | - The scope of the potential shadow decl |
Previous | - The lookup of a potential shadow decl's name. |
Definition at line 12851 of file SemaDeclCXX.cpp.
void Sema::FinalizeDeclaration | ( | Decl * | D | ) |
FinalizeDeclaration - called by ParseDeclarationAfterDeclarator to perform any semantic actions necessary after any initializer has been attached.
Definition at line 14853 of file SemaDecl.cpp.
References clang::Decl::addAttr(), clang::Decl::hasAttr(), clang::VarDecl::hasGlobalStorage(), and clang::VarDecl::isThisDeclarationADefinition().
Referenced by FinishForRangeVarDecl().
Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup | ( | Scope * | S, |
const DeclSpec & | DS, | ||
ArrayRef< Decl * > | Group | ||
) |
Definition at line 15008 of file SemaDecl.cpp.
void Sema::FinalizeVarWithDestructor | ( | VarDecl * | VD, |
const RecordType * | DeclInitType | ||
) |
FinalizeVarWithDestructor - Prepare for calling destructor on the constructed variable.
Definition at line 16180 of file SemaDeclCXX.cpp.
References CheckDestructorAccess(), clang::Expr::containsErrors(), Context, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), clang::VarDecl::evaluateDestruction(), clang::VarDecl::evaluateValue(), getASTContext(), clang::NamedDecl::getDeclName(), clang::VarDecl::getInit(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasGlobalStorage(), clang::CXXRecordDecl::hasIrrelevantDestructor(), clang::Type::isArrayType(), clang::VarDecl::isConstexpr(), clang::DeclContext::isDependentContext(), clang::Decl::isInvalidDecl(), clang::VarDecl::isNoDestroy(), clang::VarDecl::isStaticLocal(), clang::Expr::isValueDependent(), LookupDestructor(), MarkFunctionReferenced(), clang::VarDecl::needsDestruction(), and PDiag().
bool Sema::FindAllocationFunctions | ( | SourceLocation | StartLoc, |
SourceRange | Range, | ||
AllocationFunctionScope | NewScope, | ||
AllocationFunctionScope | DeleteScope, | ||
QualType | AllocType, | ||
bool | IsArray, | ||
bool & | PassAlignment, | ||
MultiExprArg | PlaceArgs, | ||
FunctionDecl *& | OperatorNew, | ||
FunctionDecl *& | OperatorDelete, | ||
bool | Diagnose = true |
||
) |
Finds the overloads of operator new and delete that are appropriate for the allocation.
Definition at line 2735 of file SemaExprCXX.cpp.
References AFS_Class, AFS_Global, clang::Type::castAs(), clang::LookupResult::clear(), Context, clang::ASTContext::DeclarationNames, DeclareGlobalNewDelete(), clang::SemaBase::Diag(), clang::LookupResult::empty(), clang::tooling::Filter, clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), clang::DeclarationNameTable::getCXXOperatorName(), clang::DeclarationName::getCXXOverloadedOperator(), clang::RecordType::getDecl(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::ASTContext::getSizeType(), getStdAlignValT(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::getTypeSize(), clang::LookupResult::isAmbiguous(), clang::Type::isRecordType(), LookupOrdinaryName, LookupQualifiedName(), clang::LookupResult::makeFilter(), Range, resolveAllocationOverload(), clang::LookupResult::suppressDiagnostics(), and clang::ASTContext::VoidTy.
void Sema::FindAssociatedClassesAndNamespaces | ( | SourceLocation | InstantiationLoc, |
ArrayRef< Expr * > | Args, | ||
AssociatedNamespaceSet & | AssociatedNamespaces, | ||
AssociatedClassSet & | AssociatedClasses | ||
) |
Find the associated classes and namespaces for argument-dependent lookup for a call with the given set of arguments.
This routine computes the sets of associated classes and associated namespaces searched by argument-dependent lookup (C++ [basic.lookup.argdep]) for a given set of arguments.
Definition at line 3369 of file SemaLookup.cpp.
References addAssociatedClassesAndNamespaces(), Context, clang::OverloadExpr::decls(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::Decl::getAsFunction(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::NamedDecl::getUnderlyingDecl(), and clang::ASTContext::OverloadTy.
Referenced by argumentDependentLookup(), and DiagnoseTwoPhaseLookup().
QualType Sema::FindCompositePointerType | ( | SourceLocation | Loc, |
Expr *& | E1, | ||
Expr *& | E2, | ||
bool | ConvertArgs = true |
||
) |
Find a merged pointer type and convert the two expressions to it.
This finds the composite pointer type for E1
and E2
according to C++2a [expr.type]p3. It converts both expressions to this type and returns it. It does not emit diagnostics (FIXME: that's not true if ConvertArgs
is true
).
Loc | The location of the operator requiring these two expressions to be converted to the composite pointer type. |
ConvertArgs | If false , do not convert E1 and E2 to the target type. |
The class for a pointer-to-member; a constant array type with a bound (if any) for an array.
Definition at line 7151 of file SemaExprCXX.cpp.
References Array, clang::Class, Context, clang::CPlusPlus, clang::CPlusPlus17, clang::CPlusPlus20, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::Qualifiers::fromCVRUMask(), clang::ActionResult< PtrTy, Compress >::get(), clang::Qualifiers::getAddressSpace(), clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::MemberPointerType::getClass(), clang::ASTContext::getCommonSugaredType(), clang::ASTContext::getConstantArrayType(), clang::Qualifiers::getCVRUQualifiers(), clang::ArrayType::getElementType(), clang::ASTContext::getFunctionType(), clang::ASTContext::getIncompleteArrayType(), getLangOpts(), clang::ASTContext::getMemberPointerType(), clang::FunctionType::ExtInfo::getNoReturn(), clang::Qualifiers::getObjCGCAttr(), clang::Qualifiers::getObjCLifetime(), clang::ASTContext::getObjCObjectPointerType(), clang::Type::getPointeeType(), clang::PointerType::getPointeeType(), clang::MemberPointerType::getPointeeType(), clang::ObjCObjectPointerType::getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::Expr::getType(), clang::ASTContext::getUnqualifiedArrayType(), clang::ASTContext::hasSameType(), ImpCastExprToType(), clang::Qualifiers::isAddressSpaceSupersetOf(), clang::Type::isAnyPointerType(), IsDerivedFrom(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjectType(), clang::isPtrSizeAddressSpace(), clang::Type::isVoidPointerType(), clang::Type::isVoidType(), Loc, clang::ASTContext::mergeExceptionSpecs(), clang::Normal, clang::Expr::NPC_ValueDependentIsNull, clang::Qualifiers::setAddressSpace(), clang::Qualifiers::setObjCGCAttr(), clang::Qualifiers::setObjCLifetime(), clang::T, and clang::FunctionType::ExtInfo::withNoReturn().
Referenced by CXXCheckConditionalOperands(), and FindCompositePointerType().
|
inline |
Definition at line 6930 of file Sema.h.
References FindCompositePointerType(), clang::ActionResult< PtrTy, Compress >::get(), and Loc.
bool Sema::FindDeallocationFunction | ( | SourceLocation | StartLoc, |
CXXRecordDecl * | RD, | ||
DeclarationName | Name, | ||
FunctionDecl *& | Operator, | ||
bool | Diagnose = true , |
||
bool | WantSize = false , |
||
bool | WantAligned = false |
||
) |
Definition at line 3352 of file SemaExprCXX.cpp.
FunctionDecl * Sema::FindDeallocationFunctionForDestructor | ( | SourceLocation | StartLoc, |
CXXRecordDecl * | RD | ||
) |
Definition at line 3335 of file SemaExprCXX.cpp.
Referenced by CheckDestructor().
Find the failed Boolean condition within a given Boolean constant expression, and describe it with a string.
Definition at line 4538 of file SemaTemplate.cpp.
References collectConjunctionTerms(), ConstantEvaluated, clang::Expr::IgnoreParenImpCasts(), and lookThroughRangesV3Condition().
Referenced by BuildStaticAssertDeclaration().
NamedDecl * Sema::FindFirstQualifierInScope | ( | Scope * | S, |
NestedNameSpecifier * | NNS | ||
) |
If the given nested-name-specifier begins with a bare identifier (e.g., Base::), perform name lookup for that identifier as a nested-name-specifier within the given scope, and return the result of that name lookup.
Definition at line 393 of file SemaCXXScopeSpec.cpp.
void Sema::FindHiddenVirtualMethods | ( | CXXMethodDecl * | MD, |
SmallVectorImpl< CXXMethodDecl * > & | OverloadedMethods | ||
) |
Check if a method overloads virtual methods in a base class without overriding any.
Definition at line 10402 of file SemaDeclCXX.cpp.
References clang::NamedDecl::getDeclName(), and clang::DeclarationName::isIdentifier().
Referenced by CheckOverrideControl(), and DiagnoseHiddenVirtualMethods().
CXXConstructorDecl * Sema::findInheritingConstructor | ( | SourceLocation | Loc, |
CXXConstructorDecl * | BaseCtor, | ||
ConstructorUsingShadowDecl * | DerivedShadow | ||
) |
Given a derived-class using shadow declaration for a constructor and the correspnding base class constructor, find or create the implicit synthesized derived class constructor to use for this initialization.
Find or create the fake constructor we synthesize to model constructing an object of a derived class via a constructor of a base class.
Definition at line 14117 of file SemaDeclCXX.cpp.
References clang::Decl::getLocation(), and clang::ConstructorUsingShadowDecl::getParent().
DeclContext * Sema::FindInstantiatedContext | ( | SourceLocation | Loc, |
DeclContext * | DC, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Finds the instantiation of the given declaration context within the current instantiation.
Definition at line 6623 of file SemaTemplateInstantiateDecl.cpp.
References FindInstantiatedDecl(), ID, and Loc.
Referenced by FindInstantiatedDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
NamedDecl * Sema::FindInstantiatedDecl | ( | SourceLocation | Loc, |
NamedDecl * | D, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool | FindingInstantiatedContext = false |
||
) |
Find the instantiation of the given declaration within the current instantiation.
This routine is intended to be used when D
is a declaration referenced from within a template, that needs to mapped into the corresponding declaration within an instantiation. For example, given:
In the instantiation of X<int>::getKind(), we need to map the EnumConstantDecl
for KnownValue
(which refers to X<T>::<Kind>::KnownValue) to its instantiation (X<int>::<Kind>::KnownValue). FindInstantiatedDecl
performs this mapping from within the instantiation of X<int>.
Definition at line 6671 of file SemaTemplateInstantiateDecl.cpp.
References clang::TemplateArgumentListInfo::addArgument(), ArgumentPackSubstitutionIndex, clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, CheckTemplateIdType(), CodeSynthesisContexts, Context, CurContext, CurrentInstantiationScope, clang::SemaBase::Diag(), clang::DeclContext::Equals(), FindInstantiatedContext(), clang::LocalInstantiationScope::findInstantiationOf(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::ClassTemplateDecl::getCanonicalDecl(), clang::RecordType::getDecl(), clang::Decl::getDeclContext(), clang::Decl::getFriendObjectKind(), clang::MultiLevelTemplateArgumentList::getInnermost(), clang::Decl::getLexicalDeclContext(), clang::Decl::getNonTransparentDeclContext(), clang::MultiLevelTemplateArgumentList::getNumRetainedOuterLevels(), clang::DeclContext::getParent(), clang::TemplateDecl::getTemplateParameters(), clang::CXXRecordDecl::getTemplateSpecializationKind(), getTrivialTemplateArgumentLoc(), clang::ASTContext::getTypeDeclType(), clang::LocalInstantiationScope::InstantiatedLocal(), clang::TagType::isBeingDefined(), isDependentContextAtLevel(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), isInstantiationOf(), clang::Decl::isInvalidDecl(), Loc, clang::TemplateArgument::Pack, RequireCompleteType(), clang::TemplateParameterList::size(), SubstDecl(), clang::T, clang::TSK_ExplicitSpecialization, and usesPartialOrExplicitSpecialization().
Referenced by BuildVariableInstantiation(), FindInstantiatedContext(), InstantiateMemInitializers(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::TemplateDeclInstantiator::SubstDefaultedFunction(), SubstParmVarDecl(), clang::TemplateDeclInstantiator::VisitBaseUsingDecls(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
NamedDecl * Sema::findLocallyScopedExternCDecl | ( | DeclarationName | Name | ) |
Look for a locally scoped extern "C" declaration by the given name.
Definition at line 6781 of file SemaDecl.cpp.
bool Sema::findMacroSpelling | ( | SourceLocation & | locref, |
StringRef | name | ||
) |
Looks through the macro-expansion chain for the given location, looking for a macro expansion with the given name.
If one is found, returns true and sets the location to that expansion loc.
Definition at line 2191 of file Sema.cpp.
References clang::SourceLocation::isMacroID(), and clang::transformer::name().
Referenced by diagnoseZeroToNullptrConversion().
FunctionDecl * Sema::FindUsualDeallocationFunction | ( | SourceLocation | StartLoc, |
bool | CanProvideSize, | ||
bool | Overaligned, | ||
DeclarationName | Name | ||
) |
Definition at line 3316 of file SemaExprCXX.cpp.
StmtResult Sema::FinishCXXForRangeStmt | ( | Stmt * | S, |
Stmt * | B | ||
) |
FinishCXXForRangeStmt - Attach the body to a C++0x for-range statement.
This is a separate step from ActOnCXXForRangeStmt because analysis of the body cannot be performed until after the type of the range variable is determined.
Definition at line 3137 of file SemaStmt.cpp.
void Sema::finishLambdaExplicitCaptures | ( | sema::LambdaScopeInfo * | LSI | ) |
Note that we have finished the explicit captures for the given lambda.
Definition at line 540 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::finishedExplicitCaptures().
TemplateDeductionResult Sema::FinishTemplateArgumentDeduction | ( | FunctionTemplateDecl * | FunctionTemplate, |
SmallVectorImpl< DeducedTemplateArgument > & | Deduced, | ||
unsigned | NumExplicitlySpecified, | ||
FunctionDecl *& | Specialization, | ||
sema::TemplateDeductionInfo & | Info, | ||
SmallVectorImpl< OriginalCallArg > const * | OriginalCallArgs = nullptr , |
||
bool | PartialOverloading = false , |
||
llvm::function_ref< bool()> | CheckNonDependent = [] { return false; } |
||
) |
Finish template argument deduction for a function template, checking the deduced template arguments for completeness and forming the function template specialization.
OriginalCallArgs | If non-NULL, the original call arguments against which the deduced argument types should be compared. |
Definition at line 3827 of file SemaTemplateDeduction.cpp.
References ConvertDeducedTemplateArguments(), clang::TemplateArgumentList::CreateCopy(), clang::sema::TemplateDeductionInfo::getLocation(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::InstantiationDepth, clang::Sema::InstantiatingTemplate::isInvalid(), clang::NonDependentConversionFailure, clang::Success, clang::Unevaluated, and Unevaluated.
ExprResult Sema::FixOverloadedFunctionReference | ( | Expr * | E, |
DeclAccessPair | Found, | ||
FunctionDecl * | Fn | ||
) |
FixOverloadedFunctionReference - E is an expression that refers to a C++ overloaded function (possibly with some parentheses and perhaps a '&' around it).
We have resolved the overloaded function to the function declaration Fn, so patch up the expression E to refer (possibly indirectly) to Fn. Returns the new expr.
Definition at line 16304 of file SemaOverload.cpp.
References clang::ASTContext::BoundMemberTy, BuildCXXThisExpr(), BuildDeclRefExpr(), BuildMemberExpr(), clang::ASTContext::BuiltinFnTy, clang::ASTContext::BuiltinInfo, CheckUseOfCXXMethodAsAddressOfOperand(), Context, clang::UnaryOperator::Create(), clang::ImplicitCastExpr::Create(), clang::GenericSelectionExpr::Create(), CreateBuiltinUnaryOp(), CurFPFeatureOverrides(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::FunctionDecl::getBuiltinID(), clang::TargetInfo::getCXXABI(), clang::DeclAccessPair::getDecl(), clang::Decl::getDeclContext(), getLangOpts(), clang::ASTContext::getMemberPointerType(), clang::ASTContext::getTargetInfo(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::Expr::getValueKind(), clang::ASTContext::hasSameType(), isCompleteType(), clang::Builtin::Context::isDirectlyAddressable(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::TargetCXXABI::isMicrosoft(), clang::CXXMethodDecl::isStatic(), Loc, clang::OK_Ordinary, clang::DeclRefExpr::setHadMultipleCandidates(), clang::ast_matchers::type, clang::VK_LValue, and clang::VK_PRValue.
Referenced by FixOverloadedFunctionReference(), PerformImplicitConversion(), resolveAndFixAddressOfSingleOverloadCandidate(), and ResolveAndFixSingleFunctionTemplateSpecialization().
ExprResult Sema::FixOverloadedFunctionReference | ( | ExprResult | E, |
DeclAccessPair | FoundDecl, | ||
FunctionDecl * | Fn | ||
) |
Definition at line 16499 of file SemaOverload.cpp.
References FixOverloadedFunctionReference(), and clang::ActionResult< PtrTy, Compress >::get().
void Sema::ForceDeclarationOfImplicitMembers | ( | CXXRecordDecl * | Class | ) |
Force the declaration of any implicitly-declared members of this class.
Definition at line 1060 of file SemaLookup.cpp.
References CanDeclareSpecialMemberFunction(), clang::Class, and clang::CPlusPlus11.
Referenced by checkClassLevelDLLAttribute().
ExprResult Sema::forceUnknownAnyToType | ( | Expr * | E, |
QualType | ToType | ||
) |
Force an expression with unknown-type to an expression of the given type.
Definition at line 20795 of file SemaExpr.cpp.
Referenced by ActOnFinishFullExpr().
bool Sema::FormatStringHasSArg | ( | const StringLiteral * | FExpr | ) |
Definition at line 11793 of file SemaChecking.cpp.
References clang::StringLiteral::getString(), and clang::T.
RedeclarationKind Sema::forRedeclarationInCurContext | ( | ) | const |
Definition at line 6010 of file SemaLookup.cpp.
References CurContext, ForExternalRedeclaration, and ForVisibleRedeclaration.
Referenced by BuildVariableInstantiation(), isDeclaratorFunctionLike(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
void Sema::FreeVisContext | ( | ) |
FreeVisContext - Deallocate and null out VisContext.
Definition at line 1235 of file SemaAttr.cpp.
References VisContext.
Referenced by ~Sema().
bool Sema::FriendConstraintsDependOnEnclosingTemplate | ( | const FunctionDecl * | FD | ) |
Definition at line 869 of file SemaConcept.cpp.
References CalculateTemplateDepthForConstraints(), clang::TemplateDecl::getAssociatedConstraints(), clang::FunctionDecl::getDescribedFunctionTemplate(), and clang::Decl::getFriendObjectKind().
bool Sema::FunctionNonObjectParamTypesAreEqual | ( | const FunctionDecl * | OldFunction, |
const FunctionDecl * | NewFunction, | ||
unsigned * | ArgPos = nullptr , |
||
bool | Reversed = false |
||
) |
Definition at line 3337 of file SemaOverload.cpp.
References clang::Decl::getFunctionType(), clang::FunctionDecl::getNumNonObjectParams(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), and clang::Reversed.
bool Sema::FunctionParamTypesAreEqual | ( | ArrayRef< QualType > | Old, |
ArrayRef< QualType > | New, | ||
unsigned * | ArgPos = nullptr , |
||
bool | Reversed = false |
||
) |
FunctionParamTypesAreEqual - This routine checks two function proto types for equality of their parameter types.
Caller has already checked that they have same number of parameters. If the parameters are different, ArgPos will have the parameter index of the first different parameter. If Reversed
is true, the parameters of NewType
will be compared in reverse order. That's useful if one of the functions is being used as a C++20 synthesized operator overload with a reversed parameter order.
Definition at line 3303 of file SemaOverload.cpp.
References clang::Reversed.
Referenced by IsOverloadOrOverrideImpl().
bool Sema::FunctionParamTypesAreEqual | ( | const FunctionProtoType * | OldType, |
const FunctionProtoType * | NewType, | ||
unsigned * | ArgPos = nullptr , |
||
bool | Reversed = false |
||
) |
Definition at line 3330 of file SemaOverload.cpp.
References clang::FunctionProtoType::param_types(), and clang::Reversed.
bool Sema::GatherArgumentsForCall | ( | SourceLocation | CallLoc, |
FunctionDecl * | FDecl, | ||
const FunctionProtoType * | Proto, | ||
unsigned | FirstParam, | ||
ArrayRef< Expr * > | Args, | ||
SmallVectorImpl< Expr * > & | AllArgs, | ||
VariadicCallType | CallType = VariadicDoesNotApply , |
||
bool | AllowExplicit = false , |
||
bool | IsListInitialization = false |
||
) |
GatherArgumentsForCall - Collector argument expressions for various form of call prototypes.
Definition at line 6029 of file SemaExpr.cpp.
References clang::Stmt::getBeginLoc(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionProtoType::getParamType(), and clang::Expr::getType().
Referenced by CompleteConstructorCall().
std::string Sema::getAmbiguousPathsDisplayString | ( | CXXBasePaths & | Paths | ) |
Builds a string representing ambiguous paths from a specific derived class to different subobjects of the same base class.
This function builds a string that can be used in error messages to show the different paths that one can take through the inheritance hierarchy to go from the derived class to different subobjects of a base class. The result looks something like this:
Definition at line 3177 of file SemaDeclCXX.cpp.
|
inline |
|
inline |
Definition at line 526 of file Sema.h.
References Context.
Referenced by ActOnCXXNestedNameSpecifierIndexedPack(), ActOnEndOfTranslationUnit(), AddImplicitlyDeclaredMembersToClass(), BuildBitIntType(), buildDistanceFunc(), buildLambdaCaptureFixit(), buildLoopVarFunc(), BuildPointerType(), BuildReferenceType(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), checkClassLevelDLLAttribute(), checkMappableExpressionList(), checkObjCMethodX86VectorTypes(), checkOpenMPLoop(), DeduceAutoType(), diagnoseUnavailableAlignedAllocation(), clang::SYCLIntegrationHeader::emit(), EvaluateAndDiagnoseImmediateInvocation(), FinalizeVarWithDestructor(), FixDependencyOfIdExpressionsInLambdaWithDependentObjectParameter(), getDefaultCXXMethodAddrSpace(), InstantiateVariableDefinition(), InstantiateVariableInitializer(), MarkVarDeclODRUsed(), clang::Parser::ParseFirstTopLevelDecl(), clang::Parser::parseMapperModifier(), parseOpenMPReductionId(), PerformPendingInstantiations(), propagateDLLAttrToBaseClassTemplate(), clang::TreeTransform< Derived >::RebuildQualifiedType(), SubstDefaultArgument(), and updateAttrsForLateParsedTemplate().
|
static |
Try to interpret the lookup result D as a template-name.
Determine whether the declaration found is acceptable as the name of a template and, if so, return that template declaration.
D | A declaration found by name lookup. |
AllowFunctionTemplates | Whether function templates should be considered valid results. |
AllowDependent | Whether unresolved using declarations (that might name templates) should be considered valid results. |
Otherwise, returns null.
Note that this may return an UnresolvedUsingValueDecl if AllowDependent is true. In all other cases it will return a TemplateDecl (or null).
Definition at line 104 of file SemaTemplate.cpp.
References clang::NamedDecl::getUnderlyingDecl().
ASTMutationListener * Sema::getASTMutationListener | ( | ) | const |
Definition at line 583 of file Sema.cpp.
References getASTConsumer(), and clang::ASTConsumer::GetASTMutationListener().
Referenced by DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), InstantiateDefaultArgument(), InstantiateInClassInitializer(), InstantiateVariableInitializer(), and UpdateExceptionSpec().
const AttributedType * Sema::getCallingConvAttributedType | ( | QualType | T | ) | const |
Get the outermost AttributedType node that sets a calling convention.
Valid types should not have multiple attributes with different CCs.
Definition at line 3553 of file SemaDecl.cpp.
References clang::Type::getAs(), clang::AttributedType::getModifiedType(), clang::AttributedType::isCallingConv(), and clang::T.
QualType Sema::getCapturedDeclRefType | ( | ValueDecl * | Var, |
SourceLocation | Loc | ||
) |
Given a variable, determine the type that a reference to that variable will have in the given scope.
Definition at line 19141 of file SemaExpr.cpp.
References Loc.
Referenced by getDecltypeForExpr().
Get the type of expression E, triggering instantiation to complete the type if necessary – that is, if the expression refers to a templated static data member of incomplete array type.
May still return an incomplete type if instantiation was not possible or if the type is incomplete for a different reason. Use RequireCompleteExprType instead if a diagnostic is expected for an incomplete expression type.
Definition at line 8864 of file SemaType.cpp.
References completeExprArrayBound(), clang::Expr::getType(), and clang::Type::isIncompleteArrayType().
Referenced by RequireCompleteExprType().
ParsedType Sema::getConstructorName | ( | const IdentifierInfo & | II, |
SourceLocation | NameLoc, | ||
Scope * | S, | ||
CXXScopeSpec & | SS, | ||
bool | EnteringContext | ||
) |
Definition at line 95 of file SemaExprCXX.cpp.
Referenced by clang::Parser::ParseUnqualifiedId().
const VarDecl * Sema::getCopyElisionCandidate | ( | NamedReturnInfo & | Info, |
QualType | ReturnType | ||
) |
Updates given NamedReturnInfo's move-eligible and copy-elidable statuses, considering the function return type criteria as applicable to return statements.
Info | The NamedReturnInfo object to update. |
ReturnType | This is the return type of the function. |
Definition at line 3375 of file SemaStmt.cpp.
References clang::Sema::NamedReturnInfo::Candidate, clang::ValueDecl::getType(), clang::Type::getTypeClass(), clang::Type::isCanonicalUnqualified(), clang::Type::isDependentType(), clang::Type::isRecordType(), and clang::Type::isSpecificBuiltinType().
BlockScopeInfo * Sema::getCurBlock | ( | ) |
Retrieve the current block, if any.
Definition at line 2428 of file Sema.cpp.
Referenced by checkDeclInTargetContext(), and clang::SemaOpenMP::isOpenMPCapturedDecl().
CapturedRegionScopeInfo * Sema::getCurCapturedRegion | ( | ) |
Retrieve the current captured region, if any.
Definition at line 2812 of file Sema.cpp.
Referenced by checkDeclInTargetContext(), and clang::SemaOpenMP::isOpenMPCapturedDecl().
sema::CompoundScopeInfo & Sema::getCurCompoundScope | ( | ) | const |
Definition at line 412 of file SemaStmt.cpp.
|
inline |
Definition at line 521 of file Sema.h.
References CurFPFeatures.
|
inline |
Definition at line 891 of file Sema.h.
References FunctionScopes.
Referenced by BuildArrayType(), and buildCoroutineParameterMoves().
FunctionScopeInfo * Sema::getCurFunctionAvailabilityContext | ( | ) |
Retrieve the current function, if any, that should be analyzed for potential availability violations.
Definition at line 1007 of file SemaAvailability.cpp.
FunctionDecl * Sema::getCurFunctionDecl | ( | bool | AllowLambda = false | ) | const |
Returns a pointer to the innermost enclosing function, or nullptr if the current context is not inside a function.
getCurFunctionDecl - If inside of a function body, this returns a pointer to the function decl for the function being parsed.
If AllowLambda
is true, this can return the call operator of an enclosing lambda, otherwise lambdas are skipped when looking for an enclosing function.
If we're currently in a 'block', this returns the containing context.
Definition at line 1547 of file Sema.cpp.
References getFunctionLevelDeclContext().
Referenced by clang::SemaCUDA::CheckCall(), clang::SemaCUDA::CheckLambdaCapture(), clang::SemaBase::Diag(), clang::SemaCUDA::DiagIfDeviceCode(), clang::SemaCUDA::DiagIfHostCode(), diagnoseZeroToNullptrConversion(), isUsualDeallocationFunction(), clang::SemaCUDA::RecordImplicitHostDeviceFuncUsedByDevice(), and resolveAddressOfSingleOverloadCandidate().
NamedDecl * Sema::getCurFunctionOrMethodDecl | ( | ) | const |
getCurFunctionOrMethodDecl - Return the Decl for the current ObjC method or C function we're in, otherwise return null.
If we're currently in a 'block', this returns the containing context.
Definition at line 1559 of file Sema.cpp.
References getFunctionLevelDeclContext().
LambdaScopeInfo * Sema::getCurGenericLambda | ( | ) |
LambdaScopeInfo * Sema::getCurLambda | ( | bool | IgnoreNonLambdaCapturingScope = false | ) |
Retrieve the current lambda scope info, if any.
IgnoreNonLambdaCapturingScope | true if should find the top-most lambda scope info ignoring all inner capturing scopes that are not lambda scopes. |
Definition at line 2472 of file Sema.cpp.
Referenced by ActOnFinishFullExpr(), ActOnSuperScopeSpecifier(), checkDeclInTargetContext(), DoMarkPotentialCapture(), GetDeclSpecTypeForDeclarator(), getDecltypeForExpr(), and clang::SemaOpenMP::isOpenMPCapturedDecl().
|
inline |
Definition at line 701 of file Sema.h.
References CurContext, and OriginalLexicalContext.
Referenced by clang::SemaHLSL::ActOnStartBuffer(), clang::SemaOpenMP::ActOnStartOpenMPDeclareTargetContext(), clang::SemaObjC::CheckObjCDeclScope(), clang::SemaOpenMP::CheckOMPRequiresDecl(), clang::SemaSYCL::DiagIfDeviceCode(), clang::SemaObjC::getCurObjCLexicalContext(), and clang::TreeTransform< Derived >::TransformFunctionProtoType().
ObjCMethodDecl * Sema::getCurMethodDecl | ( | ) |
getCurMethodDecl - If inside of a method body, this returns a pointer to the method decl for the method being parsed.
If we're currently in a 'block', this returns the containing context.
Definition at line 1552 of file Sema.cpp.
References getFunctionLevelDeclContext(), and clang::DeclContext::getParent().
Referenced by clang::SemaObjC::checkRetainCycles().
CXXRecordDecl * Sema::getCurrentClass | ( | Scope * | S, |
const CXXScopeSpec * | SS | ||
) |
Get the class that is directly named by the current context.
This is the class for which an unqualified-id in this scope could name a constructor or destructor.
If the scope specifier denotes a class, this will be that class. If the scope specifier is empty, this will be the class whose member-specification we are currently within. Otherwise, there is no such class.
Definition at line 2610 of file SemaDeclCXX.cpp.
References computeDeclContext(), clang::CPlusPlus, CurContext, getLangOpts(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isNotEmpty().
CXXRecordDecl * Sema::getCurrentInstantiationOf | ( | NestedNameSpecifier * | NNS | ) |
If the given nested name specifier refers to the current instantiation, return the declaration that corresponds to that current instantiation (C++0x [temp.dep.type]p1).
NNS | a dependent nested name specifier. |
Definition at line 198 of file SemaCXXScopeSpec.cpp.
References clang::CPlusPlus, CurContext, clang::NestedNameSpecifier::getAsType(), getCurrentInstantiationOf(), getLangOpts(), clang::NestedNameSpecifier::isDependent(), and clang::T.
Referenced by computeDeclContext().
std::tuple< MangleNumberingContext *, Decl * > Sema::getCurrentMangleNumberContext | ( | const DeclContext * | DC | ) |
Compute the mangling number context for a lambda expression or block literal.
Also return the extra mangling decl if any.
DC | - The DeclContext containing the lambda expression or block literal. |
Definition at line 281 of file SemaLambda.cpp.
References ContextKind, clang::DeclContext::getLexicalParent(), clang::DeclContext::getParent(), and isInInlineFunction().
|
inline |
Get the module unit whose scope we are currently within.
Definition at line 7861 of file Sema.h.
References clang::Module::Module().
Referenced by ActOnEndOfTranslationUnit(), DeclareGlobalNewDelete(), and diagnoseMissingImport().
QualType Sema::getCurrentThisType | ( | ) |
Try to retrieve the type of the 'this' pointer.
Definition at line 1239 of file SemaExprCXX.cpp.
References clang::isLambdaCallWithImplicitObjectParameter(), and clang::QualType::isNull().
Referenced by ActOnCXXThis(), CheckCXXThisCapture(), DefineImplicitCopyAssignment(), DefineImplicitMoveAssignment(), clang::SemaOpenMP::isOpenMPCapturedDecl(), and clang::SemaOpenMP::tryCaptureOpenMPLambdas().
|
inline |
Retrieve the parser's current scope.
This routine must only be used when it is certain that semantic analysis and the parser are in precisely the same context, which is not the case when, e.g., we are performing any kind of template instantiation. Therefore, the only safe places to use this scope are in the parser itself and in routines directly invoked from the parser and never from template substitution or instantiation.
Definition at line 697 of file Sema.h.
Referenced by clang::SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPForDirective(), clang::SemaOpenMP::ActOnOpenMPForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective(), buildDistanceFunc(), buildLoopVarFunc(), BuildNonArrayForRange(), checkMappableExpressionList(), clang::Parser::getCurScope(), GetDeclSpecTypeForDeclarator(), and isValidInteropVariable().
DarwinSDKInfo * Sema::getDarwinSDKInfoForAvailabilityChecking | ( | ) |
Definition at line 86 of file Sema.cpp.
References clang::parseDarwinSDKInfo().
DarwinSDKInfo * Sema::getDarwinSDKInfoForAvailabilityChecking | ( | SourceLocation | Loc, |
StringRef | Platform | ||
) |
getDecltypeForExpr - Given an expr, will return the decltype for that expression, according to the rules in C++11 [dcl.type.simple]p4 and C++11 [expr.lambda.prim]p18.
Definition at line 9455 of file SemaType.cpp.
References Context, clang::ASTContext::DependentTy, getCapturedDeclRefType(), getCurLambda(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getReferenceQualifiedType(), clang::ValueDecl::getType(), clang::Expr::IgnoreParens(), clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), and clang::T.
Referenced by BuildDecltypeType(), and DeduceAutoType().
LangAS Sema::getDefaultCXXMethodAddrSpace | ( | ) | const |
Returns default addr space for method qualifiers.
Definition at line 1566 of file Sema.cpp.
References clang::Default, getASTContext(), clang::ASTContext::getDefaultOpenCLPointeeAddrSpace(), getLangOpts(), and clang::OpenCL.
Referenced by DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitMoveAssignment(), and DeclareImplicitMoveConstructor().
|
inline |
Definition at line 6473 of file Sema.h.
References clang::Sema::DefaultedFunctionKind::asComparison(), and getDefaultedFunctionKind().
Sema::DefaultedFunctionKind Sema::getDefaultedFunctionKind | ( | const FunctionDecl * | FD | ) |
Determine the kind of defaulting that would be done for a given function.
If the function is both a default constructor and a copy / move constructor (due to having a default argument for the first parameter), this picks CXXSpecialMemberKind::DefaultConstructor.
FIXME: Check that case is properly handled by all callers.
Definition at line 6761 of file SemaDeclCXX.cpp.
References clang::CopyAssignment, clang::CopyConstructor, clang::CPlusPlus20, clang::DefaultConstructor, clang::Destructor, Equal, clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::CXXConstructorDecl::isCopyConstructor(), clang::CXXConstructorDecl::isDefaultConstructor(), clang::CXXConstructorDecl::isMoveConstructor(), clang::MoveAssignment, clang::MoveConstructor, NotEqual, Relational, and ThreeWay.
Referenced by CreateOverloadedBinOp(), DiagnoseDeletedDefaultedFunction(), getDefaultedComparisonKind(), getSpecialMember(), and SetDeclDefaulted().
ParsedType Sema::getDestructorName | ( | const IdentifierInfo & | II, |
SourceLocation | NameLoc, | ||
Scope * | S, | ||
CXXScopeSpec & | SS, | ||
ParsedType | ObjectType, | ||
bool | EnteringContext | ||
) |
Definition at line 145 of file SemaExprCXX.cpp.
Referenced by clang::Parser::ParseUnqualifiedId().
ParsedType Sema::getDestructorTypeForDecltype | ( | const DeclSpec & | DS, |
ParsedType | ObjectType | ||
) |
Definition at line 470 of file SemaExprCXX.cpp.
References Diag(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::Type::isDependentType(), clang::QualType::isNull(), clang::T, clang::DeclSpec::TST_decltype, clang::DeclSpec::TST_decltype_auto, and clang::DeclSpec::TST_error.
Referenced by clang::Parser::ParseUnqualifiedId().
|
inline |
Definition at line 523 of file Sema.h.
References Diags.
Referenced by clang::sema::AnalysisBasedWarnings::AnalysisBasedWarnings(), checkInitializerLifetime(), clang::PCHGenerator::getDiagnostics(), hasUncompilableErrorOccurred(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), and clang::Sema::SFINAETrap::~SFINAETrap().
QualType Sema::getElaboratedType | ( | ElaboratedTypeKeyword | Keyword, |
const CXXScopeSpec & | SS, | ||
QualType | T, | ||
TagDecl * | OwnedTagDecl = nullptr |
||
) |
Retrieve a version of the type 'T' that is elaborated by Keyword, qualified by the nested-name-specifier contained in SS, and that is (re)declared by OwnedTagDecl, which is nullptr if this is not a (re)declaration.
Definition at line 9408 of file SemaType.cpp.
References Context, clang::ASTContext::getElaboratedType(), clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::isValid(), and clang::T.
Sema::DeviceDiagnosticReason Sema::getEmissionReason | ( | const FunctionDecl * | Decl | ) |
Definition at line 20546 of file SemaDecl.cpp.
References clang::SemaBase::All, clang::CUDA, clang::SemaBase::CudaDevice, clang::SemaBase::CudaHost, clang::SemaBase::Esimd, clang::Decl::hasAttr(), clang::SemaBase::OmpDevice, clang::SemaBase::OmpHost, and clang::SemaBase::Sycl.
Referenced by clang::SemaSYCL::DiagIfDeviceCode().
Sema::FunctionEmissionStatus Sema::getEmissionStatus | ( | const FunctionDecl * | Decl, |
bool | Final = false |
||
) |
Definition at line 20563 of file SemaDecl.cpp.
References clang::DeclContext::isDependentContext().
Referenced by clang::SemaCUDA::CheckCall(), clang::SemaCUDA::DiagIfDeviceCode(), clang::SemaSYCL::DiagIfDeviceCode(), clang::SemaCUDA::DiagIfHostCode(), clang::SemaOpenMP::diagIfOpenMPDeviceCode(), and clang::SemaOpenMP::diagIfOpenMPHostCode().
FunctionScopeInfo * Sema::getEnclosingFunction | ( | ) | const |
LambdaScopeInfo * Sema::getEnclosingLambda | ( | ) | const |
Get the innermost lambda enclosing the current location, if any.
This looks through intervening non-lambda scopes such as local functions and blocks.
Definition at line 2455 of file Sema.cpp.
Referenced by DiagnoseUnexpandedParameterPack(), and DiagnoseUnexpandedParameterPacks().
SourceRange Sema::getExprRange | ( | Expr * | E | ) | const |
Definition at line 588 of file SemaExpr.cpp.
References clang::Stmt::getSourceRange().
|
inline |
std::string Sema::getFixItZeroInitializerForType | ( | QualType | T, |
SourceLocation | Loc | ||
) | const |
Get a string to suggest for zero-initialization of a type.
Definition at line 204 of file SemaFixItUtils.cpp.
References clang::Type::getAsCXXRecordDecl(), getScalarZeroExpressionForType(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::hasUserProvidedDefaultConstructor(), clang::CXXRecordDecl::isAggregate(), clang::Type::isScalarType(), LangOpts, Loc, s, and clang::T.
std::string Sema::getFixItZeroLiteralForType | ( | QualType | T, |
SourceLocation | Loc | ||
) | const |
Definition at line 223 of file SemaFixItUtils.cpp.
References getScalarZeroExpressionForType(), Loc, and clang::T.
Definition at line 6334 of file SemaChecking.cpp.
References clang::Sema::FormatStringInfo::FormatIdx.
|
static |
Given a FunctionDecl's FormatAttr, attempts to populate the FomatStringInfo parameter with the FormatAttr's correct format_idx and firstDataArg.
Returns true when the format fits the function and the FormatStringInfo has been populated.
Definition at line 6267 of file SemaChecking.cpp.
References clang::Sema::FormatStringInfo::ArgPassingKind, clang::Sema::FormatStringInfo::FirstDataArg, and clang::Sema::FormatStringInfo::FormatIdx.
|
static |
Definition at line 9935 of file SemaChecking.cpp.
std::optional< unsigned > Sema::getFullyPackExpandedSize | ( | TemplateArgument | Arg | ) |
Given a template argument that contains an unexpanded parameter pack, but which has already been substituted, attempt to determine the number of elements that will be produced once this argument is fully-expanded.
This is intended for use when transforming 'sizeof...(Arg)' in order to avoid actually expanding the pack where possible.
Definition at line 1197 of file SemaTemplateVariadic.cpp.
References clang::TemplateArgument::containsUnexpandedParameterPack(), clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::Type::getAs(), clang::TemplateArgument::getAsExpr(), clang::TemplateName::getAsSubstTemplateTemplateParmPack(), clang::TemplateArgument::getAsTemplate(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::Integral, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_elements(), clang::TemplateArgument::pack_size(), clang::TemplateArgument::StructuralValue, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
DeclContext * Sema::getFunctionLevelDeclContext | ( | bool | AllowLambda = false | ) | const |
If AllowLambda
is true, treat lambda as function.
Definition at line 1527 of file Sema.cpp.
References CurContext, and clang::DeclContext::getParent().
Referenced by CheckCXXThisType(), ClassifyImplicitMemberAccess(), diagnoseInstanceReference(), getCurFunctionDecl(), getCurFunctionOrMethodDecl(), getCurMethodDecl(), and clang::SemaObjC::tryCaptureObjCSelf().
|
inline |
Definition at line 8908 of file Sema.h.
References FunctionScopes, and FunctionScopesStart.
TemplateArgumentLoc Sema::getIdentityTemplateArgumentLoc | ( | NamedDecl * | Param, |
SourceLocation | Location | ||
) |
Get a template argument mapping the given template parameter to itself, e.g.
for X in template<int X>
, this would return an expression template argument referencing X.
Definition at line 2804 of file SemaTemplateDeduction.cpp.
Attr * Sema::getImplicitCodeSegOrSectionAttrForFunction | ( | const FunctionDecl * | FD, |
bool | IsDefinition | ||
) |
Returns an implicit CodeSegAttr if a __declspec(code_seg) is found on a containing class.
Otherwise it will return implicit SectionAttr if the function is a definition and there is an active value on CodeSegStack (from the current #pragma code-seg value).
FD | Function being declared. |
IsDefinition | Whether it is a definition or just a declaration. |
Definition at line 11138 of file SemaDecl.cpp.
References getImplicitCodeSegAttrFromClass(), and clang::Decl::hasAttr().
Referenced by checkClassLevelCodeSegAttribute().
ParsedType Sema::getInheritingConstructorName | ( | CXXScopeSpec & | SS, |
SourceLocation | NameLoc, | ||
const IdentifierInfo & | Name | ||
) |
Handle the result of the special case name lookup for inheriting constructor declarations.
'NS::X::X' and 'NS::X<...>::X' are treated as constructor names in member using declarations, even if 'X' is not the name of the corresponding type.
Definition at line 61 of file SemaExprCXX.cpp.
|
inline |
Definition at line 8899 of file Sema.h.
References InventedParameterInfos, and InventedParameterInfosStart.
QualType Sema::getLambdaConversionFunctionResultType | ( | const FunctionProtoType * | CallOpType, |
CallingConv | CC | ||
) |
Get the return type to use for a lambda's conversion function(s) to function pointer type, given the type of the call operator.
Definition at line 1625 of file SemaLambda.cpp.
References clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::getExtProtoInfo(), clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::RQ_None, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, and clang::FunctionType::ExtInfo::withCallingConv().
Referenced by DeduceReturnType().
|
inline |
Definition at line 519 of file Sema.h.
References LangOpts.
Referenced by ActOnCXXNamedCast(), ActOnCXXNestedNameSpecifierDecltype(), ActOnCXXNew(), ActOnDecltypeExpression(), ActOnEndOfTranslationUnitFragment(), ActOnFinishFullExpr(), ActOnPackIndexingType(), ActOnParamDefaultArgument(), ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), ActOnPragmaMSAllocText(), ActOnPragmaOptionsAlign(), ActOnPragmaPack(), ActOnStartOfTranslationUnit(), ActOnTypeName(), AddAlignmentAttributesForRecord(), AddBuiltinCandidate(), AddImplicitlyDeclaredMembersToClass(), AddMsStructLayoutForRecord(), AdjustDestructorExceptionSpec(), BuildArrayType(), BuildAtomicType(), BuildBlockPointerType(), BuildCStyleCastExpr(), BuildCXXConstructExpr(), BuildCXXNamedCast(), BuildCXXTypeConstructExpr(), BuildExtVectorType(), BuildFunctionType(), buildLambdaCaptureFixit(), buildLambdaThisCaptureFixit(), BuildMemberPointerType(), BuildPointerType(), BuildPseudoDestructorExpr(), BuildReferenceType(), BuildStaticAssertDeclaration(), BuildTypeofExprType(), CheckAllocatedType(), CheckAltivecInitFromScalar(), CheckBaseSpecifier(), CheckC23ConstexprInitStringLiteral(), checkClassLevelDLLAttribute(), CheckComparisonCategoryType(), CheckConstexprCtorInitializer(), CheckConstexprDeclStmt(), CheckConstexprDestructorSubobjects(), CheckConstexprFunctionBody(), CheckConstexprFunctionDefinition(), CheckConstexprParameterTypes(), CheckConstexprReturnType(), CheckConversionDeclarator(), CheckDistantExceptionSpec(), CheckEquivalentExceptionSpec(), CheckExceptionSpecCompatibility(), CheckExceptionSpecSubset(), CheckExplicitlyDefaultedSpecialMember(), CheckFunctionReturnType(), CheckImmediateEscalatingFunctionDefinition(), checkInitializerLifetime(), checkLiteralOperatorTemplateParameterList(), checkMapClauseExpressionBase(), checkMappableExpressionList(), CheckNonDependentConversions(), CheckOperatorNewDeleteTypes(), CheckOverridingFunctionExceptionSpec(), CheckPointerToMemberOperands(), CheckSpecifiedExceptionType(), CheckUsingDeclQualifier(), CheckUsingShadowDecl(), ClassifyImplicitMemberAccess(), CompleteVarTemplateSpecializationDecl(), CreateOverloadedBinOp(), DeclareGlobalNewDelete(), DeduceAutoType(), DeduceTemplateArguments(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitLambdaToBlockPointerConversion(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseMismatchedNewDelete(), diagnoseOpenCLTypes(), diagnoseTypo(), diagnoseZeroToNullptrConversion(), DiagPlaceholderVariableDefinition(), clang::SYCLIntegrationHeader::emit(), EmitCurrentDiagnostic(), clang::EnterExpressionEvaluationContext::EnterExpressionEvaluationContext(), FindAllocationFunctions(), FindCompositePointerType(), FinishForRangeVarDecl(), FixOverloadedFunctionReference(), clang::FunctionCallFilterCCC::FunctionCallFilterCCC(), getCurrentClass(), getCurrentInstantiationOf(), GetDeclSpecTypeForDeclarator(), getDefaultCXXMethodAddrSpace(), getDefaultedFunctionKind(), GetTypeForDeclarator(), GetTypeForDeclaratorCast(), hasAcceptableDefinition(), IgnoredValueConversions(), ImpCastExprToType(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), Initialize(), clang::TemplateDeclInstantiator::InitMethodInstantiation(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), InstantiateVariableInitializer(), isAbstractType(), isCurrentClassNameTypo(), IsDerivedFrom(), isExternalWithNoLinkageType(), IsOverloadOrOverrideImpl(), isResultTypeOrTemplate(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), isUnavailableAlignedAllocationFunction(), isUsualDeallocationFunction(), MarkExprReferenced(), MaybeBindToTemporary(), MergeVarDeclExceptionSpecs(), mightBeIntendedToBeTemplateName(), PerformContextualImplicitConversion(), PerformImplicitConversion(), RequireLiteralType(), resolveAddressOfSingleOverloadCandidate(), SelectBestMethod(), SetDeclDefaulted(), setExceptionMode(), ShouldDeleteSpecialMember(), shouldIgnoreDueToReservedName(), ShouldSplatAltivecScalarInCast(), TemporaryMaterializationConversion(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), and tryLookupUnambiguousFieldDecl().
SourceLocation Sema::getLocationOfStringLiteralByte | ( | const StringLiteral * | SL, |
unsigned | ByteNo | ||
) | const |
Definition at line 115 of file SemaChecking.cpp.
References clang::StringLiteral::getLocationOfByte().
Referenced by CheckC23ConstexprInitStringLiteral().
SourceLocation Sema::getLocForEndOfToken | ( | SourceLocation | Loc, |
unsigned | Offset = 0 |
||
) |
Calls Lexer::getLocForEndOfToken()
Definition at line 68 of file Sema.cpp.
References clang::Lexer::getLocForEndOfToken(), Loc, and Offset.
Referenced by clang::SemaObjC::AtomicPropertySetterGetterRules(), CheckConversionDeclarator(), CheckEquivalentExceptionSpec(), CheckUsingDeclQualifier(), DiagnoseMismatchedNewDelete(), and diagnoseNoViableConversion().
llvm::DenseSet< Module * > & Sema::getLookupModules | ( | ) |
Get the set of additional modules that should be checked during name lookup.
A module and its imports become visible when instanting a template defined within it.
Definition at line 1634 of file SemaLookup.cpp.
References getDefiningModule().
const llvm::MapVector< FieldDecl *, Sema::DeleteLocs > & Sema::getMismatchingDeleteExpressions | ( | ) | const |
ModuleLoader & Sema::getModuleLoader | ( | ) | const |
FunctionDecl * Sema::getMoreConstrainedFunction | ( | FunctionDecl * | FD1, |
FunctionDecl * | FD2 | ||
) |
Returns the more constrained function according to the rules of partial ordering by constraints (C++ [temp.constr.order]).
FD1 | the first function |
FD2 | the second function |
Definition at line 5986 of file SemaTemplateDeduction.cpp.
References clang::FunctionDecl::getAssociatedConstraints(), clang::Decl::getDescribedTemplate(), clang::FunctionDecl::getInstantiatedFromMemberFunction(), and IsAtLeastAsConstrained().
Referenced by resolveAddressOfSingleOverloadCandidate().
ClassTemplatePartialSpecializationDecl * Sema::getMoreSpecializedPartialSpecialization | ( | ClassTemplatePartialSpecializationDecl * | PS1, |
ClassTemplatePartialSpecializationDecl * | PS2, | ||
SourceLocation | Loc | ||
) |
Returns the more specialized class template partial specialization according to the rules of partial ordering of class template partial specializations (C++ [temp.class.order]).
PS1 | the first class template partial specialization |
PS2 | the second class template partial specialization |
Definition at line 6256 of file SemaTemplateDeduction.cpp.
References clang::ClassTemplatePartialSpecializationDecl::getInjectedSpecializationType(), getMoreSpecialized(), and Loc.
VarTemplatePartialSpecializationDecl * Sema::getMoreSpecializedPartialSpecialization | ( | VarTemplatePartialSpecializationDecl * | PS1, |
VarTemplatePartialSpecializationDecl * | PS2, | ||
SourceLocation | Loc | ||
) |
Definition at line 6281 of file SemaTemplateDeduction.cpp.
References clang::VarTemplateSpecializationDecl::getSpecializedTemplate().
FunctionTemplateDecl * Sema::getMoreSpecializedTemplate | ( | FunctionTemplateDecl * | FT1, |
FunctionTemplateDecl * | FT2, | ||
SourceLocation | Loc, | ||
TemplatePartialOrderingContext | TPOC, | ||
unsigned | NumCallArguments1, | ||
QualType | RawObj1Ty = {} , |
||
QualType | RawObj2Ty = {} , |
||
bool | Reversed = false |
||
) |
Returns the more specialized function template according to the rules of function template partial ordering (C++ [temp.func.order]).
FT1 | the first function template |
FT2 | the second function template |
TPOC | the context in which we are performing partial ordering of function templates. |
NumCallArguments1 | The number of arguments in the call to FT1, used only when TPOC is TPOC_Call . Does not include the object argument when calling a member function. |
RawObj1Ty | The type of the object parameter of FT1 if a member function only used if TPOC is TPOC_Call and FT1 is a Function template from a member function |
RawObj2Ty | The type of the object parameter of FT2 if a member function only used if TPOC is TPOC_Call and FT2 is a Function template from a member function |
Reversed | If true , exactly one of FT1 and FT2 is an overload candidate with a reversed parameter order. In this case, the corresponding P/A pairs between FT1 and FT2 are reversed. |
Definition at line 5659 of file SemaTemplateDeduction.cpp.
References clang::Type::castAs(), Context, clang::TemplateDecl::getAssociatedConstraints(), GetImplicitObjectParameterType(), clang::TemplateArgument::getKind(), clang::ASTContext::getLangOpts(), clang::CXXMethodDecl::getRefQualifier(), clang::FunctionDecl::getReturnType(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), IsAtLeastAsConstrained(), isAtLeastAsSpecializedAs(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Type::isRValueReferenceType(), Loc, min(), P, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_elements(), clang::TemplateArgument::pack_size(), clang::FunctionDecl::param_size(), clang::FunctionProtoType::param_type_begin(), clang::FunctionProtoType::param_type_end(), clang::FunctionDecl::parameters(), clang::Reversed, clang::RQ_RValue, clang::TemplateParameterList::size(), TemplateParameterListsAreEqual(), TPL_TemplateParamsEquivalent, clang::TPOC_Call, and clang::TPOC_Conversion.
Referenced by getMostSpecialized().
UnresolvedSetIterator Sema::getMostSpecialized | ( | UnresolvedSetIterator | SpecBegin, |
UnresolvedSetIterator | SpecEnd, | ||
TemplateSpecCandidateSet & | FailedCandidates, | ||
SourceLocation | Loc, | ||
const PartialDiagnostic & | NoneDiag, | ||
const PartialDiagnostic & | AmbigDiag, | ||
const PartialDiagnostic & | CandidateDiag, | ||
bool | Complain = true , |
||
QualType | TargetType = QualType() |
||
) |
Retrieve the most specialized of the given function template specializations.
SpecBegin | the start iterator of the function template specializations that we will be comparing. |
SpecEnd | the end iterator of the function template specializations, paired with SpecBegin . |
Loc | the location where the ambiguity or no-specializations diagnostic should occur. |
NoneDiag | partial diagnostic used to diagnose cases where there are no matching candidates. |
AmbigDiag | partial diagnostic used to diagnose an ambiguity, if one occurs. |
CandidateDiag | partial diagnostic used for each function template specialization that is a candidate in the ambiguous ordering. One parameter in this diagnostic should be unbound, which will correspond to the string describing the template arguments for the function template specialization. |
Definition at line 5902 of file SemaTemplateDeduction.cpp.
References clang::SemaBase::Diag(), getMoreSpecializedTemplate(), getTemplateArgumentBindingsText(), HandleFunctionTypeMismatch(), clang::QualType::isNull(), isSameTemplate(), Loc, clang::TemplateSpecCandidateSet::NoteCandidates(), and clang::TPOC_Other.
Sema::NamedReturnInfo Sema::getNamedReturnInfo | ( | const VarDecl * | VD | ) |
Determine whether the given NRVO candidate variable is move-eligible or copy-elidable, without considering function return type.
VD | The NRVO candidate variable. |
Definition at line 3314 of file SemaStmt.cpp.
References clang::Decl::getKind(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasDependentAlignment(), clang::VarDecl::hasLocalStorage(), clang::VarDecl::isExceptionVariable(), clang::Type::isObjectType(), clang::Type::isRValueReferenceType(), and clang::QualType::isVolatileQualified().
Sema::NamedReturnInfo Sema::getNamedReturnInfo | ( | Expr *& | E, |
SimplerImplicitMoveMode | Mode = SimplerImplicitMoveMode::Normal |
||
) |
Determine whether the given expression might be move-eligible or copy-elidable in either a (co_)return statement or throw expression, without considering function return type, if applicable.
E | The expression being returned from the function or block, being thrown, or being co_returned from a coroutine. This expression might be modified by the implementation. |
Mode | Overrides detection of current language mode and uses the rules for C++23. |
Definition at line 3280 of file SemaStmt.cpp.
References clang::Sema::NamedReturnInfo::Candidate, clang::Expr::containsErrors(), clang::CPlusPlus23, clang::ImplicitCastExpr::Create(), clang::VarDecl::getInit(), clang::Expr::IgnoreParens(), and clang::Expr::isXValue().
DeclarationNameInfo Sema::GetNameForDeclarator | ( | Declarator & | D | ) |
GetNameForDeclarator - Determine the full declaration name for the given Declarator.
Definition at line 5924 of file SemaDecl.cpp.
References clang::Declarator::getName().
Referenced by CreateNewFunctionDecl().
DeclarationNameInfo Sema::GetNameFromUnqualifiedId | ( | const UnqualifiedId & | Name | ) |
Retrieves the declaration name from a parsed unqualified-id.
Definition at line 5930 of file SemaDecl.cpp.
Referenced by clang::Parser::ParseOpenMPVarList().
getNonFieldDeclScope - Retrieves the innermost scope, starting from S, where a non-field would be declared.
This routine copes with the difference between C and C++ scoping rules in structs and unions. For example, the following code is well-formed in C but ill-formed in C++:
For the declaration of BAR, this routine will return a different scope. The scope S will be the scope of the unnamed enumeration within S6. In C++, this routine will return the scope associated with S6, because the enumeration's scope is a transparent context but structures can contain non-field names. In C, this routine will return the translation unit scope, since the enumeration's scope is a transparent context and structures cannot contain non-field names.
Definition at line 2339 of file SemaDecl.cpp.
NonOdrUseReason Sema::getNonOdrUseReasonInCurrentContext | ( | ValueDecl * | D | ) |
If D
cannot be odr-used in the current expression evaluation context, return a reason explaining why.
Otherwise, return NOUR_None.
Definition at line 2325 of file SemaExpr.cpp.
References isCapturingReferenceToHostVarInCUDADeviceLambda(), and clang::NOUR_Unevaluated.
Sema::NonTagKind Sema::getNonTagTypeDeclKind | ( | const Decl * | D, |
TagTypeKind | TTK | ||
) |
Given a non-tag type declaration, returns an enum useful for indicating what kind of non-tag type this is.
Definition at line 17131 of file SemaDecl.cpp.
References clang::Class, clang::Enum, clang::Interface, clang::Struct, and clang::Union.
Referenced by clang::TreeTransform< Derived >::RebuildDependentNameType().
const NormalizedConstraint * Sema::getNormalizedAssociatedConstraints | ( | NamedDecl * | ConstrainedDecl, |
ArrayRef< const Expr * > | AssociatedConstraints | ||
) |
Definition at line 1217 of file SemaConcept.cpp.
References clang::Decl::getCanonicalDecl().
IdentifierInfo * Sema::getNullabilityKeyword | ( | NullabilityKind | nullability | ) |
Retrieve the keyword associated.
Definition at line 3840 of file SemaType.cpp.
References clang::Preprocessor::getIdentifierInfo(), clang::NonNull, clang::Nullable, clang::NullableResult, PP, and clang::Unspecified.
Referenced by clang::Parser::getNullabilityKeyword().
std::optional< unsigned > Sema::getNumArgumentsInExpansion | ( | QualType | T, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Determine the number of arguments in the given pack expansion type.
This routine assumes that the number of arguments in the expansion is consistent across all of the unexpanded parameter packs in its pattern.
Returns an empty Optional if the type can't be expanded.
Definition at line 824 of file SemaTemplateVariadic.cpp.
References Depth, and clang::T.
Referenced by clang::TemplateDeclInstantiator::SubstFunctionType().
|
inline |
Definition at line 520 of file Sema.h.
References OpenCLFeatures.
Referenced by BuildMemberPointerType(), BuildPointerType(), BuildReferenceType(), diagnoseOpenCLTypes(), and Initialize().
|
inline |
Get the location for the currently active "\#pragma clang optimize off". If this location is invalid, then the state of the pragma is "on".
Definition at line 1519 of file Sema.h.
References OptimizeOffPragmaLocation.
LabelDecl * Sema::GetOrCreateMSAsmLabel | ( | StringRef | ExternalLabelName, |
SourceLocation | Location, | ||
bool | AlwaysCreate | ||
) |
Definition at line 970 of file SemaStmtAsm.cpp.
References Label.
NamespaceDecl * Sema::getOrCreateStdNamespace | ( | ) |
Retrieve the special "std" namespace, which may require us to implicitly define the namespace.
Definition at line 11987 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::Decl::clearIdentifierNamespace(), Context, clang::NamespaceDecl::Create(), clang::IdentifierTable::get(), clang::Preprocessor::getIdentifierTable(), getStdNamespace(), clang::ASTContext::getTranslationUnitDecl(), PP, clang::Decl::setImplicit(), and StdNamespace.
Referenced by DeclareGlobalNewDelete().
Get the module owning an entity.
Definition at line 2663 of file Sema.h.
References clang::Decl::getOwningModule().
Referenced by diagnoseEquivalentInternalLinkageDeclarations(), diagnoseMissingImport(), and isEquivalentInternalLinkageDeclaration().
|
inline |
Definition at line 525 of file Sema.h.
References PP.
Referenced by clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), and ProduceSignatureHelp().
|
inlinestatic |
|
inlinestatic |
Definition at line 11568 of file Sema.h.
References clang::Stmt::getSourceRange().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 11569 of file Sema.h.
References clang::TypeLoc::getSourceRange().
|
inline |
Retrieve a suitable printing policy for diagnostics.
Definition at line 774 of file Sema.h.
Referenced by CheckEquivalentExceptionSpec(), CheckVirtualDtorCall(), diagnoseNoViableConversion(), EmitCurrentDiagnostic(), and PrintInstantiationStack().
|
static |
TypeLoc Sema::getReturnTypeLoc | ( | FunctionDecl * | FD | ) | const |
Definition at line 3687 of file SemaStmt.cpp.
References clang::TypeLoc::getAsAdjusted(), clang::TypeSourceInfo::getTypeLoc(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by ActOnConversionDeclarator().
Scope * Sema::getScopeForContext | ( | DeclContext * | Ctx | ) |
Determines the active Scope associated with the given declaration context.
This routine maps a declaration context to the active Scope object that represents that declaration context in the parser. It is typically used from "scope-less" code (e.g., template instantiation, lazy creation of declarations) that injects a name for name-lookup purposes and, therefore, must update the Scope.
Definition at line 2219 of file Sema.cpp.
References clang::DeclContext::getPrimaryContext().
|
static |
Finds the scope corresponding to the given decl context, if it happens to be an enclosing scope.
Otherwise return NULL.
Definition at line 1592 of file SemaDecl.cpp.
Returns a field in a CXXRecordDecl that has the same name as the decl SelfAssigned
when inside a CXXMethodDecl.
Definition at line 14543 of file SemaExpr.cpp.
References Parent.
NamedDecl * Sema::getShadowedDeclaration | ( | const BindingDecl * | D, |
const LookupResult & | R | ||
) |
Return the declaration shadowed by the given variable D
, or null if it doesn't shadow any declaration or shadowing warnings are disabled.
Definition at line 8386 of file SemaDecl.cpp.
References clang::LookupResult::getFoundDecl(), and shouldWarnIfShadowedDecl().
NamedDecl * Sema::getShadowedDeclaration | ( | const TypedefNameDecl * | D, |
const LookupResult & | R | ||
) |
Return the declaration shadowed by the given typedef D
, or null if it doesn't shadow any declaration or shadowing warnings are disabled.
Definition at line 8371 of file SemaDecl.cpp.
References clang::Decl::getDeclContext(), clang::LookupResult::getFoundDecl(), clang::DeclContext::isRecord(), and shouldWarnIfShadowedDecl().
NamedDecl * Sema::getShadowedDeclaration | ( | const VarDecl * | D, |
const LookupResult & | R | ||
) |
Return the declaration shadowed by the given variable D
, or null if it doesn't shadow any declaration or shadowing warnings are disabled.
Definition at line 8355 of file SemaDecl.cpp.
References clang::LookupResult::getFoundDecl(), clang::VarDecl::hasGlobalStorage(), clang::VarDecl::isStaticLocal(), and shouldWarnIfShadowedDecl().
Definition at line 12751 of file SemaExpr.cpp.
References clang::Type::isSizelessBuiltinType(), and V.
Definition at line 12708 of file SemaExpr.cpp.
References V.
|
inline |
Definition at line 524 of file Sema.h.
References SourceMgr.
Referenced by CheckVirtualDtorCall(), DiagnoseAbsenceOfOverrideControl(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseMismatchedNewDelete(), clang::SemaSYCL::finalizeSYCLDelayedAnalysis(), InstantiateFunctionDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), InstantiateVariableDefinition(), clang::SemaCUDA::maybeAddHostDeviceAttrs(), and clang::PrintingCodeCompleteConsumer::ProcessOverloadCandidates().
|
inline |
Definition at line 4780 of file Sema.h.
References clang::Sema::DefaultedFunctionKind::asSpecialMember(), and getDefaultedFunctionKind().
EnumDecl * Sema::getStdAlignValT | ( | ) | const |
Definition at line 11839 of file SemaDeclCXX.cpp.
References Context, clang::LazyOffsetPtr< T, OffsT, Get >::get(), clang::ASTContext::getExternalSource(), and StdAlignValT.
Referenced by DeclareGlobalNewDelete(), and FindAllocationFunctions().
CXXRecordDecl * Sema::getStdBadAlloc | ( | ) | const |
Definition at line 11834 of file SemaDeclCXX.cpp.
References Context, clang::LazyOffsetPtr< T, OffsT, Get >::get(), clang::ASTContext::getExternalSource(), and StdBadAlloc.
Referenced by DeclareGlobalNewDelete().
NamespaceDecl * Sema::getStdNamespace | ( | ) | const |
Definition at line 11843 of file SemaDeclCXX.cpp.
References Context, clang::LazyOffsetPtr< T, OffsT, Get >::get(), clang::ASTContext::getExternalSource(), and StdNamespace.
Referenced by ActOnStartNamespaceDef(), CheckComparisonCategoryType(), DiagnoseTwoPhaseLookup(), getOrCreateStdNamespace(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), and lookupCoroutineTraits().
IdentifierInfo * Sema::getSuperIdentifier | ( | ) | const |
std::string Sema::getTemplateArgumentBindingsText | ( | const TemplateParameterList * | Params, |
const TemplateArgument * | Args, | ||
unsigned | NumArgs | ||
) |
Definition at line 12256 of file SemaTemplate.cpp.
References clang::NamedDecl::getIdentifier(), clang::TemplateParameterList::getParam(), Id, clang::TemplateArgument::print(), clang::TemplateParameterList::shouldIncludeTypeForArgument(), and clang::TemplateParameterList::size().
std::string Sema::getTemplateArgumentBindingsText | ( | const TemplateParameterList * | Params, |
const TemplateArgumentList & | Args | ||
) |
Produces a formatted string that describes the binding of template parameters to template arguments.
Definition at line 12250 of file SemaTemplate.cpp.
References clang::TemplateArgumentList::data(), and clang::TemplateArgumentList::size().
Referenced by getMostSpecialized(), and PrintInstantiationStack().
TemplateArgumentLoc Sema::getTemplateArgumentPackExpansionPattern | ( | TemplateArgumentLoc | OrigLoc, |
SourceLocation & | Ellipsis, | ||
std::optional< unsigned > & | NumExpansions | ||
) | const |
Returns the pattern of the pack expansion for a template argument.
OrigLoc | The template argument to expand. |
Ellipsis | Will be set to the location of the ellipsis. |
NumExpansions | Will be set to the number of expansions that will be generated from this pack expansion, if known a priori. |
Definition at line 1137 of file SemaTemplateVariadic.cpp.
References clang::TypeLoc::castAs(), Context, clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsType(), clang::PackExpansionExpr::getEllipsisLoc(), clang::PackExpansionTypeLoc::getEllipsisLoc(), clang::TemplateArgument::getKind(), clang::PackExpansionExpr::getNumExpansions(), clang::PackExpansionType::getNumExpansions(), clang::TemplateArgument::getNumTemplateExpansions(), clang::TemplateArgument::getPackExpansionPattern(), clang::PackExpansionExpr::getPattern(), clang::PackExpansionTypeLoc::getPatternLoc(), clang::TemplateArgumentLoc::getTemplateEllipsisLoc(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeLoc::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::TemplateArgumentLoc::getTypeSourceInfo(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::TemplateArgument::Integral, clang::TemplateArgument::isPackExpansion(), clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TypeLocBuilder::pushFullCopy(), clang::TemplateArgument::StructuralValue, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
Determine the number of levels of enclosing template parameters.
This is only usable while parsing. Note that this does not include dependent contexts in which no template parameters have yet been declared, such as in a terse function template or generic lambda before the first 'auto' is encountered.
Definition at line 57 of file SemaTemplate.cpp.
MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs | ( | const NamedDecl * | ND, |
const DeclContext * | DC = nullptr , |
||
bool | Final = false , |
||
std::optional< ArrayRef< TemplateArgument >> | Innermost = std::nullopt , |
||
bool | RelativeToPrimary = false , |
||
const FunctionDecl * | Pattern = nullptr , |
||
bool | ForConstraintInstantiation = false , |
||
bool | SkipForSpecialization = false |
||
) |
Retrieve the template argument list(s) that should be used to instantiate the definition of the given declaration.
ND | the declaration for which we are computing template instantiation arguments. |
DC | In the event we don't HAVE a declaration yet, we instead provide the decl context where it will be created. In this case, the Innermost should likely be provided. If ND is non-null, this is ignored. |
Innermost | if non-NULL, specifies a template argument list for the template declaration passed as ND. |
RelativeToPrimary | true if we should get the template arguments relative to the primary template, even when we're dealing with a specialization. This is only relevant for function template specializations. |
Pattern | If non-NULL, indicates the pattern from which we will be instantiating the definition of the given declaration, ND . This is used to determine the proper set of template instantiation arguments for friend function template specializations. |
ForConstraintInstantiation | when collecting arguments, ForConstraintInstantiation indicates we should continue looking when encountering a lambda generic call operator, and continue looking for arguments on an enclosing class template. |
Definition at line 494 of file SemaTemplateInstantiate.cpp.
References clang::Decl::castFromDeclContext(), clang::Function, and clang::Decl::isFileContextDecl().
Referenced by InstantiateClassTemplateSpecialization(), InstantiateClassTemplateSpecializationMembers(), InstantiateDefaultArgument(), InstantiateExceptionSpec(), InstantiateVariableDefinition(), RequireCompleteEnumDecl(), and SubstDefaultArgument().
Sema::TemplateNameKindForDiagnostics Sema::getTemplateNameKindForDiagnostics | ( | TemplateName | Name | ) |
Definition at line 1313 of file SemaDecl.cpp.
Referenced by DeduceTemplateSpecializationFromInitializer(), and GetDeclSpecTypeForDeclarator().
SourceLocation Sema::getTopMostPointOfInstantiation | ( | const NamedDecl * | N | ) | const |
Returns the top most location responsible for the definition of N
.
If N
is a a template specialization, this is the location of the top of the instantiation stack. Otherwise, the location of N
is returned.
Definition at line 12498 of file SemaTemplate.cpp.
References clang::CPlusPlus, clang::Decl::getLocation(), clang::isa(), and clang::FunctionDecl::isFunctionTemplateSpecialization().
TemplateArgumentLoc Sema::getTrivialTemplateArgumentLoc | ( | const TemplateArgument & | Arg, |
QualType | NTTPType, | ||
SourceLocation | Loc, | ||
NamedDecl * | TemplateParam = nullptr |
||
) |
Allocate a TemplateArgumentLoc where all locations have been initialized to the given location.
Arg | The template argument we are producing template argument location information for. |
NTTPType | For a declaration template argument, the type of the non-type template parameter that corresponds to this template argument. Can be null if no type sugar is available to add to the type from the template argument. |
Loc | The source location to use for the resulting template argument. |
Definition at line 2740 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgument::getKind(), clang::TemplateArgument::Null, and clang::TemplateArgument::Type.
Referenced by FindInstantiatedDecl(), and isTemplateTemplateParameterAtLeastAsSpecializedAs().
TypeSourceInfo * Sema::GetTypeForDeclarator | ( | Declarator & | D | ) |
GetTypeForDeclarator - Convert the type for the specified declarator to Type instances.
The result of this call will never be null, but the associated type may be a null type if there's an unrecoverable error.
Definition at line 5704 of file SemaType.cpp.
References GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), getLangOpts(), inferARCWriteback(), clang::Declarator::isPrototypeContext(), and clang::T.
Referenced by ActOnCXXNew(), and ActOnTypeName().
TypeSourceInfo * Sema::GetTypeForDeclaratorCast | ( | Declarator & | D, |
QualType | FromTy | ||
) |
Definition at line 5817 of file SemaType.cpp.
References Context, GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), clang::ASTContext::getInnerObjCOwnership(), getLangOpts(), ObjC(), clang::Qualifiers::OCL_None, and transferARCOwnership().
Referenced by ActOnBuiltinBitCastExpr(), and ActOnCXXNamedCast().
|
static |
Definition at line 2820 of file SemaType.cpp.
References clang::OpaquePtr< PtrTy >::get(), and clang::QualType::isNull().
Referenced by ActOnArrayTypeTrait(), ActOnBaseSpecifier(), ActOnCXXTypeConstructExpr(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperType(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionType(), ActOnPackExpansion(), clang::SemaSYCL::ActOnSYCLBuiltinFieldTypeExpr(), clang::SemaSYCL::ActOnSYCLBuiltinNumBasesExpr(), clang::SemaSYCL::ActOnSYCLBuiltinNumFieldsExpr(), ActOnTypeRequirement(), ActOnTypeTrait(), clang::SemaSYCL::ActOnUniqueStableNameExpr(), CheckConversionDeclarator(), CheckDeductionGuideDeclarator(), CheckDestructorDeclarator(), checkExceptionSpecification(), GetDeclSpecTypeForDeclarator(), and translateTemplateArgument().
ParsedType Sema::getTypeName | ( | const IdentifierInfo & | II, |
SourceLocation | NameLoc, | ||
Scope * | S, | ||
CXXScopeSpec * | SS = nullptr , |
||
bool | isClassName = false , |
||
bool | HasTrailingDot = false , |
||
ParsedType | ObjectTypePtr = nullptr , |
||
bool | IsCtorOrDtorName = false , |
||
bool | WantNontrivialTypeSourceInfo = false , |
||
bool | IsClassTemplateDeductionContext = true , |
||
ImplicitTypenameContext | AllowImplicitTypename = ImplicitTypenameContext::No , |
||
IdentifierInfo ** | CorrectedII = nullptr |
||
) |
If the identifier refers to a type name within this scope, return the declaration of that type.
This routine performs ordinary name lookup of the identifier II within the given scope, with optional C++ scope specifier SS, to determine whether the name refers to a type. If so, returns an opaque pointer (actually a QualType) corresponding to that type. Otherwise, returns NULL.
Definition at line 293 of file SemaDecl.cpp.
Referenced by clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec().
const Sema::TypoExprState & Sema::getTypoExprState | ( | TypoExpr * | TE | ) | const |
Definition at line 5985 of file SemaLookup.cpp.
void Sema::getUndefinedButUsed | ( | SmallVectorImpl< std::pair< NamedDecl *, SourceLocation >> & | Undefined | ) |
Obtain a sorted list of functions that are undefined but ODR-used.
Obtains a sorted list of functions and variables that are undefined but ODR-used.
Definition at line 857 of file Sema.cpp.
References clang::VarDecl::DeclarationOnly, clang::Decl::hasAttr(), isExternalWithNoLinkageType(), clang::Decl::isInvalidDecl(), clang::RISCV::Undefined, and UndefinedButUsed.
Sema::VariadicCallType Sema::getVariadicCallType | ( | FunctionDecl * | FDecl, |
const FunctionProtoType * | Proto, | ||
Expr * | Fn | ||
) |
Definition at line 5802 of file SemaExpr.cpp.
References clang::Expr::getType(), clang::Type::isBlockPointerType(), and clang::FunctionProtoType::isVariadic().
NamedDecl * Sema::HandleDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParameterLists | ||
) |
Get the innermost enclosing declaration scope.
Definition at line 6386 of file SemaDecl.cpp.
void Sema::HandleDelayedAccessCheck | ( | sema::DelayedDiagnostic & | DD, |
Decl * | Ctx | ||
) |
Definition at line 1513 of file SemaAccess.cpp.
References AR_inaccessible, CheckEffectiveAccess(), clang::sema::DelayedDiagnostic::getAccessData(), clang::Decl::getDeclContext(), clang::Decl::getLexicalDeclContext(), clang::Decl::isLocalExternDecl(), clang::sema::DelayedDiagnostic::Loc, and clang::sema::DelayedDiagnostic::Triggered.
void Sema::handleDelayedAvailabilityCheck | ( | sema::DelayedDiagnostic & | DD, |
Decl * | Ctx | ||
) |
Definition at line 624 of file SemaAvailability.cpp.
References clang::sema::DelayedDiagnostic::Availability, DoEmitAvailabilityWarning(), clang::sema::DelayedDiagnostic::getAvailabilityMessage(), clang::sema::DelayedDiagnostic::getAvailabilityOffendingDecl(), clang::sema::DelayedDiagnostic::getAvailabilityReferringDecl(), clang::sema::DelayedDiagnostic::getAvailabilityResult(), clang::sema::DelayedDiagnostic::getAvailabilitySelectorLocs(), clang::sema::DelayedDiagnostic::getObjCProperty(), clang::sema::DelayedDiagnostic::getUnknownObjCClass(), clang::sema::DelayedDiagnostic::Kind, and clang::sema::DelayedDiagnostic::Triggered.
void Sema::HandleDependentAccessCheck | ( | const DependentDiagnostic & | DD, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 1539 of file SemaAccess.cpp.
References clang::DependentDiagnostic::getAccess(), clang::DependentDiagnostic::getAccessBaseObjectType(), clang::DependentDiagnostic::getAccessLoc(), clang::DependentDiagnostic::getAccessNamingClass(), clang::DependentDiagnostic::getAccessTarget(), clang::DependentDiagnostic::isAccessToMember(), clang::QualType::isNull(), and Loc.
Referenced by PerformDependentDiagnostics().
ExprResult Sema::HandleExprEvaluationContextForTypeof | ( | Expr * | E | ) |
Definition at line 17826 of file SemaExpr.cpp.
References clang::ExprError(), clang::Expr::getType(), and clang::Type::isVariablyModifiedType().
FieldDecl * Sema::HandleField | ( | Scope * | S, |
RecordDecl * | TagD, | ||
SourceLocation | DeclStart, | ||
Declarator & | D, | ||
Expr * | BitfieldWidth, | ||
InClassInitStyle | InitStyle, | ||
AccessSpecifier | AS | ||
) |
HandleField - Analyze a field of a C struct or a C++ data member.
Definition at line 18602 of file SemaDecl.cpp.
void Sema::HandleFunctionTypeMismatch | ( | PartialDiagnostic & | PDiag, |
QualType | FromType, | ||
QualType | ToType | ||
) |
HandleFunctionTypeMismatch - Gives diagnostic information for differeing function types.
Catches different number of parameter, mismatch in parameter types, and different return types.
Definition at line 3201 of file SemaOverload.cpp.
References clang::Type::castAs(), ft_default, clang::Type::isMemberPointerType(), and clang::QualType::isNull().
Referenced by getMostSpecialized(), NoteHiddenVirtualMethods(), and NoteOverloadCandidate().
void Sema::handleLambdaNumbering | ( | CXXRecordDecl * | Class, |
CXXMethodDecl * | Method, | ||
std::optional< CXXRecordDecl::LambdaNumbering > | NumberingOverride = std::nullopt |
||
) |
Number lambda for linkage purposes if necessary.
Definition at line 455 of file SemaLambda.cpp.
References clang::Class.
MSPropertyDecl * Sema::HandleMSProperty | ( | Scope * | S, |
RecordDecl * | TagD, | ||
SourceLocation | DeclStart, | ||
Declarator & | D, | ||
Expr * | BitfieldWidth, | ||
InClassInitStyle | InitStyle, | ||
AccessSpecifier | AS, | ||
const ParsedAttr & | MSPropertyAttr | ||
) |
HandleMSProperty - Analyze a __delcspec(property) field of a C++ class.
Definition at line 19135 of file SemaDeclCXX.cpp.
Definition at line 686 of file SemaExceptionSpec.cpp.
References clang::Qualifiers::compatiblyIncludes(), Context, clang::Type::getAs(), clang::Type::getPointeeType(), clang::ReferenceType::getPointeeType(), clang::ASTContext::getUnqualifiedArrayType(), clang::ASTContext::hasSameUnqualifiedType(), clang::QualType::isConstQualified(), IsFunctionConversion(), clang::Type::isMemberPointerType(), clang::Type::isNullPtrType(), clang::Type::isObjectType(), clang::Type::isPointerType(), IsQualificationConversion(), clang::Type::isRecordType(), clang::Type::isVoidType(), and clang::QualType::isVolatileQualified().
Referenced by CheckExceptionSpecSubset().
Definition at line 4929 of file SemaDecl.cpp.
bool Sema::hasAcceptableDefaultArgument | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules, | ||
Sema::AcceptableKind | Kind | ||
) |
Determine if the template parameter D
has a reachable default argument.
Definition at line 1723 of file SemaLookup.cpp.
References hasAcceptableDefaultArgument(), and P.
|
inline |
Definition at line 11854 of file Sema.h.
References hasAcceptableDefinition().
bool Sema::hasAcceptableDefinition | ( | NamedDecl * | D, |
NamedDecl ** | Suggested, | ||
AcceptableKind | Kind, | ||
bool | OnlyNeedComplete = false |
||
) |
Definition at line 8952 of file SemaType.cpp.
References CodeSynthesisContexts, Context, clang::ASTContext::getExternalSource(), getLangOpts(), hasMergedDefinitionInCurrentModule(), hasVisibleMergedDefinition(), isAcceptable(), clang::NamedDecl::isModulePrivate(), and clang::Decl::setVisibleDespiteOwningModule().
Referenced by hasAcceptableDefinition(), hasReachableDefinition(), and hasVisibleDefinition().
bool Sema::hasAnyAcceptableTemplateNames | ( | LookupResult & | R, |
bool | AllowFunctionTemplates = true , |
||
bool | AllowDependent = true , |
||
bool | AllowNonTemplateFunctions = false |
||
) |
Definition at line 161 of file SemaTemplate.cpp.
References clang::LookupResult::begin(), and clang::LookupResult::end().
bool Sema::hasAnyUnrecoverableErrorsInThisFunction | ( | ) | const |
Check to see if a given expression could have '.c_str()' called on it.
Check if we could call '.c_str()' on an object.
FIXME: This returns the wrong results in some cases (if cv-qualifiers don't allow the call, or if it would be ambiguous).
Definition at line 10763 of file SemaChecking.cpp.
Definition at line 7992 of file SemaType.cpp.
References clang::Type::getAs(), clang::AttributedType::getModifiedType(), clang::AttributedType::isCallingConv(), and clang::T.
Referenced by adjustMemberFunctionCC().
Definition at line 1690 of file SemaLookup.cpp.
Referenced by hasAcceptableDefinition().
|
inline |
Determine whether any declaration of an entity is reachable.
Definition at line 7683 of file Sema.h.
References hasReachableDeclarationSlow(), and isReachable().
bool Sema::hasReachableDeclarationSlow | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules = nullptr |
||
) |
Definition at line 2112 of file SemaLookup.cpp.
References hasAcceptableDeclarationImpl(), and Reachable.
Referenced by hasReachableDeclaration().
bool Sema::hasReachableDefaultArgument | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules = nullptr |
||
) |
Determine if the template parameter D
has a reachable default argument.
Definition at line 1742 of file SemaLookup.cpp.
References hasAcceptableDefaultArgument(), and Reachable.
Definition at line 11846 of file Sema.h.
References hasReachableDefinition().
bool Sema::hasReachableDefinition | ( | NamedDecl * | D, |
NamedDecl ** | Suggested, | ||
bool | OnlyNeedComplete = false |
||
) |
Determine if D
has a reachable definition.
Determine whether there is any declaration of D
that was ever a definition (perhaps before module merging) and is currently reachable.
If not, suggest a declaration that should be made reachable to expose the definition.
D | The definition of the entity. |
Suggested | Filled in with the declaration that should be made reachable in order to provide a definition of this entity. |
OnlyNeedComplete | If true , we only need the type to be complete, not defined. This only matters for enums with a fixed underlying type, since in all other cases, a type is complete if and only if it is defined. |
Definition at line 9062 of file SemaType.cpp.
References hasAcceptableDefinition(), and Reachable.
Referenced by computeDeclContext(), hasReachableDefinition(), clang::LookupResult::isAvailableForLookup(), and RequireCompleteEnumDecl().
bool Sema::hasReachableExplicitSpecialization | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules = nullptr |
||
) |
Determine if there is a reachable declaration of D
that is an explicit specialization declaration for a specialization of a template.
(For a member specialization, use hasReachableMemberSpecialization.)
Definition at line 1803 of file SemaLookup.cpp.
References hasAcceptableExplicitSpecialization(), and Reachable.
bool Sema::hasReachableMemberSpecialization | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules = nullptr |
||
) |
Determine if there is a reachable declaration of D
that is a member specialization declaration (as opposed to an instantiated declaration).
Definition at line 1837 of file SemaLookup.cpp.
References hasAcceptableMemberSpecialization(), and Reachable.
Determine if D
and Suggested
have a structurally compatible layout as described in C11 6.2.7/1.
Definition at line 8937 of file SemaType.cpp.
References clang::Default, clang::Decl::getASTContext(), and clang::StructuralEquivalenceContext::IsEquivalent().
bool Sema::hasUncompilableErrorOccurred | ( | ) | const |
Whether uncompilable error has occurred.
This includes error happens in deferred diagnostics.
Definition at line 1670 of file Sema.cpp.
References CurContext, DeviceDeferredDiags, getDiagnostics(), clang::DiagnosticIDs::isDefaultMappingAsError(), and Loc.
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().
|
inline |
Determine whether any declaration of an entity is visible.
Definition at line 7674 of file Sema.h.
References hasVisibleDeclarationSlow(), and isVisible().
bool Sema::hasVisibleDeclarationSlow | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules | ||
) |
Definition at line 2104 of file SemaLookup.cpp.
References hasAcceptableDeclarationImpl(), and Visible.
Referenced by hasVisibleDeclaration().
bool Sema::hasVisibleDefaultArgument | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules = nullptr |
||
) |
Determine if the template parameter D
has a visible default argument.
Definition at line 1736 of file SemaLookup.cpp.
References hasAcceptableDefaultArgument(), and Visible.
Definition at line 11837 of file Sema.h.
References hasVisibleDefinition().
bool Sema::hasVisibleDefinition | ( | NamedDecl * | D, |
NamedDecl ** | Suggested, | ||
bool | OnlyNeedComplete = false |
||
) |
Determine if D
has a visible definition.
Determine whether there is any declaration of D
that was ever a definition (perhaps before module merging) and is currently visible.
If not, suggest a declaration that should be made visible to expose the definition.
D | The definition of the entity. |
Suggested | Filled in with the declaration that should be made visible in order to provide a definition of this entity. |
OnlyNeedComplete | If true , we only need the type to be complete, not defined. This only matters for enums with a fixed underlying type, since in all other cases, a type is complete if and only if it is defined. |
Definition at line 9045 of file SemaType.cpp.
References hasAcceptableDefinition(), and Visible.
Referenced by hasVisibleDefinition().
bool Sema::hasVisibleExplicitSpecialization | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules = nullptr |
||
) |
Determine if there is a visible declaration of D
that is an explicit specialization declaration for a specialization of a template.
(For a member specialization, use hasVisibleMemberSpecialization.)
Definition at line 1797 of file SemaLookup.cpp.
References hasAcceptableExplicitSpecialization(), and Visible.
bool Sema::hasVisibleMemberSpecialization | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules = nullptr |
||
) |
Determine if there is a visible declaration of D
that is a member specialization declaration (as opposed to an instantiated declaration).
Definition at line 1831 of file SemaLookup.cpp.
References hasAcceptableMemberSpecialization(), and Visible.
Definition at line 1683 of file SemaLookup.cpp.
Referenced by hasAcceptableDefinition().
void Sema::HideUsingShadowDecl | ( | Scope * | S, |
UsingShadowDecl * | Shadow | ||
) |
Hides a using shadow declaration.
This is required by the current using-decl implementation when a resolvable using declaration in a class is followed by a declaration which would hide or override one or more of the using decl's targets; for example:
struct Base { void foo(int); }; struct Derived : Base { using Base::foo; void foo(int); };
The governing language is C++03 [namespace.udecl]p12:
When a using-declaration brings names from a base class into a derived class scope, member functions in the derived class override and/or hide member functions with the same name and parameter types in a base class (rather than conflicting).
There are two ways to implement this: (1) optimistically create shadow decls when they're not hidden by existing declarations, or (2) don't create any shadow decls (or at least don't make them visible) until we've fully parsed/instantiated the class. The problem with (1) is that we might have to retroactively remove a shadow decl, which requires several O(n) operations because the decl structures are (very reasonably) not designed for removal. (2) avoids this but is very fiddly and phase-dependent.
Definition at line 12725 of file SemaDeclCXX.cpp.
|
inline |
Definition at line 1007 of file Sema.h.
Referenced by BuildMemberPointerType(), BuildPointerType(), BuildReferenceType(), CheckBaseSpecifier(), and CheckFunctionReturnType().
ExprResult Sema::IgnoredValueConversions | ( | Expr * | E | ) |
IgnoredValueConversions - Given that an expression's result is syntactically ignored, perform any conversions that are required.
Perform the conversions required for an expression used in a context that ignores the result.
Definition at line 8465 of file SemaExprCXX.cpp.
References CheckPlaceholderExpr(), CheckUnusedVolatileAssignment(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus17, DefaultFunctionArrayConversion(), DefaultFunctionArrayLvalueConversion(), DefaultLvalueConversion(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getExprLoc(), getLangOpts(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), ImpCastExprToType(), clang::Type::isFunctionType(), isInLifetimeExtendingContext(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isPRValue(), clang::Expr::isReadIfDiscardedInCPlusPlus11(), clang::Type::isVoidType(), MaybeDecrementCount(), RefsMinusAssignments, RequireCompleteType(), clang::T, TemporaryMaterializationConversion(), and clang::ASTContext::VoidTy.
Referenced by ActOnFinishFullExpr(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), and clang::SemaOpenMP::ActOnOpenMPLinearClause().
ExprResult Sema::ImpCastExprToType | ( | Expr * | E, |
QualType | Ty, | ||
CastKind | Kind, | ||
ExprValueKind | VK = VK_PRValue , |
||
const CXXCastPath * | BasePath = nullptr , |
||
CheckedConversionKind | CCK = CheckedConversionKind::Implicit |
||
) |
ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast.
If there is already an implicit cast, merge into the existing one. If isLvalue, the result of the cast is an lvalue.
If there is already an implicit cast, merge into the existing one. The result is of the given category.
Definition at line 678 of file Sema.cpp.
References Context, clang::CPlusPlus, clang::CPlusPlus11, clang::ImplicitCastExpr::Create(), CreateMaterializeTemporaryExpr(), CurFPFeatureOverrides(), clang::SemaBase::Diag(), diagnoseNullableToNonnullConversion(), diagnoseZeroToNullptrConversion(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::CastExpr::getCastKindName(), clang::Expr::getExprLoc(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isPRValue(), clang::SC_Register, and clang::VK_PRValue.
Referenced by BuildImplicitBaseInitializer(), CheckPointerToMemberOperands(), CheckSizelessVectorConditionalTypes(), CheckVectorConditionalTypes(), ConstantFoldAttrArgs(), CXXCheckConditionalOperands(), FindCompositePointerType(), IgnoredValueConversions(), PerformImplicitConversion(), and PerformQualificationConversion().
NamedDecl * Sema::ImplicitlyDefineFunction | ( | SourceLocation | Loc, |
IdentifierInfo & | II, | ||
Scope * | S | ||
) |
ImplicitlyDefineFunction - An undeclared identifier was used in a function call, forming a call to an implicitly defined function (per C99 6.5.1p2).
Definition at line 16584 of file SemaDecl.cpp.
|
inline |
Definition at line 833 of file Sema.h.
References clang::Scope::incrementMSManglingNumber().
Referenced by clang::Parser::incrementMSManglingNumber().
void Sema::inferGslOwnerPointerAttribute | ( | CXXRecordDecl * | Record | ) |
Add [[gsl::Owner]] and [[gsl::Pointer]] attributes for std:: types.
Definition at line 167 of file SemaAttr.cpp.
References Context, and inferGslPointerAttribute().
void Sema::inferGslPointerAttribute | ( | NamedDecl * | ND, |
CXXRecordDecl * | UnderlyingRecord | ||
) |
Add gsl::Pointer attribute to std::container::iterator.
ND | The declaration that introduces the name std::container::iterator. |
UnderlyingRecord | The record named by ND. |
Definition at line 111 of file SemaAttr.cpp.
References Context, clang::Decl::getDeclContext(), clang::NamedDecl::getName(), and Parent.
Referenced by inferGslOwnerPointerAttribute(), inferGslPointerAttribute(), and clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl().
void Sema::inferGslPointerAttribute | ( | TypedefNameDecl * | TD | ) |
Add [[gsl::Pointer]] attributes for std:: types.
Definition at line 150 of file SemaAttr.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::QualType::getCanonicalType(), clang::QualType::getTypePtr(), clang::TypedefNameDecl::getUnderlyingType(), and inferGslPointerAttribute().
void Sema::inferNullableClassAttribute | ( | CXXRecordDecl * | CRD | ) |
Add _Nullable attributes for std:: types.
Definition at line 218 of file SemaAttr.cpp.
References Context, clang::NamedDecl::getName(), clang::Decl::hasAttr(), clang::Decl::isInStdNamespace(), clang::Nullable, and clang::Redeclarable< decl_type >::redecls().
void Sema::Initialize | ( | ) |
Perform initialization that occurs after the parser has been initialized but before it parses anything.
Definition at line 282 of file Sema.cpp.
References addImplicitTypedef(), clang::OpenCLOptions::addSupport(), clang::IdentifierResolver::begin(), clang::ASTContext::buildImplicitRecord(), clang::Class, Consumer, Context, clang::CPlusPlus, clang::ASTContext::DoubleTy, clang::IdentifierResolver::end(), clang::ASTContext::FloatTy, clang::IdentifierTable::get(), clang::ASTContext::getAtomicType(), clang::ASTContext::getAuxTargetInfo(), clang::ASTContext::getBuiltinMSVaListDecl(), clang::ASTContext::getBuiltinVaListDecl(), clang::ASTContext::getCFConstantStringDecl(), clang::ASTContext::getExternalSource(), clang::Preprocessor::getIdentifierInfo(), clang::ASTContext::getInt128Decl(), clang::ASTContext::getIntPtrType(), getLangOpts(), clang::ASTContext::getObjCClassDecl(), clang::ASTContext::getObjCIdDecl(), clang::ASTContext::getObjCProtocolDecl(), clang::ASTContext::getObjCSelDecl(), clang::LangOptions::getOpenCLCompatibleVersion(), getOpenCLOptions(), clang::ASTContext::getPointerDiffType(), clang::ASTContext::getSizeType(), clang::TargetInfo::getSupportedOpenCLOpts(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ASTContext::getTypeSize(), clang::ASTContext::getUInt128Decl(), clang::ASTContext::getUIntPtrType(), clang::ASTContext::HalfTy, clang::TargetInfo::hasAArch64SVETypes(), clang::TargetInfo::hasBuiltinMSVaList(), clang::TargetInfo::hasFeature(), clang::TargetInfo::hasInt128Type(), clang::TargetInfo::hasRISCVVTypes(), Id, clang::ASTContext::Idents, IdResolver, clang::ASTContext::IntTy, clang::ASTContext::LongTy, ObjC(), clang::ASTContext::OCLClkEventTy, clang::ASTContext::OCLEventTy, clang::ASTContext::OCLQueueTy, clang::ASTContext::OCLReserveIDTy, clang::ASTContext::OCLSamplerTy, clang::OpenCL, PP, PushOnScopeChains(), TUScope, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongTy, and VAListTagName.
Referenced by clang::Parser::Initialize().
ExprResult Sema::InitializeExplicitObjectArgument | ( | Sema & | S, |
Expr * | Obj, | ||
FunctionDecl * | Fun | ||
) |
Definition at line 6486 of file SemaOverload.cpp.
Referenced by CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), and CreateOverloadedUnaryOp().
|
inline |
Definition at line 6430 of file Sema.h.
References ExprEvalContexts, and PotentiallyEvaluated.
void Sema::InstantiateAttrs | ( | const MultiLevelTemplateArgumentList & | TemplateArgs, |
const Decl * | Pattern, | ||
Decl * | Inst, | ||
LateInstantiatedAttrVec * | LateAttrs = nullptr , |
||
LocalInstantiationScope * | OuterMostScope = nullptr |
||
) |
Definition at line 1062 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::addAttr(), AddParameterABIAttr(), AddXConsumedAttr(), clang::Decl::attrs(), attrToRetainOwnershipKind(), clang::LocalInstantiationScope::cloneScopes(), Context, CurrentInstantiationScope, clang::Decl::hasAttr(), instantiateDependentAlignedAttr(), instantiateDependentAlignValueAttr(), instantiateDependentAllocAlignAttr(), instantiateDependentAMDGPUFlatWorkGroupSizeAttr(), instantiateDependentAMDGPUMaxNumWorkGroupsAttr(), instantiateDependentAMDGPUWavesPerEUAttr(), instantiateDependentAnnotationAttr(), instantiateDependentAssumeAlignedAttr(), instantiateDependentCUDALaunchBoundsAttr(), instantiateDependentDiagnoseIfAttr(), instantiateDependentEnableIfAttr(), instantiateDependentHLSLParamModifierAttr(), instantiateDependentModeAttr(), instantiateDependentSYCLKernelAttr(), instantiateIntelReqdSubGroupSize(), instantiateOMPDeclareSimdDeclAttr(), instantiateOMPDeclareVariantAttr(), instantiateSYCLAddIRAnnotationsMemberAttr(), instantiateSYCLAddIRAttributesFunctionAttr(), instantiateSYCLAddIRAttributesGlobalVariableAttr(), instantiateSYCLAddIRAttributesKernelParameterAttr(), instantiateSYCLDeviceHasAttr(), instantiateSYCLIntelBankBitsAttr(), instantiateSYCLIntelBankWidthAttr(), instantiateSYCLIntelESimdVectorizeAttr(), instantiateSYCLIntelForcePow2DepthAttr(), instantiateSYCLIntelInitiationIntervalAttr(), instantiateSYCLIntelLoopFuseAttr(), instantiateSYCLIntelMaxConcurrencyAttr(), instantiateSYCLIntelMaxGlobalWorkDimAttr(), instantiateSYCLIntelMaxReplicatesAttr(), instantiateSYCLIntelMaxWorkGroupSizeAttr(), instantiateSYCLIntelMaxWorkGroupsPerMultiprocessorAttr(), instantiateSYCLIntelMinWorkGroupsPerComputeUnitAttr(), instantiateSYCLIntelNoGlobalWorkOffsetAttr(), instantiateSYCLIntelNumBanksAttr(), instantiateSYCLIntelNumSimdWorkItemsAttr(), instantiateSYCLIntelPipeIOAttr(), instantiateSYCLIntelPrivateCopiesAttr(), instantiateSYCLIntelSchedulerTargetFmaxMhzAttr(), instantiateSYCLReqdWorkGroupSizeAttr(), instantiateSYCLUsesAspectsAttr(), instantiateSYCLWorkGroupSizeHintAttr(), clang::sema::instantiateTemplateAttribute(), and isRelevantAttr().
Referenced by BuildVariableInstantiation(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), InstantiateEnum(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), and SubstParmVarDecl().
void Sema::InstantiateAttrsForDecl | ( | const MultiLevelTemplateArgumentList & | TemplateArgs, |
const Decl * | Pattern, | ||
Decl * | Inst, | ||
LateInstantiatedAttrVec * | LateAttrs = nullptr , |
||
LocalInstantiationScope * | OuterMostScope = nullptr |
||
) |
Definition at line 1022 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::addAttr(), clang::Decl::attrs(), Context, clang::sema::instantiateTemplateAttributeForDecl(), and isRelevantAttr().
bool Sema::InstantiateClass | ( | SourceLocation | PointOfInstantiation, |
CXXRecordDecl * | Instantiation, | ||
CXXRecordDecl * | Pattern, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
TemplateSpecializationKind | TSK, | ||
bool | Complain = true |
||
) |
Instantiate the definition of a class from a given pattern.
PointOfInstantiation | The point of instantiation within the source code. |
Instantiation | is the declaration whose definition is being instantiated. This will be either a class template specialization or a member class of a class template specialization. |
Pattern | is the pattern from which the instantiation occurs. This will be either the declaration of a class template or the declaration of a member class of a class template. |
TemplateArgs | The template arguments to be substituted into the pattern. |
TSK | the kind of implicit or explicit instantiation to perform. |
Complain | whether to complain if the class cannot be instantiated due to the lack of a definition. |
Definition at line 3612 of file SemaTemplateInstantiate.cpp.
References DiagnoseUninstantiableTemplate(), clang::CXXRecordDecl::getDefinition(), and clang::CXXRecordDecl::getInstantiatedFromMemberClass().
Referenced by InstantiateClassMembers(), and InstantiateClassTemplateSpecialization().
void Sema::InstantiateClassMembers | ( | SourceLocation | PointOfInstantiation, |
CXXRecordDecl * | Instantiation, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
TemplateSpecializationKind | TSK | ||
) |
Instantiates the definitions of all of the member of the given class, which is an instantiation of a class template or a member class of a template.
Definition at line 4207 of file SemaTemplateInstantiate.cpp.
References CheckFunctionConstraints(), CheckSpecializationInstantiationRedecl(), Consumer, Context, clang::DeclContext::decls(), clang::DeclContextLookupResult::find_first(), clang::Function, clang::EnumDecl::getDefinition(), clang::CXXRecordDecl::getDefinition(), clang::VarDecl::getDefinition(), clang::CXXRecordDecl::getInstantiatedFromMemberClass(), clang::VarDecl::getInstantiatedFromStaticDataMember(), clang::VarDecl::getMemberSpecializationInfo(), clang::MemberSpecializationInfo::getPointOfInstantiation(), clang::ASTContext::getTargetInfo(), clang::CXXRecordDecl::getTemplateInstantiationPattern(), clang::MemberSpecializationInfo::getTemplateSpecializationKind(), clang::TargetInfo::getTriple(), clang::ASTConsumer::HandleTopLevelDecl(), clang::Decl::hasAttr(), InstantiateClass(), InstantiateEnum(), InstantiateFunctionDefinition(), InstantiateInClassInitializer(), InstantiateVariableDefinition(), clang::CXXRecordDecl::isLocalClass(), clang::ConstraintSatisfaction::IsSatisfied, clang::VarDecl::isStaticDataMember(), clang::DeclContext::lookup(), MarkVTableUsed(), PendingLocalImplicitInstantiations, clang::MemberSpecializationInfo::setPointOfInstantiation(), clang::MemberSpecializationInfo::setTemplateSpecializationKind(), clang::VarDecl::setTemplateSpecializationKind(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.
Referenced by InstantiateClassTemplateSpecializationMembers().
bool Sema::InstantiateClassTemplateSpecialization | ( | SourceLocation | PointOfInstantiation, |
ClassTemplateSpecializationDecl * | ClassTemplateSpec, | ||
TemplateSpecializationKind | TSK, | ||
bool | Complain = true |
||
) |
Definition at line 4182 of file SemaTemplateInstantiate.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::CXXRecordDecl::getCanonicalDecl(), getPatternForClassTemplateSpecialization(), getTemplateInstantiationArgs(), InstantiateClass(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), and clang::ActionResult< PtrTy, Compress >::isUsable().
void Sema::InstantiateClassTemplateSpecializationMembers | ( | SourceLocation | PointOfInstantiation, |
ClassTemplateSpecializationDecl * | ClassTemplateSpec, | ||
TemplateSpecializationKind | TSK | ||
) |
Instantiate the definitions of all of the members of the given class template specialization, which was named as part of an explicit instantiation.
Definition at line 4439 of file SemaTemplateInstantiate.cpp.
References getTemplateInstantiationArgs(), and InstantiateClassMembers().
bool Sema::InstantiateDefaultArgument | ( | SourceLocation | CallLoc, |
FunctionDecl * | FD, | ||
ParmVarDecl * | Param | ||
) |
Definition at line 5160 of file SemaTemplateInstantiateDecl.cpp.
References getASTMutationListener(), clang::Decl::getLexicalDeclContext(), getTemplateInstantiationArgs(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), and SubstDefaultArgument().
void Sema::InstantiateDefaultCtorDefaultArgs | ( | CXXConstructorDecl * | Ctor | ) |
In the MS ABI, we need to instantiate default arguments of dllexported default constructors along with the constructor definition.
This allows IR gen to emit a constructor closure which calls the default constructor with its default arguments.
Definition at line 1383 of file SemaTemplateInstantiateDecl.cpp.
References CheckCXXDefaultArgExpr(), CleanupVarDeclMarking(), Context, clang::Decl::getAttr(), clang::TargetInfo::getCXXABI(), clang::Attr::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ASTContext::getTargetInfo(), clang::CXXConstructorDecl::isDefaultConstructor(), and clang::TargetCXXABI::isMicrosoft().
bool Sema::InstantiateEnum | ( | SourceLocation | PointOfInstantiation, |
EnumDecl * | Instantiation, | ||
EnumDecl * | Pattern, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
TemplateSpecializationKind | TSK | ||
) |
Instantiate the definition of an enum from a given pattern.
PointOfInstantiation | The point of instantiation within the source code. |
Instantiation | is the declaration whose definition is being instantiated. This will be a member enumeration of a class temploid specialization, or a local enumeration within a function temploid specialization. |
Pattern | The templated declaration from which the instantiation occurs. |
TemplateArgs | The template arguments to be substituted into the pattern. |
TSK | The kind of implicit or explicit instantiation to perform. |
true
if an error occurred, false
otherwise. Definition at line 3871 of file SemaTemplateInstantiate.cpp.
References Context, DiagnoseUninstantiableTemplate(), clang::EnumDecl::getDefinition(), clang::EnumDecl::getInstantiatedFromMemberEnum(), clang::EnumDecl::getMemberSpecializationInfo(), InstantiateAttrs(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::Sema::ContextRAII::pop(), PotentiallyEvaluated, clang::EnumDecl::setTemplateSpecializationKind(), and clang::Decl::setVisibleDespiteOwningModule().
Referenced by InstantiateClassMembers(), and RequireCompleteEnumDecl().
void Sema::InstantiateExceptionSpec | ( | SourceLocation | PointOfInstantiation, |
FunctionDecl * | Function | ||
) |
Definition at line 5195 of file SemaTemplateInstantiateDecl.cpp.
References clang::Type::castAs(), clang::SemaBase::Diag(), clang::EST_None, clang::EST_Uninstantiated, clang::FunctionProtoType::getExceptionSpecTemplate(), clang::FunctionProtoType::getExceptionSpecType(), clang::Decl::getLexicalDeclContext(), getTemplateInstantiationArgs(), clang::ValueDecl::getType(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::Sema::InstantiatingTemplate::isInvalid(), SubstExceptionSpec(), and UpdateExceptionSpec().
Referenced by ResolveExceptionSpec().
ExplicitSpecifier Sema::instantiateExplicitSpecifier | ( | const MultiLevelTemplateArgumentList & | TemplateArgs, |
ExplicitSpecifier | ES | ||
) |
Definition at line 570 of file SemaTemplateInstantiateDecl.cpp.
References ConstantEvaluated, clang::ActionResult< PtrTy, Compress >::get(), clang::ExplicitSpecifier::getExpr(), clang::ExplicitSpecifier::getKind(), clang::ExplicitSpecifier::Invalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), SubstExpr(), tryResolveExplicitSpecifier(), and clang::Unevaluated.
Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
FunctionDecl * Sema::InstantiateFunctionDeclaration | ( | FunctionTemplateDecl * | FTD, |
const TemplateArgumentList * | Args, | ||
SourceLocation | Loc, | ||
CodeSynthesisContext::SynthesisKind | CSC = CodeSynthesisContext::ExplicitTemplateArgumentSubstitution |
||
) |
Instantiate (or find existing instantiation of) a function template with a given set of template arguments.
Usually this should not be used, and template argument deduction should be used in its place.
Definition at line 5381 of file SemaTemplateInstantiateDecl.cpp.
References clang::TemplateArgumentList::asArray(), clang::DeclContext::getParent(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Sema::InstantiatingTemplate::isInvalid(), Loc, and SubstDecl().
Referenced by CheckIfFunctionSpecializationIsImmediate(), DeduceReturnType(), and DefineImplicitLambdaToFunctionPointerConversion().
void Sema::InstantiateFunctionDefinition | ( | SourceLocation | PointOfInstantiation, |
FunctionDecl * | Function, | ||
bool | Recursive = false , |
||
bool | DefinitionRequired = false , |
||
bool | AtEndOfTU = false |
||
) |
Instantiate the definition of the given function from its template.
PointOfInstantiation | the point at which the instantiation was required. Note that this is not precisely a "point of instantiation" for the function, but it's close. |
Function | the already-instantiated declaration of a function template specialization or member function of a class template specialization. |
Recursive | if true, recursively instantiates any functions that are required by this instantiation. |
DefinitionRequired | if true, then we are performing an explicit instantiation where the body of the function is required. Complain if there is no such body. |
Definition at line 5415 of file SemaTemplateInstantiateDecl.cpp.
References clang::CPlusPlus11, clang::SemaBase::Diag(), DiagnoseUninstantiableTemplate(), clang::Function, clang::DeclaratorDecl::getBeginLoc(), clang::FunctionDecl::getBody(), clang::FunctionDecl::getDefinition(), getDiagnostics(), getLangOpts(), clang::Decl::getLocation(), getSourceManager(), clang::FunctionDecl::isLateTemplateParsed(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isThisDeclarationInstantiatedFromAFriendDefinition(), LateParsedInstantiations, LateTemplateParser, PendingInstantiations, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::FunctionDecl::willHaveBody().
Referenced by CheckIfFunctionSpecializationIsImmediate(), DeduceReturnType(), InstantiateClassMembers(), clang::SemaCUDA::isEmptyConstructor(), and clang::SemaCUDA::isEmptyDestructor().
bool Sema::InstantiateInClassInitializer | ( | SourceLocation | PointOfInstantiation, |
FieldDecl * | Instantiation, | ||
FieldDecl * | Pattern, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Instantiate the definition of a field from the given pattern.
PointOfInstantiation | The point of instantiation within the source code. |
Instantiation | is the declaration whose definition is being instantiated. This will be a class of a class temploid specialization, or a local enumeration within a function temploid specialization. |
Pattern | The templated declaration from which the instantiation occurs. |
TemplateArgs | The template arguments to be substituted into the pattern. |
true
if an error occurred, false
otherwise. Definition at line 3936 of file SemaTemplateInstantiate.cpp.
References ActOnFinishCXXInClassMemberInitializer(), ActOnStartCXXInClassMemberInitializer(), Context, CurContext, clang::SemaBase::Diag(), ExprEvalContexts, clang::ActionResult< PtrTy, Compress >::get(), getASTMutationListener(), clang::FieldDecl::getInClassInitializer(), clang::FieldDecl::getInClassInitStyle(), clang::DeclContext::getOuterLexicalRecordContext(), clang::FieldDecl::getParent(), clang::FieldDecl::hasInClassInitializer(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::Sema::InstantiatingTemplate::isInvalid(), PotentiallyEvaluated, clang::Decl::setInvalidDecl(), and SubstInitializer().
Referenced by InstantiateClassMembers().
void Sema::InstantiateMemInitializers | ( | CXXConstructorDecl * | New, |
const CXXConstructorDecl * | Tmpl, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 6270 of file SemaTemplateInstantiateDecl.cpp.
References ActOnMemInitializers(), BuildBaseInitializer(), BuildDelegatingInitializer(), BuildMemberInitializer(), CheckParameterPacksForExpansion(), collectUnexpandedParameterPacks(), CurContext, FindInstantiatedDecl(), clang::ActionResult< PtrTy, Compress >::get(), clang::NamedDecl::getDeclName(), clang::DeclContext::getParent(), clang::CXXMethodDecl::getParent(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), clang::CXXConstructorDecl::inits(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::Member, clang::Decl::setInvalidDecl(), SubstInitializer(), and SubstType().
void Sema::InstantiateVariableDefinition | ( | SourceLocation | PointOfInstantiation, |
VarDecl * | Var, | ||
bool | Recursive = false , |
||
bool | DefinitionRequired = false , |
||
bool | AtEndOfTU = false |
||
) |
Instantiate the definition of the given variable from its template.
PointOfInstantiation | the point at which the instantiation was required. Note that this is not precisely a "point of instantiation" for the variable, but it's close. |
Var | the already-instantiated declaration of a templated variable. |
Recursive | if true, recursively instantiates any functions that are required by this instantiation. |
DefinitionRequired | if true, then we are performing an explicit instantiation where a definition of the variable is required. Complain if there is no such definition. |
Definition at line 6045 of file SemaTemplateInstantiateDecl.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::TemplateArgumentList::asArray(), CompleteVarTemplateSpecializationDecl(), Consumer, Context, clang::CPlusPlus11, clang::SemaBase::Diag(), DiagnoseUninstantiableTemplate(), getASTContext(), clang::DeclaratorDecl::getBeginLoc(), clang::Decl::getDeclContext(), clang::VarDecl::getDefinition(), getDiagnostics(), clang::Redeclarable< decl_type >::getFirstDecl(), clang::VarDecl::getInit(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::VarDecl::getPointOfInstantiation(), getSourceManager(), clang::VarTemplateSpecializationDecl::getSpecializedTemplate(), clang::VarTemplateSpecializationDecl::getSpecializedTemplateOrPartial(), clang::VarTemplateSpecializationDecl::getTemplateArgs(), clang::VarTemplateSpecializationDecl::getTemplateArgsAsWritten(), clang::VarTemplateSpecializationDecl::getTemplateInstantiationArgs(), getTemplateInstantiationArgs(), clang::VarDecl::getTemplateInstantiationPattern(), clang::VarDecl::getTemplateSpecializationKind(), clang::VarDecl::getTemplateSpecializationKindForInstantiation(), clang::ValueDecl::getType(), clang::ASTConsumer::HandleCXXStaticMemberVarInstantiation(), clang::VarDecl::hasInit(), InstantiateVariableInitializer(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::Expr::isConstantInitializer(), clang::VarDecl::isConstexpr(), clang::QualType::isConstQualified(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::VarDecl::isOutOfLine(), clang::DeclContext::isRecord(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::mightBeUsableInConstantExpressions(), PendingInstantiations, clang::Sema::LocalEagerInstantiationScope::perform(), clang::Sema::GlobalEagerInstantiationScope::perform(), clang::Sema::ContextRAII::pop(), clang::SemaBase::SemaRef, clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::VarDecl::setTemplateSpecializationKind(), clang::Decl::setVisibleDespiteOwningModule(), SubstDecl(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
Referenced by completeExprArrayBound(), DoMarkVarDeclReferenced(), InstantiateClassMembers(), and PerformPendingInstantiations().
void Sema::InstantiateVariableInitializer | ( | VarDecl * | Var, |
VarDecl * | OldVar, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Instantiate the initializer of a variable.
Definition at line 5961 of file SemaTemplateInstantiateDecl.cpp.
References ActOnUninitializedDecl(), AddInitializerToDecl(), clang::VarDecl::CallInit, clang::SemaCUDA::checkAllowedInitializer(), CUDA(), clang::DirectInit, clang::Evaluated, getASTContext(), getASTMutationListener(), clang::Decl::getDeclContext(), clang::Redeclarable< decl_type >::getFirstDecl(), clang::VarDecl::getInit(), clang::VarDecl::getInitStyle(), getLangOpts(), clang::Decl::hasAttr(), clang::VarDecl::hasInit(), clang::Expr::isConstantInitializer(), clang::VarDecl::isCXXForRangeDecl(), clang::VarDecl::isDirectInit(), clang::VarDecl::isInline(), clang::VarDecl::isInlineSpecified(), clang::VarDecl::isObjCForDecl(), clang::VarDecl::isOutOfLine(), clang::VarDecl::isStaticDataMember(), keepInLifetimeExtendingContext(), PotentiallyEvaluated, clang::VarDecl::setImplicitlyInline(), clang::VarDecl::setInlineSpecified(), clang::Decl::setInvalidDecl(), and SubstInitializer().
Referenced by BuildVariableInstantiation(), CompleteVarTemplateSpecializationDecl(), and InstantiateVariableDefinition().
|
inline |
Determine whether we are currently performing template instantiation.
Definition at line 10604 of file Sema.h.
References CodeSynthesisContexts, and NonInstantiationEntries.
Referenced by clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(), AddImplicitlyDeclaredMembersToClass(), BuildCXXNoexceptExpr(), BuiltinSEHScopeCheck(), CheckExplicitlyDefaultedSpecialMember(), CheckIdentityFieldAssignment(), checkLiteralOperatorTemplateParameterList(), DiagnoseForRangeVariableCopies(), DiagnoseTwoPhaseLookup(), and makeUnavailableInSystemHeader().
QualType Sema::InvalidLogicalVectorOperands | ( | SourceLocation | Loc, |
ExprResult & | LHS, | ||
ExprResult & | RHS | ||
) |
Definition at line 9977 of file SemaExpr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreImpCasts(), clang::Type::isVectorType(), Loc, and clang::Vector.
QualType Sema::InvalidOperands | ( | SourceLocation | Loc, |
ExprResult & | LHS, | ||
ExprResult & | RHS | ||
) |
the following "Check" methods will return a valid/converted QualType or a null QualType (indicating an error diagnostic was issued).
type checking binary operators (subroutines of CreateBuiltinBinOp).
Definition at line 9950 of file SemaExpr.cpp.
References Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and Loc.
IdentifierInfo * Sema::InventAbbreviatedTemplateParameterTypeName | ( | const IdentifierInfo * | ParamName, |
unsigned | Index | ||
) |
bool Sema::isAbstractType | ( | SourceLocation | Loc, |
QualType | T | ||
) |
Definition at line 5995 of file SemaDeclCXX.cpp.
References Context, clang::CPlusPlus, clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), clang::CXXRecordDecl::getDefinition(), getLangOpts(), clang::CXXRecordDecl::isAbstract(), clang::TagDecl::isBeingDefined(), and clang::T.
Referenced by RequireNonAbstractType().
|
inline |
Determine whether a declaration is acceptable (visible/reachable).
Definition at line 11825 of file Sema.h.
References isReachable(), isVisible(), and Visible.
Referenced by hasAcceptableDefinition().
Determines whether the given declaration is an valid acceptable result for name lookup of a nested-name-specifier.
SD | Declaration checked for nested-name-specifier. |
IsExtension | If not null and the declaration is accepted as an extension, the pointed variable is assigned true. |
Definition at line 349 of file SemaCXXScopeSpec.cpp.
References Context, clang::ASTContext::getLangOpts(), clang::ASTContext::getTypeDeclType(), clang::NamedDecl::getUnderlyingDecl(), clang::Type::isDependentType(), and clang::T.
bool Sema::isAcceptableTagRedeclaration | ( | const TagDecl * | Previous, |
TagTypeKind | NewTag, | ||
bool | isDefinition, | ||
SourceLocation | NewTagLoc, | ||
const IdentifierInfo * | Name | ||
) |
Determine whether a tag with a given kind is acceptable as a redeclaration of the given tag declaration.
Definition at line 17160 of file SemaDecl.cpp.
Referenced by clang::TreeTransform< Derived >::RebuildDependentNameType().
|
inline |
bool Sema::IsAtLeastAsConstrained | ( | NamedDecl * | D1, |
MutableArrayRef< const Expr * > | AC1, | ||
NamedDecl * | D2, | ||
MutableArrayRef< const Expr * > | AC2, | ||
bool & | Result | ||
) |
Check whether the given declaration's associated constraints are at least as constrained than another declaration's according to the partial ordering of constraints.
Result | If no error occurred, receives the result of true if D1 is at least constrained than D2, and false otherwise. |
Definition at line 1513 of file SemaConcept.cpp.
References CalculateTemplateDepthForConstraints(), clang::FunctionDecl::getTemplatedKind(), clang::AtomicConstraint::subsumes(), subsumes(), clang::FunctionDecl::TK_FunctionTemplate, and clang::FunctionDecl::TK_NonTemplate.
Referenced by getMoreConstrainedFunction(), and getMoreSpecializedTemplate().
bool Sema::IsBlockPointerConversion | ( | QualType | FromType, |
QualType | ToType, | ||
QualType & | ConvertedType | ||
) |
Definition at line 3083 of file SemaOverload.cpp.
References clang::Type::getAs(), and clang::Type::getPointeeType().
|
inline |
Definition at line 5335 of file Sema.h.
References ExprEvalContexts.
|
inlinestatic |
Definition at line 1821 of file Sema.h.
References clang::CStyleCast, clang::FunctionalCast, and clang::OtherCast.
Referenced by PerformImplicitConversion().
|
inline |
|
inline |
Definition at line 11787 of file Sema.h.
Referenced by AddMemberOperatorCandidates(), BuildArrayType(), CompareReferenceRelationship(), FixOverloadedFunctionReference(), IsDerivedFrom(), PerformImplicitConversion(), and RequireLiteralType().
Determine if a conversion is a complex promotion.
A complex promotion is defined as a complex -> complex conversion where the conversion between the underlying real types is a floating-point or integral promotion.
Definition at line 2667 of file SemaOverload.cpp.
References clang::Type::getAs(), and clang::ComplexType::getElementType().
|
inline |
Definition at line 1888 of file Sema.h.
References currentEvaluationContext(), clang::Sema::ExpressionEvaluationContextRecord::isConstantEvaluated(), and isConstantEvaluatedOverride.
bool Sema::isCurrentClassName | ( | const IdentifierInfo & | II, |
Scope * | S, | ||
const CXXScopeSpec * | SS = nullptr |
||
) |
isCurrentClassName - Determine whether the identifier II is the name of the class type currently being defined.
In the case of nested classes, this will only return true if II is the name of the innermost class.
Definition at line 2628 of file SemaDeclCXX.cpp.
Referenced by clang::Parser::ParseUnqualifiedId().
bool Sema::isCurrentClassNameTypo | ( | IdentifierInfo *& | II, |
const CXXScopeSpec * | SS | ||
) |
Determine whether the identifier II is a typo for the name of the class type currently being defined.
If so, update it to the identifier that should have been used.
Definition at line 2637 of file SemaDeclCXX.cpp.
References computeDeclContext(), clang::CPlusPlus, CurContext, clang::NamedDecl::getIdentifier(), getLangOpts(), clang::IdentifierInfo::getLength(), clang::IdentifierInfo::getName(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isSet().
bool Sema::isDeclaratorFunctionLike | ( | Declarator & | D | ) |
Determine whether.
D | is function like (function or function template) for parsing. |
Definition at line 2836 of file Sema.cpp.
References computeDeclContext(), forRedeclarationInCurContext(), clang::Declarator::getBeginLoc(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclSpec(), clang::Declarator::getIdentifier(), clang::DeclSpec::isFriendSpecified(), clang::CXXScopeSpec::isSet(), LookupOrdinaryName, and LookupQualifiedName().
bool Sema::isDeclInScope | ( | NamedDecl * | D, |
DeclContext * | Ctx, | ||
Scope * | S = nullptr , |
||
bool | AllowInlineNamespace = false |
||
) | const |
isDeclInScope - If 'Ctx' is a function/method, isDeclInScope returns true if 'D' is in Scope 'S', otherwise 'S' is ignored and isDeclInScope returns true if 'D' belongs to the given declaration context.
AllowInlineNamespace | If true , allow the declaration to be in the enclosing namespace set of the context, rather than contained directly within it. |
Definition at line 1587 of file SemaDecl.cpp.
bool Sema::isDeductionGuideName | ( | Scope * | S, |
const IdentifierInfo & | Name, | ||
SourceLocation | NameLoc, | ||
CXXScopeSpec & | SS, | ||
ParsedTemplateTy * | Template = nullptr |
||
) |
Determine whether a particular identifier might be the name in a C++1z deduction-guide declaration.
Definition at line 321 of file SemaTemplate.cpp.
Referenced by clang::Parser::ParseUnqualifiedId().
bool Sema::isDependentScopeSpecifier | ( | const CXXScopeSpec & | SS | ) |
Definition at line 186 of file SemaCXXScopeSpec.cpp.
References clang::CXXScopeSpec::getScopeRep(), clang::NestedNameSpecifier::isDependent(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isSet().
bool Sema::IsDerivedFrom | ( | SourceLocation | Loc, |
QualType | Derived, | ||
QualType | Base | ||
) |
Determine whether the type Derived
is a C++ class that is derived from the type Base
.
Definition at line 2988 of file SemaDeclCXX.cpp.
References clang::CPlusPlus, clang::Type::getAsCXXRecordDecl(), getLangOpts(), clang::TagDecl::isBeingDefined(), isCompleteType(), clang::CXXRecordDecl::isDerivedFrom(), clang::Decl::isInvalidDecl(), and Loc.
Referenced by ActOnConversionDeclarator(), CheckOverridingFunctionReturnType(), CheckPointerToMemberOperands(), CompareReferenceRelationship(), and FindCompositePointerType().
bool Sema::IsDerivedFrom | ( | SourceLocation | Loc, |
QualType | Derived, | ||
QualType | Base, | ||
CXXBasePaths & | Paths | ||
) |
Determine whether the type Derived
is a C++ class that is derived from the type Base
.
Definition at line 3015 of file SemaDeclCXX.cpp.
Determine if A
and B
are equivalent internal linkage declarations from different modules, and thus an ambiguity error can be downgraded to an extension warning.
Determine whether two declarations are "equivalent" for the purposes of name lookup and overload resolution.
This applies when the same internal/no linkage entity is defined by two modules (probably by textually including the same header). In such a case, we don't consider the declarations to declare the same entity, but we also don't want lookups with both declarations visible to be ambiguous in some cases (this happens when using a modularized libstdc++).
Definition at line 10780 of file SemaOverload.cpp.
References Context, getOwningModule(), and clang::ASTContext::hasSameType().
Referenced by CheckUsingShadowDecl().
Determine if VD, which must be a variable or function, is an external symbol that nonetheless can't be referenced from outside this translation unit because its type has no linkage and it's not extern "C".
Determine whether ND is an external-linkage function or variable whose type has no linkage.
Definition at line 846 of file Sema.cpp.
References getLangOpts(), clang::Type::getLinkage(), clang::ValueDecl::getType(), clang::NamedDecl::hasExternalFormalLinkage(), clang::isExternalFormalLinkage(), and isFunctionOrVarDeclExternC().
Referenced by getUndefinedButUsed(), and MarkVarDeclODRUsed().
IsFloatingPointPromotion - Determines whether the conversion from FromType to ToType is a floating point promotion (C++ 4.6).
If so, returns true and sets PromotedType to the promoted type.
An rvalue of type float can be converted to an rvalue of type double. (C++ 4.6p1).
Definition at line 2625 of file SemaOverload.cpp.
References clang::CPlusPlus, clang::RISCV::Float, clang::Type::getAs(), and clang::HLSL.
Determine whether the conversion from FromType to ToType is a valid conversion that strips "noexcept" or "noreturn" off the nested function type.
Definition at line 1799 of file SemaOverload.cpp.
Referenced by CompareReferenceRelationship(), and handlerCanCatch().
|
inline |
Definition at line 6412 of file Sema.h.
References currentEvaluationContext(), and clang::Sema::ExpressionEvaluationContextRecord::isImmediateFunctionContext().
bool Sema::isImplicitlyDeleted | ( | FunctionDecl * | FD | ) |
Determine whether the given function is an implicitly-deleted special member function.
Definition at line 15950 of file SemaDeclCXX.cpp.
References clang::FunctionDecl::isDefaulted(), and clang::FunctionDecl::isDeleted().
Referenced by CreateOverloadedBinOp().
bool Sema::isIncompatibleTypedef | ( | const TypeDecl * | Old, |
TypedefNameDecl * | New | ||
) |
Definition at line 2509 of file SemaDecl.cpp.
Referenced by clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl().
bool Sema::isInitListConstructor | ( | const FunctionDecl * | Ctor | ) |
Determine whether Ctor is an initializer-list constructor, as defined in [dcl.init.list]p2.
Definition at line 12122 of file SemaDeclCXX.cpp.
References clang::Type::getAs(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::FunctionDecl::hasOneParamOrDefaultArgs(), and isStdInitializerList().
|
inline |
Definition at line 6416 of file Sema.h.
References ExprEvalContexts.
Referenced by CreateMaterializeTemporaryExpr(), and IgnoredValueConversions().
bool Sema::IsInsideALocalClassWithinATemplateFunction | ( | ) |
Definition at line 12312 of file SemaTemplate.cpp.
References clang::DeclContext::getParent(), clang::FunctionDecl::getTemplatedKind(), clang::DeclContext::isNamespace(), clang::DeclContext::isTranslationUnit(), and clang::FunctionDecl::TK_NonTemplate.
IsIntegralPromotion - Determines whether the conversion from the expression From (whose potentially-adjusted type is FromType) to ToType is an integral promotion (C++ 4.5).
If so, returns true and sets PromotedType to the promoted type.
Definition at line 2457 of file SemaOverload.cpp.
References clang::Type::getAs().
Definition at line 8996 of file SemaExpr.cpp.
Referenced by CheckOverridingFunctionAttributes().
bool Sema::IsInvalidUnlessNestedName | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
NestedNameSpecInfo & | IdInfo, | ||
bool | EnteringContext | ||
) |
IsInvalidUnlessNestedName - This method is used for error recovery purposes to determine whether the specified identifier is only valid as a nested name specifier, for example a namespace name.
It is conservatively correct to always return false from this method.
The arguments are the same as those passed to ActOnCXXNestedNameSpecifier.
Definition at line 907 of file SemaCXXScopeSpec.cpp.
Is this a legal conversion between two types, one of which is known to be a vector type?
Definition at line 7708 of file SemaExpr.cpp.
References clang::Type::isVectorType().
Definition at line 17945 of file SemaChecking.cpp.
References isLayoutCompatible().
bool clang::Sema::isLibstdcxxEagerExceptionSpecHack | ( | const Declarator & | D | ) |
Determine if we're in a case where we need to (incorrectly) eagerly parse an exception specification to work around a libstdc++ bug.
HACK: 2014-11-14 libstdc++ had a bug where it shadows std::swap with a member swap function then tries to call std::swap unqualified from the exception specification of that function.
This function detects whether we're in such a case and turns off delay-parsing of exception specifications. Libstdc++ 6.1 (released 2016-04-27) appears to have resolved it as side-effect of commit ddb63209a8d (2015-06-05).
Definition at line 45 of file SemaExceptionSpec.cpp.
References Context, CurContext, clang::Declarator::getBeginLoc(), clang::Declarator::getIdentifier(), clang::ASTContext::getSourceManager(), clang::SourceManager::isInSystemHeader(), and clang::IdentifierInfo::isStr().
|
inline |
Definition at line 1163 of file Sema.h.
References isMemberAccessibleForDeletion(), and PDiag().
bool Sema::isMemberAccessibleForDeletion | ( | CXXRecordDecl * | NamingClass, |
DeclAccessPair | Found, | ||
QualType | ObjectType, | ||
SourceLocation | Loc, | ||
const PartialDiagnostic & | Diag | ||
) |
Is the given member accessible for the purposes of deciding whether to define a special member function as deleted?
Definition at line 1614 of file SemaAccess.cpp.
References clang::AS_public, and clang::DeclAccessPair::getAccess().
Referenced by isMemberAccessibleForDeletion().
bool Sema::IsMemberPointerConversion | ( | Expr * | From, |
QualType | FromType, | ||
QualType | ToType, | ||
bool | InOverloadResolution, | ||
QualType & | ConvertedType | ||
) |
IsMemberPointerConversion - Determines whether the conversion of the expression From, which has the (possibly adjusted) type FromType, can be converted to the type ToType via a member pointer conversion (C++ 4.11).
If so, returns true and places the converted type (that might differ from ToType in its cv-qualifiers at some level) into ConvertedType.
Definition at line 3451 of file SemaOverload.cpp.
References clang::Type::getAs(), and clang::Expr::isNullPointerConstant().
bool Sema::isMicrosoftMissingTypename | ( | const CXXScopeSpec * | SS, |
Scope * | S | ||
) |
isMicrosoftMissingTypename - In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to the type of one of the base classes then downgrade the missing typename error to a warning.
This is needed for MSVC compatibility; Example:
Definition at line 687 of file SemaDecl.cpp.
Definition at line 1938 of file SemaLookup.cpp.
References clang::Module::getTopLevelModule(), clang::Module::isGlobalModule(), and clang::Module::isModuleVisible().
bool Sema::isMoreSpecializedThanPrimary | ( | ClassTemplatePartialSpecializationDecl * | T, |
sema::TemplateDeductionInfo & | Info | ||
) |
Definition at line 6267 of file SemaTemplateDeduction.cpp.
References clang::sema::TemplateDeductionInfo::clearSFINAEDiagnostic(), clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::ClassTemplatePartialSpecializationDecl::getInjectedSpecializationType(), getMoreSpecialized(), and clang::ClassTemplateSpecializationDecl::getSpecializedTemplate().
bool Sema::isMoreSpecializedThanPrimary | ( | VarTemplatePartialSpecializationDecl * | T, |
sema::TemplateDeductionInfo & | Info | ||
) |
Definition at line 6300 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgumentList::asArray(), clang::sema::TemplateDeductionInfo::clearSFINAEDiagnostic(), Context, clang::ASTContext::getCanonicalTemplateName(), clang::RedeclarableTemplateDecl::getInjectedTemplateArgs(), getMoreSpecialized(), clang::VarTemplateSpecializationDecl::getSpecializedTemplate(), clang::VarTemplateSpecializationDecl::getTemplateArgs(), and clang::ASTContext::getTemplateSpecializationType().
bool Sema::isObjCPointerConversion | ( | QualType | FromType, |
QualType | ToType, | ||
QualType & | ConvertedType, | ||
bool & | IncompatibleObjC | ||
) |
isObjCPointerConversion - Determines whether this is an Objective-C pointer conversion.
Subroutine of IsPointerConversion, with the same arguments and return values.
Definition at line 2912 of file SemaOverload.cpp.
References clang::Type::getAs(), and clang::QualType::getQualifiers().
bool Sema::IsOverload | ( | FunctionDecl * | New, |
FunctionDecl * | Old, | ||
bool | UseMemberUsingDeclRules, | ||
bool | ConsiderCudaAttrs = true |
||
) |
Definition at line 1579 of file SemaOverload.cpp.
References IsOverloadOrOverrideImpl().
Referenced by clang::SemaCUDA::checkTargetOverload(), and clang::SemaCUDA::maybeAddHostDeviceAttrs().
bool Sema::IsOverride | ( | FunctionDecl * | MD, |
FunctionDecl * | BaseMD, | ||
bool | UseMemberUsingDeclRules, | ||
bool | ConsiderCudaAttrs = true |
||
) |
Definition at line 1585 of file SemaOverload.cpp.
References IsOverloadOrOverrideImpl().
bool Sema::IsPointerConversion | ( | Expr * | From, |
QualType | FromType, | ||
QualType | ToType, | ||
bool | InOverloadResolution, | ||
QualType & | ConvertedType, | ||
bool & | IncompatibleObjC | ||
) |
IsPointerConversion - Determines whether the conversion of the expression From, which has the (possibly adjusted) type FromType, can be converted to the type ToType via a pointer conversion (C++ 4.10).
If so, returns true and places the converted type (that might differ from ToType in its cv-qualifiers at some level) into ConvertedType.
This routine also supports conversions to and from block pointers and conversions with Objective-C's 'id', 'id<protocols...>', and pointers to interfaces. FIXME: Once we've determined the appropriate overloading rules for Objective-C, we may want to split the Objective-C checks into a different routine; however, GCC seems to consider all of these conversions to be pointer conversions, so for now they live here. IncompatibleObjC will be set if the conversion is an allowed Objective-C conversion that should result in a warning.
Definition at line 2761 of file SemaOverload.cpp.
References isNullPointerConstantForConversion(), and clang::Type::isObjCObjectPointerType().
bool Sema::IsPointerInterconvertibleBaseOf | ( | const TypeSourceInfo * | Base, |
const TypeSourceInfo * | Derived | ||
) |
Definition at line 17951 of file SemaChecking.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::TypeLoc::getBeginLoc(), clang::Type::getCanonicalTypeUnqualified(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::CXXRecordDecl::isStandardLayout(), and clang::Type::isStructureOrClassType().
bool Sema::isPotentialImplicitMemberAccess | ( | const CXXScopeSpec & | SS, |
LookupResult & | R, | ||
bool | IsAddressOfOperand | ||
) |
Check whether an expression might be an implicit class member access.
Definition at line 286 of file SemaExprMember.cpp.
References clang::LookupResult::begin(), clang::CPlusPlus, clang::LookupResult::empty(), clang::LookupResult::getFoundDecl(), clang::NamedDecl::isCXXClassMember(), clang::CXXScopeSpec::isEmpty(), clang::LookupResult::isOverloadedResult(), and clang::LookupResult::isUnresolvableResult().
Referenced by attemptRecovery().
|
inline |
Are precise floating point semantics currently enabled?
Definition at line 1606 of file Sema.h.
References CurFPFeatures.
Referenced by ActOnPragmaFEnvAccess(), and ActOnPragmaFloatControl().
bool Sema::IsQualificationConversion | ( | QualType | FromType, |
QualType | ToType, | ||
bool | CStyle, | ||
bool & | ObjCLifetimeConversion | ||
) |
IsQualificationConversion - Determines whether the conversion from an rvalue of type FromType to ToType is a qualification conversion (C++ 4.4).
ObjCLifetimeConversion | Output parameter that will be set to indicate when the qualification conversion involves a change in the Objective-C object lifetime. |
Definition at line 3653 of file SemaOverload.cpp.
Referenced by handlerCanCatch().
Determine whether the given expression is a qualified member access expression, of a form that could be turned into a pointer to member with the address-of operator.
Definition at line 15693 of file SemaExpr.cpp.
References clang::NamedDecl::isCXXClassMember().
Determine whether a declaration is reachable.
Definition at line 11818 of file Sema.h.
References clang::Decl::isUnconditionallyVisible(), and Reachable.
Referenced by hasReachableDeclaration(), and isAcceptable().
Definition at line 1758 of file SemaDecl.cpp.
References clang::Decl::getOwningModule(), clang::Module::getTopLevelModule(), clang::Module::isHeaderLikeModule(), and clang::Module::isNamedModule().
Compare types for equality with respect to possibly compatible function types (noreturn adjustment, implicit calling conventions).
If any of parameter and argument is not a function, just perform type comparison.
P | the template parameter type. |
A | the argument type. |
Definition at line 1315 of file SemaTemplateDeduction.cpp.
References clang::Type::getAs(), and P.
Referenced by DeduceTemplateArguments().
std::optional< TemplateDeductionInfo * > Sema::isSFINAEContext | ( | ) | const |
Determines whether we are currently in a context where template argument substitution failures are not considered errors.
Optional
if we're not in a SFINAE context. Otherwise, contains a pointer that, if non-NULL, contains the nearest template-deduction context object, which can be used to capture diagnostics that will be suppressed. Definition at line 1279 of file SemaTemplateInstantiate.cpp.
References clang::Sema::CodeSynthesisContext::BuildingBuiltinDumpStructCall, clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, CodeSynthesisContexts, clang::Sema::CodeSynthesisContext::ConstraintNormalization, clang::Sema::CodeSynthesisContext::ConstraintsCheck, clang::Sema::CodeSynthesisContext::ConstraintSubstitution, clang::Sema::CodeSynthesisContext::DeclaringImplicitEqualityComparison, clang::Sema::CodeSynthesisContext::DeclaringSpecialMember, clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, clang::Sema::CodeSynthesisContext::DefaultFunctionArgumentInstantiation, clang::Sema::CodeSynthesisContext::DefaultTemplateArgumentChecking, clang::Sema::CodeSynthesisContext::DefaultTemplateArgumentInstantiation, clang::Sema::CodeSynthesisContext::DefiningSynthesizedFunction, clang::Sema::CodeSynthesisContext::ExceptionSpecEvaluation, clang::Sema::CodeSynthesisContext::ExceptionSpecInstantiation, clang::Sema::CodeSynthesisContext::ExplicitTemplateArgumentSubstitution, clang::Sema::CodeSynthesisContext::InitializingStructuredBinding, InNonInstantiationSFINAEContext, clang::Sema::CodeSynthesisContext::LambdaExpressionSubstitution, clang::Sema::CodeSynthesisContext::MarkingClassDllexported, clang::Sema::CodeSynthesisContext::Memoization, clang::Sema::CodeSynthesisContext::NestedRequirementConstraintsCheck, clang::Sema::CodeSynthesisContext::ParameterMappingSubstitution, clang::Sema::CodeSynthesisContext::PriorTemplateArgumentSubstitution, clang::Sema::CodeSynthesisContext::RequirementInstantiation, clang::Sema::CodeSynthesisContext::RequirementParameterInstantiation, clang::Sema::CodeSynthesisContext::RewritingOperatorAsSpaceship, clang::Sema::CodeSynthesisContext::TemplateInstantiation, and clang::Sema::CodeSynthesisContext::TypeAliasTemplateInstantiation.
Referenced by BuildArrayType(), computeDeclContext(), diagnoseNoViableConversion(), EmitCurrentDiagnostic(), recordConversion(), RequireCompleteEnumDecl(), and clang::Sema::SFINAETrap::SFINAETrap().
bool Sema::IsSimplyAccessible | ( | NamedDecl * | Target, |
CXXRecordDecl * | NamingClass, | ||
QualType | BaseType | ||
) |
Checks access to Target from the given class.
The check will take access specifiers into account, but no member access expressions and such.
Target | the declaration to check if it can be accessed |
NamingClass | the class in which the lookup was started. |
BaseType | type of the left side of member access expression. BaseType and NamingClass are used for C++ access control. Depending on the lookup case, they should be set to the following:
|
Definition at line 1972 of file SemaAccess.cpp.
References clang::CPlusPlus.
Tests whether Ty is an instance of std::initializer_list and, if it is and Element is not NULL, assigns the element type to Element.
Definition at line 12005 of file SemaDeclCXX.cpp.
Referenced by isInitListConstructor().
Definition at line 168 of file SemaInit.cpp.
References Context, IsStringInit(), and SIF_None.
Helper function to determine whether this is the (deprecated) C++ conversion from a string literal to a pointer to non-const char or non-const wchar_t (for narrow and wide string literals, respectively).
Definition at line 4165 of file SemaExprCXX.cpp.
References clang::interp::Cast(), Context, clang::Type::getAs(), clang::Type::getPointeeType(), clang::ASTContext::getWideCharType(), clang::Expr::IgnoreParens(), clang::Ordinary, clang::ASTContext::typesAreCompatible(), clang::Unevaluated, clang::UTF16, clang::UTF32, clang::UTF8, and clang::Wide.
DeclSpec::TST Sema::isTagName | ( | IdentifierInfo & | II, |
Scope * | S | ||
) |
isTagName() - This method is called for error recovery purposes only to determine if the specified name is a valid tag name ("struct foo").
If so, this returns the TST for the tag corresponding to it (TST_enum, TST_union, TST_struct, TST_interface, TST_class). This is used to diagnose cases in C where the user forgot to specify the tag.
Definition at line 649 of file SemaDecl.cpp.
TemplateNameKind Sema::isTemplateName | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
bool | hasTemplateKeyword, | ||
const UnqualifiedId & | Name, | ||
ParsedType | ObjectType, | ||
bool | EnteringContext, | ||
TemplateTy & | Template, | ||
bool & | MemberOfUnknownSpecialization, | ||
bool | Disambiguation = false |
||
) |
Definition at line 176 of file SemaTemplate.cpp.
Referenced by clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec().
bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs | ( | TemplateParameterList * | PParam, |
TemplateDecl * | AArg, | ||
SourceLocation | Loc, | ||
bool | IsDeduced | ||
) |
Definition at line 6317 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgumentListInfo::addArgument(), ArgumentToParameter, CheckTemplateArgumentList(), Context, DeduceTemplateArguments(), clang::TemplateParameterList::getDepth(), clang::ASTContext::getInjectedTemplateArgs(), clang::TemplateArgument::getKind(), clang::sema::TemplateDeductionInfo::getLocation(), clang::TemplateDecl::getTemplateParameters(), getTrivialTemplateArgumentLoc(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::TemplateArgument::isPackExpansion(), Loc, P, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_size(), ParameterToArgument, runWithSufficientStackSpace(), clang::TemplateParameterList::size(), and clang::Success.
Determine whether the given type is the type of *this that is used outside of the body of a member function for a type that is currently being defined.
Definition at line 1510 of file SemaExprCXX.cpp.
References clang::Class, CXXThisTypeOverride, clang::Type::getAsCXXRecordDecl(), and clang::QualType::isNull().
Referenced by LookupMemberExprInRecord().
bool Sema::isUnavailableAlignedAllocationFunction | ( | const FunctionDecl & | FD | ) | const |
Determine whether FD
is an aligned allocation or deallocation function that is unavailable.
Definition at line 2032 of file SemaExprCXX.cpp.
References getLangOpts(), clang::FunctionDecl::isDefined(), and clang::FunctionDecl::isReplaceableGlobalAllocationFunction().
Referenced by diagnoseUnavailableAlignedAllocation().
|
inline |
Determines whether we are currently in a context that is not evaluated as per C++ [expr] p5.
Definition at line 6408 of file Sema.h.
References currentEvaluationContext(), and clang::Sema::ExpressionEvaluationContextRecord::isUnevaluated().
Referenced by CheckCXXThisCapture(), CheckIdentityFieldAssignment(), CheckVirtualDtorCall(), DoMarkVarDeclReferenced(), clang::EnterExpressionEvaluationContext::EnterExpressionEvaluationContext(), and MarkVTableUsed().
bool Sema::isUnexpandedParameterPackPermitted | ( | ) |
Determine whether an unexpanded parameter pack might be permitted in this location.
Determine whether it's possible for an unexpanded parameter pack to be valid in this location.
Useful for error recovery.
This only happens when we're in a declaration that is nested within an expression that could be expanded, such as a lambda-expression within a function call.
This is conservatively correct, but may claim that some unexpanded packs are permitted when they are not.
Definition at line 293 of file SemaTemplateVariadic.cpp.
References FunctionScopes.
bool Sema::isUsualDeallocationFunction | ( | const CXXMethodDecl * | FD | ) |
Definition at line 1711 of file SemaExprCXX.cpp.
References clang::SemaCUDA::CFP_HostDevice, clang::SemaCUDA::CFP_WrongSide, CUDA(), getCurFunctionDecl(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::FunctionDecl::getNumParams(), clang::SemaCUDA::IdentifyPreference(), clang::CXXMethodDecl::isUsualDeallocationFunction(), and clang::DeclContext::lookup().
Referenced by CheckOperatorDeleteDeclaration().
Determine if type T is a valid subject for a nonnull and similar attributes.
By default, we look through references (the behavior used by nonnull), but if the second parameter is true, then we treat a reference type as valid.
llvm::Error clang::Sema::isValidSectionSpecifier | ( | StringRef | Str | ) |
Referenced by ActOnPragmaClangSection().
Are the two types SVE-bitcast-compatible types? I.e.
is bitcasting from the first SVE type (e.g. an SVE VLAT) to the second type (e.g. an SVE VLST) allowed?
This will also return false if the two given types do not make sense from the perspective of SVE bitcasts.
Definition at line 7614 of file SemaExpr.cpp.
References clang::VectorType::getVectorKind(), clang::Type::isSVESizelessBuiltinType(), clang::Type::isVectorType(), and clang::SveFixedLengthData.
Sema::VarArgKind Sema::isValidVarArgType | ( | const QualType & | Ty | ) |
Determine the degree of POD-ness for an expression.
Incomplete types are considered POD, since this check can be performed when we're in an unevaluated context.
Definition at line 1015 of file SemaExpr.cpp.
References clang::QualType::DK_nontrivial_c_struct, clang::QualType::isDestructedType(), clang::Type::isIncompleteType(), clang::Type::isObjCObjectType(), and clang::Type::isVoidType().
IsValueInFlagEnum - Determine if a value is allowed as part of a flag enum.
If AllowMask is true, then we also allow the complement of a valid value, to be used as a mask.
Definition at line 20189 of file SemaDecl.cpp.
References clang::EnumDecl::enumerators(), clang::EnumDecl::isClosedFlag(), and clang::TagDecl::isCompleteDefinition().
Determine whether a declaration is visible to name lookup.
Definition at line 11812 of file Sema.h.
References clang::Decl::isUnconditionallyVisible(), and Visible.
Referenced by argumentDependentLookup(), CheckUsingShadowDecl(), hasVisibleDeclaration(), and isAcceptable().
|
inline |
keepInLifetimeExtendingContext - Pull down InLifetimeExtendingContext flag from previous context.
Definition at line 6463 of file Sema.h.
References ExprEvalContexts, and parentEvaluationContext().
Referenced by InstantiateVariableInitializer().
NamedDecl * Sema::LazilyCreateBuiltin | ( | IdentifierInfo * | II, |
unsigned | ID, | ||
Scope * | S, | ||
bool | ForRedeclaration, | ||
SourceLocation | Loc | ||
) |
LazilyCreateBuiltin - The specified Builtin-ID was first used at file scope.
lazily create a decl for it. ForRedeclaration is true if we're creating this built-in in anticipation of redeclaring the built-in.
Definition at line 2405 of file SemaDecl.cpp.
void Sema::LoadExternalVTableUses | ( | ) |
Load any externally-stored vtable uses.
Definition at line 18608 of file SemaDeclCXX.cpp.
References VTablesUsed, and VTableUses.
Referenced by DefineUsedVTables(), and MarkVTableUsed().
void Sema::LoadExternalWeakUndeclaredIdentifiers | ( | ) |
Load weak undeclared identifiers from the external source.
Definition at line 972 of file Sema.cpp.
References WeakUndeclaredIdentifiers.
Referenced by ActOnEndOfTranslationUnit().
void Sema::LookupBinOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
BinaryOperatorKind | Opc, | ||
UnresolvedSetImpl & | Functions | ||
) |
Definition at line 15245 of file SemaExpr.cpp.
bool Sema::LookupBuiltin | ( | LookupResult & | R | ) |
Lookup a builtin function, when name lookup would otherwise fail.
Definition at line 946 of file SemaLookup.cpp.
References clang::LookupResult::addDecl(), clang::CPlusPlus, clang::DeclarationName::getAsIdentifierInfo(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), LookupOrdinaryName, LookupRedeclarationWithLinkage, and clang::OpenCL.
DeclContext::lookup_result Sema::LookupConstructors | ( | CXXRecordDecl * | Class | ) |
Look up the constructors for the given class.
Definition at line 3693 of file SemaLookup.cpp.
References CanDeclareSpecialMemberFunction(), clang::Class, Context, clang::ASTContext::getCanonicalType(), clang::ASTContext::getTypeDeclType(), runWithSufficientStackSpace(), and clang::T.
CXXMethodDecl * Sema::LookupCopyingAssignment | ( | CXXRecordDecl * | Class, |
unsigned | Quals, | ||
bool | RValueThis, | ||
unsigned | ThisQuals | ||
) |
Look up the copying assignment operator for the given class.
Definition at line 3712 of file SemaLookup.cpp.
References clang::Class, clang::Qualifiers::Const, clang::CopyAssignment, LookupSpecialMember(), and clang::Qualifiers::Volatile.
CXXConstructorDecl * Sema::LookupCopyingConstructor | ( | CXXRecordDecl * | Class, |
unsigned | Quals | ||
) |
Look up the copying constructor for the given class.
Definition at line 3671 of file SemaLookup.cpp.
References clang::Class, clang::Qualifiers::Const, clang::CopyConstructor, LookupSpecialMember(), and clang::Qualifiers::Volatile.
ClassTemplateDecl * Sema::lookupCoroutineTraits | ( | SourceLocation | KwLoc, |
SourceLocation | FuncLoc | ||
) |
Lookup 'coroutine_traits' in std namespace and std::experimental namespace.
The namespace found is recorded in Namespace.
Definition at line 1923 of file SemaCoroutine.cpp.
References clang::SemaBase::Diag(), clang::IdentifierTable::get(), clang::Preprocessor::getIdentifierTable(), clang::Decl::getLocation(), getStdNamespace(), LookupOrdinaryName, LookupQualifiedName(), PP, and StdCoroutineTraitsCache.
CXXConstructorDecl * Sema::LookupDefaultConstructor | ( | CXXRecordDecl * | Class | ) |
Look up the default constructor for the given class.
Definition at line 3662 of file SemaLookup.cpp.
References clang::Class, clang::DefaultConstructor, and LookupSpecialMember().
CXXDestructorDecl * Sema::LookupDestructor | ( | CXXRecordDecl * | Class | ) |
Look for the destructor of the given class.
During semantic analysis, this routine should be used in lieu of CXXRecordDecl::getDestructor().
Definition at line 3748 of file SemaLookup.cpp.
References clang::Class, clang::Destructor, and LookupSpecialMember().
Referenced by ActOnDecltypeExpression(), canRecoverDotPseudoDestructorCallsOnPointerObjects(), checkDestructorReference(), clang::Interpreter::CompileDtorCall(), FinalizeVarWithDestructor(), MarkBaseAndMemberDestructorsReferenced(), MarkVirtualBaseDestructorsReferenced(), MaybeBindToTemporary(), SetDelegatingInitializer(), and clang::UsedDeclVisitor< Derived >::VisitCXXDeleteExpr().
bool Sema::LookupInlineAsmField | ( | StringRef | Base, |
StringRef | Member, | ||
unsigned & | Offset, | ||
SourceLocation | AsmLoc | ||
) |
Definition at line 823 of file SemaStmtAsm.cpp.
References clang::Member, and Offset.
ExprResult Sema::LookupInlineAsmIdentifier | ( | CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
UnqualifiedId & | Id, | ||
bool | IsUnevaluatedContext | ||
) |
Definition at line 776 of file SemaStmtAsm.cpp.
References CheckNakedParmReference(), clang::ExprError(), Id, clang::Type::isDependentType(), clang::Type::isFunctionType(), and clang::T.
Referenced by clang::Parser::ParseMSAsmIdentifier().
ExprResult Sema::LookupInlineAsmVarDeclField | ( | Expr * | RefExpr, |
StringRef | Member, | ||
SourceLocation | AsmLoc | ||
) |
Definition at line 892 of file SemaStmtAsm.cpp.
References clang::Expr::getType(), clang::Type::isDependentType(), clang::DeclarationNameInfo::setLoc(), clang::DeclarationNameInfo::setName(), and clang::T.
Referenced by clang::Parser::ParseMSAsmIdentifier().
bool Sema::LookupInSuper | ( | LookupResult & | R, |
CXXRecordDecl * | Class | ||
) |
Perform qualified name lookup into all base classes of the given class.
R | captures both the lookup criteria and any lookup results found. |
Class | The context in which qualified name lookup will search. Name lookup will search in all base classes merging the results. |
Definition at line 2867 of file SemaLookup.cpp.
References clang::LookupResult::addDecl(), clang::Class, Context, clang::LookupResult::empty(), clang::RecordType::getDecl(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::ASTContext::getRecordType(), LookupQualifiedName(), clang::CXXRecordDecl::MergeAccess(), clang::LookupResult::resolveKind(), and clang::LookupResult::setNamingClass().
Referenced by LookupQualifiedName().
Sema::LiteralOperatorLookupResult Sema::LookupLiteralOperator | ( | Scope * | S, |
LookupResult & | R, | ||
ArrayRef< QualType > | ArgTys, | ||
bool | AllowRaw, | ||
bool | AllowTemplate, | ||
bool | AllowStringTemplatePack, | ||
bool | DiagnoseMissing, | ||
StringLiteral * | StringLit = nullptr |
||
) |
LookupLiteralOperator - Determine which literal operator should be used for a user-defined literal, per C++11 [lex.ext].
Normal overload resolution is not used to select which literal operator to call for a user-defined literal. Look up the provided literal operator name, and filter the results to the appropriate set for the given argument types.
Definition at line 3762 of file SemaLookup.cpp.
CXXMethodDecl * Sema::LookupMovingAssignment | ( | CXXRecordDecl * | Class, |
unsigned | Quals, | ||
bool | RValueThis, | ||
unsigned | ThisQuals | ||
) |
Look up the moving assignment operator for the given class.
Definition at line 3728 of file SemaLookup.cpp.
References clang::Class, clang::Qualifiers::Const, LookupSpecialMember(), clang::MoveAssignment, and clang::Qualifiers::Volatile.
CXXConstructorDecl * Sema::LookupMovingConstructor | ( | CXXRecordDecl * | Class, |
unsigned | Quals | ||
) |
Look up the moving constructor for the given class.
Definition at line 3683 of file SemaLookup.cpp.
References clang::Class, clang::Qualifiers::Const, LookupSpecialMember(), clang::MoveConstructor, and clang::Qualifiers::Volatile.
bool Sema::LookupName | ( | LookupResult & | R, |
Scope * | S, | ||
bool | AllowBuiltinCreation = false , |
||
bool | ForceNoCPlusPlus = false |
||
) |
Perform unqualified name lookup starting from a given scope.
Unqualified name lookup (C++ [basic.lookup.unqual], C99 6.2.1) is used to find names within the current scope. For example, 'x' in
Different lookup criteria can find different names. For example, a particular scope can have both a struct and a function of the same name, and each can be found by certain lookup criteria. For more information about lookup criteria, see the documentation for the class LookupCriteria.
S | The scope from which unqualified name lookup will begin. If the lookup criteria permits, name lookup may also search in the parent scopes. | |
[in,out] | R | Specifies the lookup to perform (e.g., the name to look up and the lookup kind), and is updated with the results of lookup including zero or more declarations and possibly additional information used to diagnose ambiguities. |
true
if lookup succeeded and false otherwise. Definition at line 2247 of file SemaLookup.cpp.
Referenced by isValidInteropVariable().
Definition at line 1044 of file SemaLookup.cpp.
LabelDecl * Sema::LookupOrCreateLabel | ( | IdentifierInfo * | II, |
SourceLocation | Loc, | ||
SourceLocation | GnuLabelLoc = SourceLocation() |
||
) |
LookupOrCreateLabel - Do a name lookup of a label with the specified name.
If GnuLabelLoc is a valid source location, then this is a definition of an label label name, otherwise it is a normal label definition or use.
Definition at line 4532 of file SemaLookup.cpp.
References Context, clang::LabelDecl::Create(), CurContext, clang::SourceLocation::isValid(), and Loc.
void Sema::LookupOverloadedBinOp | ( | OverloadCandidateSet & | CandidateSet, |
OverloadedOperatorKind | Op, | ||
const UnresolvedSetImpl & | Fns, | ||
ArrayRef< Expr * > | Args, | ||
bool | RequiresADL = true |
||
) |
Perform lookup for an overloaded binary operator.
Definition at line 14542 of file SemaOverload.cpp.
References AddArgumentDependentLookupCandidates(), AddBuiltinOperatorCandidates(), AddMemberOperatorCandidates(), AddNonMemberOperatorCandidates(), clang::OverloadCandidateSet::OperatorRewriteInfo::AllowRewrittenCandidates, clang::OverloadCandidateSet::OperatorRewriteInfo::allowsReversed(), Context, clang::ASTContext::DeclarationNames, clang::DeclarationNameTable::getCXXOperatorName(), clang::OverloadCandidateSet::getLocation(), clang::OverloadCandidateSet::getRewriteInfo(), clang::getRewrittenOverloadedOperator(), clang::OO_None, and clang::Reversed.
Referenced by CreateOverloadedBinOp().
void Sema::LookupOverloadedOperatorName | ( | OverloadedOperatorKind | Op, |
Scope * | S, | ||
UnresolvedSetImpl & | Functions | ||
) |
Definition at line 3423 of file SemaLookup.cpp.
bool Sema::LookupParsedName | ( | LookupResult & | R, |
Scope * | S, | ||
CXXScopeSpec * | SS, | ||
QualType | ObjectType, | ||
bool | AllowBuiltinCreation = false , |
||
bool | EnteringContext = false |
||
) |
Performs name lookup for a name that was parsed in the source code, and may contain a C++ scope specifier.
This routine is a convenience routine meant to be called from contexts that receive a name and an optional C++ scope specifier (e.g., "N::M::x"). It will then perform either qualified or unqualified name lookup (with LookupQualifiedName or LookupName, respectively) on the given name and return those results. It will perform a special type of lookup for "__super::" scope specifier.
S | The scope from which unqualified name lookup will begin. |
SS | An optional C++ scope-specifier, e.g., "::N::M". |
EnteringContext | Indicates whether we are going to enter the context of the scope-specifier SS (if present). |
Definition at line 2804 of file SemaLookup.cpp.
Referenced by LookupMemberExprInRecord(), and clang::SemaOpenMP::lookupOpenMPDeclareTargetName().
bool Sema::LookupQualifiedName | ( | LookupResult & | R, |
DeclContext * | LookupCtx, | ||
bool | InUnqualifiedLookup = false |
||
) |
Perform qualified name lookup into a given context.
Qualified name lookup (C++ [basic.lookup.qual]) is used to find names when the context of those names is explicit specified, e.g., "std::vector" or "x->member", or as part of unqualified name lookup.
Different lookup criteria can find different names. For example, a particular scope can have both a struct and a function of the same name, and each can be found by certain lookup criteria. For more information about lookup criteria, see the documentation for the class LookupCriteria.
R | captures both the lookup criteria and any lookup results found. |
LookupCtx | The context in which qualified name lookup will search. If the lookup criteria permits, name lookup may also search in the parent contexts or (for C++ classes) base classes. |
InUnqualifiedLookup | true if this is qualified name lookup that occurs as part of unqualified name lookup. |
Definition at line 2486 of file SemaLookup.cpp.
References clang::LookupResult::getLookupName(), and clang::DeclContext::isDependentContext().
Referenced by ActOnStartNamespaceDef(), AddMemberOperatorCandidates(), BuildNonArrayForRange(), BuildVariableInstantiation(), DeduceTemplateSpecializationFromInitializer(), DiagnoseTwoPhaseLookup(), EvaluateStaticAssertMessageAsString(), FindAllocationFunctions(), isDeclaratorFunctionLike(), lookupCoroutineTraits(), LookupInSuper(), LookupQualifiedName(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool Sema::LookupQualifiedName | ( | LookupResult & | R, |
DeclContext * | LookupCtx, | ||
CXXScopeSpec & | SS | ||
) |
Performs qualified name lookup or special type of lookup for "__super::" scope specifier.
This routine is a convenience overload meant to be called from contexts that need to perform a qualified name lookup with an optional C++ scope specifier that might require special kind of lookup.
R | captures both the lookup criteria and any lookup results found. |
LookupCtx | The context in which qualified name lookup will search. |
SS | An optional C++ scope-specifier. |
Definition at line 2775 of file SemaLookup.cpp.
References clang::CXXScopeSpec::getScopeRep(), LookupInSuper(), LookupQualifiedName(), and clang::NestedNameSpecifier::Super.
NamedDecl * Sema::LookupSingleName | ( | Scope * | S, |
DeclarationName | Name, | ||
SourceLocation | Loc, | ||
LookupNameKind | NameKind, | ||
RedeclarationKind | Redecl = RedeclarationKind::NotForRedeclaration |
||
) |
Look up a name, looking for a single declaration.
Return null if the results were absent, ambiguous, or overloaded.
It is preferable to use the elaborated form and explicitly handle ambiguity and overloaded.
Definition at line 3414 of file SemaLookup.cpp.
Referenced by ActOnEndOfTranslationUnit(), ActOnPragmaMSAllocText(), clang::SemaObjC::ActOnTypedefedProtocols(), clang::SemaObjC::getObjCInterfaceDecl(), and clang::SemaObjC::LookupProtocol().
Sema::SpecialMemberOverloadResult Sema::LookupSpecialMember | ( | CXXRecordDecl * | D, |
CXXSpecialMemberKind | SM, | ||
bool | ConstArg, | ||
bool | VolatileArg, | ||
bool | RValueThis, | ||
bool | ConstThis, | ||
bool | VolatileThis | ||
) |
Definition at line 3440 of file SemaLookup.cpp.
References BumpAlloc, CanDeclareSpecialMemberFunction(), Context, clang::CopyAssignment, clang::DefaultConstructor, clang::Destructor, clang::ASTContext::getCanonicalType(), clang::CXXRecordDecl::getDefinition(), clang::CXXRecordDecl::getDestructor(), clang::Decl::getLocation(), clang::ASTContext::getTagDeclType(), ID, clang::FunctionDecl::isDeleted(), clang::MoveAssignment, clang::CXXRecordDecl::needsImplicitDestructor(), clang::Sema::SpecialMemberOverloadResult::NoMemberOrDeleted, runWithSufficientStackSpace(), SM, SpecialMemberCache, and clang::Sema::SpecialMemberOverloadResult::Success.
Referenced by clang::SemaCUDA::inferTargetForImplicitSpecialMember(), LookupCopyingAssignment(), LookupCopyingConstructor(), LookupDefaultConstructor(), LookupDestructor(), LookupMovingAssignment(), and LookupMovingConstructor().
bool Sema::LookupTemplateName | ( | LookupResult & | R, |
Scope * | S, | ||
CXXScopeSpec & | SS, | ||
QualType | ObjectType, | ||
bool | EnteringContext, | ||
RequiredTemplateKind | RequiredTemplate = SourceLocation() , |
||
AssumedTemplateKind * | ATK = nullptr , |
||
bool | AllowTypoCorrection = true |
||
) |
Definition at line 375 of file SemaTemplate.cpp.
Referenced by LookupMemberExprInRecord().
void Sema::LookupVisibleDecls | ( | DeclContext * | Ctx, |
LookupNameKind | Kind, | ||
VisibleDeclConsumer & | Consumer, | ||
bool | IncludeGlobalScope = true , |
||
bool | IncludeDependentBases = false , |
||
bool | LoadExternal = true |
||
) |
Definition at line 4520 of file SemaLookup.cpp.
References Consumer.
void Sema::LookupVisibleDecls | ( | Scope * | S, |
LookupNameKind | Kind, | ||
VisibleDeclConsumer & | Consumer, | ||
bool | IncludeGlobalScope = true , |
||
bool | LoadExternal = true |
||
) |
Definition at line 4512 of file SemaLookup.cpp.
|
inline |
Definition at line 5976 of file Sema.h.
References ActOnFinishFullExpr(), clang::ActionResult< PtrTy, Compress >::get(), and clang::Expr::getExprLoc().
|
inline |
Definition at line 5969 of file Sema.h.
References clang::Expr::getExprLoc().
Referenced by ActOnConditionVariable(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), clang::SemaOpenMP::ActOnOpenMPDistScheduleClause(), clang::SemaOpenMP::ActOnOpenMPFilterClause(), clang::SemaOpenMP::ActOnOpenMPFinalClause(), clang::SemaOpenMP::ActOnOpenMPIfClause(), clang::SemaOpenMP::ActOnOpenMPNocontextClause(), clang::SemaOpenMP::ActOnOpenMPNovariantsClause(), clang::SemaOpenMP::ActOnOpenMPNumTeamsClause(), clang::SemaOpenMP::ActOnOpenMPNumThreadsClause(), clang::SemaOpenMP::ActOnOpenMPScheduleClause(), clang::SemaOpenMP::ActOnOpenMPThreadLimitClause(), clang::SemaOpenMP::ActOnOpenMPXDynCGroupMemClause(), and isNonNegativeIntegerValue().
|
inline |
Definition at line 5972 of file Sema.h.
References ActOnFinishFullExpr().
void Sema::makeMergedDefinitionVisible | ( | NamedDecl * | ND | ) |
Make a merged definition of an existing hidden definition ND
visible at the specified location.
Definition at line 1594 of file SemaLookup.cpp.
Referenced by ActOnDuplicateODRHashDefinition().
|
inline |
bool Sema::makeUnavailableInSystemHeader | ( | SourceLocation | loc, |
UnavailableAttr::ImplicitReason | reason | ||
) |
makeUnavailableInSystemHeader - There is an error in the current context.
If we're still in a system header, and we can plausibly make the relevant declaration unavailable instead of erroring, do so and return true.
Definition at line 562 of file Sema.cpp.
References clang::Decl::addAttr(), Context, CurContext, clang::ASTContext::getSourceManager(), clang::Decl::hasAttr(), inTemplateInstantiation(), and clang::SourceManager::isInSystemHeader().
void Sema::MarkAnyDeclReferenced | ( | SourceLocation | Loc, |
Decl * | D, | ||
bool | MightBeOdrUse | ||
) |
Perform marking for a reference to an arbitrary declaration.
It marks the declaration referenced, and performs odr-use checking for functions and variables. This method should not be used when building a normal expression which refers to a variable.
Definition at line 19951 of file SemaExpr.cpp.
References Loc, and clang::Decl::setReferenced().
Referenced by MarkExprReferenced().
void Sema::MarkAsLateParsedTemplate | ( | FunctionDecl * | FD, |
Decl * | FnD, | ||
CachedTokens & | Toks | ||
) |
Definition at line 12290 of file SemaTemplate.cpp.
References clang::FunctionDecl::setLateTemplateParsed().
void Sema::MarkBaseAndMemberDestructorsReferenced | ( | SourceLocation | Loc, |
CXXRecordDecl * | Record | ||
) |
MarkBaseAndMemberDestructorsReferenced - Given a record decl, mark all the non-trivial destructors of its members and bases as referenced.
Definition at line 5836 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), CheckDestructorAccess(), Context, DiagnoseUseOfDecl(), clang::RecordDecl::fields(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::TargetInfo::getCXXABI(), clang::RecordType::getDecl(), clang::CXXRecordDecl::getDestructor(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeDeclType(), clang::CXXRecordDecl::hasIrrelevantDestructor(), clang::CXXRecordDecl::isAbstract(), clang::RecordDecl::isAnonymousStructOrUnion(), clang::DeclContext::isDependentContext(), isIncompleteOrZeroLengthArrayType(), clang::Decl::isInvalidDecl(), clang::TargetCXXABI::isMicrosoft(), clang::TagDecl::isUnion(), clang::Decl::isUsed(), LookupDestructor(), MarkFunctionReferenced(), MarkVirtualBaseDestructorsReferenced(), and PDiag().
Referenced by DefineImplicitDestructor(), and SetCtorInitializers().
void Sema::MarkCaptureUsedInEnclosingContext | ( | ValueDecl * | Capture, |
SourceLocation | Loc, | ||
unsigned | CapturingScopeIndex | ||
) |
Definition at line 18344 of file SemaExpr.cpp.
References Loc, and MarkVarDeclODRUsed().
void Sema::MarkDeclarationsReferencedInExpr | ( | Expr * | E, |
bool | SkipLocalVariables = false , |
||
ArrayRef< const Expr * > | StopAt = std::nullopt |
||
) |
Mark any declarations that appear within this expression or any potentially-evaluated subexpressions as "referenced".
SkipLocalVariables | If true, don't mark local variables as 'referenced'. |
StopAt | Subexpressions that we shouldn't recurse into. |
Definition at line 20064 of file SemaExpr.cpp.
Referenced by clang::SemaOpenMP::ActOnOpenMPLoopInitialization().
void Sema::MarkDeclarationsReferencedInType | ( | SourceLocation | Loc, |
QualType | T | ||
) |
Mark all of the declarations referenced within a particular AST node as referenced.
Used when template instantiation instantiates a non-dependent type – entities referenced by the type are now referenced.
Definition at line 20004 of file SemaExpr.cpp.
Referenced by clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl().
void Sema::MarkDeclRefReferenced | ( | DeclRefExpr * | E, |
const Expr * | Base = nullptr |
||
) |
Perform reference-marking and odr-use handling for a DeclRefExpr.
Note, this may change the dependence of the DeclRefExpr, and so needs to be handled with care if the DeclRefExpr is not newly-created.
Definition at line 19898 of file SemaExpr.cpp.
References clang::DeclRefExpr::getDecl(), clang::DeclRefExpr::getLocation(), and MarkExprReferenced().
Referenced by BuildImplicitBaseInitializer(), and BuildImplicitMemberInitializer().
|
static |
Marks all of the template parameters that will be deduced by a call to the given function template.
Definition at line 6909 of file SemaTemplateDeduction.cpp.
References clang::Function, clang::TemplateParameterList::getDepth(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), MarkUsedTemplateParameters(), and clang::TemplateParameterList::size().
|
inline |
Definition at line 9835 of file Sema.h.
References Context.
Referenced by clang::CodeCompletionResult::createCodeCompletionStringForDecl().
void Sema::MarkExpressionAsImmediateEscalating | ( | Expr * | E | ) |
Definition at line 17415 of file SemaExpr.cpp.
References clang::CPlusPlus20, and clang::Expr::IgnoreImplicit().
void Sema::MarkFunctionParmPackReferenced | ( | FunctionParmPackExpr * | E | ) |
Perform reference-marking and odr-use handling for a FunctionParmPackExpr.
Definition at line 19941 of file SemaExpr.cpp.
References clang::FunctionParmPackExpr::getParameterPackLocation(), and MarkExprReferenced().
void Sema::MarkFunctionReferenced | ( | SourceLocation | Loc, |
FunctionDecl * | Func, | ||
bool | MightBeOdrUse = true |
||
) |
Mark a function referenced, and check whether it is odr-used (C++ [basic.def.odr]p2, C99 6.9p3)
Definition at line 18001 of file SemaExpr.cpp.
References clang::CUDA, clang::Func, clang::FunctionProtoType::getExceptionSpecType(), isImplicitlyDefinableConstexprFunction(), clang::SourceLocation::isInvalid(), clang::CXXConversionDecl::isLambdaToBlockPointerConversion(), isOdrUseContext(), isPotentiallyConstantEvaluatedContext(), clang::isUnresolvedExceptionSpec(), Loc, clang::XRayInstrKind::None, clang::runWithSufficientStackSpace(), clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, and Used.
Referenced by ActOnDecltypeExpression(), BuildCXXConstructExpr(), CheckDestructor(), checkDestructorReference(), DefineImplicitLambdaToFunctionPointerConversion(), DefineInheritingConstructor(), FinalizeVarWithDestructor(), MarkBaseAndMemberDestructorsReferenced(), MarkVirtualBaseDestructorsReferenced(), MarkVirtualMembersReferenced(), MarkVTableUsed(), MaybeBindToTemporary(), SetDelegatingInitializer(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
void Sema::MarkMemberReferenced | ( | MemberExpr * | E | ) |
Perform reference-marking and odr-use handling for a MemberExpr.
Definition at line 19921 of file SemaExpr.cpp.
References clang::MemberExpr::getBeginLoc(), clang::MemberExpr::getMemberDecl(), clang::MemberExpr::getMemberLoc(), clang::SourceLocation::isValid(), Loc, MarkExprReferenced(), and clang::MemberExpr::performsVirtualDispatch().
void Sema::MarkThisReferenced | ( | CXXThisExpr * | This | ) |
Definition at line 1470 of file SemaExprCXX.cpp.
References CheckCXXThisCapture(), CurContext, FunctionScopes, clang::FunctionProtoType::getParamType(), clang::Type::isDependentType(), and clang::interp::This().
Referenced by BuildCXXThisExpr().
void Sema::MarkTypoCorrectedFunctionDefinition | ( | const NamedDecl * | F | ) |
Definition at line 9177 of file SemaDecl.cpp.
void Sema::MarkUnusedFileScopedDecl | ( | const DeclaratorDecl * | D | ) |
If it's a file scoped decl that must warn if not used, keep track of it.
Definition at line 1950 of file SemaDecl.cpp.
References clang::First.
void Sema::MarkUsedTemplateParameters | ( | const Expr * | E, |
bool | OnlyDeduced, | ||
unsigned | Depth, | ||
llvm::SmallBitVector & | Used | ||
) |
Mark which template parameters are used in a given expression.
E | the expression from which template parameters will be deduced. |
Used | a bit vector whose elements will be set to true to indicate when the corresponding template parameter will be deduced. |
Definition at line 6875 of file SemaTemplateDeduction.cpp.
References Context, Depth, and Used.
Referenced by MarkDeducedTemplateParameters(), and MarkUsedTemplateParameters().
void Sema::MarkUsedTemplateParameters | ( | const TemplateArgumentList & | TemplateArgs, |
bool | OnlyDeduced, | ||
unsigned | Depth, | ||
llvm::SmallBitVector & | Used | ||
) |
Mark which template parameters can be deduced from a given template argument list.
TemplateArgs | the template argument list from which template parameters will be deduced. |
Used | a bit vector whose elements will be set to true to indicate when the corresponding template parameter will be deduced. |
Definition at line 6891 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgumentList::asArray(), Context, Depth, hasPackExpansionBeforeEnd(), MarkUsedTemplateParameters(), clang::TemplateArgumentList::size(), and Used.
void Sema::MarkVariableReferenced | ( | SourceLocation | Loc, |
VarDecl * | Var | ||
) |
Mark a variable referenced, and check whether it is odr-used (C++ [basic.def.odr]p2, C99 6.9p3).
Note that this should not be used directly for normal expressions referring to VarDecl.
Definition at line 19794 of file SemaExpr.cpp.
References DoMarkVarDeclReferenced(), and Loc.
Referenced by CheckComparisonCategoryType(), and clang::SemaOpenMP::tryCaptureOpenMPLambdas().
void Sema::MarkVirtualBaseDestructorsReferenced | ( | SourceLocation | Location, |
CXXRecordDecl * | ClassDecl, | ||
llvm::SmallPtrSetImpl< const RecordType * > * | DirectVirtualBases = nullptr |
||
) |
Mark destructors of virtual bases of this class referenced.
In the Itanium C++ ABI, this is done when emitting a destructor for any non-abstract class. In the Microsoft C++ ABI, this is done any time a class's destructor is referenced.
Definition at line 5940 of file SemaDeclCXX.cpp.
References AR_accessible, clang::Type::castAs(), CheckDerivedToBaseConversion(), CheckDestructorAccess(), Context, DiagnoseUseOfDecl(), clang::RecordType::getDecl(), clang::Decl::getLocation(), clang::ASTContext::getTypeDeclType(), clang::CXXRecordDecl::hasIrrelevantDestructor(), clang::Decl::isInvalidDecl(), LookupDestructor(), MarkFunctionReferenced(), PDiag(), and clang::CXXRecordDecl::vbases().
Referenced by CheckCompleteDestructorVariant(), and MarkBaseAndMemberDestructorsReferenced().
void Sema::MarkVirtualMemberExceptionSpecsNeeded | ( | SourceLocation | Loc, |
const CXXRecordDecl * | RD | ||
) |
Mark the exception specifications of all virtual member functions in the given class as needed.
Definition at line 18784 of file SemaDeclCXX.cpp.
References Loc, clang::CXXRecordDecl::methods(), and ResolveExceptionSpec().
Referenced by DefineUsedVTables().
void Sema::MarkVirtualMembersReferenced | ( | SourceLocation | Loc, |
const CXXRecordDecl * | RD, | ||
bool | ConstexprOnly = false |
||
) |
MarkVirtualMembersReferenced - Will mark all members of the given CXXRecordDecl referenced.
Definition at line 18791 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::RecordType::getDecl(), clang::CXXRecordDecl::getFinalOverriders(), clang::CXXRecordDecl::getNumVBases(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isPureVirtual(), Loc, and MarkFunctionReferenced().
Referenced by DefineUsedVTables(), and MarkVTableUsed().
void Sema::MarkVTableUsed | ( | SourceLocation | Loc, |
CXXRecordDecl * | Class, | ||
bool | DefinitionRequired = false |
||
) |
Note that the vtable for the given class was used at the given location.
Definition at line 18632 of file SemaDeclCXX.cpp.
References CheckDestructor(), clang::Class, Context, CurContext, clang::TargetInfo::getCXXABI(), clang::ASTContext::getTargetInfo(), clang::FunctionDecl::isDefined(), clang::FunctionDecl::isDeleted(), clang::DeclContext::isDependentContext(), clang::TargetCXXABI::isMicrosoft(), isUnevaluatedContext(), clang::CXXMethodDecl::isVirtual(), LangOpts, LoadExternalVTableUses(), Loc, MarkFunctionReferenced(), MarkVirtualMembersReferenced(), OpenMP(), clang::TU_Prefix, TUKind, VTablesUsed, and VTableUses.
Referenced by DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), and InstantiateClassMembers().
TemplateParameterList * Sema::MatchTemplateParametersToScopeSpecifier | ( | SourceLocation | DeclStartLoc, |
SourceLocation | DeclLoc, | ||
const CXXScopeSpec & | SS, | ||
TemplateIdAnnotation * | TemplateId, | ||
ArrayRef< TemplateParameterList * > | ParamLists, | ||
bool | IsFriend, | ||
bool & | IsMemberSpecialization, | ||
bool & | Invalid, | ||
bool | SuppressDiagnostic = false |
||
) |
Match the given template parameter lists to the given scope specifier, returning the template parameter list that applies to the name.
DeclStartLoc | the start of the declaration that has a scope specifier or a template parameter list. |
DeclLoc | The location of the declaration itself. |
SS | the scope specifier that will be matched to the given template parameter lists. This scope specifier precedes a qualified name that is being declared. |
TemplateId | The template-id following the scope specifier, if there is one. Used to check for a missing 'template<>'. |
ParamLists | the template parameter lists, from the outermost to the innermost template parameter lists. |
IsFriend | Whether to apply the slightly different rules for matching template parameters to scope specifiers in friend declarations. |
IsMemberSpecialization | will be set true if the scope specifier denotes a fully-specialized type, and therefore this is a declaration of a member specialization. |
SS
. This template parameter list may have template parameters (if we're declaring a template) or may have no template parameters (if we're declaring a template specialization), or may be NULL (if what we're declaring isn't itself a template). Definition at line 3972 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::getScopeRep(), and clang::T.
Referenced by ActOnStartFunctionDeclarationDeclarator().
ExprResult Sema::MaybeBindToTemporary | ( | Expr * | E | ) |
MaybeBindToTemporary - If the passed in expression has a record type with a non-trivial destructor, this will return CXXBindTemporaryExpr.
Otherwise it simply returns the passed in expression.
Definition at line 7523 of file SemaExprCXX.cpp.
References clang::ASTContext::BoundMemberTy, clang::Type::castAs(), CheckDestructorAccess(), Cleanup, Context, clang::CPlusPlus, clang::CXXTemporary::Create(), clang::CXXBindTemporaryExpr::Create(), clang::ImplicitCastExpr::Create(), DiagnoseUseOfDecl(), clang::QualType::DK_nontrivial_c_struct, clang::Sema::ExpressionEvaluationContextRecord::EK_Decltype, clang::ExprError(), ExprEvalContexts, clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::RecordType::getDecl(), clang::Expr::getExprLoc(), clang::FunctionType::getExtInfo(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::ObjCMethodDecl::getMethodFamily(), clang::Type::getPointeeType(), clang::FunctionType::ExtInfo::getProducesResult(), clang::Expr::getType(), clang::Type::getTypeClass(), clang::QualType::getTypePtr(), clang::Decl::hasAttr(), clang::ObjCRuntime::hasEmptyCollections(), clang::DeclContext::isDependentContext(), clang::QualType::isDestructedType(), clang::Expr::isGLValue(), clang::Decl::isInvalidDecl(), clang::Type::isObjCARCImplicitlyUnretainedType(), clang::Type::isObjCRetainableType(), LookupDestructor(), MarkFunctionReferenced(), clang::LangOptions::ObjCRuntime, clang::OMF_performSelector, PDiag(), clang::CleanupInfo::setExprNeedsCleanups(), clang::T, and clang::VK_PRValue.
Referenced by BuildLiteralOperatorCall(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), and CreateOverloadedUnaryOp().
ExprResult Sema::MaybeConvertParenListExprToParenExpr | ( | Scope * | S, |
Expr * | ME | ||
) |
This is not an AltiVec-style cast or or C++ direct-initialization, so turn the ParenListExpr into a sequence of comma binary operators.
Definition at line 8003 of file SemaExpr.cpp.
MaybeCreateExprWithCleanups - If the current full-expression requires any cleanups, surround it with a ExprWithCleanups node.
Otherwise, just returns the passed-in expression.
Definition at line 7694 of file SemaExprCXX.cpp.
References Cleanup, clang::CleanupInfo::cleanupsHaveSideEffects(), CleanupVarDeclMarking(), Context, clang::ExprWithCleanups::Create(), DiscardCleanupsInEvaluationContext(), ExprCleanupObjects, ExprEvalContexts, and clang::CleanupInfo::exprNeedsCleanups().
Referenced by ActOnFinishFullExpr(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), ConvertParamDefaultArgument(), MaybeCreateExprWithCleanups(), and MaybeCreateStmtWithCleanups().
ExprResult Sema::MaybeCreateExprWithCleanups | ( | ExprResult | SubExpr | ) |
Definition at line 7687 of file SemaExprCXX.cpp.
References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and MaybeCreateExprWithCleanups().
Definition at line 7716 of file SemaExprCXX.cpp.
References Cleanup, CleanupVarDeclMarking(), Context, clang::CompoundStmt::Create(), clang::CleanupInfo::exprNeedsCleanups(), MaybeCreateExprWithCleanups(), and clang::ASTContext::VoidTy.
Referenced by ActOnFinishFullStmt().
bool Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic | ( | NamedDecl * | D1, |
ArrayRef< const Expr * > | AC1, | ||
NamedDecl * | D2, | ||
ArrayRef< const Expr * > | AC2 | ||
) |
If D1 was not at least as constrained as D2, but would've been if a pair of atomic constraints involved had been declared in a concept and not repeated in two separate places in code.
Definition at line 1574 of file SemaConcept.cpp.
References clang::AtomicConstraint::subsumes().
void Sema::maybeExtendBlockObject | ( | ExprResult & | E | ) |
Do an explicit extend of the given block pointer if we're in ARC.
Definition at line 7367 of file SemaExpr.cpp.
References clang::ImplicitCastExpr::Create(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Type::isBlockPointerType(), and clang::Expr::isPRValue().
Referenced by clang::SemaObjC::PrepareCastToObjCObjectPointer().
void Sema::MaybeSuggestAddingStaticToDecl | ( | const FunctionDecl * | D | ) |
Definition at line 206 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), Diag(), clang::First, clang::Redeclarable< decl_type >::getFirstDecl(), and hasAnyExplicitStorageClass().
AlwaysInlineAttr* clang::Sema::mergeAlwaysInlineAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
const IdentifierInfo * | Ident | ||
) |
AvailabilityAttr* clang::Sema::mergeAvailabilityAttr | ( | NamedDecl * | D, |
const AttributeCommonInfo & | CI, | ||
IdentifierInfo * | Platform, | ||
bool | Implicit, | ||
VersionTuple | Introduced, | ||
VersionTuple | Deprecated, | ||
VersionTuple | Obsoleted, | ||
bool | IsUnavailable, | ||
StringRef | Message, | ||
bool | IsStrict, | ||
StringRef | Replacement, | ||
AvailabilityMergeKind | AMK, | ||
int | Priority, | ||
IdentifierInfo * | IIEnvironment | ||
) |
BTFDeclTagAttr* clang::Sema::mergeBTFDeclTagAttr | ( | Decl * | D, |
const BTFDeclTagAttr & | AL | ||
) |
CodeSegAttr* clang::Sema::mergeCodeSegAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | Name | ||
) |
bool Sema::MergeCompatibleFunctionDecls | ( | FunctionDecl * | New, |
FunctionDecl * | Old, | ||
Scope * | S, | ||
bool | MergeTypeWithOld | ||
) |
Completes the merge of two function declarations that are known to be compatible.
This routine handles the merging of attributes and other properties of function declarations from the old declaration to the new declaration, once we know that New is in fact a redeclaration of Old.
Definition at line 4384 of file SemaDecl.cpp.
bool Sema::MergeCXXFunctionDecl | ( | FunctionDecl * | New, |
FunctionDecl * | Old, | ||
Scope * | S | ||
) |
MergeCXXFunctionDecl - Merge two declarations of the same C++ function, once we already know that they have the same type.
Subroutine of MergeFunctionDecl. Returns true if there was an error, false otherwise.
Definition at line 474 of file SemaDeclCXX.cpp.
void Sema::mergeDeclAttributes | ( | NamedDecl * | New, |
Decl * | Old, | ||
AvailabilityMergeKind | AMK = AMK_Redeclaration |
||
) |
mergeDeclAttributes - Copy attributes from the Old decl to the New one.
Definition at line 3217 of file SemaDecl.cpp.
References clang::Decl::getAttr(), and clang::Decl::getMostRecentDecl().
DLLExportAttr* clang::Sema::mergeDLLExportAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI | ||
) |
DLLImportAttr* clang::Sema::mergeDLLImportAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI | ||
) |
EnforceTCBAttr* clang::Sema::mergeEnforceTCBAttr | ( | Decl * | D, |
const EnforceTCBAttr & | AL | ||
) |
EnforceTCBLeafAttr* clang::Sema::mergeEnforceTCBLeafAttr | ( | Decl * | D, |
const EnforceTCBLeafAttr & | AL | ||
) |
ErrorAttr* clang::Sema::mergeErrorAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | NewUserDiagnostic | ||
) |
FormatAttr* clang::Sema::mergeFormatAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
IdentifierInfo * | Format, | ||
int | FormatIdx, | ||
int | FirstArg | ||
) |
bool Sema::MergeFunctionDecl | ( | FunctionDecl * | New, |
NamedDecl *& | OldD, | ||
Scope * | S, | ||
bool | MergeTypeWithOld, | ||
bool | NewDeclIsDefn | ||
) |
MergeFunctionDecl - We just parsed a function 'New' from declarator D which has the same name and scope as a previous declaration 'Old'.
Figure out how to resolve this situation, merging decls or emitting diagnostics as appropriate.
In C++, New and Old must be declarations that are not overloaded. Use IsOverload to determine whether New and Old are overloaded, and to select the Old declaration that New should be merged with.
Returns true if there was an error, false otherwise.
Definition at line 3686 of file SemaDecl.cpp.
WebAssemblyImportModuleAttr* clang::Sema::mergeImportModuleAttr | ( | Decl * | D, |
const WebAssemblyImportModuleAttr & | AL | ||
) |
WebAssemblyImportNameAttr* clang::Sema::mergeImportNameAttr | ( | Decl * | D, |
const WebAssemblyImportNameAttr & | AL | ||
) |
IntelNamedSubGroupSizeAttr* clang::Sema::MergeIntelNamedSubGroupSizeAttr | ( | Decl * | D, |
const IntelNamedSubGroupSizeAttr & | A | ||
) |
IntelReqdSubGroupSizeAttr* clang::Sema::MergeIntelReqdSubGroupSizeAttr | ( | Decl * | D, |
const IntelReqdSubGroupSizeAttr & | A | ||
) |
InternalLinkageAttr* clang::Sema::mergeInternalLinkageAttr | ( | Decl * | D, |
const InternalLinkageAttr & | AL | ||
) |
InternalLinkageAttr* clang::Sema::mergeInternalLinkageAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
MinSizeAttr* clang::Sema::mergeMinSizeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI | ||
) |
MSInheritanceAttr* clang::Sema::mergeMSInheritanceAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
bool | BestCase, | ||
MSInheritanceModel | Model | ||
) |
void Sema::mergeObjCMethodDecls | ( | ObjCMethodDecl * | New, |
ObjCMethodDecl * | Old | ||
) |
Definition at line 4420 of file SemaDecl.cpp.
References clang::Decl::getDeclContext(), clang::ObjCMethodDecl::isOptional(), mergeParamDeclAttributes(), clang::ObjCMethodDecl::param_begin(), and clang::ObjCMethodDecl::param_end().
OptimizeNoneAttr* clang::Sema::mergeOptimizeNoneAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI | ||
) |
SectionAttr* clang::Sema::mergeSectionAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | Name | ||
) |
SwiftNameAttr* clang::Sema::mergeSwiftNameAttr | ( | Decl * | D, |
const SwiftNameAttr & | SNA, | ||
StringRef | Name | ||
) |
SYCLAddIRAnnotationsMemberAttr* clang::Sema::MergeSYCLAddIRAnnotationsMemberAttr | ( | Decl * | D, |
const SYCLAddIRAnnotationsMemberAttr & | A | ||
) |
SYCLAddIRAttributesFunctionAttr* clang::Sema::MergeSYCLAddIRAttributesFunctionAttr | ( | Decl * | D, |
const SYCLAddIRAttributesFunctionAttr & | A | ||
) |
SYCLAddIRAttributesGlobalVariableAttr* clang::Sema::MergeSYCLAddIRAttributesGlobalVariableAttr | ( | Decl * | D, |
const SYCLAddIRAttributesGlobalVariableAttr & | A | ||
) |
SYCLAddIRAttributesKernelParameterAttr* clang::Sema::MergeSYCLAddIRAttributesKernelParameterAttr | ( | Decl * | D, |
const SYCLAddIRAttributesKernelParameterAttr & | A | ||
) |
SYCLDeviceHasAttr* clang::Sema::MergeSYCLDeviceHasAttr | ( | Decl * | D, |
const SYCLDeviceHasAttr & | A | ||
) |
SYCLIntelBankWidthAttr* clang::Sema::MergeSYCLIntelBankWidthAttr | ( | Decl * | D, |
const SYCLIntelBankWidthAttr & | A | ||
) |
SYCLIntelESimdVectorizeAttr* clang::Sema::MergeSYCLIntelESimdVectorizeAttr | ( | Decl * | D, |
const SYCLIntelESimdVectorizeAttr & | A | ||
) |
SYCLIntelForcePow2DepthAttr* clang::Sema::MergeSYCLIntelForcePow2DepthAttr | ( | Decl * | D, |
const SYCLIntelForcePow2DepthAttr & | A | ||
) |
SYCLIntelInitiationIntervalAttr* clang::Sema::MergeSYCLIntelInitiationIntervalAttr | ( | Decl * | D, |
const SYCLIntelInitiationIntervalAttr & | A | ||
) |
SYCLIntelLoopFuseAttr* clang::Sema::MergeSYCLIntelLoopFuseAttr | ( | Decl * | D, |
const SYCLIntelLoopFuseAttr & | A | ||
) |
SYCLIntelMaxConcurrencyAttr* clang::Sema::MergeSYCLIntelMaxConcurrencyAttr | ( | Decl * | D, |
const SYCLIntelMaxConcurrencyAttr & | A | ||
) |
SYCLIntelMaxGlobalWorkDimAttr* clang::Sema::MergeSYCLIntelMaxGlobalWorkDimAttr | ( | Decl * | D, |
const SYCLIntelMaxGlobalWorkDimAttr & | A | ||
) |
SYCLIntelMaxReplicatesAttr* clang::Sema::MergeSYCLIntelMaxReplicatesAttr | ( | Decl * | D, |
const SYCLIntelMaxReplicatesAttr & | A | ||
) |
SYCLIntelMaxWorkGroupSizeAttr* clang::Sema::MergeSYCLIntelMaxWorkGroupSizeAttr | ( | Decl * | D, |
const SYCLIntelMaxWorkGroupSizeAttr & | A | ||
) |
SYCLIntelMaxWorkGroupsPerMultiprocessorAttr* clang::Sema::MergeSYCLIntelMaxWorkGroupsPerMultiprocessorAttr | ( | Decl * | D, |
const SYCLIntelMaxWorkGroupsPerMultiprocessorAttr & | A | ||
) |
SYCLIntelMinWorkGroupsPerComputeUnitAttr* clang::Sema::MergeSYCLIntelMinWorkGroupsPerComputeUnitAttr | ( | Decl * | D, |
const SYCLIntelMinWorkGroupsPerComputeUnitAttr & | A | ||
) |
SYCLIntelNoGlobalWorkOffsetAttr* clang::Sema::MergeSYCLIntelNoGlobalWorkOffsetAttr | ( | Decl * | D, |
const SYCLIntelNoGlobalWorkOffsetAttr & | A | ||
) |
SYCLIntelNumBanksAttr* clang::Sema::MergeSYCLIntelNumBanksAttr | ( | Decl * | D, |
const SYCLIntelNumBanksAttr & | A | ||
) |
SYCLIntelNumSimdWorkItemsAttr* clang::Sema::MergeSYCLIntelNumSimdWorkItemsAttr | ( | Decl * | D, |
const SYCLIntelNumSimdWorkItemsAttr & | A | ||
) |
SYCLIntelPipeIOAttr* clang::Sema::MergeSYCLIntelPipeIOAttr | ( | Decl * | D, |
const SYCLIntelPipeIOAttr & | A | ||
) |
SYCLIntelSchedulerTargetFmaxMhzAttr* clang::Sema::MergeSYCLIntelSchedulerTargetFmaxMhzAttr | ( | Decl * | D, |
const SYCLIntelSchedulerTargetFmaxMhzAttr & | A | ||
) |
SYCLReqdWorkGroupSizeAttr* clang::Sema::MergeSYCLReqdWorkGroupSizeAttr | ( | Decl * | D, |
const SYCLReqdWorkGroupSizeAttr & | A | ||
) |
SYCLTypeAttr* clang::Sema::MergeSYCLTypeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
SYCLTypeAttr::SYCLType | TypeName | ||
) |
SYCLUsesAspectsAttr* clang::Sema::MergeSYCLUsesAspectsAttr | ( | Decl * | D, |
const SYCLUsesAspectsAttr & | A | ||
) |
SYCLWorkGroupSizeHintAttr* clang::Sema::MergeSYCLWorkGroupSizeHintAttr | ( | Decl * | D, |
const SYCLWorkGroupSizeHintAttr & | A | ||
) |
void Sema::MergeTypedefNameDecl | ( | Scope * | S, |
TypedefNameDecl * | New, | ||
LookupResult & | OldDecls | ||
) |
MergeTypedefNameDecl - We just parsed a typedef 'New' which has the same name and scope as a previous declaration 'Old'.
Figure out how to resolve this situation, merging decls or emitting diagnostics as appropriate. If there was an error, set New to be invalid.
Definition at line 2548 of file SemaDecl.cpp.
TypeVisibilityAttr* clang::Sema::mergeTypeVisibilityAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
TypeVisibilityAttr::VisibilityType | Vis | ||
) |
UuidAttr* clang::Sema::mergeUuidAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | UuidAsWritten, | ||
MSGuidDecl * | GuidDecl | ||
) |
void Sema::MergeVarDecl | ( | VarDecl * | New, |
LookupResult & | Previous | ||
) |
MergeVarDecl - We just parsed a variable 'New' which has the same name and scope as a previous declaration 'Old'.
Figure out how to resolve this situation, merging decls or emitting diagnostics as appropriate.
Tentative definition rules (C99 6.9.2p2) are checked by FinalizeDeclaratorGroup. Unfortunately, we can't analyze tentative definitions here, since the initializer hasn't been attached.
Definition at line 4590 of file SemaDecl.cpp.
References adjustDeclContextForDeclaratorDecl(), clang::CPlusPlus, clang::VarDecl::Definition, Diag(), clang::Decl::dropAttr(), clang::Decl::getAccess(), clang::Decl::getAttr(), clang::VarDecl::getCanonicalDecl(), clang::NamedDecl::getDeclName(), clang::VarDecl::getDefinition(), clang::VarDecl::getDescribedVarTemplate(), clang::NamedDecl::getIdentifier(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::Redeclarable< decl_type >::getMostRecentDecl(), getNoteDiagForInvalidRedeclaration(), clang::VarDecl::getStorageClass(), clang::VarTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::VarDecl::getTLSKind(), clang::Decl::hasAttr(), clang::NamedDecl::hasExternalFormalLinkage(), clang::VarDecl::hasExternalStorage(), clang::NamedDecl::hasLinkage(), haveIncompatibleLanguageLinkages(), clang::VarDecl::isConstexpr(), clang::VarDecl::isFileVarDecl(), clang::VarDecl::isInline(), clang::Decl::isInvalidDecl(), clang::VarDecl::isLocalVarDeclOrParm(), clang::VarDecl::isOutOfLine(), clang::DeclContext::isRecord(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::isThisDeclarationADefinition(), clang::Decl::isUsed(), mergeTypeWithPrevious(), Previous, clang::SC_None, clang::SC_Static, clang::Decl::setAccess(), clang::VarDecl::setImplicitlyInline(), clang::Decl::setInvalidDecl(), clang::Decl::setIsUsed(), clang::Redeclarable< decl_type >::setPreviousDecl(), and clang::VarDecl::TLS_Dynamic.
Merge the exception specifications of two variable declarations.
This is called when there's a redeclaration of a VarDecl. The function checks if the redeclaration might have an exception specification and validates compatibility and merges the specs if necessary.
Definition at line 1616 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), CheckEquivalentExceptionSpec(), Context, clang::Type::getAs(), getLangOpts(), clang::Decl::getLocation(), clang::Type::getPointeeType(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::Type::isFunctionProtoType(), P, and clang::Decl::setInvalidDecl().
MergeVarDeclTypes - We parsed a variable 'New' which has the same name and scope as a previous declaration 'Old'.
Figure out how to merge their types, emitting diagnostics as appropriate.
Declarations using the auto type specifier (C++ [decl.spec.auto]) call back to here in AddInitializerToDecl. We can't check them before the initializer is attached.
Definition at line 4466 of file SemaDecl.cpp.
References clang::Type::containsErrors(), clang::CPlusPlus, clang::ValueDecl::getType(), clang::Decl::isInvalidDecl(), and clang::Type::isUndeducedType().
VisibilityAttr* clang::Sema::mergeVisibilityAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
VisibilityAttr::VisibilityType | Vis | ||
) |
|
inline |
Determine whether it's plausible that E was intended to be a template-name.
Definition at line 2908 of file Sema.h.
References clang::CPlusPlus, clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
void Sema::ModifyFnAttributesMSPragmaOptimize | ( | FunctionDecl * | FD | ) |
Only called on function definitions; if there is a MSVC #pragma optimize in scope, consider changing the function's attributes based on the optimization list passed to the pragma.
Definition at line 1184 of file SemaAttr.cpp.
References AddOptnoneAttributeIfNoConflicts(), clang::DeclaratorDecl::getBeginLoc(), and MSPragmaOptimizeIsOn.
bool Sema::NeedToCaptureVariable | ( | ValueDecl * | Var, |
SourceLocation | Loc | ||
) |
Checks if the variable must be captured.
Definition at line 19133 of file SemaExpr.cpp.
References Loc.
void Sema::NoteAllFoundTemplates | ( | TemplateName | Name | ) |
Definition at line 4333 of file SemaTemplate.cpp.
void Sema::NoteAllOverloadCandidates | ( | Expr * | E, |
QualType | DestType = QualType() , |
||
bool | TakingAddress = false |
||
) |
Definition at line 11263 of file SemaOverload.cpp.
References Context, clang::CRK_None, clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::Expr::getType(), NoteOverloadCandidate(), and clang::ASTContext::OverloadTy.
Referenced by ResolveAndFixSingleFunctionTemplateSpecialization(), and ResolveSingleFunctionTemplateSpecialization().
void Sema::NoteDeletedFunction | ( | FunctionDecl * | FD | ) |
Emit a note explaining that this function is deleted.
Definition at line 122 of file SemaExpr.cpp.
References Diag(), clang::Decl::getLocation(), and clang::Decl::isImplicit().
Referenced by CreateOverloadedBinOp().
void Sema::NoteDeletedInheritingConstructor | ( | CXXConstructorDecl * | CD | ) |
Definition at line 14201 of file SemaDeclCXX.cpp.
References clang::DefaultConstructor, clang::CXXConstructorDecl::getInheritedConstructor(), clang::Decl::getLocation(), clang::InheritedConstructor::getShadowDecl(), and ShouldDeleteSpecialMember().
void Sema::NoteHiddenVirtualMethods | ( | CXXMethodDecl * | MD, |
SmallVectorImpl< CXXMethodDecl * > & | OverloadedMethods | ||
) |
Definition at line 10430 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::ValueDecl::getType(), HandleFunctionTypeMismatch(), and PDiag().
Referenced by CheckOverrideControl(), and DiagnoseHiddenVirtualMethods().
void Sema::NoteOverloadCandidate | ( | const NamedDecl * | Found, |
const FunctionDecl * | Fn, | ||
OverloadCandidateRewriteKind | RewriteKind = OverloadCandidateRewriteKind() , |
||
QualType | DestType = QualType() , |
||
bool | TakingAddress = false |
||
) |
Definition at line 11186 of file SemaOverload.cpp.
References checkAddressOfCandidateIsAvailable(), clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::Decl::getLocation(), clang::ValueDecl::getType(), HandleFunctionTypeMismatch(), clang::Decl::hasAttr(), clang::FunctionDecl::isMultiVersion(), PDiag(), and shouldSkipNotingLambdaConversionDecl().
Referenced by NoteAllOverloadCandidates().
void Sema::notePreviousDefinition | ( | const NamedDecl * | Old, |
SourceLocation | New | ||
) |
Definition at line 4827 of file SemaDecl.cpp.
References clang::Module::DefinitionLoc, Diag(), clang::SourceManager::getDecomposedLoc(), clang::SourceManager::getFileEntryForID(), clang::SourceManager::getFileEntryRefForID(), clang::SourceManager::getFilename(), clang::Module::getFullModuleName(), clang::SourceManager::getIncludeLoc(), clang::Decl::getLocation(), clang::Decl::getOwningModule(), clang::SourceManager::getSpellingLoc(), clang::SourceLocation::isInvalid(), and clang::SourceLocation::isValid().
void Sema::NoteTemplateLocation | ( | const NamedDecl & | Decl, |
std::optional< SourceRange > | ParamRange = {} |
||
) |
Definition at line 8555 of file SemaTemplate.cpp.
References clang::Decl::getLocation(), clang::SourceLocation::isValid(), and noteLocation().
Referenced by CheckDeductionGuideDeclarator(), DeduceTemplateSpecializationFromInitializer(), and GetDeclSpecTypeForDeclarator().
void Sema::NoteTemplateParameterLocation | ( | const NamedDecl & | Decl | ) |
Definition at line 8567 of file SemaTemplate.cpp.
References noteLocation().
|
inline |
Definition at line 1012 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), attemptRecovery(), CXXCheckConditionalOperands(), FinishForRangeVarDecl(), clang::Parser::getObjCDeclContext(), GetTypeForDeclaratorCast(), Initialize(), clang::Parser::ObjCTypeParamListScope::leave(), PerformImplicitConversion(), clang::TreeTransform< Derived >::RebuildObjCEncodeExpr(), clang::TreeTransform< Derived >::RebuildObjCMessageExpr(), clang::TreeTransform< Derived >::RebuildObjCObjectType(), clang::TreeTransform< Derived >::RebuildObjCTypeParamType(), and SelectBestMethod().
|
inline |
|
inline |
Definition at line 1022 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), BuildArrayType(), isNonNegativeIntegerValue(), MarkExprReferenced(), MarkVarDeclODRUsed(), MarkVTableUsed(), and ~Sema().
|
inline |
Definition at line 6445 of file Sema.h.
References ExprEvalContexts, and PotentiallyEvaluated.
|
inline |
Definition at line 5325 of file Sema.h.
References ExprEvalContexts.
Referenced by DeduceTemplateArguments(), keepInLifetimeExtendingContext(), and parentEvaluationContext().
|
inline |
Definition at line 5331 of file Sema.h.
References parentEvaluationContext().
Decl * Sema::ParsedFreeStandingDeclSpec | ( | Scope * | S, |
AccessSpecifier | AS, | ||
DeclSpec & | DS, | ||
const ParsedAttributesView & | DeclAttrs, | ||
MultiTemplateParamsArg | TemplateParams, | ||
bool | IsExplicitInstantiation, | ||
RecordDecl *& | AnonRecord | ||
) |
ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g.
"struct foo;") is parsed. It also accepts template parameters to cope with template friend declarations.
Definition at line 5133 of file SemaDecl.cpp.
Decl * Sema::ParsedFreeStandingDeclSpec | ( | Scope * | S, |
AccessSpecifier | AS, | ||
DeclSpec & | DS, | ||
const ParsedAttributesView & | DeclAttrs, | ||
RecordDecl *& | AnonRecord | ||
) |
ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g.
"struct foo;") is parsed.
Definition at line 4909 of file SemaDecl.cpp.
TypedefDecl * Sema::ParseTypedefDecl | ( | Scope * | S, |
Declarator & | D, | ||
QualType | T, | ||
TypeSourceInfo * | TInfo | ||
) |
Subroutines of ActOnDeclarator().
Definition at line 16996 of file SemaDecl.cpp.
|
inline |
Build a partial diagnostic.
Definition at line 24 of file SemaInternal.h.
References Context, and clang::ASTContext::getDiagAllocator().
Referenced by ActOnDecltypeExpression(), BuildLiteralOperatorCall(), BuildNonArrayForRange(), checkDestructorReference(), CheckEquivalentExceptionSpec(), CheckExceptionSpecCompatibility(), CheckOverridingFunctionExceptionSpec(), CheckParamExceptionSpec(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), diagnoseTypo(), FinalizeVarWithDestructor(), clang::SemaObjC::FindProtocolDeclaration(), clang::SemaObjC::getObjCInterfaceDecl(), isMemberAccessibleForDeletion(), clang::SemaOpenMP::lookupOpenMPDeclareTargetName(), MarkBaseAndMemberDestructorsReferenced(), MarkVirtualBaseDestructorsReferenced(), MaybeBindToTemporary(), NoteHiddenVirtualMethods(), NoteOverloadCandidate(), and PerformImplicitConversion().
ExprResult Sema::PerformContextualImplicitConversion | ( | SourceLocation | Loc, |
Expr * | From, | ||
ContextualImplicitConverter & | Converter | ||
) |
Perform a contextual implicit conversion.
Attempt to convert the given expression to a type which is accepted by the given converter.
This routine will attempt to convert an expression of class type to a type accepted by the specified converter. In C++11 and before, the class must have a single non-explicit conversion function converting to a matching type. In C++1y, there can be multiple such conversion functions, but only one target type.
Loc | The source location of the construct that requires the conversion. |
From | The expression we're converting from. |
Converter | Used to control and diagnose the conversion process. |
Definition at line 6667 of file SemaOverload.cpp.
References CheckPlaceholderExpr(), DefaultLvalueConversion(), clang::Sema::ContextualImplicitConverter::diagnoseNoMatch(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), Loc, clang::Sema::ContextualImplicitConverter::match(), clang::Sema::ContextualImplicitConverter::Suppress, and clang::T.
ExprResult Sema::PerformContextuallyConvertToBool | ( | Expr * | From | ) |
PerformContextuallyConvertToBool - Perform a contextual conversion of the expression From to bool (C++0x [conv]p3).
Definition at line 6047 of file SemaOverload.cpp.
References AA_Converting, clang::ASTContext::BoolTy, checkPlaceholderForOverload(), Context, clang::SemaBase::Diag(), DiagnoseMultipleUserDefinedConversion(), clang::ExprError(), clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ImplicitConversionSequence::isBad(), PerformImplicitConversion(), and TryContextuallyConvertToBool().
Referenced by BuildStaticAssertDeclaration(), and CheckCXXBooleanCondition().
ExprResult Sema::PerformContextuallyConvertToObjCPointer | ( | Expr * | From | ) |
PerformContextuallyConvertToObjCPointer - Perform a contextual conversion of the expression From to an Objective-C pointer type.
Returns a valid but null ExprResult if no conversion sequence exists.
Definition at line 6437 of file SemaOverload.cpp.
References AA_Converting, checkPlaceholderForOverload(), Context, clang::ExprError(), clang::ASTContext::getObjCIdType(), clang::ImplicitConversionSequence::isBad(), PerformImplicitConversion(), and TryContextuallyConvertToObjCPointer().
Referenced by clang::SemaObjC::ActOnObjCAtSynchronizedOperand().
ExprResult Sema::PerformCopyInitialization | ( | const InitializedEntity & | Entity, |
SourceLocation | EqualLoc, | ||
ExprResult | Init, | ||
bool | TopLevelOfInitList = false , |
||
bool | AllowExplicit = false |
||
) |
Definition at line 10678 of file SemaInit.cpp.
References clang::OverloadCandidate::Conversions, clang::InitializationKind::CreateCopy(), CurrentParameterCopyTypes, clang::ExprError(), clang::OverloadCandidate::FailureKind, clang::InitializationSequence::FK_ConstructorOverloadFailed, clang::Function, clang::Stmt::getBeginLoc(), clang::InitializedEntity::getType(), clang::SourceLocation::isInvalid(), clang::InitializedEntity::isParameterKind(), clang::BadConversionSequence::no_conversion, clang::OR_No_Viable_Function, clang::ovl_fail_bad_conversion, clang::Seq, clang::InitializationSequence::SK_ConstructorInitialization, and clang::OverloadCandidate::Viable.
Referenced by BuildLiteralOperatorCall(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), and CXXCheckConditionalOperands().
void Sema::PerformDependentDiagnostics | ( | const DeclContext * | Pattern, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 7070 of file SemaTemplateInstantiateDecl.cpp.
References clang::DependentDiagnostic::Access, clang::DeclContext::ddiags(), and HandleDependentAccessCheck().
ExprResult Sema::PerformImplicitConversion | ( | Expr * | From, |
QualType | ToType, | ||
AssignmentAction | Action, | ||
bool | AllowExplicit = false |
||
) |
PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType.
Returns the converted expression. Flavor is the kind of conversion we're performing, used in the error message. If AllowExplicit
, explicit user-defined conversions are permitted.
Definition at line 1773 of file SemaOverload.cpp.
References clang::XRayInstrKind::All, checkPlaceholderForOverload(), clang::ExprError(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), and TryImplicitConversion().
ExprResult Sema::PerformImplicitConversion | ( | Expr * | From, |
QualType | ToType, | ||
const ImplicitConversionSequence & | ICS, | ||
AssignmentAction | Action, | ||
CheckedConversionKind | CCK = CheckedConversionKind::Implicit |
||
) |
PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType using the pre-computed implicit conversion sequence ICS.
Returns the converted expression. Action is the kind of conversion we're performing, used in the error message.
Definition at line 4271 of file SemaExprCXX.cpp.
References AA_Converting, clang::UserDefinedConversionSequence::After, clang::ImplicitConversionSequence::AmbiguousConversion, clang::ImplicitConversionSequence::BadConversion, clang::UserDefinedConversionSequence::Before, BuildCXXCastArgument(), CheckAssignmentConstraints(), Compatible, Context, clang::UserDefinedConversionSequence::ConversionFunction, clang::ImplicitConversionSequence::DiagnoseAmbiguousConversion(), DiagnoseAssignmentResult(), clang::UserDefinedConversionSequence::EllipsisConversion, clang::ImplicitConversionSequence::EllipsisConversion, clang::ExprError(), clang::ForBuiltinOverloadedOp, clang::UserDefinedConversionSequence::FoundConversionFunction, clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::ImplicitConversionSequence::getKind(), clang::QualType::getNonReferenceType(), clang::FunctionDecl::getParamDecl(), clang::Stmt::getSourceRange(), clang::ASTContext::getTagDeclType(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::UserDefinedConversionSequence::HadMultipleCandidates, Incompatible, clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isRecordType(), PDiag(), clang::ImplicitConversionSequence::Standard, clang::ImplicitConversionSequence::StandardConversion, clang::ImplicitConversionSequence::StaticObjectArgumentConversion, clang::ImplicitConversionSequence::UserDefined, and clang::ImplicitConversionSequence::UserDefinedConversion.
Referenced by CheckDestructor(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), PerformContextuallyConvertToBool(), PerformContextuallyConvertToObjCPointer(), and widenIterationCount().
ExprResult Sema::PerformImplicitConversion | ( | Expr * | From, |
QualType | ToType, | ||
const StandardConversionSequence & | SCS, | ||
AssignmentAction | Action, | ||
CheckedConversionKind | CCK | ||
) |
PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType by following the standard conversion sequence SCS.
Returns the converted expression. Flavor is the context in which we're performing this conversion, for use in error messages.
Definition at line 4375 of file SemaExprCXX.cpp.
References AA_Assigning, AA_Casting, AA_Converting, AA_Initializing, AA_Passing, AA_Passing_CFAudited, AA_Returning, AA_Sending, clang::LangOptions::allowsNonTrivialObjCLifetimeQualifiers(), clang::ASTContext::BoolTy, BuildCXXConstructExpr(), clang::Type::castAs(), CheckDerivedToBaseConversion(), CheckExceptionSpecCompatibility(), CheckMemberPointerConversion(), clang::SemaObjC::CheckObjCConversion(), CheckPlaceholderExpr(), CheckPointerConversion(), CheckTransparentUnionArgumentConstraints(), Compatible, clang::Complete, CompleteConstructorCall(), Context, clang::StandardConversionSequence::CopyConstructor, clang::CPlusPlus11, clang::ImplicitCastExpr::Create(), clang::CStyleCast, DefaultLvalueConversion(), clang::StandardConversionSequence::DeprecatedStringLiteralToCharPtr, clang::SemaBase::Diag(), diagnoseNullableToNonnullConversion(), DiagnoseUseOfDecl(), clang::StandardConversionSequence::Element, clang::SemaObjC::EmitRelatedResultTypeNote(), clang::ExprError(), clang::StandardConversionSequence::First, FixOverloadedFunctionReference(), clang::ASTContext::FloatTy, clang::StandardConversionSequence::FoundCopyConstructor, clang::FunctionalCast, clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::ASTContext::getAddrSpaceQualType(), clang::ASTContext::getArrayDecayedType(), clang::ASTContext::getArrayParameterType(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::ASTContext::getBlockPointerType(), clang::TargetInfo::getCXXABI(), clang::EnumType::getDecl(), clang::Expr::getExprLoc(), clang::ASTContext::getExtVectorType(), getLangOpts(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::VectorType::getNumElements(), clang::ASTContext::getObjCObjectPointerType(), clang::Expr::getObjectKind(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Expr::getValueKind(), clang::AtomicType::getValueType(), clang::Type::hasFloatingRepresentation(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Qualifiers::hasUnaligned(), clang::ICK_Array_To_Pointer, clang::ICK_Block_Pointer_Conversion, clang::ICK_Boolean_Conversion, clang::ICK_C_Only_Conversion, clang::ICK_Compatible_Conversion, clang::ICK_Complex_Conversion, clang::ICK_Complex_Promotion, clang::ICK_Complex_Real, clang::ICK_Derived_To_Base, clang::ICK_Fixed_Point_Conversion, clang::ICK_Floating_Conversion, clang::ICK_Floating_Integral, clang::ICK_Floating_Promotion, clang::ICK_Function_Conversion, clang::ICK_Function_To_Pointer, clang::ICK_HLSL_Array_RValue, clang::ICK_HLSL_Vector_Truncation, clang::ICK_Identity, clang::ICK_Incompatible_Pointer_Conversion, clang::ICK_Integral_Conversion, clang::ICK_Integral_Promotion, clang::ICK_Lvalue_To_Rvalue, clang::ICK_Num_Conversion_Kinds, clang::ICK_Pointer_Conversion, clang::ICK_Pointer_Member, clang::ICK_Qualification, clang::ICK_RVV_Vector_Conversion, clang::ICK_SVE_Vector_Conversion, clang::ICK_TransparentUnionConversion, clang::ICK_Vector_Conversion, clang::ICK_Vector_Splat, clang::ICK_Writeback_Conversion, clang::ICK_Zero_Event_Conversion, clang::ICK_Zero_Queue_Conversion, ImpCastExprToType(), clang::StandardConversionSequence::IncompatibleObjC, clang::Qualifiers::isAddressSpaceSupersetOf(), clang::Type::isBlockPointerType(), clang::Type::isBooleanType(), isCast(), isCompleteType(), clang::Type::isExtVectorType(), clang::EnumDecl::isFixed(), clang::Type::isFixedPointType(), clang::Type::isFloatingType(), clang::Type::isHalfType(), clang::Type::isIntegerType(), clang::Type::isIntegralType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMatrixType(), clang::TargetCXXABI::isMicrosoft(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Expr::isPRValue(), clang::Type::isRealFloatingType(), clang::Type::isReferenceType(), clang::Type::isVectorType(), ObjC(), clang::OK_ObjCProperty, clang::ASTContext::OverloadTy, clang::SemaObjC::PrepareCastToObjCObjectPointer(), prepareVectorSplat(), clang::ASTContext::removeAddrSpaceQualType(), ResolveAddressOfOverloadedFunction(), ScalarTypeToBooleanCastKind(), clang::StandardConversionSequence::Second, TemporaryMaterializationConversion(), clang::StandardConversionSequence::Third, and clang::VK_PRValue.
ExprResult Sema::PerformImplicitObjectArgumentInitialization | ( | Expr * | From, |
NestedNameSpecifier * | Qualifier, | ||
NamedDecl * | FoundDecl, | ||
CXXMethodDecl * | Method | ||
) |
PerformObjectArgumentInitialization - Perform initialization of the implicit object parameter for the given Method with the given expression.
Definition at line 5927 of file SemaOverload.cpp.
Referenced by CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), and CreateOverloadedUnaryOp().
ExprResult Sema::PerformMemberExprBaseConversion | ( | Expr * | Base, |
bool | IsArrow | ||
) |
Perform conversions on the LHS of a member access expression.
Definition at line 1280 of file SemaExprMember.cpp.
References CheckPlaceholderExpr(), and DefaultFunctionArrayLvalueConversion().
ExprResult Sema::PerformMoveOrCopyInitialization | ( | const InitializedEntity & | Entity, |
const NamedReturnInfo & | NRInfo, | ||
Expr * | Value, | ||
bool | SupressSimplerImplicitMoves = false |
||
) |
Perform the initialization of a potentially-movable value, which is the result of return value.
This routine implements C++20 [class.copy.elision]p3, which attempts to treat returned lvalues as rvalues in certain cases (to prefer move construction), then falls back to treating them as lvalues if that failed.
Definition at line 3438 of file SemaStmt.cpp.
References clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus23, clang::ImplicitCastExpr::Create(), clang::InitializationKind::CreateCopy(), clang::Value::getType(), clang::Sema::NamedReturnInfo::isMoveEligible(), clang::ImplicitCastExpr::OnStack, clang::OR_Deleted, clang::OR_Success, clang::Seq, VerifyInitializationSequenceCXX98(), and clang::VK_XValue.
ExprResult Sema::PerformObjectMemberConversion | ( | Expr * | From, |
NestedNameSpecifier * | Qualifier, | ||
NamedDecl * | FoundDecl, | ||
NamedDecl * | Member | ||
) |
Cast a base object to a member's actual type.
There are two relevant checks:
C++ [class.access.base]p7:
If a class member access operator [...] is used to access a non-static data member or non-static member function, the reference is ill-formed if the left operand [...] cannot be implicitly converted to a pointer to the naming class of the right operand.
C++ [expr.ref]p7:
If E2 is a non-static data member or a non-static member function, the program is ill-formed if the class of which E2 is directly a member is an ambiguous base (11.8) of the naming class (11.9.3) of E2.
Note that the latter check does not consider access; the access of the "real" base class is checked as appropriate when checking the access of the member name.
Definition at line 3081 of file SemaExpr.cpp.
Performs template instantiation for all implicit template instantiations we have seen until this point.
Definition at line 6986 of file SemaTemplateInstantiateDecl.cpp.
References Context, clang::ASTContext::forEachMultiversionedFunctionVersion(), clang::Function, getASTContext(), clang::Redeclarable< decl_type >::getMostRecentDecl(), clang::VarDecl::getTemplateSpecializationKind(), clang::VarDecl::getTemplateSpecializationKindForInstantiation(), InstantiateVariableDefinition(), clang::Decl::isInvalidDecl(), clang::VarDecl::isStaticDataMember(), LangOpts, PendingInstantiations, PendingLocalImplicitInstantiations, processFunctionInstantiation(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, clang::TU_Prefix, and TUKind.
Referenced by ActOnEndOfTranslationUnit(), and ActOnEndOfTranslationUnitFragment().
ExprResult Sema::PerformQualificationConversion | ( | Expr * | E, |
QualType | Ty, | ||
ExprValueKind | VK = VK_PRValue , |
||
CheckedConversionKind | CCK = CheckedConversionKind::Implicit |
||
) |
Definition at line 8566 of file SemaInit.cpp.
References clang::QualType::getAddressSpace(), clang::Type::getPointeeType(), clang::Expr::getType(), ImpCastExprToType(), and clang::VK_PRValue.
void Sema::popCodeSynthesisContext | ( | ) |
Definition at line 849 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContextLookupModules, CodeSynthesisContexts, InNonInstantiationSFINAEContext, LastEmittedCodeSynthesisContextDepth, LookupModulesCache, and NonInstantiationEntries.
Referenced by clang::Sema::InstantiatingTemplate::Clear(), CreateOverloadedBinOp(), and DeclareImplicitEqualityComparison().
void Sema::PopCompoundScope | ( | ) |
Definition at line 2395 of file Sema.cpp.
References clang::sema::FunctionScopeInfo::CompoundScopes.
void Sema::PopDeclContext | ( | ) |
Definition at line 1339 of file SemaDecl.cpp.
Referenced by ActOnFinishNamespaceDef(), clang::SemaObjC::ActOnObjCContainerFinishDefinition(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(), and clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd().
void Sema::PopExpressionEvaluationContext | ( | ) |
Definition at line 17740 of file SemaExpr.cpp.
References clang::CPlusPlus17, clang::CPlusPlus20, clang::CPlusPlus23, Diag(), clang::Sema::ExpressionEvaluationContextRecord::ExprContext, clang::Sema::ExpressionEvaluationContextRecord::ForRangeLifetimeExtendTemps, HandleImmediateInvocations(), clang::Sema::ExpressionEvaluationContextRecord::InLifetimeExtendingContext, clang::Sema::ExpressionEvaluationContextRecord::isConstantEvaluated(), clang::Sema::ExpressionEvaluationContextRecord::isUnevaluated(), clang::Sema::ExpressionEvaluationContextRecord::Lambdas, clang::Sema::ExpressionEvaluationContextRecord::NumCleanupObjects, clang::Sema::ExpressionEvaluationContextRecord::NumTypos, clang::Sema::ExpressionEvaluationContextRecord::ParentCleanup, clang::Sema::ExpressionEvaluationContextRecord::SavedMaybeODRUseExprs, and clang::Sema::ExpressionEvaluationContextRecord::VolatileAssignmentLHSs.
Referenced by clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd(), and clang::EnterExpressionEvaluationContext::~EnterExpressionEvaluationContext().
Sema::PoppedFunctionScopePtr Sema::PopFunctionScopeInfo | ( | const sema::AnalysisBasedWarnings::Policy * | WP = nullptr , |
const Decl * | D = nullptr , |
||
QualType | BlockType = QualType() |
||
) |
Pop a function (or block or lambda or captured region) scope from the stack.
WP | The warning policy to use for CFG-based warnings, or null if such warnings should not be produced. |
D | The declaration corresponding to this function scope, if producing CFG-based warnings. |
BlockType | The type of the block expression, if D is a BlockDecl. |
Definition at line 2357 of file Sema.cpp.
References markEscapingByrefs().
Referenced by ActOnFinishCXXInClassMemberInitializer(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd(), and clang::Sema::FunctionScopeRAII::~FunctionScopeRAII().
|
inline |
Definition at line 4987 of file Sema.h.
References clang::Sema::DelayedDiagnostics::popUndelayed().
void clang::Sema::PopParsingDeclaration | ( | ParsingDeclState | state, |
Decl * | decl | ||
) |
void Sema::PopPragmaVisibility | ( | bool | IsNamespaceEnd, |
SourceLocation | EndLoc | ||
) |
PopPragmaVisibility - Pop the top element of the visibility stack; used for '#pragma GCC visibility' and visibility attributes on namespaces.
Definition at line 1373 of file SemaAttr.cpp.
References clang::SemaBase::Diag(), and VisContext.
Referenced by ActOnFinishNamespaceDef(), and ActOnPragmaVisibility().
|
inline |
Definition at line 6134 of file Sema.h.
References clang::ASTContext::BoolTy, Context, clang::ASTContext::IntTy, and Switch.
CastKind Sema::PrepareScalarCast | ( | ExprResult & | src, |
QualType | destType | ||
) |
Prepares for a scalar cast, performing all the necessary stages except the final cast and returning the kind required.
Definition at line 7382 of file SemaExpr.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), and clang::Expr::getType().
Referenced by CXXCheckConditionalOperands().
ExprResult Sema::prepareVectorSplat | ( | QualType | VectorTy, |
Expr * | SplattedExpr | ||
) |
Prepare SplattedExpr
for a vector splat operation, adding implicit casts if necessary.
Definition at line 7777 of file SemaExpr.cpp.
References clang::Type::castAs(), clang::Expr::getType(), clang::Type::isBooleanType(), clang::Type::isExtVectorType(), clang::Type::isFloatingType(), and clang::Type::isIntegralOrEnumerationType().
Referenced by PerformImplicitConversion().
|
inline |
Definition at line 10445 of file Sema.h.
References CodeSynthesisContexts, LastEmittedCodeSynthesisContextDepth, PragmaAttributeCurrentTargetDecl, PrintInstantiationStack(), and PrintPragmaAttributeInstantiationPoint().
Referenced by BuildStaticAssertDeclaration(), and EmitCurrentDiagnostic().
void Sema::PrintInstantiationStack | ( | ) |
Prints the current instantiation stack through a series of notes.
Definition at line 929 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, clang::Sema::CodeSynthesisContext::DefaultFunctionArgumentInstantiation, clang::Sema::CodeSynthesisContext::DefaultTemplateArgumentInstantiation, Diags, clang::Sema::CodeSynthesisContext::ExplicitTemplateArgumentSubstitution, clang::Function, clang::Decl::getDeclContext(), getPrintingPolicy(), getTemplateArgumentBindingsText(), clang::DiagnosticsEngine::getTemplateBacktraceLimit(), clang::TemplateDecl::getTemplateParameters(), clang::NamedDecl::printName(), clang::printTemplateArgumentList(), clang::Sema::CodeSynthesisContext::PriorTemplateArgumentSubstitution, clang::DiagnosticsEngine::Report(), and clang::Sema::CodeSynthesisContext::TemplateInstantiation.
Referenced by PrintContextStack().
void Sema::PrintPragmaAttributeInstantiationPoint | ( | ) |
Definition at line 1123 of file SemaAttr.cpp.
References Diags, clang::Decl::getBeginLoc(), PragmaAttributeCurrentTargetDecl, and clang::DiagnosticsEngine::Report().
Referenced by PrintContextStack().
void Sema::PrintStats | ( | ) | const |
Print out statistics about the semantic analysis.
Definition at line 607 of file Sema.cpp.
References AnalysisWarnings, BumpAlloc, NumSFINAEErrors, and clang::sema::AnalysisBasedWarnings::PrintStats().
bool clang::Sema::ProcessAccessDeclAttributeList | ( | AccessSpecDecl * | ASDecl, |
const ParsedAttributesView & | AttrList | ||
) |
Referenced by ActOnAccessSpecifier().
void Sema::ProcessAPINotes | ( | Decl * | D | ) |
Map any API notes provided for this declaration to attributes on the declaration.
Process API notes that are associated with this declaration, mapping them to attributes as appropriate.
Triggered by declaration-attribute processing.
Definition at line 779 of file SemaAPINotes.cpp.
References APINotes, clang::api_notes::APINotesManager::findAPINotes(), clang::Decl::getDeclContext(), clang::DeclContext::isExternCContext(), clang::DeclContext::isExternCXXContext(), clang::DeclContext::isFileContext(), and clang::DeclContext::isNamespace().
Referenced by ActOnStartNamespaceDef().
void clang::Sema::ProcessDeclAttributeDelayed | ( | Decl * | D, |
const ParsedAttributesView & | AttrList | ||
) |
void clang::Sema::ProcessDeclAttributeList | ( | Scope * | S, |
Decl * | D, | ||
const ParsedAttributesView & | AttrList, | ||
const ProcessDeclAttributeOptions & | Options = ProcessDeclAttributeOptions() |
||
) |
Referenced by ActOnStartNamespaceDef().
void clang::Sema::ProcessDeclAttributes | ( | Scope * | S, |
Decl * | D, | ||
const Declarator & | PD | ||
) |
void Sema::ProcessStmtAttributes | ( | Stmt * | Stmt, |
const ParsedAttributes & | InAttrs, | ||
SmallVectorImpl< const Attr * > & | OutAttrs | ||
) |
Process the attributes before creating an attributed statement.
Returns the semantic attributes that have been processed.
Definition at line 1216 of file SemaStmtAttr.cpp.
void Sema::propagateDLLAttrToBaseClassTemplate | ( | CXXRecordDecl * | Class, |
Attr * | ClassAttr, | ||
ClassTemplateSpecializationDecl * | BaseTemplateSpec, | ||
SourceLocation | BaseLoc | ||
) |
Perform propagation of DLL attributes from a derived class to a templated base class for MS compatibility.
Definition at line 6695 of file SemaDeclCXX.cpp.
References clang::Decl::addAttr(), checkClassLevelDLLAttribute(), clang::Attr::clone(), clang::SemaBase::Diag(), getASTContext(), clang::getDLLAttr(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::ClassTemplateSpecializationDecl::getPointOfInstantiation(), clang::ClassTemplateSpecializationDecl::getSpecializationKind(), clang::ClassTemplateSpecializationDecl::getSpecializedTemplate(), clang::ClassTemplateDecl::getTemplatedDecl(), clang::ClassTemplateSpecializationDecl::isExplicitSpecialization(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by CheckBaseSpecifier().
|
inline |
Definition at line 1027 of file Sema.h.
Referenced by clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
Definition at line 2250 of file Sema.cpp.
References Block, and clang::SemaBase::getDiagnostics().
void Sema::PushCapturedRegionScope | ( | Scope * | RegionScope, |
CapturedDecl * | CD, | ||
RecordDecl * | RD, | ||
CapturedRegionKind | K, | ||
unsigned | OpenMPCaptureLevel = 0 |
||
) |
void Sema::pushCodeSynthesisContext | ( | CodeSynthesisContext | Ctx | ) |
Definition at line 834 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, InNonInstantiationSFINAEContext, clang::Sema::CodeSynthesisContext::isInstantiationRecord(), clang::isStackNearlyExhausted(), NonInstantiationEntries, clang::Sema::CodeSynthesisContext::PointOfInstantiation, clang::Sema::CodeSynthesisContext::SavedInNonInstantiationSFINAEContext, and warnStackExhausted().
Referenced by CreateOverloadedBinOp(), and DeclareImplicitEqualityComparison().
void Sema::PushDeclContext | ( | Scope * | S, |
DeclContext * | DC | ||
) |
Set the current declaration context until it gets popped.
Definition at line 1332 of file SemaDecl.cpp.
Referenced by clang::SemaHLSL::ActOnStartBuffer(), ActOnStartNamespaceDef(), and ActOnStartRequiresExpr().
void Sema::PushExpressionEvaluationContext | ( | ExpressionEvaluationContext | NewContext, |
Decl * | LambdaContextDecl = nullptr , |
||
ExpressionEvaluationContextRecord::ExpressionKind | Type = ExpressionEvaluationContextRecord::EK_Other |
||
) |
Definition at line 17315 of file SemaExpr.cpp.
Referenced by clang::EnterExpressionEvaluationContext::EnterExpressionEvaluationContext(), and clang::SemaOpenMP::StartOpenMPDSABlock().
void Sema::PushExpressionEvaluationContext | ( | ExpressionEvaluationContext | NewContext, |
ReuseLambdaContextDecl_t | , | ||
ExpressionEvaluationContextRecord::ExpressionKind | Type = ExpressionEvaluationContextRecord::EK_Other |
||
) |
Definition at line 17344 of file SemaExpr.cpp.
void Sema::PushFunctionScope | ( | ) |
Enter a new function scope.
Definition at line 2238 of file Sema.cpp.
References clang::SemaBase::getDiagnostics().
Referenced by ActOnStartCXXInClassMemberInitializer().
LambdaScopeInfo * Sema::PushLambdaScope | ( | ) |
Definition at line 2256 of file Sema.cpp.
References clang::SemaBase::getDiagnostics().
void Sema::PushNamespaceVisibilityAttr | ( | const VisibilityAttr * | Attr, |
SourceLocation | Loc | ||
) |
PushNamespaceVisibilityAttr - Note that we've entered a namespace with a visibility attribute.
Definition at line 1364 of file SemaAttr.cpp.
References Loc, NoVisibility, and PushPragmaVisibility().
Referenced by ActOnStartNamespaceDef().
Add this decl to the scope shadowed decl chains.
Definition at line 1525 of file SemaDecl.cpp.
Referenced by clang::SemaHLSL::ActOnStartBuffer(), ActOnStartNamespaceDef(), ActOnStartRequiresExpr(), and Initialize().
|
inline |
Definition at line 4983 of file Sema.h.
References clang::Sema::DelayedDiagnostics::pushUndelayed().
|
inline |
Definition at line 985 of file Sema.h.
References clang::Sema::DelayedDiagnostics::push().
|
inline |
Definition at line 11303 of file Sema.h.
References clang::Decl::getCanonicalDecl(), and ID.
void Sema::PushUsingDirective | ( | Scope * | S, |
UsingDirectiveDecl * | UDir | ||
) |
Definition at line 12307 of file SemaDeclCXX.cpp.
ExprResult Sema::RebuildExprInCurrentInstantiation | ( | Expr * | E | ) |
Definition at line 12177 of file SemaTemplate.cpp.
References clang::Expr::getExprLoc().
LambdaScopeInfo * Sema::RebuildLambdaScopeInfo | ( | CXXMethodDecl * | CallOperator | ) |
Definition at line 15678 of file SemaDecl.cpp.
References clang::sema::CapturingScopeInfo::addCapture(), clang::sema::CapturingScopeInfo::addThisCapture(), clang::sema::CapturingScopeInfo::addVLATypeCapture(), clang::sema::LambdaScopeInfo::AfterParameterList, clang::sema::LambdaScopeInfo::CallOperator, clang::CXXRecordDecl::captures(), clang::sema::LambdaScopeInfo::ExplicitObjectParameter, clang::RecordDecl::field_begin(), clang::DeclarationNameInfo::getCXXOperatorNameRange(), clang::CXXRecordDecl::getLambdaCaptureDefault(), clang::FunctionDecl::getNameInfo(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::FunctionDecl::getReturnType(), clang::sema::CapturingScopeInfo::ImpCap_LambdaByref, clang::sema::CapturingScopeInfo::ImpCap_LambdaByval, clang::sema::CapturingScopeInfo::ImpCap_None, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::sema::LambdaScopeInfo::IntroducerRange, clang::CXXMethodDecl::isConst(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ValueDecl::isInitCapture(), clang::sema::LambdaScopeInfo::Lambda, clang::LCD_ByCopy, clang::LCD_ByRef, clang::LCD_None, clang::LCK_ByRef, clang::LCK_StarThis, clang::sema::LambdaScopeInfo::Mutable, and clang::sema::CapturingScopeInfo::ReturnType.
Referenced by clang::Sema::LambdaScopeForCallOperatorInstantiationRAII::LambdaScopeForCallOperatorInstantiationRAII().
bool Sema::RebuildNestedNameSpecifierInCurrentInstantiation | ( | CXXScopeSpec & | SS | ) |
Definition at line 12183 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::getWithLocInContext(), and clang::CXXScopeSpec::isInvalid().
bool Sema::RebuildTemplateParamsInCurrentInstantiation | ( | TemplateParameterList * | Params | ) |
Rebuild the template parameters now that we know we're in a current instantiation.
Definition at line 12201 of file SemaTemplate.cpp.
References clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::TemplateParameterList::getParam(), clang::TypeSourceInfo::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Type::isUndeducedType(), clang::ValueDecl::setType(), clang::DeclaratorDecl::setTypeSourceInfo(), and clang::TemplateParameterList::size().
TypeSourceInfo * Sema::RebuildTypeInCurrentInstantiation | ( | TypeSourceInfo * | T, |
SourceLocation | Loc, | ||
DeclarationName | Name | ||
) |
Rebuilds a type within the context of the current instantiation.
The type T
is part of the type of an out-of-line member definition of a class template (or class template partial specialization) that was parsed and constructed before we entered the scope of the class template (or partial specialization thereof). This routine will rebuild that type now that we have entered the declarator's scope, which may produce different canonical types, e.g.,
Here, the type "typename X<T>::pointer" will be created as a DependentNameType, since we do not know that we can look into X<T> when we parsed the type. This function will rebuild the type, performing the lookup of "pointer" in X<T> and returning an ElaboratedType whose canonical type is the same as the canonical type of T*, allowing the return types of the out-of-line definition and the declaration to match.
Definition at line 12167 of file SemaTemplate.cpp.
void Sema::RecordParsingTemplateParameterDepth | ( | unsigned | Depth | ) |
void clang::Sema::redelayDiagnostics | ( | sema::DelayedDiagnosticPool & | pool | ) |
void Sema::referenceDLLExportedClassMethods | ( | ) |
Definition at line 14451 of file SemaDeclCXX.cpp.
References clang::Class, DelayedDllExportClasses, and ReferenceDllExportedMembers().
Referenced by ActOnFinishCXXNonNestedClass().
void Sema::RefersToMemberWithReducedAlignment | ( | Expr * | E, |
llvm::function_ref< void(Expr *, RecordDecl *, FieldDecl *, CharUnits)> | Action | ||
) |
This function calls Action when it determines that E designates a misaligned member due to the packed attribute.
This is used to emit local diagnostics like in reference binding.
Definition at line 18270 of file SemaChecking.cpp.
References clang::Type::castAs(), clang::MemberExpr::getBase(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::Qualifiers::hasUnaligned(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isDependentType(), and clang::Decl::isInvalidDecl().
Register the given locally-scoped extern "C" declaration so that it can be found later for redeclarations.
We include any extern "C" declaration that is not visible in the translation unit here, not just function-scope declarations.
Definition at line 6771 of file SemaDecl.cpp.
void Sema::RegisterTypeTagForDatatype | ( | const IdentifierInfo * | ArgumentKind, |
uint64_t | MagicValue, | ||
QualType | Type, | ||
bool | LayoutCompatible, | ||
bool | MustBeNull | ||
) |
Register a magic integral constant to be used as a type tag.
Definition at line 18108 of file SemaChecking.cpp.
Completely replace the auto
in TypeWithAuto
by Replacement
.
This does not retain any auto
type sugar.
Definition at line 5361 of file SemaTemplateDeduction.cpp.
TypeSourceInfo * Sema::ReplaceAutoTypeSourceInfo | ( | TypeSourceInfo * | TypeWithAuto, |
QualType | Replacement | ||
) |
Definition at line 5368 of file SemaTemplateDeduction.cpp.
bool Sema::RequireCompleteDeclContext | ( | CXXScopeSpec & | SS, |
DeclContext * | DC | ||
) |
Require that the context specified by SS be complete.
If SS refers to a type, this routine checks whether the type is complete enough (or can be made complete enough) for name lookup into the DeclContext. A type that is not yet completed can be considered "complete enough" if it is a class/struct/union/enum that is currently being defined. Or, if we have a type that names a class template specialization that is not a complete type, we will attempt to instantiate that class template.
Definition at line 218 of file SemaCXXScopeSpec.cpp.
References Context, clang::SourceRange::getBegin(), clang::CXXScopeSpec::getLastQualifierNameLoc(), clang::CXXScopeSpec::getRange(), clang::ASTContext::getTypeDeclType(), clang::TagDecl::isBeingDefined(), clang::DeclContext::isDependentContext(), clang::SourceLocation::isInvalid(), RequireCompleteEnumDecl(), RequireCompleteType(), clang::CXXScopeSpec::SetInvalid(), and clang::ast_matchers::type.
Referenced by CheckUsingDeclQualifier(), clang::TreeTransform< Derived >::RebuildDependentNameType(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
bool Sema::RequireCompleteEnumDecl | ( | EnumDecl * | EnumD, |
SourceLocation | L, | ||
CXXScopeSpec * | SS = nullptr |
||
) |
Require that the EnumDecl is completed with its enumerators defined or instantiated.
SS, if provided, is the ScopeRef parsed.
Definition at line 260 of file SemaCXXScopeSpec.cpp.
References Definition, clang::SemaBase::Diag(), diagnoseMissingImport(), clang::EnumDecl::getInstantiatedFromMemberEnum(), clang::Decl::getLocation(), clang::EnumDecl::getMemberSpecializationInfo(), clang::CXXScopeSpec::getRange(), getTemplateInstantiationArgs(), clang::MemberSpecializationInfo::getTemplateSpecializationKind(), clang::TypeDecl::getTypeForDecl(), hasReachableDefinition(), InstantiateEnum(), clang::TagDecl::isCompleteDefinition(), isSFINAEContext(), clang::CXXScopeSpec::SetInvalid(), clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.
Referenced by RequireCompleteDeclContext().
bool Sema::RequireCompleteExprType | ( | Expr * | E, |
CompleteTypeKind | Kind, | ||
TypeDiagnoser & | Diagnoser | ||
) |
Ensure that the type of the given expression is complete.
This routine checks whether the expression E
has a complete type. If the expression refers to an instantiable construct, that instantiation is performed as needed to complete its type. Furthermore Sema::RequireCompleteType is called for the expression's type (or in the case of a reference type, the referred-to type).
E | The expression whose type is required to be complete. |
Kind | Selects which completeness rules should be applied. |
Diagnoser | The object that will emit a diagnostic if the type is incomplete. |
true
if the type of E
is incomplete and diagnosed, false
otherwise. Definition at line 8893 of file SemaType.cpp.
References getCompletedType(), clang::Expr::getExprLoc(), and RequireCompleteType().
Referenced by RequireCompleteExprType(), and RequireCompleteSizedExprType().
Definition at line 8899 of file SemaType.cpp.
References Default, and RequireCompleteExprType().
|
inline |
Definition at line 11733 of file Sema.h.
References Default, and RequireCompleteExprType().
|
inline |
Definition at line 6492 of file Sema.h.
References Normal, and RequireCompleteExprType().
|
inline |
Definition at line 6485 of file Sema.h.
References Loc, Normal, RequireCompleteType(), and clang::T.
Referenced by BuildArrayType(), and CheckAllocatedType().
bool Sema::RequireCompleteType | ( | SourceLocation | Loc, |
QualType | T, | ||
CompleteTypeKind | Kind, | ||
TypeDiagnoser & | Diagnoser | ||
) |
Ensure that the type T is a complete type.
This routine checks whether the type T
is complete in any context where a complete type is required. If T
is a complete type, returns false. If T
is a class template specialization, this routine then attempts to perform class template instantiation. If instantiation fails, or if T
is incomplete and cannot be completed, issues the diagnostic diag
(giving it the type T
) and returns true.
Loc | The location in the source that the incomplete type diagnostic should refer to. |
T | The type that this routine is examining for completeness. |
Kind | Selects which completeness rules should be applied. |
true
if T
is incomplete and a diagnostic was emitted, false
otherwise. Definition at line 8923 of file SemaType.cpp.
References Consumer, clang::Type::getAs(), clang::ASTConsumer::HandleTagDeclRequiredDefinition(), Loc, and clang::T.
Referenced by clang::SemaObjC::ActOnObjCAtSynchronizedOperand(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), BuildAtomicType(), BuildCXXTypeConstructExpr(), CheckBaseSpecifier(), CheckComparisonCategoryType(), clang::SemaOpenMP::CheckOpenMPLinearDecl(), CheckOverridingFunctionReturnType(), CheckPointerToMemberOperands(), CheckSpecifiedExceptionType(), clang::SemaObjC::CheckSubscriptingKind(), ConvertParamDefaultArgument(), DiagnoseMultipleUserDefinedConversion(), FindInstantiatedDecl(), IgnoredValueConversions(), LookupMemberExprInRecord(), RequireCompleteDeclContext(), RequireCompleteExprType(), RequireCompleteSizedType(), RequireCompleteType(), RequireLiteralType(), and TemporaryMaterializationConversion().
bool Sema::RequireCompleteType | ( | SourceLocation | Loc, |
QualType | T, | ||
CompleteTypeKind | Kind, | ||
unsigned | DiagID | ||
) |
Definition at line 9268 of file SemaType.cpp.
References Loc, RequireCompleteType(), and clang::T.
|
inline |
|
inline |
|
inline |
Definition at line 11805 of file Sema.h.
References Loc, RequireCompleteType(), and clang::T.
bool Sema::RequireLiteralType | ( | SourceLocation | Loc, |
QualType | T, | ||
TypeDiagnoser & | Diagnoser | ||
) |
Ensure that the type T is a literal type.
This routine checks whether the type T
is a literal type. If T
is an incomplete type, an attempt is made to complete it. If T
is a literal type, or AllowIncompleteType
is true and T
is an incomplete type, returns false. Otherwise, this routine issues the diagnostic PD
(giving it the type T
), along with notes explaining why the type is not a literal type, and returns true.
Loc | The location in the source that the non-literal type diagnostic should refer to. |
T | The type that this routine is examining for literalness. |
Diagnoser | Emits a diagnostic if T is not a literal type. |
true
if T
is not a literal type and a diagnostic was emitted, false
otherwise. Definition at line 9309 of file SemaType.cpp.
References clang::CXXRecordDecl::bases(), Context, clang::CPlusPlus17, clang::CPlusPlus20, clang::Destructor, clang::SemaBase::Diag(), clang::Sema::TypeDiagnoser::diagnose(), clang::RecordDecl::fields(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::RecordType::getDecl(), clang::CXXRecordDecl::getDestructor(), getLangOpts(), getLiteralDiagFromTagKind(), clang::Decl::getLocation(), clang::CXXRecordDecl::getNumVBases(), clang::TagDecl::getTagKind(), clang::CXXRecordDecl::hasConstexprDestructor(), clang::CXXRecordDecl::hasConstexprNonCopyMoveConstructor(), clang::CXXRecordDecl::hasNonLiteralTypeFieldsOrBases(), clang::CXXRecordDecl::hasTrivialDefaultConstructor(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::CXXRecordDecl::isAggregate(), isCompleteType(), clang::Type::isDependentType(), clang::CXXRecordDecl::isLambda(), clang::Type::isLiteralType(), clang::FunctionDecl::isUserProvided(), clang::Type::isVariableArrayType(), clang::Type::isVoidType(), Loc, RequireCompleteType(), SpecialMemberIsTrivial(), clang::T, TAH_IgnoreTrivialABI, and clang::CXXRecordDecl::vbases().
Referenced by CheckLiteralType(), and RequireLiteralType().
bool Sema::RequireLiteralType | ( | SourceLocation | Loc, |
QualType | T, | ||
unsigned | DiagID | ||
) |
Definition at line 9400 of file SemaType.cpp.
References Loc, RequireLiteralType(), and clang::T.
|
inline |
Definition at line 11781 of file Sema.h.
References Loc, RequireLiteralType(), and clang::T.
bool Sema::RequireNonAbstractType | ( | SourceLocation | Loc, |
QualType | T, | ||
TypeDiagnoser & | Diagnoser | ||
) |
Definition at line 6016 of file SemaDeclCXX.cpp.
References Context, clang::Sema::TypeDiagnoser::diagnose(), DiagnoseAbstractType(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), isAbstractType(), Loc, and clang::T.
Referenced by BuildArrayType(), CheckAllocatedType(), and RequireNonAbstractType().
|
inline |
Definition at line 4742 of file Sema.h.
References Loc, RequireNonAbstractType(), and clang::T.
bool Sema::RequireStructuralType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Require the given type to be a structural type, and diagnose if it is not.
true
if an error was produced. Definition at line 1315 of file SemaTemplate.cpp.
References clang::AS_public, clang::CPlusPlus20, Diag(), clang::Type::getAsCXXRecordDecl(), clang::Type::isDependentType(), clang::Type::isRecordType(), clang::Type::isRValueReferenceType(), clang::Type::isScalarType(), clang::Type::isStructuralType(), Loc, and clang::T.
|
inline |
Definition at line 8894 of file Sema.h.
References CurFPFeatures, FpPragmaStack, clang::FPOptions::getChangesFrom(), and LangOpts.
FunctionDecl * Sema::ResolveAddressOfOverloadedFunction | ( | Expr * | AddressOfExpr, |
QualType | TargetType, | ||
bool | Complain, | ||
DeclAccessPair & | FoundResult, | ||
bool * | pHadMultipleCandidates = nullptr |
||
) |
ResolveAddressOfOverloadedFunction - Try to resolve the address of an overloaded function (C++ [over.over]), where From
is an expression with overloaded function type and ToType
is the type we're trying to resolve to.
For example:
This routine returns the resulting FunctionDecl if it could be resolved, and NULL otherwise. When Complain
is true, this routine will emit diagnostics if there is an error.
Definition at line 13285 of file SemaOverload.cpp.
References CheckAddressOfMemberAccess(), Context, clang::Type::getAs(), clang::Expr::getExprLoc(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::OverloadTy, and ResolveExceptionSpec().
Referenced by PerformImplicitConversion().
FunctionDecl * Sema::resolveAddressOfSingleOverloadCandidate | ( | Expr * | E, |
DeclAccessPair & | Pair | ||
) |
Given an expression that refers to an overloaded function, try to resolve that function to a single function that can have its address taken.
This will modify Pair
iff it returns non-null.
This routine can only succeed if from all of the candidates in the overload set for SrcExpr that can have their addresses taken, there is one candidate that is more constrained than the rest.
Definition at line 13332 of file SemaOverload.cpp.
References checkAddressOfFunctionIsAvailable(), CUDA(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), getCurFunctionDecl(), getLangOpts(), getMoreConstrainedFunction(), and clang::SemaCUDA::IdentifyPreference().
Referenced by resolveAndFixAddressOfSingleOverloadCandidate().
bool Sema::resolveAndFixAddressOfSingleOverloadCandidate | ( | ExprResult & | SrcExpr, |
bool | DoFunctionPointerConversion = false |
||
) |
Given an overloaded function, tries to turn it into a non-overloaded function reference using resolveAddressOfSingleOverloadCandidate.
This will perform access checks, diagnose the use of the resultant decl, and, if requested, potentially perform a function-to-pointer decay.
Returns false if resolveAddressOfSingleOverloadCandidate fails. Otherwise, returns true. This may emit diagnostics and return true.
Definition at line 13424 of file SemaOverload.cpp.
References CheckAddressOfMemberAccess(), Context, DefaultFunctionArrayConversion(), DiagnoseUseOfDecl(), FixOverloadedFunctionReference(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::FunctionDecl::isCPUDispatchMultiVersion(), clang::FunctionDecl::isCPUSpecificMultiVersion(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ASTContext::OverloadTy, and resolveAddressOfSingleOverloadCandidate().
bool Sema::ResolveAndFixSingleFunctionTemplateSpecialization | ( | ExprResult & | SrcExpr, |
bool | DoFunctionPointerConversion = false , |
||
bool | Complain = false , |
||
SourceRange | OpRangeForComplaining = SourceRange() , |
||
QualType | DestTypeForComplaining = QualType() , |
||
unsigned | DiagIDForComplaining = 0 |
||
) |
Definition at line 13543 of file SemaOverload.cpp.
References Context, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), DiagnoseUseOfDecl(), clang::ExprError(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), FixOverloadedFunctionReference(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::OverloadExpr::getName(), clang::OverloadExpr::getQualifierLoc(), clang::NestedNameSpecifierLoc::getSourceRange(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::OverloadExpr::FindResult::HasFormOfMemberPointer, clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUsable(), NoteAllOverloadCandidates(), clang::ASTContext::OverloadTy, and ResolveSingleFunctionTemplateSpecialization().
bool Sema::resolveAssumedTemplateNameAsType | ( | Scope * | S, |
TemplateName & | Name, | ||
SourceLocation | NameLoc, | ||
bool | Diagnose = true |
||
) |
Definition at line 4811 of file SemaTemplate.cpp.
const FunctionProtoType * clang::Sema::ResolveExceptionSpec | ( | SourceLocation | Loc, |
const FunctionProtoType * | FPT | ||
) |
Definition at line 216 of file SemaExceptionSpec.cpp.
References clang::Type::castAs(), clang::SemaBase::Diag(), clang::EST_Unevaluated, clang::EST_Unparsed, EvaluateImplicitExceptionSpec(), clang::FunctionProtoType::getExceptionSpecDecl(), clang::FunctionProtoType::getExceptionSpecType(), clang::ValueDecl::getType(), InstantiateExceptionSpec(), clang::isUnresolvedExceptionSpec(), and Loc.
Referenced by clang::Sema::ImplicitExceptionSpecification::CalledDecl(), CheckExceptionSpecSubset(), DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), MarkVirtualMemberExceptionSpecsNeeded(), and ResolveAddressOfOverloadedFunction().
FunctionDecl * Sema::ResolveSingleFunctionTemplateSpecialization | ( | OverloadExpr * | ovl, |
bool | Complain = false , |
||
DeclAccessPair * | FoundResult = nullptr , |
||
TemplateSpecCandidateSet * | FailedTSC = nullptr |
||
) |
Given an expression that refers to an overloaded function, try to resolve that overloaded function expression down to a single function.
This routine can only resolve template-ids that refer to a single function template, where that template-id refers to a single template whose template arguments are either provided by the template-id or have defaults, as described in C++0x [temp.arg.explicit]p3.
If no template-ids are found, no diagnostics are emitted and NULL is returned.
Definition at line 13461 of file SemaOverload.cpp.
References clang::TemplateSpecCandidateSet::addCandidate(), completeFunctionType(), Context, clang::OverloadExpr::copyTemplateArgumentsInto(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), DeduceTemplateArguments(), clang::SemaBase::Diag(), clang::Expr::getExprLoc(), clang::OverloadExpr::getName(), clang::OverloadExpr::getNameLoc(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::OverloadExpr::hasExplicitTemplateArgs(), clang::MakeDeductionFailureInfo(), NoteAllOverloadCandidates(), clang::TemplateSpecCandidate::set(), clang::Specialization, and clang::Success.
Referenced by ResolveAndFixSingleFunctionTemplateSpecialization().
void Sema::RestoreNestedNameSpecifierAnnotation | ( | void * | Annotation, |
SourceRange | AnnotationRange, | ||
CXXScopeSpec & | SS | ||
) |
Given an annotation pointer for a nested-name-specifier, restore the nested-name-specifier structure.
Annotation | The annotation pointer, produced by SaveNestedNameSpecifierAnnotation() . |
AnnotationRange | The source range corresponding to the annotation. |
SS | The nested-name-specifier that will be updated with the contents of the annotation pointer. |
Definition at line 1035 of file SemaCXXScopeSpec.cpp.
References clang::CXXScopeSpec::Adopt(), and clang::CXXScopeSpec::SetInvalid().
void Sema::runWithSufficientStackSpace | ( | SourceLocation | Loc, |
llvm::function_ref< void()> | Fn | ||
) |
Run some code with "sufficient" stack space.
(Currently, at least 256K is guaranteed). Produces a warning if we're low on stack space and allocates more in that case. Use this in code that may recurse deeply (for example, in template instantiation) to avoid stack overflow.
Definition at line 553 of file Sema.cpp.
References Loc, clang::runWithSufficientStackSpace(), and warnStackExhausted().
Referenced by CheckIfFunctionSpecializationIsImmediate(), completeExprArrayBound(), DeduceReturnType(), DeduceTemplateArguments(), DoMarkVarDeclReferenced(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), LookupConstructors(), LookupSpecialMember(), SubstDecl(), and SubstDefaultArgument().
|
inline |
Definition at line 11311 of file Sema.h.
References clang::Decl::getCanonicalDecl(), and ID.
void * Sema::SaveNestedNameSpecifierAnnotation | ( | CXXScopeSpec & | SS | ) |
Given a C++ nested-name-specifier, produce an annotation value that the parser can use later to reconstruct the given nested-name-specifier.
SS | A nested-name-specifier. |
SS
. Definition at line 1021 of file SemaCXXScopeSpec.cpp.
References clang::ASTContext::Allocate(), Context, clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::isEmpty(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::location_data(), clang::CXXScopeSpec::location_size(), and memcpy().
ScalarTypeToBooleanCastKind - Returns the cast kind corresponding to the conversion from scalar type ScalarTy to the Boolean type.
Definition at line 760 of file Sema.cpp.
References clang::Type::getScalarTypeKind(), clang::Type::STK_BlockPointer, clang::Type::STK_Bool, clang::Type::STK_CPointer, clang::Type::STK_FixedPoint, clang::Type::STK_Floating, clang::Type::STK_FloatingComplex, clang::Type::STK_Integral, clang::Type::STK_IntegralComplex, clang::Type::STK_MemberPointer, and clang::Type::STK_ObjCObjectPointer.
Referenced by PerformImplicitConversion().
ObjCMethodDecl * Sema::SelectBestMethod | ( | Selector | Sel, |
MultiExprArg | Args, | ||
bool | IsInstance, | ||
SmallVectorImpl< ObjCMethodDecl * > & | Methods | ||
) |
Definition at line 7169 of file SemaOverload.cpp.
References b, Context, DefaultVariadicArgumentPromotion(), getLangOpts(), clang::Selector::getNumArgs(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::Expr::hasPlaceholderType(), clang::ICK_Incompatible_Pointer_Conversion, clang::ImplicitConversionSequence::isBad(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isObjCIdType(), clang::ImplicitConversionSequence::isStandard(), clang::ObjCMethodDecl::isVariadic(), ObjC(), clang::ObjCMethodDecl::param_size(), clang::ObjCMethodDecl::parameters(), clang::StandardConversionSequence::Second, clang::ImplicitConversionSequence::Standard, clang::SemaObjC::stripARCUnbridgedCast(), TryCopyInitialization(), clang::ASTContext::UnknownAnyTy, and VariadicMethod.
bool Sema::SetCtorInitializers | ( | CXXConstructorDecl * | Constructor, |
bool | AnyErrors, | ||
ArrayRef< CXXCtorInitializer * > | Initializers = std::nullopt |
||
) |
Definition at line 5359 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), BuildImplicitBaseInitializer(), CollectFieldInitializer(), Context, clang::DeclContext::decls(), clang::SemaBase::Diag(), DiagnoseAbstractType(), clang::FieldDecl::getCanonicalDecl(), clang::TagDecl::getCanonicalDecl(), clang::FieldDecl::getParent(), clang::RecordDecl::hasFlexibleArrayMember(), clang::CXXRecordDecl::isAbstract(), clang::TagDecl::isUnion(), MarkBaseAndMemberDestructorsReferenced(), clang::Member, memcpy(), and clang::CXXRecordDecl::vbases().
Referenced by ActOnDefaultCtorInitializers(), ActOnMemInitializers(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitMoveConstructor(), and DefineInheritingConstructor().
void Sema::SetDeclDefaulted | ( | Decl * | dcl, |
SourceLocation | DefaultLoc | ||
) |
Definition at line 18196 of file SemaDeclCXX.cpp.
References clang::Sema::DefaultedFunctionKind::asComparison(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), CheckExplicitlyDefaultedComparison(), CheckExplicitlyDefaultedSpecialMember(), clang::CPlusPlus20, DefineDefaultedComparison(), DefineDefaultedFunction(), clang::SemaBase::Diag(), clang::FunctionDecl::getCanonicalDecl(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), getDefaultedFunctionKind(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Sema::DefaultedFunctionKind::isComparison(), clang::TagDecl::isCompleteDefinition(), clang::FunctionDecl::isDefaulted(), clang::Decl::isInvalidDecl(), clang::Decl::setInvalidDecl(), and ThreeWay.
Referenced by SetFunctionBodyKind(), and clang::TemplateDeclInstantiator::SubstDefaultedFunction().
void Sema::SetDeclDeleted | ( | Decl * | dcl, |
SourceLocation | DelLoc, | ||
StringLiteral * | Message = nullptr |
||
) |
Definition at line 18143 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), clang::SemaBase::Diag(), clang::FunctionDecl::getCanonicalDecl(), clang::getDLLAttr(), clang::Decl::getLocation(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::FunctionDecl::isMain(), clang::FunctionDecl::setDeletedAsWritten(), clang::FunctionDecl::setImplicitlyInline(), clang::Decl::setInvalidDecl(), clang::FunctionDecl::setWillHaveBody(), and clang::TSK_ExplicitSpecialization.
Referenced by CheckExplicitlyDefaultedSpecialMember(), SetFunctionBodyKind(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool Sema::SetDelegatingInitializer | ( | CXXConstructorDecl * | Constructor, |
CXXCtorInitializer * | Initializer | ||
) |
Definition at line 5338 of file SemaDeclCXX.cpp.
References Context, DelegatingCtorDecls, DiagnoseUseOfDecl(), clang::Initializer, LookupDestructor(), MarkFunctionReferenced(), memcpy(), and clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::push_back().
Referenced by ActOnMemInitializers().
void Sema::setExceptionMode | ( | SourceLocation | Loc, |
LangOptions::FPExceptionModeKind | FPE | ||
) |
Called to set exception behavior for floating point operations.
Definition at line 1327 of file SemaAttr.cpp.
References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, FpPragmaStack, getLangOpts(), Loc, and PSK_Set.
Referenced by ActOnPragmaFPExceptions().
void Sema::SetFunctionBodyKind | ( | Decl * | D, |
SourceLocation | Loc, | ||
FnBodyKind | BodyKind, | ||
StringLiteral * | DeletedMessage = nullptr |
||
) |
Definition at line 18306 of file SemaDeclCXX.cpp.
References Default, Delete, Loc, Other, SetDeclDefaulted(), and SetDeclDeleted().
void Sema::setFunctionHasBranchProtectedScope | ( | ) |
Definition at line 2413 of file Sema.cpp.
Referenced by clang::SemaOpenMP::ActOnOpenMPCriticalDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMasterDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPOrderedDirective(), clang::SemaOpenMP::ActOnOpenMPParallelDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPScopeDirective(), clang::SemaOpenMP::ActOnOpenMPSectionDirective(), clang::SemaOpenMP::ActOnOpenMPSimdDirective(), clang::SemaOpenMP::ActOnOpenMPSingleDirective(), clang::SemaOpenMP::ActOnOpenMPTargetDataDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTargetSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskDirective(), clang::SemaOpenMP::ActOnOpenMPTaskgroupDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective(), and clang::SemaOpenMP::ActOnOpenMPTeamsGenericLoopDirective().
|
inline |
Definition at line 906 of file Sema.h.
References LateTemplateParser, LateTemplateParserCleanup, OpaqueParser, and P.
Referenced by clang::Parser::ParseTopLevelDecl().
bool Sema::SetMemberAccessSpecifier | ( | NamedDecl * | MemberDecl, |
NamedDecl * | PrevMemberDecl, | ||
AccessSpecifier | LexicalAS | ||
) |
SetMemberAccessSpecifier - Set the access specifier of a member.
Returns true on error (when the previous member decl access specifier is different from the new member decl access specifier).
Definition at line 40 of file SemaAccess.cpp.
References clang::AS_none, Diag(), clang::Decl::getAccess(), clang::Decl::getLocation(), and clang::Decl::setAccess().
void Sema::SetParamDefaultArgument | ( | ParmVarDecl * | Param, |
Expr * | DefaultArg, | ||
SourceLocation | EqualLoc | ||
) |
Definition at line 312 of file SemaDeclCXX.cpp.
References clang::ParmVarDecl::setDefaultArg(), and UnparsedDefaultArgInstantiations.
Referenced by ActOnParamDefaultArgument().
void Sema::setTagNameForLinkagePurposes | ( | TagDecl * | TagFromDeclSpec, |
TypedefNameDecl * | NewTD | ||
) |
Definition at line 5039 of file SemaDecl.cpp.
References clang::TagDecl::hasNameForLinkage(), clang::Decl::isInvalidDecl(), and clang::TagDecl::isThisDeclarationADefinition().
bool Sema::ShouldDeleteSpecialMember | ( | CXXMethodDecl * | MD, |
CXXSpecialMemberKind | CSM, | ||
InheritedConstructorInfo * | ICI = nullptr , |
||
bool | Diagnose = false |
||
) |
Determine if a special member function should have a deleted definition when it is defaulted.
Determine whether a defaulted special member function should be defined as deleted, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p11, C++11 [class.copy]p23, and C++11 [class.dtor]p5.
Definition at line 9732 of file SemaDeclCXX.cpp.
References clang::CopyAssignment, clang::CopyConstructor, clang::CXXRecordDecl::ctors(), clang::DefaultConstructor, clang::Destructor, clang::SemaBase::Diag(), getLangOpts(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::CXXRecordDecl::hasUserDeclaredMoveAssignment(), clang::CXXRecordDecl::hasUserDeclaredMoveConstructor(), clang::RecordDecl::isAnonymousStructOrUnion(), clang::LangOptions::isCompatibleWithMSVC(), clang::TagDecl::isDependentType(), clang::Decl::isImplicit(), clang::Decl::isInvalidDecl(), clang::CXXRecordDecl::isLambda(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::CXXMethodDecl::isVirtual(), clang::CXXRecordDecl::lambdaIsDefaultConstructibleAndAssignable(), LangOpts, clang::CXXRecordDecl::methods(), and clang::LangOptionsBase::MSVC2015.
Referenced by CheckExplicitlyDefaultedSpecialMember(), DiagnoseDeletedDefaultedFunction(), and NoteDeletedInheritingConstructor().
bool Sema::ShouldEnterDeclaratorScope | ( | Scope * | S, |
const CXXScopeSpec & | SS | ||
) |
Definition at line 1048 of file SemaCXXScopeSpec.cpp.
Referenced by clang::Parser::ParseUnqualifiedId().
bool Sema::shouldIgnoreInHostDeviceCheck | ( | FunctionDecl * | Callee | ) |
Definition at line 20659 of file SemaDecl.cpp.
Checks if the new declaration declared in dependent context must be put in the same redeclaration chain as the specified declaration.
D | Declaration that is checked. |
PrevDecl | Previous declaration found with proper lookup method for the same declaration name. |
Definition at line 11191 of file SemaDecl.cpp.
References clang::Decl::getDeclContext(), clang::Decl::getFriendObjectKind(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isDependentContext(), and clang::DeclContext::isFileContext().
SkipBodyInfo Sema::shouldSkipAnonEnumBody | ( | Scope * | S, |
IdentifierInfo * | II, | ||
SourceLocation | IILoc | ||
) |
Determine whether the body of an anonymous enumeration should be skipped.
II | The name of the first enumerator. |
Definition at line 19937 of file SemaDecl.cpp.
bool Sema::ShouldSplatAltivecScalarInCast | ( | const VectorType * | VecTy | ) |
Definition at line 2711 of file SemaCast.cpp.
References clang::AltiVecBool, clang::AltiVecPixel, clang::AltiVecVector, getLangOpts(), clang::VectorType::getVectorKind(), and clang::LangOptionsBase::XL.
bool Sema::ShouldWarnIfUnusedFileScopedDecl | ( | const DeclaratorDecl * | D | ) | const |
Definition at line 1887 of file SemaDecl.cpp.
References clang::Decl::getDeclContext(), clang::Decl::getLexicalDeclContext(), clang::Decl::hasAttr(), clang::DeclContext::isDependentContext(), IsDisallowedCopyOrAssign(), clang::Decl::isInvalidDecl(), isMainFileLoc(), clang::Decl::isUsed(), clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.
Referenced by ShouldRemoveFromUnused().
bool Sema::SpecialMemberIsTrivial | ( | CXXMethodDecl * | MD, |
CXXSpecialMemberKind | CSM, | ||
TrivialABIHandling | TAH = TAH_IgnoreTrivialABI , |
||
bool | Diagnose = false |
||
) |
Determine whether a defaulted or deleted special member function is trivial, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25, and C++11 [class.dtor]p5.
Definition at line 10170 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), checkTrivialClassMembers(), checkTrivialSubobjectCall(), clang::Qualifiers::Const, Context, clang::CopyAssignment, clang::CopyConstructor, clang::DefaultConstructor, clang::Destructor, clang::SemaBase::Diag(), clang::Type::getAs(), clang::CXXBaseSpecifier::getBeginLoc(), clang::QualType::getCVRQualifiers(), clang::ASTContext::getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getLValueReferenceType(), clang::FunctionDecl::getMinRequiredArguments(), clang::FunctionDecl::getNonObjectParameter(), clang::FunctionDecl::getNumParams(), clang::CXXRecordDecl::getNumVBases(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::ReferenceType::getPointeeType(), clang::ASTContext::getRecordType(), clang::ASTContext::getRValueReferenceType(), clang::ParmVarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::Invalid, clang::QualType::isConstQualified(), clang::CXXRecordDecl::isDynamicClass(), clang::FunctionDecl::isUserProvided(), clang::FunctionDecl::isVariadic(), clang::CXXBaseSpecifier::isVirtual(), clang::CXXMethodDecl::isVirtual(), clang::CXXRecordDecl::methods(), clang::MoveAssignment, clang::MoveConstructor, TSK_BaseClass, clang::CXXRecordDecl::vbases_begin(), clang::LangOptionsBase::Ver14, and clang::QualType::withConst().
Referenced by RequireLiteralType().
Substitute Replacement for auto
in TypeWithAuto
.
Definition at line 5336 of file SemaTemplateDeduction.cpp.
References Context, and clang::ASTContext::DependentTy.
Referenced by DeduceTemplateArguments().
Definition at line 5350 of file SemaTemplateDeduction.cpp.
Referenced by DeduceTemplateArguments(), and DeduceTemplateSpecializationFromInitializer().
TypeSourceInfo * Sema::SubstAutoTypeSourceInfo | ( | TypeSourceInfo * | TypeWithAuto, |
QualType | Replacement | ||
) |
Substitute Replacement for auto in TypeWithAuto.
Definition at line 5343 of file SemaTemplateDeduction.cpp.
References Context, and clang::ASTContext::DependentTy.
TypeSourceInfo * Sema::SubstAutoTypeSourceInfoDependent | ( | TypeSourceInfo * | TypeWithAuto | ) |
Definition at line 5356 of file SemaTemplateDeduction.cpp.
bool Sema::SubstBaseSpecifiers | ( | CXXRecordDecl * | Instantiation, |
CXXRecordDecl * | Pattern, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Perform substitution on the base class specifiers of the given class template specialization.
Produces a diagnostic and returns true on error, returns false and attaches the instantiated base classes to the class template specialization if successful.
Definition at line 3476 of file SemaTemplateInstantiate.cpp.
References AttachBaseSpecifiers(), clang::CXXRecordDecl::bases(), CheckBaseSpecifier(), CheckParameterPacksForExpansion(), collectUnexpandedParameterPacks(), Context, clang::Decl::setInvalidDecl(), and SubstType().
ExprResult Sema::SubstConstraintExpr | ( | Expr * | E, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4497 of file SemaTemplateInstantiate.cpp.
References SubstExpr().
ExprResult Sema::SubstConstraintExprWithoutSatisfaction | ( | Expr * | E, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4504 of file SemaTemplateInstantiate.cpp.
Decl * Sema::SubstDecl | ( | Decl * | D, |
DeclContext * | Owner, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4605 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::getLocation(), clang::Decl::isInvalidDecl(), and runWithSufficientStackSpace().
Referenced by FindInstantiatedDecl(), InstantiateFunctionDeclaration(), and InstantiateVariableDefinition().
DeclarationNameInfo Sema::SubstDeclarationNameInfo | ( | const DeclarationNameInfo & | NameInfo, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Do template substitution on declaration name info.
Definition at line 4549 of file SemaTemplateInstantiate.cpp.
References clang::DeclarationNameInfo::getLoc(), and clang::DeclarationNameInfo::getName().
Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool Sema::SubstDefaultArgument | ( | SourceLocation | Loc, |
ParmVarDecl * | Param, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool | ForCallExpr = false |
||
) |
Substitute the given template arguments into the default argument.
Definition at line 3378 of file SemaTemplateInstantiate.cpp.
References ActOnFinishFullExpr(), clang::TemplateArgumentList::asArray(), Context, ConvertParamDefaultArgument(), clang::TemplateArgumentList::CreateCopy(), clang::InitializationKind::CreateCopy(), clang::SemaBase::Diag(), getASTContext(), clang::DeclaratorDecl::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::Decl::getDeclContext(), clang::MultiLevelTemplateArgumentList::getInnermost(), clang::Decl::getLocation(), clang::DeclaratorDecl::getOuterLocStart(), clang::FunctionDecl::getPrimaryTemplate(), getTemplateInstantiationArgs(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::ParmVarDecl::getUninstantiatedDefaultArg(), clang::InitializedEntity::InitializeParameter(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isOutOfLine(), Loc, PotentiallyEvaluated, runWithSufficientStackSpace(), clang::ParmVarDecl::setDefaultArg(), clang::Decl::setInvalidDecl(), and SubstInitializer().
Referenced by InstantiateDefaultArgument(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
TemplateArgumentLoc Sema::SubstDefaultTemplateArgumentIfAvailable | ( | TemplateDecl * | Template, |
SourceLocation | TemplateLoc, | ||
SourceLocation | RAngleLoc, | ||
Decl * | Param, | ||
ArrayRef< TemplateArgument > | SugaredConverted, | ||
ArrayRef< TemplateArgument > | CanonicalConverted, | ||
bool & | HasDefaultArg | ||
) |
If the given template parameter has a default template argument, substitute into that default template argument and return the corresponding template argument.
Definition at line 6200 of file SemaTemplate.cpp.
References clang::TemplateName::isNull(), and SubstDefaultTemplateArgument().
void Sema::SubstExceptionSpec | ( | FunctionDecl * | New, |
const FunctionProtoType * | Proto, | ||
const MultiLevelTemplateArgumentList & | Args | ||
) |
Definition at line 3102 of file SemaTemplateInstantiate.cpp.
References clang::EST_None, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::TypeLoc::getEndLoc(), clang::FunctionProtoType::getExtProtoInfo(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::FunctionProtoType::ExceptionSpecInfo::Type, and UpdateExceptionSpec().
Referenced by clang::TemplateDeclInstantiator::InitFunctionInstantiation(), and InstantiateExceptionSpec().
bool Sema::SubstExceptionSpec | ( | SourceLocation | Loc, |
FunctionProtoType::ExceptionSpecInfo & | ESI, | ||
SmallVectorImpl< QualType > & | ExceptionStorage, | ||
const MultiLevelTemplateArgumentList & | Args | ||
) |
Definition at line 3092 of file SemaTemplateInstantiate.cpp.
References Loc.
ExprResult Sema::SubstExpr | ( | Expr * | E, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4486 of file SemaTemplateInstantiate.cpp.
Referenced by clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), instantiateExplicitSpecifier(), and SubstConstraintExpr().
bool Sema::SubstExprs | ( | ArrayRef< Expr * > | Exprs, |
bool | IsCall, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
SmallVectorImpl< Expr * > & | Outputs | ||
) |
Substitute the given template arguments into a list of expressions, expanding pack expansions if required.
Exprs | The list of expressions to substitute into. |
IsCall | Whether this is some form of call, in which case default arguments will be dropped. |
TemplateArgs | The set of template arguments to substitute. |
Outputs | Will receive all of the substituted arguments. |
Definition at line 4523 of file SemaTemplateInstantiate.cpp.
TypeSourceInfo * Sema::SubstFunctionDeclType | ( | TypeSourceInfo * | T, |
const MultiLevelTemplateArgumentList & | Args, | ||
SourceLocation | Loc, | ||
DeclarationName | Entity, | ||
CXXRecordDecl * | ThisContext, | ||
Qualifiers | ThisTypeQuals, | ||
bool | EvaluateConstraints = true |
||
) |
A form of SubstType intended specifically for instantiating the type of a FunctionDecl.
Its purpose is solely to force the instantiation of default-argument expressions and to avoid instantiating an exception-specification.
Definition at line 3046 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, Context, clang::TypeLoc::getAs(), clang::TypeLoc::getFullDataSize(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::TypeLoc::IgnoreParens(), Loc, NeedsInstantiationAsFunctionType(), clang::TypeLocBuilder::reserve(), and clang::T.
Referenced by clang::TemplateDeclInstantiator::SubstFunctionType().
ExprResult Sema::SubstInitializer | ( | Expr * | E, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool | CXXDirectInit | ||
) |
Definition at line 4515 of file SemaTemplateInstantiate.cpp.
Referenced by InstantiateInClassInitializer(), InstantiateMemInitializers(), InstantiateVariableInitializer(), and SubstDefaultArgument().
TemplateDeductionResult Sema::SubstituteExplicitTemplateArguments | ( | FunctionTemplateDecl * | FunctionTemplate, |
TemplateArgumentListInfo & | ExplicitTemplateArgs, | ||
SmallVectorImpl< DeducedTemplateArgument > & | Deduced, | ||
SmallVectorImpl< QualType > & | ParamTypes, | ||
QualType * | FunctionType, | ||
sema::TemplateDeductionInfo & | Info | ||
) |
Substitute the explicitly-provided template arguments into the given function template according to C++ [temp.arg.explicit].
FunctionTemplate | the function template into which the explicit template arguments will be substituted. |
ExplicitTemplateArgs | the explicitly-specified template arguments. |
Deduced | the deduced template arguments, which will be populated with the converted and checked explicit template arguments. |
ParamTypes | will be populated with the instantiated function parameters. |
FunctionType | if non-NULL, the result type of the function template will also be instantiated and the pointed-to value will be updated with the instantiated function type. |
Info | if substitution fails for any reason, this object will be populated with more information about the failure. |
Definition at line 3444 of file SemaTemplateDeduction.cpp.
References clang::Function, clang::sema::TemplateDeductionInfo::getLocation(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::InstantiationDepth, clang::Sema::InstantiatingTemplate::isInvalid(), P, clang::TemplateArgumentListInfo::size(), clang::Success, clang::Unevaluated, and Unevaluated.
NestedNameSpecifierLoc Sema::SubstNestedNameSpecifierLoc | ( | NestedNameSpecifierLoc | NNS, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4537 of file SemaTemplateInstantiate.cpp.
References clang::NestedNameSpecifierLoc::getBeginLoc().
Referenced by SubstDefaultTemplateArgument(), SubstQualifier(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool Sema::SubstParmTypes | ( | SourceLocation | Loc, |
ArrayRef< ParmVarDecl * > | Params, | ||
const FunctionProtoType::ExtParameterInfo * | ExtParamInfos, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
SmallVectorImpl< QualType > & | ParamTypes, | ||
SmallVectorImpl< ParmVarDecl * > * | OutParams, | ||
ExtParameterInfoBuilder & | ParamInfos | ||
) |
Substitute the given template arguments into the given set of parameters, producing the set of parameter types that would be generated from such a substitution.
Definition at line 3360 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, and Loc.
Referenced by clang::TemplateDeclInstantiator::SubstFunctionType().
ParmVarDecl * Sema::SubstParmVarDecl | ( | ParmVarDecl * | D, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
int | indexAdjustment, | ||
std::optional< unsigned > | NumExpansions, | ||
bool | ExpectParameterPack, | ||
bool | EvaluateConstraints = true |
||
) |
Definition at line 3236 of file SemaTemplateInstantiate.cpp.
References CheckPackExpansion(), CheckParameter(), clang::Type::containsUnexpandedParameterPack(), Context, CurContext, CurrentInstantiationScope, clang::SemaBase::Diag(), FindInstantiatedDecl(), clang::TypeLoc::getAs(), clang::NamedDecl::getDeclName(), clang::ParmVarDecl::getDefaultArg(), clang::ParmVarDecl::getExplicitObjectParamThisLoc(), clang::ParmVarDecl::getFunctionScopeDepth(), clang::ParmVarDecl::getFunctionScopeIndex(), clang::NamedDecl::getIdentifier(), clang::DeclaratorDecl::getInnerLocStart(), clang::Decl::getLocation(), clang::VarDecl::getStorageClass(), clang::ASTContext::getTranslationUnitDecl(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::ParmVarDecl::getUninstantiatedDefaultArg(), clang::ParmVarDecl::hasInheritedDefaultArg(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), clang::ParmVarDecl::hasUnparsedDefaultArg(), InstantiateAttrs(), clang::LocalInstantiationScope::InstantiatedLocal(), clang::LocalInstantiationScope::InstantiatedLocalPackArg(), clang::VarDecl::isParameterPack(), clang::Type::isVoidType(), clang::Decl::setDeclContext(), clang::ParmVarDecl::setExplicitObjectParameterLoc(), clang::ParmVarDecl::setHasInheritedDefaultArg(), clang::ParmVarDecl::setScopeInfo(), clang::ParmVarDecl::setUninstantiatedDefaultArg(), clang::ParmVarDecl::setUnparsedDefaultArg(), SubstType(), SubstTypeConstraint(), and UnparsedDefaultArgInstantiations.
FunctionDecl * Sema::SubstSpaceshipAsEqualEqual | ( | CXXRecordDecl * | RD, |
FunctionDecl * | Spaceship | ||
) |
Substitute the name and return type of a defaulted 'operator<=>' to form an implicit 'operator=='.
Definition at line 4650 of file SemaTemplateInstantiateDecl.cpp.
References clang::DeclContext::addDecl(), clang::MultiLevelTemplateArgumentList::addOuterRetainedLevels(), clang::AS_public, Context, clang::FriendDecl::Create(), clang::Decl::getTemplateDepth(), clang::Rewrite, clang::TemplateDeclInstantiator::RewriteSpaceshipAsEqualEqual, clang::Decl::setAccess(), clang::MultiLevelTemplateArgumentList::setKind(), clang::prec::Spaceship, clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
Referenced by DeclareImplicitEqualityComparison().
StmtResult Sema::SubstStmt | ( | Stmt * | S, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4457 of file SemaTemplateInstantiate.cpp.
bool Sema::SubstTemplateArgument | ( | const TemplateArgumentLoc & | Input, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
TemplateArgumentLoc & | Output, | ||
SourceLocation | Loc = {} , |
||
const DeclarationName & | Entity = {} |
||
) |
Definition at line 4467 of file SemaTemplateInstantiate.cpp.
References Loc.
Referenced by SubstDefaultTemplateArgument().
bool Sema::SubstTemplateArguments | ( | ArrayRef< TemplateArgumentLoc > | Args, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
TemplateArgumentListInfo & | Outputs | ||
) |
Definition at line 4476 of file SemaTemplateInstantiate.cpp.
Referenced by clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), SubstTypeConstraint(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
TemplateName Sema::SubstTemplateName | ( | NestedNameSpecifierLoc | QualifierLoc, |
TemplateName | Name, | ||
SourceLocation | Loc, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4557 of file SemaTemplateInstantiate.cpp.
Referenced by SubstDefaultTemplateArgument().
TemplateParameterList * Sema::SubstTemplateParams | ( | TemplateParameterList * | Params, |
DeclContext * | Owner, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool | EvaluateConstraints = true |
||
) |
Definition at line 4722 of file SemaTemplateInstantiateDecl.cpp.
References clang::TemplateDeclInstantiator::setEvaluateConstraints(), and clang::TemplateDeclInstantiator::SubstTemplateParams().
QualType Sema::SubstType | ( | QualType | T, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
SourceLocation | Loc, | ||
DeclarationName | Entity | ||
) |
Deprecated form of the above.
Definition at line 3004 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, clang::Type::isInstantiationDependentType(), clang::Type::isVariablyModifiedType(), Loc, and clang::T.
TypeSourceInfo * Sema::SubstType | ( | TypeLoc | TL, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
SourceLocation | Loc, | ||
DeclarationName | Entity | ||
) |
Definition at line 2973 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, Context, clang::TypeLoc::getFullDataSize(), clang::TypeLoc::getType(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::Type::isInstantiationDependentType(), clang::QualType::isNull(), clang::Type::isVariablyModifiedType(), Loc, clang::TypeLocBuilder::pushFullCopy(), and clang::TypeLocBuilder::reserve().
TypeSourceInfo * Sema::SubstType | ( | TypeSourceInfo * | T, |
const MultiLevelTemplateArgumentList & | Args, | ||
SourceLocation | Loc, | ||
DeclarationName | Entity, | ||
bool | AllowDeducedTST = false |
||
) |
Perform substitution on the type T with a given set of template arguments.
This routine substitutes the given template arguments into the type T and produces the instantiated type.
T | the type into which the template arguments will be substituted. If this type is not dependent, it will be returned immediately. |
Args | the template arguments that will be substituted for the top-level template parameters within T. |
Loc | the location in the source code where this substitution is being performed. It will typically be the location of the declarator (if we're instantiating the type of some declaration) or the location of the type in the source code (if, e.g., we're instantiating the type of a cast expression). |
Entity | the name of the entity associated with a declaration being instantiated (if any). May be empty to indicate that there is no such entity (if, e.g., this is a type that occurs as part of a cast expression) or that the entity has no name (e.g., an unnamed function parameter). |
AllowDeducedTST | Whether a DeducedTemplateSpecializationType is acceptable as the top level type of the result. |
Definition at line 2955 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, clang::Type::isInstantiationDependentType(), clang::Type::isVariablyModifiedType(), Loc, and clang::T.
Referenced by CompleteVarTemplateSpecializationDecl(), InstantiateMemInitializers(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), SubstBaseSpecifiers(), and SubstParmVarDecl().
bool Sema::SubstTypeConstraint | ( | TemplateTypeParmDecl * | Inst, |
const TypeConstraint * | TC, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool | EvaluateConstraint | ||
) |
Definition at line 3204 of file SemaTemplateInstantiate.cpp.
References clang::ASTTemplateArgumentListInfo::arguments(), AttachTypeConstraint(), clang::TypeConstraint::getConceptNameInfo(), clang::TypeConstraint::getConceptReference(), clang::ConceptReference::getFoundDecl(), clang::TypeConstraint::getImmediatelyDeclaredConstraint(), clang::TypeConstraint::getNamedConcept(), clang::TypeConstraint::getNestedNameSpecifierLoc(), clang::TypeConstraint::getTemplateArgsAsWritten(), clang::TemplateTypeParmDecl::isParameterPack(), clang::ASTTemplateArgumentListInfo::LAngleLoc, clang::ASTTemplateArgumentListInfo::RAngleLoc, clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::TemplateTypeParmDecl::setTypeConstraint(), and SubstTemplateArguments().
Referenced by SubstParmVarDecl().
|
inline |
Definition at line 11338 of file Sema.h.
Referenced by clang::Sema::SatisfactionStackResetRAII::~SatisfactionStackResetRAII().
|
inline |
Definition at line 1037 of file Sema.h.
Referenced by ActOnEndOfTranslationUnitFragment(), and BuildVarTemplateInstantiation().
|
inline |
Definition at line 707 of file Sema.h.
References clang::PartialDiagnostic::getDiagID(), Loc, and targetDiag().
Sema::SemaDiagnosticBuilder Sema::targetDiag | ( | SourceLocation | Loc, |
unsigned | DiagID, | ||
const FunctionDecl * | FD = nullptr |
||
) |
Definition at line 1999 of file Sema.cpp.
Referenced by clang::SemaOpenMP::ActOnOpenMPDeviceClause(), BuildArrayType(), MarkVarDeclODRUsed(), and targetDiag().
bool Sema::TemplateParameterListsAreEqual | ( | const TemplateCompareNewDeclInfo & | NewInstFrom, |
TemplateParameterList * | New, | ||
const NamedDecl * | OldInstFrom, | ||
TemplateParameterList * | Old, | ||
bool | Complain, | ||
TemplateParameterListEqualKind | Kind, | ||
SourceLocation | TemplateArgLoc = SourceLocation() |
||
) |
Determine whether the given template parameter lists are equivalent.
New | The new template parameter list, typically written in the source code as part of a new template declaration. |
Old | The old template parameter list, typically found via name lookup of the template declared with this template parameter list. |
Complain | If true, this routine will produce a diagnostic if the template parameter lists are not equivalent. |
Kind | describes how we are to match the template parameter lists. |
TemplateArgLoc | If this source location is valid, then we are actually checking the template parameter list of a template argument (New) against the template parameter list of its corresponding template template parameter (Old). We produce slightly different diagnostics in this scenario. |
Definition at line 9046 of file SemaTemplate.cpp.
References clang::TemplateParameterList::begin(), Diag(), DiagnoseTemplateParameterListArityMismatch(), clang::TemplateParameterList::end(), clang::Stmt::getBeginLoc(), clang::TemplateParameterList::getRequiresClause(), clang::TemplateParameterList::getTemplateLoc(), MatchTemplateParameterKind(), and clang::TemplateParameterList::size().
Referenced by getMoreSpecializedTemplate(), IsOverloadOrOverrideImpl(), and TemplateParameterListsAreEqual().
|
inline |
Definition at line 9448 of file Sema.h.
References TemplateParameterListsAreEqual().
ExprResult Sema::TemporaryMaterializationConversion | ( | Expr * | E | ) |
If E
is a prvalue denoting an unmaterialized temporary, materialize it as an xvalue.
In C++98, the result will still be a prvalue, because we don't have xvalues there.
Definition at line 8548 of file SemaInit.cpp.
References clang::CPlusPlus11, CreateMaterializeTemporaryExpr(), clang::ExprError(), clang::Expr::getExprLoc(), getLangOpts(), clang::Expr::getType(), clang::Expr::isPRValue(), RequireCompleteType(), and clang::T.
Referenced by CheckPointerToMemberOperands(), EvaluateStaticAssertMessageAsString(), IgnoredValueConversions(), and PerformImplicitConversion().
ExprResult Sema::TransformToPotentiallyEvaluated | ( | Expr * | E | ) |
Definition at line 17295 of file SemaExpr.cpp.
TypeSourceInfo * Sema::TransformToPotentiallyEvaluated | ( | TypeSourceInfo * | TInfo | ) |
Definition at line 17305 of file SemaExpr.cpp.
void Sema::translateTemplateArguments | ( | const ASTTemplateArgsPtr & | In, |
TemplateArgumentListInfo & | Out | ||
) |
Translates template arguments as provided by the parser into template arguments used by semantic analysis.
Definition at line 940 of file SemaTemplate.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::Last, and translateTemplateArgument().
bool Sema::tryCaptureVariable | ( | ValueDecl * | Var, |
SourceLocation | Loc, | ||
TryCaptureKind | Kind, | ||
SourceLocation | EllipsisLoc, | ||
bool | BuildAndDiagnose, | ||
QualType & | CaptureType, | ||
QualType & | DeclRefType, | ||
const unsigned *const | FunctionScopeIndexToStopAt | ||
) |
Try to capture the given variable.
Var | The variable to capture. |
Loc | The location at which the capture occurs. |
Kind | The kind of capture, which may be implicit (for either a block or a lambda), or explicit by-value or by-reference (for a lambda). |
EllipsisLoc | The location of the ellipsis, if one is provided in an explicit lambda capture. |
BuildAndDiagnose | Whether we are actually supposed to add the captures or diagnose errors. If false, this routine merely check whether the capture can occur without performing the capture itself or complaining if the variable cannot be captured. |
CaptureType | Will be set to the type of the field used to capture this variable in the innermost block or lambda. Only valid when the variable can be captured. |
DeclRefType | Will be set to the type of a reference to the capture from within the current scope. Only valid when the variable can be captured. |
FunctionScopeIndexToStopAt | If non-null, it points to the index of the FunctionScopeInfo stack beyond which we do not attempt to capture. This is useful when enclosing lambdas must speculatively capture variables that may or may not be used in certain specializations of a nested generic lambda. |
Definition at line 18835 of file SemaExpr.cpp.
References clang::Decl::getDeclContext(), clang::getLambdaAwareParentOfDeclContext(), clang::DeclContext::getParent(), and clang::ValueDecl::getPotentiallyDecomposedVarDecl().
Referenced by buildLoopVarFunc(), DoMarkBindingDeclReferenced(), MarkVarDeclODRUsed(), and clang::SemaObjC::tryCaptureObjCSelf().
bool Sema::tryCaptureVariable | ( | ValueDecl * | Var, |
SourceLocation | Loc, | ||
TryCaptureKind | Kind = TryCapture_Implicit , |
||
SourceLocation | EllipsisLoc = SourceLocation() |
||
) |
ExprResult Sema::tryConvertExprToType | ( | Expr * | E, |
QualType | Ty | ||
) |
Try to convert an expression E
to type Ty
.
Returns the result of the conversion.
Definition at line 5114 of file SemaExpr.cpp.
References clang::InitializationKind::CreateCopy(), clang::Stmt::getBeginLoc(), clang::InitializedEntity::InitializeTemporary(), and clang::InitializationSequence::Perform().
bool Sema::tryExprAsCall | ( | Expr & | E, |
QualType & | ZeroArgCallReturnTy, | ||
UnresolvedSetImpl & | OverloadSet | ||
) |
Figure out if an expression could be turned into a call.
Use this when trying to recover from an error where the programmer may have written just the name of a function instead of actually calling it.
E | - The expression to examine. |
ZeroArgCallReturnTy | - If the expression can be turned into a call with no arguments, this parameter is set to the type returned by such a call; otherwise, it is set to an empty QualType. |
OverloadSet | - If the expression is an overloaded function name, this parameter is populated with the decls of the various overloads. |
Definition at line 2565 of file Sema.cpp.
References clang::UnresolvedSetImpl::clear(), and clang::Expr::getType().
ImplicitConversionSequence Sema::TryImplicitConversion | ( | Expr * | From, |
QualType | ToType, | ||
bool | SuppressUserConversions, | ||
AllowedExplicit | AllowExplicit, | ||
bool | InOverloadResolution, | ||
bool | CStyle, | ||
bool | AllowObjCWritebackConversion | ||
) |
Definition at line 1756 of file SemaOverload.cpp.
References TryImplicitConversion().
ValueDecl * Sema::tryLookupCtorInitMemberDecl | ( | CXXRecordDecl * | ClassDecl, |
CXXScopeSpec & | SS, | ||
ParsedType | TemplateTypeTy, | ||
IdentifierInfo * | MemberOrBase | ||
) |
Definition at line 4409 of file SemaDeclCXX.cpp.
References clang::CXXScopeSpec::getScopeRep(), and tryLookupUnambiguousFieldDecl().
Referenced by clang::SemaCodeCompletion::ProduceCtorInitMemberSignatureHelp().
ValueDecl * Sema::tryLookupUnambiguousFieldDecl | ( | RecordDecl * | ClassDecl, |
const IdentifierInfo * | MemberOrBase | ||
) |
Definition at line 4390 of file SemaDeclCXX.cpp.
References clang::Decl::getDeclContext(), getLangOpts(), clang::NamedDecl::isPlaceholderVar(), and clang::DeclContext::lookup().
Referenced by tryLookupCtorInitMemberDecl().
bool Sema::tryResolveExplicitSpecifier | ( | ExplicitSpecifier & | ExplicitSpec | ) |
tryResolveExplicitSpecifier - Attempt to resolve the explict specifier.
Returns true if the explicit specifier is now resolved.
Definition at line 13847 of file SemaDeclCXX.cpp.
References clang::ASTContext::BoolTy, CCEK_ExplicitBool, CheckConvertedConstantExpression(), Context, clang::ActionResult< PtrTy, Compress >::get(), clang::ExplicitSpecifier::getExpr(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Expr::isValueDependent(), clang::ResolvedFalse, clang::ResolvedTrue, clang::ExplicitSpecifier::setExpr(), clang::ExplicitSpecifier::setKind(), and clang::Unresolved.
Referenced by ActOnExplicitBoolSpecifier(), and instantiateExplicitSpecifier().
bool Sema::tryToFixVariablyModifiedVarType | ( | TypeSourceInfo *& | TInfo, |
QualType & | T, | ||
SourceLocation | Loc, | ||
unsigned | FailedFoldDiagID | ||
) |
Attempt to fold a variable-sized type to a constant-sized type, returning true if we were successful.
Definition at line 6743 of file SemaDecl.cpp.
References TryToFixInvalidVariablyModifiedTypeSourceInfo().
bool Sema::tryToRecoverWithCall | ( | ExprResult & | E, |
const PartialDiagnostic & | PD, | ||
bool | ForceComplain = false , |
||
bool(*)(QualType) | IsPlausibleResult = nullptr |
||
) |
Try to recover by turning the given expression into a call.
Returns true if recovery was attempted or an error was emitted; this may also leave the ExprResult invalid.
Definition at line 2747 of file Sema.cpp.
References clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), clang::SourceLocation::getLocWithOffset(), clang::Stmt::getSourceRange(), IsCallableWithAppend(), IsCPUDispatchCPUSpecificMultiVersion(), clang::QualType::isNull(), Loc, notePlausibleOverloads(), and Range.
Definition at line 693 of file SemaAttr.cpp.
References Context, clang::Decl::Decl(), clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::Decl::getLocation(), clang::SourceLocation::isValid(), clang::ASTContext::PSF_Implicit, and clang::ASTContext::SectionInfos.
Referenced by ActOnPragmaClangSection(), and ActOnPragmaMSSection().
bool Sema::UnifySection | ( | StringRef | SectionName, |
int | SectionFlags, | ||
SourceLocation | PragmaSectionLocation | ||
) |
Definition at line 722 of file SemaAttr.cpp.
References Context, clang::SemaBase::Diag(), clang::ASTContext::PSF_Implicit, and clang::ASTContext::SectionInfos.
void Sema::UnmarkAsLateParsedTemplate | ( | FunctionDecl * | FD | ) |
Definition at line 12306 of file SemaTemplate.cpp.
References clang::FunctionDecl::setLateTemplateParsed().
Update instantiation attributes after template was late parsed.
Some attributes are evaluated based on the body of template. If it is late parsed, such attributes cannot be evaluated when declaration is instantiated. This function is used to update instantiation attributes when template definition is ready.
Definition at line 1369 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::addAttr(), clang::Decl::attrs(), getASTContext(), and clang::Decl::hasAttr().
void clang::Sema::UpdateExceptionSpec | ( | FunctionDecl * | FD, |
const FunctionProtoType::ExceptionSpecInfo & | ESI | ||
) |
Definition at line 249 of file SemaExceptionSpec.cpp.
References clang::ASTContext::adjustExceptionSpec(), Context, getASTMutationListener(), clang::isUnresolvedExceptionSpec(), clang::Redeclarable< decl_type >::redecls(), and clang::FunctionProtoType::ExceptionSpecInfo::Type.
Referenced by EvaluateImplicitExceptionSpec(), InstantiateExceptionSpec(), and SubstExceptionSpec().
bool Sema::UseArgumentDependentLookup | ( | const CXXScopeSpec & | SS, |
const LookupResult & | R, | ||
bool | HasTrailingLParen | ||
) |
Definition at line 3213 of file SemaExpr.cpp.
References clang::CPlusPlus, and clang::CXXScopeSpec::isNotEmpty().
bool Sema::usesPartialOrExplicitSpecialization | ( | SourceLocation | Loc, |
ClassTemplateSpecializationDecl * | ClassTemplateSpec | ||
) |
Definition at line 4011 of file SemaTemplateInstantiate.cpp.
References clang::TemplateArgumentList::asArray(), DeduceTemplateArguments(), clang::ClassTemplateDecl::getPartialSpecializations(), clang::ClassTemplateSpecializationDecl::getSpecializedTemplate(), clang::ClassTemplateSpecializationDecl::getTemplateArgs(), clang::CXXRecordDecl::getTemplateSpecializationKind(), Loc, clang::Success, and clang::TSK_ExplicitSpecialization.
Referenced by FindInstantiatedDecl().
QualType Sema::UsualArithmeticConversions | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
ArithConvKind | ACK | ||
) |
UsualArithmeticConversions - Performs various conversions that are common to binary operators (C99 6.3.1.8).
If both operands aren't arithmetic, this routine returns the first non-arithmetic type found. The client is responsible for emitting appropriate error diagnostics.
Definition at line 1632 of file SemaExpr.cpp.
References checkEnumArithmeticConversions(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
Referenced by CheckSizelessVectorConditionalTypes(), CheckVectorConditionalTypes(), and CXXCheckConditionalOperands().
ExprResult Sema::UsualUnaryConversions | ( | Expr * | E | ) |
UsualUnaryConversions - Performs various conversions that are common to most operators (C99 6.3).
The conversions of array and function types are sometimes suppressed. For example, the array->pointer conversion doesn't apply if the array is an argument to the sizeof or address (&) operators. In these instances, this routine should not be called.
Definition at line 867 of file SemaExpr.cpp.
References clang::ExprError(), clang::LangOptionsBase::FEM_Double, clang::LangOptionsBase::FEM_Source, clang::LangOptionsBase::FEM_UnsetOnCommandLine, clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Type::isFloatingType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::QualType::isNull().
ExprResult Sema::VerifyBitField | ( | SourceLocation | FieldLoc, |
const IdentifierInfo * | FieldName, | ||
QualType | FieldTy, | ||
bool | IsMsStruct, | ||
Expr * | BitWidth | ||
) |
VerifyBitField - verifies that a bit field expression is an ICE and has the correct width, and that the field type is valid.
Returns false on success.
Definition at line 18502 of file SemaDecl.cpp.
References clang::Expr::containsErrors(), Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ConstantArrayType::getMaxSizeBits(), clang::Stmt::getSourceRange(), clang::Type::isDependentType(), clang::Type::isIntegralOrEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::threadSafety::sx::toString().
|
inline |
Definition at line 5935 of file Sema.h.
References VerifyIntegerConstantExpression().
ExprResult Sema::VerifyIntegerConstantExpression | ( | Expr * | E, |
llvm::APSInt * | Result, | ||
unsigned | DiagID, | ||
AllowFoldKind | CanFold = NoFold |
||
) |
Definition at line 17070 of file SemaExpr.cpp.
ExprResult Sema::VerifyIntegerConstantExpression | ( | Expr * | E, |
llvm::APSInt * | Result, | ||
VerifyICEDiagnoser & | Diagnoser, | ||
AllowFoldKind | CanFold = NoFold |
||
) |
VerifyIntegerConstantExpression - Verifies that an expression is an ICE, and reports the appropriate diagnostics.
Returns false on success. Can optionally return the value of the expression.
Definition at line 17101 of file SemaExpr.cpp.
References clang::CPlusPlus11, clang::Stmt::getBeginLoc(), and clang::Sema::VerifyICEDiagnoser::Suppress.
Referenced by ActOnCXXNew(), clang::SemaOpenMP::ActOnOpenMPDeclareSimdDirective(), BuildBitIntType(), BuildStaticAssertDeclaration(), CheckCXXBooleanCondition(), and VerifyIntegerConstantExpression().
ExprResult Sema::VerifyIntegerConstantExpression | ( | Expr * | E, |
llvm::APSInt * | Result = nullptr , |
||
AllowFoldKind | CanFold = NoFold |
||
) |
Definition at line 17052 of file SemaExpr.cpp.
void Sema::WarnOnPendingNoDerefs | ( | ExpressionEvaluationContextRecord & | Rec | ) |
Emit a warning for all pending noderef expressions that we recorded.
Definition at line 17380 of file SemaExpr.cpp.
References Diag(), clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), and clang::Sema::ExpressionEvaluationContextRecord::PossibleDerefs.
void Sema::warnOnReservedIdentifier | ( | const NamedDecl * | D | ) |
Definition at line 6179 of file SemaDecl.cpp.
References clang::Decl::getPreviousDecl(), and clang::Decl::isImplicit().
void Sema::warnStackExhausted | ( | SourceLocation | Loc | ) |
Warn that the stack is nearly exhausted.
Definition at line 545 of file Sema.cpp.
References clang::SemaBase::Diag(), Loc, and WarnedStackExhausted.
Referenced by pushCodeSynthesisContext(), and runWithSufficientStackSpace().
|
inline |
WeakTopLevelDeclDecls - access to #pragma weak-generated Decls.
Definition at line 3569 of file Sema.h.
References WeakTopLevelDecl.
|
friend |
|
friend |
bool clang::Sema::AccessCheckingSFINAE |
When true, access checking violations are treated as SFINAE failures rather than hard errors.
Definition at line 9605 of file Sema.h.
Referenced by EmitCurrentDiagnostic(), clang::Sema::SFINAETrap::SFINAETrap(), and clang::Sema::SFINAETrap::~SFINAETrap().
llvm::DenseMap<unsigned, CXXDeductionGuideDecl *> clang::Sema::AggregateDeductionCandidates |
SmallVector<AlignPackIncludeState, 8> clang::Sema::AlignPackIncludeStack |
Definition at line 1437 of file Sema.h.
Referenced by AddAlignmentAttributesForRecord(), and DiagnoseNonDefaultPragmaAlignPack().
PragmaStack<AlignPackInfo> clang::Sema::AlignPackStack |
Definition at line 1430 of file Sema.h.
Referenced by ActOnPragmaOptionsAlign(), ActOnPragmaPack(), AddAlignmentAttributesForRecord(), DiagnoseNonDefaultPragmaAlignPack(), and DiagnoseUnterminatedPragmaAlignPack().
sema::AnalysisBasedWarnings clang::Sema::AnalysisWarnings |
Worker object for performing CFG-based warnings.
Definition at line 896 of file Sema.h.
Referenced by PrintStats().
api_notes::APINotesManager clang::Sema::APINotes |
Definition at line 861 of file Sema.h.
Referenced by ProcessAPINotes().
int clang::Sema::ArgumentPackSubstitutionIndex |
The current index into pack expansion arguments that will be used for substitution of parameter packs.
The pack expansion index will be -1 to indicate that parameter packs should be instantiated as themselves. Otherwise, the index specifies which argument within the parameter pack will be used for substitution.
Definition at line 10419 of file Sema.h.
Referenced by clang::TreeTransform< Derived >::AlwaysRebuild(), and FindInstantiatedDecl().
PragmaStack<StringLiteral *> clang::Sema::BSSSegStack |
llvm::BumpPtrAllocator clang::Sema::BumpAlloc |
Definition at line 815 of file Sema.h.
Referenced by CreateParsedType(), LookupSpecialMember(), and PrintStats().
std::unique_ptr<sema::FunctionScopeInfo> clang::Sema::CachedFunctionScope |
unsigned clang::Sema::CapturingFunctionScopes = 0 |
CleanupInfo clang::Sema::Cleanup |
Used to control the generation of ExprWithCleanups.
Definition at line 5347 of file Sema.h.
Referenced by ActOnDecltypeExpression(), CreateMaterializeTemporaryExpr(), MaybeBindToTemporary(), MaybeCreateExprWithCleanups(), and MaybeCreateStmtWithCleanups().
PragmaStack<StringLiteral *> clang::Sema::CodeSegStack |
SmallVector<Module *, 16> clang::Sema::CodeSynthesisContextLookupModules |
Extra modules inspected when performing a lookup during a template instantiation.
Computed lazily.
Definition at line 10370 of file Sema.h.
Referenced by popCodeSynthesisContext().
SmallVector<CodeSynthesisContext, 16> clang::Sema::CodeSynthesisContexts |
List of active code synthesis contexts.
This vector is treated as a stack. As synthesis of one entity requires synthesis of another, additional contexts are pushed onto the stack.
Definition at line 10359 of file Sema.h.
Referenced by BuildDecltypeType(), clang::Sema::InstantiatingTemplate::Clear(), diagnoseZeroToNullptrConversion(), FindInstantiatedDecl(), hasAcceptableDefinition(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), inTemplateInstantiation(), isSFINAEContext(), popCodeSynthesisContext(), PrintContextStack(), PrintInstantiationStack(), pushCodeSynthesisContext(), SubstFunctionDeclType(), SubstParmTypes(), SubstType(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool clang::Sema::CollectStats |
PragmaStack<StringLiteral *> clang::Sema::ConstSegStack |
ASTConsumer& clang::Sema::Consumer |
Definition at line 858 of file Sema.h.
Referenced by ActOnPragmaMSComment(), attemptRecovery(), DefineUsedVTables(), getASTConsumer(), Initialize(), InstantiateClassMembers(), InstantiateVariableDefinition(), LookupVisibleDecls(), clang::Sema::TypoExprState::operator=(), RequireCompleteType(), and ~Sema().
ASTContext& clang::Sema::Context |
Definition at line 857 of file Sema.h.
Referenced by ActOnAccessSpecifier(), ActOnArrayTypeTrait(), ActOnCompoundRequirement(), ActOnConversionDeclarator(), ActOnCXXGlobalScopeSpecifier(), ActOnCXXNestedNameSpecifierDecltype(), ActOnCXXNestedNameSpecifierIndexedPack(), ActOnCXXNew(), ActOnCXXTypeConstructExpr(), ActOnDecltypeExpression(), actOnDelayedExceptionSpecification(), ActOnFinishFullExpr(), ActOnFinishFunctionDeclarationDeclarator(), ActOnMemInitializers(), ActOnNoexceptSpec(), ActOnPragmaMSComment(), ActOnPragmaOptionsAlign(), ActOnPragmaPack(), ActOnRequiresExpr(), ActOnStartNamespaceDef(), ActOnStartRequiresExpr(), ActOnTypeRequirement(), ActOnTypeTrait(), AddAlignmentAttributesForRecord(), AddBuiltinCandidate(), AddBuiltinOperatorCandidates(), AddFunctionCandidates(), addGslOwnerPointerAttributeIfNotExisting(), AddImplicitlyDeclaredMembersToClass(), AddImplicitMSFunctionNoBuiltinAttr(), AddMemberOperatorCandidates(), AddMsStructLayoutForRecord(), AddOptnoneAttributeIfNoConflicts(), adjustCCAndNoReturn(), AdjustDestructorExceptionSpec(), clang::TemplateDeclInstantiator::adjustForRewrite(), adjustMemberFunctionCC(), allowAmbiguity(), AttachBaseSpecifiers(), attemptRecovery(), BuildAddressSpaceAttr(), BuildArrayType(), BuildArrayTypeTrait(), BuildAtomicType(), BuildBaseInitializer(), BuildBitIntType(), BuildBlockPointerType(), BuildBuiltinBitCastExpr(), BuildCoroutineBodyStmt(), BuildCountAttributedArrayOrPointerType(), BuildCStyleCastExpr(), BuildCXXConstructExpr(), BuildCXXFoldExpr(), BuildCXXFunctionalCastExpr(), BuildCXXNamedCast(), BuildCXXNoexceptExpr(), BuildCXXThisExpr(), BuildCXXTypeConstructExpr(), BuildDecltypeType(), BuildDelegatingInitializer(), BuildEmptyCXXFoldExpr(), BuildExpressionTrait(), BuildExprRequirement(), BuildExtVectorType(), BuildFunctionType(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), BuildLiteralOperatorCall(), BuildMatrixType(), BuildMemberInitializer(), BuildMemberPointerType(), BuildNestedRequirement(), BuildParenType(), BuildPointerType(), BuildPseudoDestructorExpr(), BuildQualifiedType(), BuildReadPipeType(), BuildReferenceType(), BuildStaticAssertDeclaration(), BuildSynthesizedThreeWayComparison(), BuildTypeofExprType(), BuildTypeRequirement(), BuildTypeTrait(), BuildUnaryTransformType(), BuildUsingPackDecl(), BuildVariableInstantiation(), BuildVectorType(), BuildWritePipeType(), BuiltinChangeCVRQualifiers(), BuiltinChangeSignedness(), BuiltinDecay(), BuiltinRemoveExtent(), BuiltinRemoveReference(), clang::Sema::ImplicitExceptionSpecification::CalledDecl(), CastForMoving(), CheckAllocatedType(), checkArrayElementAlignment(), CheckBaseSpecifier(), CheckC23ConstexprInitStringLiteral(), CheckC23ConstexprVarType(), checkClassLevelDLLAttribute(), CheckComparisonCategoryType(), CheckCompatibleReinterpretCast(), CheckCompleteDecompositionDeclaration(), CheckCompleteDestructorVariant(), CheckConstructor(), CheckConstructorDeclarator(), CheckConversionDeclarator(), CheckDeductionGuideDeclarator(), CheckDestructorDeclarator(), CheckEnableIf(), CheckEquivalentExceptionSpec(), checkExceptionSpecification(), CheckExplicitlyDefaultedSpecialMember(), CheckForReference(), CheckFunctionReturnType(), CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), CheckLiteralType(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeclaration(), CheckOperatorNewDeleteTypes(), CheckOverridingFunctionReturnType(), CheckPackExpansion(), CheckPointerToMemberOperands(), CheckSizelessVectorConditionalTypes(), CheckSpecifiedExceptionType(), CheckUsingDeclRedeclaration(), CheckUsingShadowDecl(), CheckVectorConditionalTypes(), CloneDesignatedInitExpr(), CollectFieldInitializer(), CollectVRQualifiers(), CompareReferenceRelationship(), computeDeclContext(), ConstantFoldAttrArgs(), ConvertAPValueToString(), ConvertParamDefaultArgument(), CreateMaterializeTemporaryExpr(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), CreateUnresolvedLookupExpr(), CXXCheckConditionalOperands(), DeclareGlobalNewDelete(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DeduceAutoType(), DeduceReturnType(), DeduceTemplateArguments(), DeduceTemplateSpecializationFromInitializer(), DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), DefineUsedVTables(), diagnoseArgDependentDiagnoseIfAttrs(), diagnoseArgIndependentDiagnoseIfAttrs(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseForRangeConstVariableCopies(), DiagnoseForRangeReferenceVariableCopies(), diagnoseMissingImport(), DiagnoseNontrivial(), diagnoseOpenCLTypes(), DiagnoseStaticAssertDetails(), DiagnoseTwoPhaseOperatorLookup(), DoMarkPotentialCapture(), DoMarkVarDeclReferenced(), EmitCurrentDiagnostic(), EvaluateConvertedConstantExpression(), EvaluateStaticAssertMessageAsString(), ExpandAnonymousFieldDesignator(), ExtractUnqualifiedFunctionType(), FinalizeVarWithDestructor(), FindAllocationFunctions(), FindAssociatedClassesAndNamespaces(), FindBaseInitializer(), FindCompositePointerType(), FindInstantiatedDecl(), fitsInto(), FixOverloadedFunctionReference(), getASTContext(), clang::SemaBase::getASTContext(), clang::TypoCorrectionConsumer::getContext(), GetDeclSpecTypeForDeclarator(), getDecltypeForExpr(), getElaboratedType(), getGenericLambdaTemplateParameterList(), GetKeyForBase(), GetKeyForMember(), getMoreSpecializedTemplate(), getOrCreateStdNamespace(), getParamType(), getPrintingPolicy(), getStdAlignValT(), getStdBadAlloc(), getStdNamespace(), getTemplateArgumentPackExpansionPattern(), GetTypeForDeclaratorCast(), handlerCanCatch(), hasAcceptableDefinition(), IgnoredValueConversions(), ImpCastExprToType(), inferGslOwnerPointerAttribute(), inferGslPointerAttribute(), inferNullableClassAttribute(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), clang::Sema::ExpressionEvaluationContextRecord::InitializationContext::InitializationContext(), Initialize(), InstantiateAttrs(), InstantiateAttrsForDecl(), InstantiateClassMembers(), clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), InstantiateDefaultCtorDefaultArgs(), InstantiateEnum(), InstantiateInClassInitializer(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), InstantiateVariableDefinition(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), clang::TreeTransform< Derived >::InventTypeSourceInfo(), isAbstractType(), isAcceptableNestedNameSpecifier(), IsAcceptableNonMemberOperatorCandidate(), clang::Sema::ExpressionEvaluationContextRecord::isConstantEvaluated(), clang::Sema::ExpressionEvaluationContextRecord::isDiscardedStatementContext(), IsEquivalentForUsingDecl(), isEquivalentInternalLinkageDeclaration(), clang::Sema::ExpressionEvaluationContextRecord::isImmediateFunctionContext(), isIncompleteOrZeroLengthArrayType(), isLibstdcxxEagerExceptionSpecHack(), isMoreSpecializedThanPrimary(), isNonNegativeIntegerValue(), IsOverloadOrOverrideImpl(), clang::Sema::ExpressionEvaluationContextRecord::isPotentiallyEvaluated(), IsStringInit(), IsStringLiteralToNonConstPointerConversion(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::Sema::ExpressionEvaluationContextRecord::isUnevaluated(), isValidInteropVariable(), LookupConstructors(), LookupInSuper(), LookupOrCreateLabel(), LookupOverloadedBinOp(), LookupSpecialMember(), makeUnavailableInSystemHeader(), MarkBaseAndMemberDestructorsReferenced(), MarkDeducedTemplateParameters(), MarkUsedTemplateParameters(), MarkVarDeclODRUsed(), MarkVirtualBaseDestructorsReferenced(), MarkVTableUsed(), MaybeBindToTemporary(), MaybeCreateExprWithCleanups(), MaybeCreateStmtWithCleanups(), MergeVarDeclExceptionSpecs(), NoteAllOverloadCandidates(), NoteIndirectBases(), PDiag(), PerformContextuallyConvertToBool(), PerformContextuallyConvertToObjCPointer(), PerformImplicitConversion(), PerformPendingInstantiations(), PreferredConditionType(), clang::TreeTransform< Derived >::RebuildAutoType(), clang::TreeTransform< Derived >::RebuildBitIntType(), clang::TreeTransform< Derived >::RebuildConstantMatrixType(), clang::TreeTransform< Derived >::RebuildDeducedTemplateSpecializationType(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TreeTransform< Derived >::RebuildElaboratedType(), clang::TreeTransform< Derived >::RebuildEnumType(), clang::TreeTransform< Derived >::RebuildExtVectorType(), clang::TreeTransform< Derived >::RebuildFunctionNoProtoType(), clang::TreeTransform< Derived >::RebuildImplicitValueInitExpr(), clang::TreeTransform< Derived >::RebuildMacroQualifiedType(), clang::TreeTransform< Derived >::RebuildObjCObjectPointerType(), clang::TreeTransform< Derived >::RebuildPackExpansion(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::TreeTransform< Derived >::RebuildRecordType(), clang::TreeTransform< Derived >::RebuildRequiresExpr(), clang::TreeTransform< Derived >::RebuildSizeOfPackExpr(), clang::TreeTransform< Derived >::RebuildTemplateName(), clang::TreeTransform< Derived >::RebuildTypedefType(), clang::TreeTransform< Derived >::RebuildTypeOfType(), clang::TreeTransform< Derived >::RebuildUsingType(), clang::TreeTransform< Derived >::RebuildVectorType(), recordConversion(), RemoveAddressSpaceFromPtr(), RequireCompleteDeclContext(), RequireLiteralType(), RequireNonAbstractType(), ResolveAddressOfOverloadedFunction(), resolveAndFixAddressOfSingleOverloadCandidate(), ResolveAndFixSingleFunctionTemplateSpecialization(), ResolveSingleFunctionTemplateSpecialization(), SaveNestedNameSpecifierAnnotation(), SelectBestMethod(), SetCtorInitializers(), SetDelegatingInitializer(), ShouldRemoveFromUnused(), SpecialMemberIsTrivial(), SubstAutoType(), SubstAutoTypeSourceInfo(), SubstBaseSpecifiers(), SubstDefaultArgument(), clang::TemplateDeclInstantiator::SubstDefaultedFunction(), SubstFunctionDeclType(), SubstParmVarDecl(), SubstSpaceshipAsEqualEqual(), clang::TemplateDeclInstantiator::SubstTemplateParams(), SubstType(), clang::TreeTransform< Derived >::TransformAttributedType(), clang::TreeTransform< Derived >::TransformDependentTemplateSpecializationType(), clang::TreeTransform< Derived >::TransformExceptionSpec(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), clang::transformOMPMappableExprListClause(), clang::TreeTransform< Derived >::TransformType(), clang::TreeTransform< Derived >::TransformTypeWithDeducedTST(), translateTemplateArgument(), tryResolveExplicitSpecifier(), UnifySection(), UpdateExceptionSpec(), VariableCanNeverBeAConstantExpression(), clang::TemplateDeclInstantiator::VisitBaseUsingDecls(), clang::UsedDeclVisitor< Derived >::VisitCXXDeleteExpr(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), widenIterationCount(), clang::ASTWriter::WriteAST(), and ~Sema().
DeclContext* clang::Sema::CurContext |
CurContext - This is the current declaration context of parsing.
Definition at line 995 of file Sema.h.
Referenced by ActOnAccessSpecifier(), ActOnCompoundRequirement(), ActOnFinishCXXMemberDecls(), ActOnFinishFullExpr(), ActOnFinishRequiresExpr(), clang::SemaObjC::ActOnObjCContainerStartDefinition(), clang::SemaObjC::ActOnObjCTemporaryExitContainerContext(), clang::SemaOpenMP::ActOnOpenMPAssumesDirective(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), clang::SemaOpenMP::ActOnOpenMPDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPDistScheduleClause(), clang::SemaOpenMP::ActOnOpenMPExecutableDirective(), clang::SemaOpenMP::ActOnOpenMPFilterClause(), clang::SemaOpenMP::ActOnOpenMPFinalClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPForDirective(), clang::SemaOpenMP::ActOnOpenMPForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPHasDeviceAddrClause(), clang::SemaOpenMP::ActOnOpenMPIfClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPNocontextClause(), clang::SemaOpenMP::ActOnOpenMPNovariantsClause(), clang::SemaOpenMP::ActOnOpenMPNumTeamsClause(), clang::SemaOpenMP::ActOnOpenMPNumThreadsClause(), clang::SemaOpenMP::ActOnOpenMPParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPRequiresDirective(), clang::SemaOpenMP::ActOnOpenMPScheduleClause(), clang::SemaOpenMP::ActOnOpenMPSharedClause(), clang::SemaOpenMP::ActOnOpenMPSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTargetSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeSimdDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPThreadLimitClause(), clang::SemaOpenMP::ActOnOpenMPThreadprivateDirective(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), clang::SemaOpenMP::ActOnOpenMPXDynCGroupMemClause(), ActOnPragmaFloatControl(), ActOnPragmaMSAllocText(), ActOnPragmaMSFunction(), ActOnPragmaMSOptimize(), ActOnStartNamespaceDef(), ActOnStartRequiresExpr(), BuildBaseInitializer(), buildCoroutineParameterMoves(), BuildDelegatingInitializer(), buildDistanceFunc(), buildLoopVarFunc(), BuildStaticAssertDeclaration(), BuildUsingPackDecl(), CheckCXXThisType(), CheckDeductionGuideDeclarator(), CheckInheritingConstructorUsingDecl(), clang::SemaObjC::CheckObjCDeclScope(), CheckUsingDeclQualifier(), CheckUsingDeclRedeclaration(), CheckUsingShadowDecl(), computeDeclContext(), clang::SemaCUDA::CurrentTarget(), DiagnoseTwoPhaseLookup(), DoMarkPotentialCapture(), clang::SemaOpenMP::EndOpenMPDSABlock(), FindInstantiatedDecl(), FinishForRangeVarDecl(), FixDependencyOfIdExpressionsInLambdaWithDependentObjectParameter(), forRedeclarationInCurContext(), getCurLexicalContext(), getCurrentClass(), getCurrentInstantiationOf(), GetDeclSpecTypeForDeclarator(), getFunctionLevelDeclContext(), getFunctionStorageClass(), clang::SemaObjC::getObjCContainerKind(), clang::SemaObjC::getObjCDeclContext(), hasUncompilableErrorOccurred(), InstantiateInClassInitializer(), InstantiateMemInitializers(), isCurrentClassNameTypo(), isLibstdcxxEagerExceptionSpecHack(), isNonNegativeIntegerValue(), isOdrUseContext(), clang::SemaOpenMP::isOpenMPCapturedDecl(), clang::SemaObjC::isSelfExpr(), IsUsingDirectiveInToplevelContext(), LookupOrCreateLabel(), makeUnavailableInSystemHeader(), MarkThisReferenced(), MarkVarDeclODRUsed(), MarkVTableUsed(), SubstParmVarDecl(), clang::SemaOpenMP::tryCaptureOpenMPLambdas(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
FPOptions clang::Sema::CurFPFeatures |
Definition at line 853 of file Sema.h.
Referenced by ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), getCurFPFeatures(), isPreciseFPEnabled(), resetFPOptions(), and setExceptionMode().
StringLiteral* clang::Sema::CurInitSeg |
Last section used with #pragma init_seg.
Definition at line 1480 of file Sema.h.
Referenced by ActOnPragmaMSInitSeg().
SourceLocation clang::Sema::CurInitSegLoc |
Definition at line 1481 of file Sema.h.
Referenced by ActOnPragmaMSInitSeg().
LocalInstantiationScope* clang::Sema::CurrentInstantiationScope |
The current instantiation scope used to store local variables.
Definition at line 9903 of file Sema.h.
Referenced by BuildVariableInstantiation(), CheckCXXDefaultArguments(), clang::LocalInstantiationScope::cloneScopes(), clang::TemplateDeclInstantiator::enableLateAttributeInstantiation(), clang::LocalInstantiationScope::Exit(), FindInstantiatedDecl(), InstantiateAttrs(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::LocalInstantiationScope::LocalInstantiationScope(), clang::TemplateDeclInstantiator::SubstFunctionType(), SubstParmVarDecl(), and clang::TemplateDeclInstantiator::VisitBaseUsingDecls().
llvm::SmallVector<QualType, 4> clang::Sema::CurrentParameterCopyTypes |
Stack of types that correspond to the parameter entities that are currently being copy-initialized.
Can be empty.
Definition at line 7168 of file Sema.h.
Referenced by PerformCopyInitialization().
SmallVector<Scope *, 2> clang::Sema::CurrentSEHFinally |
QualType clang::Sema::CXXThisTypeOverride |
When non-NULL, the C++ 'this' expression is allowed despite the current context not being a non-static member function.
In such cases, this provides the type used for 'this'.
Definition at line 6670 of file Sema.h.
Referenced by ClassifyImplicitMemberAccess(), and isThisOutsideMemberFunctionBody().
RecordDecl* clang::Sema::CXXTypeInfoDecl |
PragmaStack<StringLiteral *> clang::Sema::DataSegStack |
Whether deferrable diagnostics should be deferred.
Definition at line 8024 of file Sema.h.
Referenced by clang::SemaBase::Diag().
SmallVector<CXXRecordDecl *, 4> clang::Sema::DelayedDllExportClasses |
Definition at line 4770 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), checkClassLevelDLLAttribute(), and referenceDLLExportedClassMethods().
SmallVector<CXXMethodDecl *, 4> clang::Sema::DelayedDllExportMemberFunctions |
Definition at line 4771 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), and ActOnFinishCXXNonNestedClass().
SmallVector<std::pair<FunctionDecl *, FunctionDecl *>, 2> clang::Sema::DelayedEquivalentExceptionSpecChecks |
All the function redeclarations seen during a class definition that had their exception spec checks delayed, plus the prior declaration they should be checked against.
Except during error recovery, the new decl should always be a friend declaration, as that's the only valid way to redeclare a special member before its class is complete.
Definition at line 5038 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnFinishCXXMemberDecls(), CheckDelayedMemberExceptionSpecs(), and CheckEquivalentExceptionSpec().
SmallVector<std::pair<const CXXMethodDecl *, const CXXMethodDecl *>, 2> clang::Sema::DelayedOverridingExceptionSpecChecks |
All the overriding functions seen during a class definition that had their exception spec checks delayed, plus the overridden function.
Definition at line 5030 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnFinishCXXMemberDecls(), CheckDelayedMemberExceptionSpecs(), and CheckOverridingFunctionExceptionSpec().
DelegatingCtorDeclsType clang::Sema::DelegatingCtorDecls |
All the delegating constructors seen so far in the file, used for cycle detection at the end of the TU.
Definition at line 4953 of file Sema.h.
Referenced by SetDelegatingInitializer().
llvm::MapVector<FieldDecl *, DeleteLocs> clang::Sema::DeleteExprs |
SemaDiagnosticBuilder::DeferredDiagnosticsType clang::Sema::DeviceDeferredDiags |
Diagnostics that are emitted only if we discover that the given function must be codegen'ed.
Because handling these correctly adds overhead to compilation, this is currently only enabled for CUDA compilations.
Definition at line 992 of file Sema.h.
Referenced by emitDeferredDiags(), and hasUncompilableErrorOccurred().
DiagnosticsEngine& clang::Sema::Diags |
Definition at line 859 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), CheckCompatibleReinterpretCast(), CheckConstexprFunctionBody(), DiagnoseAbsenceOfOverrideControl(), DiagnoseAbstractType(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseForRangeVariableCopies(), DiagnoseHiddenVirtualMethods(), diagnoseZeroToNullptrConversion(), EmitCurrentDiagnostic(), EvaluateStaticAssertMessageAsString(), getDiagnostics(), clang::SemaBase::getDiagnostics(), PrintInstantiationStack(), and PrintPragmaAttributeInstantiationPoint().
bool clang::Sema::DisableTypoCorrection |
Tracks whether we are in a context where typo correction is disabled.
Definition at line 7421 of file Sema.h.
Referenced by clang::Sema::TentativeAnalysisScope::TentativeAnalysisScope(), and clang::Sema::TentativeAnalysisScope::~TentativeAnalysisScope().
SmallVector<ExprWithCleanups::CleanupObject, 8> clang::Sema::ExprCleanupObjects |
ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current full expression.
Definition at line 5351 of file Sema.h.
Referenced by MaybeCreateExprWithCleanups().
SmallVector<ExpressionEvaluationContextRecord, 8> clang::Sema::ExprEvalContexts |
A stack of expression evaluation contexts.
Definition at line 6558 of file Sema.h.
Referenced by ActOnDecltypeExpression(), ClassifyImplicitMemberAccess(), CorrectDelayedTyposInExpr(), CreateMaterializeTemporaryExpr(), currentEvaluationContext(), InnermostDeclarationWithDelayedImmediateInvocations(), InstantiateInClassInitializer(), isBoundsAttrContext(), isInLifetimeExtendingContext(), isOdrUseContext(), isPotentiallyConstantEvaluatedContext(), keepInLifetimeExtendingContext(), MaybeBindToTemporary(), MaybeCreateExprWithCleanups(), OutermostDeclarationWithDelayedImmediateInvocations(), parentEvaluationContext(), clang::Parser::ParseArrayBoundExpression(), and clang::Parser::ParseConstantExpressionInExprEvalContext().
SmallVector<VarDecl *, 4> clang::Sema::ExternalDeclarations |
IntrusiveRefCntPtr<ExternalSemaSource> clang::Sema::ExternalSource |
Source of additional semantic information.
Definition at line 1048 of file Sema.h.
Referenced by clang::SemaObjC::CollectMultipleMethodsInGlobalPool(), clang::SemaObjC::ReadMethodPool(), and clang::SemaObjC::updateOutOfDateSelector().
llvm::DenseMap<IdentifierInfo *, AsmLabelAttr *> clang::Sema::ExtnameUndeclaredIdentifiers |
ExtVectorDeclsType clang::Sema::ExtVectorDecls |
llvm::SmallPtrSet<ConstantExpr *, 4> clang::Sema::FailedImmediateInvocations |
Definition at line 6561 of file Sema.h.
Referenced by EvaluateAndDiagnoseImmediateInvocation(), and HandleImmediateInvocations().
std::unique_ptr<CXXFieldCollector> clang::Sema::FieldCollector |
|
mutable |
PragmaStack<FPOptionsOverride> clang::Sema::FpPragmaStack |
Definition at line 1448 of file Sema.h.
Referenced by ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), CurFPFeatureOverrides(), resetFPOptions(), and setExceptionMode().
SmallVector<sema::FunctionScopeInfo *, 4> clang::Sema::FunctionScopes |
Stack containing information about each of the nested function, block, and method scopes that are currently active.
Definition at line 806 of file Sema.h.
Referenced by CheckCXXThisCapture(), DiagnoseUnexpandedParameterPacks(), FixDependencyOfIdExpressionsInLambdaWithDependentObjectParameter(), getCurFunction(), getFunctionScopes(), clang::SemaOpenMP::isOpenMPCapturedDecl(), isUnexpandedParameterPackPermitted(), MarkThisReferenced(), and ~Sema().
unsigned clang::Sema::FunctionScopesStart = 0 |
The index of the first FunctionScope that corresponds to the current context.
Definition at line 810 of file Sema.h.
Referenced by getFunctionScopes().
llvm::StringMap<std::tuple<StringRef, SourceLocation> > clang::Sema::FunctionToSectionMap |
Sections used with #pragma alloc_text.
Definition at line 1484 of file Sema.h.
Referenced by ActOnPragmaMSAllocText().
bool clang::Sema::GlobalNewDeleteDeclared |
A flag to remember whether the implicit forms of operator new and delete have been declared.
Definition at line 6609 of file Sema.h.
Referenced by DeclareGlobalNewDelete().
IdentifierResolver clang::Sema::IdResolver |
Definition at line 2551 of file Sema.h.
Referenced by ActOnReenterTemplateScope(), clang::ASTReader::getIdResolver(), and Initialize().
llvm::SmallVector<std::pair<SourceLocation, const BlockDecl *>, 1> clang::Sema::ImplicitlyRetainedSelfLocs |
SourceLocation clang::Sema::ImplicitMSInheritanceAttrLoc |
Source location for newly created implicit MSInheritanceAttrs.
Definition at line 1195 of file Sema.h.
Referenced by ActOnPragmaMSPointersToMembers().
bool clang::Sema::InNonInstantiationSFINAEContext |
Whether we are in a SFINAE context that is not associated with template instantiation.
This is used when setting up a SFINAE trap (see
SFINAETrap) outside of a template instantiation or template argument deduction.
Definition at line 10386 of file Sema.h.
Referenced by isSFINAEContext(), popCodeSynthesisContext(), pushCodeSynthesisContext(), clang::Sema::SFINAETrap::SFINAETrap(), and clang::Sema::SFINAETrap::~SFINAETrap().
llvm::DenseSet<QualType> clang::Sema::InstantiatedNonDependentTypes |
llvm::DenseSet<std::pair<Decl *, unsigned> > clang::Sema::InstantiatingSpecializations |
Specializations whose definitions are currently being instantiated.
Definition at line 10362 of file Sema.h.
Referenced by clang::Sema::InstantiatingTemplate::Clear(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), and ~Sema().
SmallVector<InventedTemplateParameterInfo, 4> clang::Sema::InventedParameterInfos |
Stack containing information needed when in C++2a an 'auto' is encountered in a function declaration parameter type specifier in order to invent a corresponding template parameter in the enclosing abbreviated function template.
This information is also present in LambdaScopeInfo, stored in the FunctionScopes stack.
Definition at line 4931 of file Sema.h.
Referenced by ActOnFinishFunctionDeclarationDeclarator(), ActOnStartFunctionDeclarationDeclarator(), GetDeclSpecTypeForDeclarator(), and getInventedParameterInfos().
unsigned clang::Sema::InventedParameterInfosStart = 0 |
The index of the first InventedParameterInfo that refers to the current context.
Definition at line 2555 of file Sema.h.
Referenced by getInventedParameterInfos().
bool clang::Sema::IsBuildingRecoveryCallExpr |
Used to change context to isConstantEvaluated without pushing a heavy ExpressionEvaluationContextRecord object.
Definition at line 1886 of file Sema.h.
Referenced by isAlwaysConstantEvaluatedContext(), and isConstantEvaluatedContext().
Is the last error level diagnostic immediate.
This is used to determined whether the next info diagnostic should be immediate.
Definition at line 923 of file Sema.h.
Referenced by clang::SemaBase::Diag(), clang::SemaCUDA::DiagIfDeviceCode(), and clang::SemaCUDA::DiagIfHostCode().
const LangOptions& clang::Sema::LangOpts |
Definition at line 855 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnPragmaAttributeAttribute(), BuildDelegatingInitializer(), BuiltinAddReference(), BuiltinRemoveReference(), CheckConstexprDeclStmt(), checkDeclInTargetContext(), checkMapConflicts(), checkMappableExpressionList(), checkOpenMPLoop(), CheckOverloadedOperatorDeclaration(), clang::SemaSYCL::CheckSYCLKernelCall(), DefineImplicitCopyAssignment(), DiagnoseUnterminatedPragmaAlignPack(), emitDeferredDiags(), getFixItZeroInitializerForType(), getLangOpts(), clang::SemaBase::getLangOpts(), isNonNegativeIntegerValue(), IsOverloadOrOverrideImpl(), MarkVarDeclODRUsed(), MarkVTableUsed(), PerformPendingInstantiations(), resetFPOptions(), and ShouldDeleteSpecialMember().
unsigned clang::Sema::LastEmittedCodeSynthesisContextDepth = 0 |
The depth of the context stack at the point when the most recent error or warning was produced.
This value is used to suppress printing of redundant context stacks when there are multiple errors or warnings in the same instantiation.
Definition at line 10403 of file Sema.h.
Referenced by popCodeSynthesisContext(), and PrintContextStack().
SmallVector<PendingImplicitInstantiation, 1> clang::Sema::LateParsedInstantiations |
Queue of implicit template instantiations that cannot be performed eagerly.
Definition at line 10637 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnEndOfTranslationUnitFragment(), and InstantiateFunctionDefinition().
LateParsedTemplateMapT clang::Sema::LateParsedTemplateMap |
LateTemplateParserCB* clang::Sema::LateTemplateParser |
Definition at line 902 of file Sema.h.
Referenced by InstantiateFunctionDefinition(), and SetLateTemplateParser().
LateTemplateParserCleanupCB* clang::Sema::LateTemplateParserCleanup |
Definition at line 903 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), and SetLateTemplateParser().
llvm::DenseSet<Module *> clang::Sema::LookupModulesCache |
Cache of additional modules that should be used for name lookup within the current template instantiation.
Computed lazily; use getLookupModules() to get a complete set.
Definition at line 10375 of file Sema.h.
Referenced by popCodeSynthesisContext().
|
static |
The maximum alignment, same as in llvm::Value.
We duplicate them here because that allows us not to duplicate the constants in clang code, which we must to since we can't directly use the llvm constants. The value is verified against llvm here: lib/CodeGen/CGDecl.cpp
This is the greatest alignment value supported by load, store, and alloca instructions, and global values.
|
static |
MaybeODRUseExprSet clang::Sema::MaybeODRUseExprs |
Definition at line 5162 of file Sema.h.
Referenced by DoMarkVarDeclReferenced().
llvm::SmallSetVector<StringRef, 4> clang::Sema::MSFunctionNoBuiltins |
Set of no-builtin functions listed by #pragma function.
Definition at line 1531 of file Sema.h.
Referenced by ActOnPragmaMSFunction(), and AddImplicitMSFunctionNoBuiltinAttr().
LangOptions::PragmaMSPointersToMembersKind clang::Sema::MSPointerToMemberRepresentationMethod |
Controls member pointer representation format under the MS ABI.
Definition at line 1190 of file Sema.h.
Referenced by ActOnPragmaMSPointersToMembers().
The "on" or "off" argument passed by #pragma optimize, that denotes whether the optimizations in the list passed to the pragma should be turned off or on.
This boolean is true by default because command line options are honored when #pragma optimize("", on)
. (i.e. ModifyFnAttributeMSPragmaOptimze()
does nothing)
Definition at line 1528 of file Sema.h.
Referenced by ActOnPragmaMSOptimize(), and ModifyFnAttributesMSPragmaOptimize().
bool clang::Sema::MSStructPragmaOn |
Definition at line 1192 of file Sema.h.
Referenced by ActOnPragmaMSStruct(), and AddMsStructLayoutForRecord().
unsigned clang::Sema::NonInstantiationEntries |
The number of CodeSynthesisContexts
that are not template instantiations and, therefore, should not be counted as part of the instantiation depth.
When the instantiation depth reaches the user-configurable limit LangOptions::InstantiationDepth
we will abort instantiation.
Definition at line 10395 of file Sema.h.
Referenced by inTemplateInstantiation(), popCodeSynthesisContext(), and pushCodeSynthesisContext().
FileNullabilityMap clang::Sema::NullabilityMap |
unsigned clang::Sema::NumSFINAEErrors |
The number of SFINAE diagnostics that have been trapped.
Definition at line 8906 of file Sema.h.
Referenced by EmitCurrentDiagnostic(), clang::Sema::SFINAETrap::hasErrorOccurred(), PrintStats(), and clang::Sema::SFINAETrap::~SFINAETrap().
void* clang::Sema::OpaqueParser |
Definition at line 904 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), and SetLateTemplateParser().
OpenCLOptions clang::Sema::OpenCLFeatures |
Definition at line 852 of file Sema.h.
Referenced by getOpenCLOptions().
SourceLocation clang::Sema::OptimizeOffPragmaLocation |
This represents the last location of a "#pragma clang optimize off" directive if such a directive has not been closed by an "on" yet.
If optimizations are currently "on", this is set to an invalid location.
Definition at line 1515 of file Sema.h.
Referenced by ActOnPragmaOptimize(), AddRangeBasedOptnone(), and getOptimizeOffPragmaLocation().
DeclContext* clang::Sema::OriginalLexicalContext |
Generally null except when we temporarily switch decl contexts, like in.
Definition at line 2654 of file Sema.h.
Referenced by clang::SemaObjC::ActOnObjCReenterContainerContext(), clang::SemaObjC::ActOnObjCTemporaryExitContainerContext(), and getCurLexicalContext().
std::function<TypeResult(StringRef, StringRef, SourceLocation)> clang::Sema::ParseTypeFromStringCallback |
Callback to the parser to parse a type expressed as a string.
Definition at line 915 of file Sema.h.
Referenced by clang::Parser::Parser().
llvm::SmallPtrSet<const Decl *, 4> clang::Sema::ParsingInitForAutoVars |
std::deque<PendingImplicitInstantiation> clang::Sema::PendingInstantiations |
The queue of implicit template instantiations that are required but have not yet been performed.
Definition at line 10633 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnEndOfTranslationUnitFragment(), DoMarkVarDeclReferenced(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), and PerformPendingInstantiations().
std::deque<PendingImplicitInstantiation> clang::Sema::PendingLocalImplicitInstantiations |
The queue of implicit template instantiations that are required and must be performed within the current local scope.
This queue is only used for member functions of local classes in templates, which must be instantiated in the same scope as their enclosing function, so that they can reference function-local types, static variables, enumerators, etc.
Definition at line 10650 of file Sema.h.
Referenced by InstantiateClassMembers(), PerformPendingInstantiations(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
Preprocessor& clang::Sema::PP |
Definition at line 856 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), BuildNonArrayForRange(), DeclareGlobalNewDelete(), diagnoseMissingImport(), EvaluateStaticAssertMessageAsString(), clang::arcmt::trans::getNilString(), clang::SemaObjC::getNSErrorIdent(), getNullabilityKeyword(), getOrCreateStdNamespace(), getPreprocessor(), getPrintingPolicy(), Initialize(), lookupCoroutineTraits(), and clang::ASTWriter::WriteAST().
const Decl* clang::Sema::PragmaAttributeCurrentTargetDecl |
The declaration that is currently receiving an attribute from the #pragma attribute stack.
Definition at line 1510 of file Sema.h.
Referenced by PrintContextStack(), and PrintPragmaAttributeInstantiationPoint().
SmallVector<PragmaAttributeGroup, 2> clang::Sema::PragmaAttributeStack |
Definition at line 1506 of file Sema.h.
Referenced by ActOnPragmaAttributeAttribute(), ActOnPragmaAttributeEmptyPush(), ActOnPragmaAttributePop(), and DiagnoseUnterminatedPragmaAttribute().
PragmaClangSection clang::Sema::PragmaClangBSSSection |
Definition at line 1215 of file Sema.h.
Referenced by ActOnPragmaClangSection().
PragmaClangSection clang::Sema::PragmaClangDataSection |
Definition at line 1216 of file Sema.h.
Referenced by ActOnPragmaClangSection().
PragmaClangSection clang::Sema::PragmaClangRelroSection |
Definition at line 1218 of file Sema.h.
Referenced by ActOnPragmaClangSection().
PragmaClangSection clang::Sema::PragmaClangRodataSection |
Definition at line 1217 of file Sema.h.
Referenced by ActOnPragmaClangSection().
PragmaClangSection clang::Sema::PragmaClangTextSection |
Definition at line 1219 of file Sema.h.
Referenced by ActOnPragmaClangSection().
std::unique_ptr<RecordDeclSetTy> clang::Sema::PureVirtualClassDiagSet |
PureVirtualClassDiagSet - a set of class declarations which we have emitted a list of pure virtual functions.
Used to prevent emitting the same list more than once.
Definition at line 4945 of file Sema.h.
Referenced by DiagnoseAbstractType().
Whether the AST is currently being rebuilt to correct immediate invocations.
Immediate invocation candidates and references to consteval functions aren't tracked when this is set.
Definition at line 6398 of file Sema.h.
Referenced by HandleImmediateInvocations().
Increment when we find a reference; decrement when we find an ignored assignment.
Ultimately the value is 0 if every reference is an ignored assignment.
Definition at line 5344 of file Sema.h.
Referenced by IgnoredValueConversions(), and MaybeDecrementCount().
SmallVector<std::deque<PendingImplicitInstantiation>, 8> clang::Sema::SavedPendingInstantiations |
Definition at line 10641 of file Sema.h.
Referenced by DoMarkVarDeclReferenced().
SmallVector<SmallVector<VTableUse, 16>, 8> clang::Sema::SavedVTableUses |
SourceManager& clang::Sema::SourceMgr |
Definition at line 860 of file Sema.h.
Referenced by diagnoseMissingImport(), DiagnoseUnterminatedPragmaAlignPack(), diagnoseZeroToNullptrConversion(), getSourceManager(), and clang::sema::AnalysisBasedWarnings::IssueWarnings().
llvm::FoldingSet<SpecialMemberOverloadResultEntry> clang::Sema::SpecialMemberCache |
A cache of special member function overload resolution results for C++ records.
Definition at line 7467 of file Sema.h.
Referenced by LookupSpecialMember().
llvm::SmallPtrSet<SpecialMemberDecl, 4> clang::Sema::SpecialMembersBeingDeclared |
LazyDeclPtr clang::Sema::StdAlignValT |
The C++ "std::align_val_t" enum class, which is defined by the C++ standard library.
Definition at line 6602 of file Sema.h.
Referenced by DeclareGlobalNewDelete(), and getStdAlignValT().
LazyDeclPtr clang::Sema::StdBadAlloc |
The C++ "std::bad_alloc" class, which is defined by the C++ standard library.
Definition at line 6598 of file Sema.h.
Referenced by DeclareGlobalNewDelete(), and getStdBadAlloc().
ClassTemplateDecl* clang::Sema::StdCoroutineTraitsCache |
The C++ "std::coroutine_traits" template, which is defined in <coroutine_traits>
Definition at line 2305 of file Sema.h.
Referenced by lookupCoroutineTraits().
ClassTemplateDecl* clang::Sema::StdInitializerList |
LazyDeclPtr clang::Sema::StdNamespace |
The C++ "std" namespace, where the standard library resides.
Definition at line 4956 of file Sema.h.
Referenced by ActOnStartNamespaceDef(), getOrCreateStdNamespace(), and getStdNamespace().
RecordDecl* clang::Sema::StdSourceLocationImplDecl |
PragmaStack<bool> clang::Sema::StrictGuardStackCheckStack |
Definition at line 1445 of file Sema.h.
Referenced by ActOnPragmaMSStrictGuardStackCheck().
SuppressedDiagnosticsMap clang::Sema::SuppressedDiagnostics |
std::vector<std::unique_ptr<TemplateInstantiationCallback> > clang::Sema::TemplateInstCallbacks |
The template instantiation callbacks to trace or track instantiations (objects can be chained).
This callbacks is used to print, trace or track template instantiations as they are being constructed.
Definition at line 10411 of file Sema.h.
Referenced by clang::Sema::InstantiatingTemplate::Clear(), clang::TemplightDumpAction::ExecuteAction(), and clang::TemplateDeclInstantiator::InitFunctionInstantiation().
TentativeDefinitionsType clang::Sema::TentativeDefinitions |
threadSafety::BeforeSet* clang::Sema::ThreadSafetyDeclCache |
const TranslationUnitKind clang::Sema::TUKind |
The kind of translation unit we are processing.
When we're processing a complete translation unit, Sema will perform end-of-translation-unit semantic tasks (such as creating initializers for tentative definitions in C) once parsing has completed. Modules and precompiled headers perform different kinds of checks.
Definition at line 824 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), MarkVTableUsed(), and PerformPendingInstantiations().
Scope* clang::Sema::TUScope |
Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in the "ordinary" C decl namespace.
For example, user-defined classes, built-in "id" type, etc.
Definition at line 829 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnPragmaMSAllocText(), clang::SemaObjC::ActOnTypedefedProtocols(), clang::SemaObjC::FindProtocolDeclaration(), clang::SemaObjC::getObjCInterfaceDecl(), Initialize(), and clang::SemaObjC::LookupProtocol().
llvm::SmallPtrSet<const NamedDecl *, 4> clang::Sema::TypoCorrectedFunctionDefinitions |
The function definitions which were renamed as part of typo-correction to match their respective declarations.
We want to keep track of them to ensure that we don't emit a "redefinition" error if we encounter a correctly named definition after the renamed definition.
IdentifierSourceLocations clang::Sema::TypoCorrectionFailures |
llvm::SmallVector<TypoExpr *, 2> clang::Sema::TypoExprs |
unsigned clang::Sema::TyposCorrected |
llvm::MapVector<NamedDecl *, SourceLocation> clang::Sema::UndefinedButUsed |
UndefinedInternals - all the used, undefined objects which require a definition in this translation unit.
Definition at line 4968 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), CheckImmediateEscalatingFunctionDefinition(), getUndefinedButUsed(), and MarkVarDeclODRUsed().
UnparsedDefaultArgInstantiationsMap clang::Sema::UnparsedDefaultArgInstantiations |
A mapping from parameters with unparsed default arguments to the set of instantiations of each parameter.
This mapping is a temporary data structure used when parsing nested class templates or nested classes of class templates, where we might end up instantiating an inner class before the default arguments of its methods have been parsed.
Definition at line 9915 of file Sema.h.
Referenced by SetParamDefaultArgument(), and SubstParmVarDecl().
llvm::DenseMap<ParmVarDecl *, SourceLocation> clang::Sema::UnparsedDefaultArgLocs |
Definition at line 4964 of file Sema.h.
Referenced by ActOnParamDefaultArgument(), ActOnParamDefaultArgumentError(), ActOnParamUnparsedDefaultArgument(), and CheckExtraCXXDefaultArguments().
UnusedFileScopedDeclsType clang::Sema::UnusedFileScopedDecls |
The set of file scoped decls seen so far that have not been used and must warn if not used.
Only contains the first declaration.
Definition at line 2640 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit().
llvm::SmallSetVector<const TypedefNameDecl *, 4> clang::Sema::UnusedLocalTypedefNameCandidates |
Set containing all typedefs that are likely unused.
Definition at line 2632 of file Sema.h.
Referenced by emitAndClearUnusedLocalTypedefWarnings().
NamedDeclSetType clang::Sema::UnusedPrivateFields |
DeclarationName clang::Sema::VAListTagName |
VAListTagName - The declaration name corresponding to __va_list_tag.
This is used as part of a hack to omit that class from ADL results.
Definition at line 919 of file Sema.h.
Referenced by Initialize().
void* clang::Sema::VisContext |
VisContext - Manages the stack for #pragma GCC visibility.
Definition at line 1487 of file Sema.h.
Referenced by AddPushedVisibilityAttribute(), FreeVisContext(), PopPragmaVisibility(), and ~Sema().
llvm::DenseMap<CXXRecordDecl *, bool> clang::Sema::VTablesUsed |
The set of classes whose vtables have been used within this translation unit, and a bit that will be true if the vtable is required to be emitted (otherwise, it should be emitted only if needed by code generation).
Definition at line 4521 of file Sema.h.
Referenced by DefineUsedVTables(), LoadExternalVTableUses(), and MarkVTableUsed().
SmallVector<VTableUse, 16> clang::Sema::VTableUses |
The list of vtables that are required but have not yet been materialized.
Definition at line 4515 of file Sema.h.
Referenced by DefineUsedVTables(), LoadExternalVTableUses(), and MarkVTableUsed().
PragmaStack<MSVtorDispMode> clang::Sema::VtorDispStack |
Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI.
Possible values are 0, 1, and 2, which mean:
0: Suppress all vtordisps 1: Insert vtordisps in the presence of vbase overrides and non-trivial structors 2: Always insert vtordisps to support RTTI on partially constructed objects
Definition at line 1429 of file Sema.h.
Referenced by ActOnPragmaMSVtorDisp(), and AddMsStructLayoutForRecord().
Definition at line 831 of file Sema.h.
Referenced by warnStackExhausted().
SmallVector<Decl *, 2> clang::Sema::WeakTopLevelDecl |
WeakTopLevelDecl - Translation-unit scoped declarations generated by #pragma weak during processing of other Decls.
I couldn't figure out a clean way to generate these in-line, so we store them here and handle separately – which is a hack. It would be best to refactor this.
Definition at line 3566 of file Sema.h.
Referenced by WeakTopLevelDecls().
llvm::MapVector< IdentifierInfo *, llvm::SetVector< WeakInfo, llvm::SmallVector<WeakInfo, 1u>, llvm::SmallDenseSet<WeakInfo, 2u, WeakInfo::DenseMapInfoByAliasOnly> > > clang::Sema::WeakUndeclaredIdentifiers |
WeakUndeclaredIdentifiers - Identifiers contained in #pragma weak before declared.
Rare. May alias another identifier, declared or undeclared.
For aliases, the target identifier is used as a key for eventual processing when the target is declared. For the single-identifier form, the sole identifier is used as the key. Each entry is a SetVector
(ordered by parse order) of aliases (identified by the alias name) in case of multiple aliases to the same undeclared identifier.
Definition at line 2622 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), and LoadExternalWeakUndeclaredIdentifiers().