clang 20.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 | FunctionEffectDiff |
struct | FunctionEffectDiffVector |
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. | |
typedef void | LateTemplateParserCleanupCB(void *P) |
typedef DelayedDiagnosticsState | ParsingDeclState |
typedef DelayedDiagnosticsState | ProcessingContextState |
static const unsigned | MaxAlignmentExponent = 32 |
The maximum alignment, same as in llvm::Value. | |
static const uint64_t | MaximumAlignment = 1ull << MaxAlignmentExponent |
bool | CollectStats |
Flag indicating whether or not to collect detailed statistics. | |
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. | |
unsigned | FunctionScopesStart = 0 |
The index of the first FunctionScope that corresponds to the current context. | |
unsigned | CapturingFunctionScopes = 0 |
Track the number of currently active capturing scopes. | |
llvm::BumpPtrAllocator | BumpAlloc |
const TranslationUnitKind | TUKind |
The kind of translation unit we are processing. | |
Scope * | TUScope |
Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in the "ordinary" C decl namespace. | |
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. | |
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. | |
DeclarationName | VAListTagName |
VAListTagName - The declaration name corresponding to __va_list_tag. | |
bool | IsLastErrorImmediate = true |
Is the last error level diagnostic immediate. | |
class clang::Sema::DelayedDiagnostics | DelayedDiagnostics |
SemaDiagnosticBuilder::DeferredDiagnosticsType | DeviceDeferredDiags |
Diagnostics that are emitted only if we discover that the given function must be codegen'ed. | |
DeclContext * | CurContext |
CurContext - This is the current declaration context of parsing. | |
IntrusiveRefCntPtr< ExternalSemaSource > | ExternalSource |
Source of additional semantic information. | |
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. | |
virtual void | anchor () |
This virtual key function only exists to limit the emission of debug info describing the Sema class. | |
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. | |
void | PrintStats () const |
Print out statistics about the semantic analysis. | |
void | runWithSufficientStackSpace (SourceLocation Loc, llvm::function_ref< void()> Fn) |
Run some code with "sufficient" stack space. | |
LangAS | getDefaultCXXMethodAddrSpace () const |
Returns default addr space for method qualifiers. | |
void | LoadExternalWeakUndeclaredIdentifiers () |
Load weak undeclared identifiers from the external source. | |
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". | |
void | getUndefinedButUsed (SmallVectorImpl< std::pair< NamedDecl *, SourceLocation > > &Undefined) |
Obtain a sorted list of functions that are undefined but ODR-used. | |
const llvm::MapVector< FieldDecl *, DeleteLocs > & | getMismatchingDeleteExpressions () const |
Retrieves list of suspicious delete-expressions that will be checked at the end of translation unit. | |
void | EmitDiagnostic (unsigned DiagID, const DiagnosticBuilder &DB) |
Cause the built diagnostic to be emitted on the DiagosticsEngine. | |
void | addImplicitTypedef (StringRef Name, QualType T) |
bool | hasUncompilableErrorOccurred () const |
Whether uncompilable error has occurred. | |
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. | |
SourceLocation | getLocForEndOfToken (SourceLocation Loc, unsigned Offset=0) |
Calls Lexer::getLocForEndOfToken() | |
ModuleLoader & | getModuleLoader () const |
Retrieve the module loader associated with the preprocessor. | |
IdentifierInfo * | InventAbbreviatedTemplateParameterTypeName (const IdentifierInfo *ParamName, unsigned Index) |
Invent a new identifier for parameters of abbreviated templates. | |
void | emitAndClearUnusedLocalTypedefWarnings () |
void | emitDeferredDiags () |
void | ActOnStartOfTranslationUnit () |
This is called before the very first declaration in the translation unit is parsed. | |
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. | |
void | ActOnEndOfTranslationUnitFragment (TUFragmentKind Kind) |
Scope * | getScopeForContext (DeclContext *Ctx) |
Determines the active Scope associated with the given declaration context. | |
void | PushFunctionScope () |
Enter a new function scope. | |
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. | |
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. | |
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. | |
sema::BlockScopeInfo * | getCurBlock () |
Retrieve the current block, if any. | |
sema::CapturingScopeInfo * | getEnclosingLambdaOrBlock () const |
Get the innermost lambda or block enclosing the current location, if any. | |
sema::LambdaScopeInfo * | getCurLambda (bool IgnoreNonLambdaCapturingScope=false) |
Retrieve the current lambda scope info, if any. | |
sema::LambdaScopeInfo * | getCurGenericLambda () |
Retrieve the current generic lambda info, if any. | |
sema::CapturedRegionScopeInfo * | getCurCapturedRegion () |
Retrieve the current captured region, if any. | |
void | ActOnComment (SourceRange Comment) |
Scope * | getCurScope () const |
Retrieve the parser's current scope. | |
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. | |
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. | |
DeclContext * | getFunctionLevelDeclContext (bool AllowLambda=false) const |
If AllowLambda is true, treat lambda as function. | |
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. | |
ObjCMethodDecl * | getCurMethodDecl () |
getCurMethodDecl - If inside of a method body, this returns a pointer to the method decl for the method being parsed. | |
NamedDecl * | getCurFunctionOrMethodDecl () const |
getCurFunctionOrMethodDecl - Return the Decl for the current ObjC method or C function we're in, otherwise return null. | |
void | diagnoseNullableToNonnullConversion (QualType DstType, QualType SrcType, SourceLocation Loc) |
Warn if we're implicitly casting from a _Nullable pointer type to a _Nonnull one. | |
void | diagnoseZeroToNullptrConversion (CastKind Kind, const Expr *E) |
Warn when implicitly casting 0 to nullptr. | |
void | diagnoseFunctionEffectConversion (QualType DstType, QualType SrcType, SourceLocation Loc) |
Warn when implicitly changing function effects. | |
bool | makeUnavailableInSystemHeader (SourceLocation loc, UnavailableAttr::ImplicitReason reason) |
makeUnavailableInSystemHeader - There is an error in the current context. | |
PrintingPolicy | getPrintingPolicy () const |
Retrieve a suitable printing policy for diagnostics. | |
void | ActOnTranslationUnitScope (Scope *S) |
Scope actions. | |
bool | isDeclaratorFunctionLike (Declarator &D) |
Determine whether. | |
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. | |
bool | tryExprAsCall (Expr &E, QualType &ZeroArgCallReturnTy, UnresolvedSetImpl &NonTemplateOverloads) |
Figure out if an expression could be turned into a call. | |
sema::FunctionScopeInfo * | getCurFunction () const |
void | SetLateTemplateParser (LateTemplateParserCB *LTP, LateTemplateParserCleanupCB *LTPCleanup, void *P) |
ParsingDeclState | PushParsingDeclaration (sema::DelayedDiagnosticPool &pool) |
SemaAMDGPU & | AMDGPU () |
SemaARM & | ARM () |
SemaAVR & | AVR () |
SemaBPF & | BPF () |
SemaCodeCompletion & | CodeCompletion () |
SemaCUDA & | CUDA () |
SemaHLSL & | HLSL () |
SemaHexagon & | Hexagon () |
SemaLoongArch & | LoongArch () |
SemaM68k & | M68k () |
SemaMIPS & | MIPS () |
SemaMSP430 & | MSP430 () |
SemaNVPTX & | NVPTX () |
SemaObjC & | ObjC () |
SemaOpenACC & | OpenACC () |
SemaOpenCL & | OpenCL () |
SemaOpenMP & | OpenMP () |
SemaPPC & | PPC () |
SemaPseudoObject & | PseudoObject () |
SemaRISCV & | RISCV () |
SemaSPIRV & | SPIRV () |
SemaSYCL & | SYCL () |
SemaSwift & | Swift () |
SemaSystemZ & | SystemZ () |
SemaWasm & | Wasm () |
SemaX86 & | X86 () |
static CastKind | ScalarTypeToBooleanCastKind (QualType ScalarTy) |
ScalarTypeToBooleanCastKind - Returns the cast kind corresponding to the conversion from scalar type ScalarTy to the Boolean type. | |
static PrintingPolicy | getPrintingPolicy (const ASTContext &Ctx, const Preprocessor &PP) |
Retrieve a suitable printing policy for diagnostics. | |
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. | |
bool | MSStructPragmaOn |
SourceLocation | ImplicitMSInheritanceAttrLoc |
Source location for newly created implicit MSInheritanceAttrs. | |
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. | |
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. | |
SourceLocation | CurInitSegLoc |
llvm::StringMap< std::tuple< StringRef, SourceLocation > > | FunctionToSectionMap |
Sections used with #pragma alloc_text. | |
void * | VisContext |
VisContext - Manages the stack for #pragma GCC visibility. | |
SmallVector< PragmaAttributeGroup, 2 > | PragmaAttributeStack |
const Decl * | PragmaAttributeCurrentTargetDecl |
The declaration that is currently receiving an attribute from the #pragma attribute stack. | |
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. | |
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. | |
llvm::SmallSetVector< StringRef, 4 > | MSFunctionNoBuiltins |
Set of no-builtin functions listed by #pragma function. | |
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". | |
void | AddAlignmentAttributesForRecord (RecordDecl *RD) |
AddAlignmentAttributesForRecord - Adds any needed alignment attributes to a the record decl, to handle '#pragma pack' and '#pragma options align'. | |
void | AddMsStructLayoutForRecord (RecordDecl *RD) |
AddMsStructLayoutForRecord - Adds ms_struct layout attribute to record. | |
void | inferGslPointerAttribute (NamedDecl *ND, CXXRecordDecl *UnderlyingRecord) |
Add gsl::Pointer attribute to std::container::iterator. | |
void | inferGslOwnerPointerAttribute (CXXRecordDecl *Record) |
Add [[gsl::Owner]] and [[gsl::Pointer]] attributes for std:: types. | |
void | inferLifetimeBoundAttribute (FunctionDecl *FD) |
Add [[clang:::lifetimebound]] attr for std:: functions and methods. | |
void | inferLifetimeCaptureByAttribute (FunctionDecl *FD) |
Add [[clang:::lifetime_capture_by(this)]] to STL container methods. | |
void | inferGslPointerAttribute (TypedefNameDecl *TD) |
Add [[gsl::Pointer]] attributes for std:: types. | |
LifetimeCaptureByAttr * | ParseLifetimeCaptureByAttr (const ParsedAttr &AL, StringRef ParamName) |
void | LazyProcessLifetimeCaptureByParams (FunctionDecl *FD) |
void | inferNullableClassAttribute (CXXRecordDecl *CRD) |
Add _Nullable attributes for std:: types. | |
void | ActOnPragmaClangSection (SourceLocation PragmaLoc, PragmaClangSectionAction Action, PragmaClangSectionKind SecKind, StringRef SecName) |
ActOnPragmaClangSection - Called on well formed #pragma clang section. | |
void | ActOnPragmaOptionsAlign (PragmaOptionsAlignKind Kind, SourceLocation PragmaLoc) |
ActOnPragmaOptionsAlign - Called on well formed #pragma options align. | |
void | ActOnPragmaPack (SourceLocation PragmaLoc, PragmaMsStackAction Action, StringRef SlotLabel, Expr *Alignment) |
ActOnPragmaPack - Called on well formed #pragma pack(...). | |
bool | ConstantFoldAttrArgs (const AttributeCommonInfo &CI, MutableArrayRef< Expr * > Args) |
ConstantFoldAttrArgs - Folds attribute arguments into ConstantExprs (unless they are value dependent or type dependent). | |
void | DiagnoseNonDefaultPragmaAlignPack (PragmaAlignPackDiagnoseKind Kind, SourceLocation IncludeLoc) |
void | DiagnoseUnterminatedPragmaAlignPack () |
void | ActOnPragmaMSStruct (PragmaMSStructKind Kind) |
ActOnPragmaMSStruct - Called on well formed #pragma ms_struct [on|off]. | |
void | ActOnPragmaMSComment (SourceLocation CommentLoc, PragmaMSCommentKind Kind, StringRef Arg) |
ActOnPragmaMSComment - Called on well formed #pragma comment(kind, "arg"). | |
void | ActOnPragmaDetectMismatch (SourceLocation Loc, StringRef Name, StringRef Value) |
ActOnPragmaDetectMismatch - Call on well-formed #pragma detect_mismatch. | |
bool | isPreciseFPEnabled () |
Are precise floating point semantics currently enabled? | |
void | ActOnPragmaFPEvalMethod (SourceLocation Loc, LangOptions::FPEvalMethodKind Value) |
void | ActOnPragmaFloatControl (SourceLocation Loc, PragmaMsStackAction Action, PragmaFloatControlKind Value) |
ActOnPragmaFloatControl - Call on well-formed #pragma float_control. | |
void | ActOnPragmaMSPointersToMembers (LangOptions::PragmaMSPointersToMembersKind Kind, SourceLocation PragmaLoc) |
ActOnPragmaMSPointersToMembers - called on well formed #pragma pointers_to_members(representation method[, general purpose
representation]). | |
void | ActOnPragmaMSVtorDisp (PragmaMsStackAction Action, SourceLocation PragmaLoc, MSVtorDispMode Value) |
Called on well formed #pragma vtordisp(). | |
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. | |
void | ActOnPragmaMSSection (SourceLocation PragmaLocation, int SectionFlags, StringLiteral *SegmentName) |
Called on well formed #pragma section(). | |
void | ActOnPragmaMSInitSeg (SourceLocation PragmaLocation, StringLiteral *SegmentName) |
Called on well-formed #pragma init_seg(). | |
void | ActOnPragmaMSAllocText (SourceLocation PragmaLocation, StringRef Section, const SmallVector< std::tuple< IdentifierInfo *, SourceLocation > > &Functions) |
Called on well-formed #pragma alloc_text(). | |
void | ActOnPragmaMSStrictGuardStackCheck (SourceLocation PragmaLocation, PragmaMsStackAction Action, bool Value) |
ActOnPragmaMSStrictGuardStackCheck - Called on well formed #pragma strict_gs_check. | |
void | ActOnPragmaUnused (const Token &Identifier, Scope *curScope, SourceLocation PragmaLoc) |
ActOnPragmaUnused - Called on well-formed '#pragma unused'. | |
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'. | |
void | AddPragmaAttributes (Scope *S, Decl *D) |
Adds the attributes that have been specified using the '#pragma clang attribute push' directives to the given declaration. | |
void | PrintPragmaAttributeInstantiationPoint () |
void | DiagnoseUnterminatedPragmaAttribute () |
void | ActOnPragmaOptimize (bool On, SourceLocation PragmaLoc) |
Called on well formed #pragma clang optimize. | |
void | ActOnPragmaMSOptimize (SourceLocation Loc, bool IsOn) |
#pragma optimize("[optimization-list]", on | off). | |
void | ActOnPragmaMSFunction (SourceLocation Loc, const llvm::SmallVectorImpl< StringRef > &NoBuiltins) |
Call on well formed #pragma function. | |
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. | |
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. | |
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). | |
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. | |
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. | |
void | AddPushedVisibilityAttribute (Decl *RD) |
AddPushedVisibilityAttribute - If '#pragma GCC visibility' was used, add an appropriate visibility attribute. | |
void | FreeVisContext () |
FreeVisContext - Deallocate and null out VisContext. | |
void | ActOnPragmaVisibility (const IdentifierInfo *VisType, SourceLocation PragmaLoc) |
ActOnPragmaVisibility - Called on well formed #pragma GCC visibility... . | |
void | ActOnPragmaFPContract (SourceLocation Loc, LangOptions::FPModeKind FPC) |
ActOnPragmaFPContract - Called on well formed #pragma {STDC,OPENCL} FP_CONTRACT and #pragma clang fp contract. | |
void | ActOnPragmaFPValueChangingOption (SourceLocation Loc, PragmaFPKind Kind, bool IsEnabled) |
Called on well formed #pragma clang fp reassociate or #pragma clang fp reciprocal. | |
void | ActOnPragmaFEnvAccess (SourceLocation Loc, bool IsEnabled) |
ActOnPragmaFenvAccess - Called on well formed #pragma STDC FENV_ACCESS. | |
void | ActOnPragmaCXLimitedRange (SourceLocation Loc, LangOptions::ComplexRangeKind Range) |
ActOnPragmaCXLimitedRange - Called on well formed #pragma STDC CX_LIMITED_RANGE. | |
void | ActOnPragmaFPExceptions (SourceLocation Loc, LangOptions::FPExceptionModeKind) |
Called on well formed '#pragma clang fp' that has option 'exceptions'. | |
void | ActOnPragmaFEnvRound (SourceLocation Loc, llvm::RoundingMode) |
Called to set constant rounding mode for floating point operations. | |
void | setExceptionMode (SourceLocation Loc, LangOptions::FPExceptionModeKind) |
Called to set exception behavior for floating point operations. | |
void | PushNamespaceVisibilityAttr (const VisibilityAttr *Attr, SourceLocation Loc) |
PushNamespaceVisibilityAttr - Note that we've entered a namespace with a visibility attribute. | |
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. | |
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. | |
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_Syslog , 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. | |
bool | isConstantEvaluatedOverride = false |
Used to change context to isConstantEvaluated without pushing a heavy ExpressionEvaluationContextRecord object. | |
bool | isConstantEvaluatedContext () const |
SourceLocation | getLocationOfStringLiteralByte (const StringLiteral *SL, unsigned ByteNo) const |
ExprResult | BuiltinShuffleVector (CallExpr *TheCall) |
BuiltinShuffleVector - Handle __builtin_shufflevector. | |
ExprResult | ConvertVectorExpr (Expr *E, TypeSourceInfo *TInfo, SourceLocation BuiltinLoc, SourceLocation RParenLoc) |
ConvertVectorExpr - Handle __builtin_convertvector. | |
bool | FormatStringHasSArg (const StringLiteral *FExpr) |
void | CheckFloatComparison (SourceLocation Loc, Expr *LHS, Expr *RHS, BinaryOperatorKind Opcode) |
Check for comparisons of floating-point values using == and !=. | |
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. | |
void | DiagnoseMisalignedMembers () |
Diagnoses the current set of gathered accesses. | |
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. | |
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. | |
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. | |
void | DiagnoseAlwaysNonNullPointer (Expr *E, Expr::NullPointerConstantKind NullType, bool IsEqual, SourceRange Range) |
Diagnose pointers that are always non-null. | |
bool | CheckParmsForFunctionDef (ArrayRef< ParmVarDecl * > Parameters, bool CheckParameterNames) |
CheckParmsForFunctionDef - Check that the parameters of the given function are appropriate for the definition of a function. | |
void | CheckCastAlign (Expr *Op, QualType T, SourceRange TRange) |
CheckCastAlign - Implements -Wcast-align, which warns when a pointer cast increases the alignment requirements. | |
bool | checkUnsafeAssigns (SourceLocation Loc, QualType LHS, Expr *RHS) |
checkUnsafeAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained type. | |
void | checkUnsafeExprAssigns (SourceLocation Loc, Expr *LHS, Expr *RHS) |
checkUnsafeExprAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained expression. | |
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. | |
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. | |
void | DiagnoseSelfMove (const Expr *LHSExpr, const Expr *RHSExpr, SourceLocation OpLoc) |
DiagnoseSelfMove - Emits a warning if a value is moved to itself. | |
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. | |
bool | BuiltinVectorMath (CallExpr *TheCall, QualType &Res, bool FPOnly=false) |
bool | BuiltinVectorToScalarMath (CallExpr *TheCall) |
void | checkLifetimeCaptureBy (FunctionDecl *FDecl, bool IsMemberFunction, const Expr *ThisArg, ArrayRef< const Expr * > Args) |
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. | |
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. | |
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. | |
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]. | |
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. | |
bool | BuiltinConstantArgPower2 (CallExpr *TheCall, int ArgNum) |
BuiltinConstantArgPower2 - Check if argument ArgNum of TheCall is a constant expression representing a power of 2. | |
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. | |
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. | |
bool | checkArgCountAtLeast (CallExpr *Call, unsigned MinArgCount) |
Checks that a call expression's argument count is at least the desired number. | |
bool | checkArgCountAtMost (CallExpr *Call, unsigned MaxArgCount) |
Checks that a call expression's argument count is at most the desired number. | |
bool | checkArgCountRange (CallExpr *Call, unsigned MinArgCount, unsigned MaxArgCount) |
Checks that a call expression's argument count is in the desired range. | |
bool | checkArgCount (CallExpr *Call, unsigned DesiredArgCount) |
Checks that a call expression's argument count is the desired number. | |
bool | ValueIsRunOfOnes (CallExpr *TheCall, unsigned ArgNum) |
Returns true if the argument consists of one contiguous run of 1s with any number of 0s on either side. | |
void | CheckImplicitConversion (Expr *E, QualType T, SourceLocation CC, bool *ICContext=nullptr, bool IsListInit=false) |
bool | BuiltinElementwiseTernaryMath (CallExpr *TheCall, bool CheckForFloatArgs=true) |
bool | PrepareBuiltinElementwiseMathOneArgCall (CallExpr *TheCall) |
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. | |
static FormatStringType | GetFormatStringType (const FormatAttr *Format) |
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. | |
llvm::SmallPtrSet< const NamedDecl *, 4 > | TypoCorrectedFunctionDefinitions |
The function definitions which were renamed as part of typo-correction to match their respective declarations. | |
llvm::DenseMap< const EnumDecl *, llvm::APInt > | FlagBitsCache |
A cache of the flags available in enumerations with the flag_bits attribute. | |
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. | |
llvm::DenseMap< IdentifierInfo *, AsmLabelAttr * > | ExtnameUndeclaredIdentifiers |
ExtnameUndeclaredIdentifiers - Identifiers contained in #pragma redefine_extname before declared. | |
llvm::SmallSetVector< const TypedefNameDecl *, 4 > | UnusedLocalTypedefNameCandidates |
Set containing all typedefs that are likely unused. | |
UnusedFileScopedDeclsType | UnusedFileScopedDecls |
The set of file scoped decls seen so far that have not been used and must warn if not used. | |
TentativeDefinitionsType | TentativeDefinitions |
All the tentative definitions encountered in the TU. | |
SmallVector< DeclaratorDecl *, 4 > | ExternalDeclarations |
All the external declarations encoutered and used in the TU. | |
DeclContext * | OriginalLexicalContext |
Generally null except when we temporarily switch decl contexts, like in. | |
llvm::SmallPtrSet< const Decl *, 4 > | ParsingInitForAutoVars |
ParsingInitForAutoVars - a set of declarations with auto types for which we are currently parsing the initializer. | |
void | DiagnoseInvalidJumps (Stmt *Body) |
bool | currentModuleIsHeaderUnit () const |
Is the module scope we are in a C++ Header Unit? | |
Module * | getOwningModule (const Decl *Entity) |
Get the module owning an entity. | |
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. | |
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"). | |
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. | |
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. | |
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. | |
ExprResult | ActOnNameClassifiedAsUndeclaredNonType (IdentifierInfo *Name, SourceLocation NameLoc) |
Act on the result of classifying a name as an undeclared (ADL-only) non-type declaration. | |
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. | |
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. | |
ExprResult | ActOnNameClassifiedAsOverloadSet (Scope *S, Expr *OverloadSet) |
Act on the result of classifying a name as an overload set. | |
TemplateNameKindForDiagnostics | getTemplateNameKindForDiagnostics (TemplateName Name) |
bool | mightBeIntendedToBeTemplateName (ExprResult E, bool &Dependent) |
Determine whether it's plausible that E was intended to be a template-name. | |
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. | |
void | RegisterLocallyScopedExternCDecl (NamedDecl *ND, Scope *S) |
Register the given locally-scoped extern "C" declaration so that it can be found later for redeclarations. | |
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: | |
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. | |
bool | checkPointerAuthEnabled (SourceLocation Loc, SourceRange Range) |
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. | |
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. | |
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. | |
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. | |
void | CheckShadow (NamedDecl *D, NamedDecl *ShadowedDecl, const LookupResult &R) |
Diagnose variable or built-in function shadowing. | |
void | CheckShadow (Scope *S, VarDecl *D) |
Check -Wshadow without the advantage of a previous lookup. | |
void | CheckShadowingDeclModification (Expr *E, SourceLocation Loc) |
Warn if 'E', which is an expression that is about to be modified, refers to a shadowing declaration. | |
void | DiagnoseShadowingLambdaDecls (const sema::LambdaScopeInfo *LSI) |
Diagnose shadowing for variables shadowed in the lambda record LambdaRD when these variables are captured by the lambda. | |
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;'. | |
NamedDecl * | ActOnVariableDeclarator (Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo, LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists, bool &AddToScope, ArrayRef< BindingDecl * > Bindings={}) |
bool | CheckVariableDeclaration (VarDecl *NewVD, LookupResult &Previous) |
Perform semantic checking on a newly-created variable declaration. | |
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. | |
bool | CheckFunctionDeclaration (Scope *S, FunctionDecl *NewFD, LookupResult &Previous, bool IsMemberSpecialization, bool DeclIsDefn) |
Perform semantic checking of a new function declaration. | |
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. | |
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 . | |
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. | |
void | CheckFunctionOrTemplateParamDeclarator (Scope *S, Declarator &D) |
Common checks for a parameter-declaration that should apply to both function parameters and non-type template parameters. | |
Decl * | ActOnParamDeclarator (Scope *S, Declarator &D, SourceLocation ExplicitThisLoc={}) |
ActOnParamDeclarator - Called from Parser::ParseFunctionDeclarator() to introduce parameters into function prototype scope. | |
ParmVarDecl * | BuildParmVarDeclForTypedef (DeclContext *DC, SourceLocation Loc, QualType T) |
Synthesizes a variable for a parameter arising from a typedef. | |
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. | |
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. | |
void | AddInitializerToDecl (Decl *dcl, Expr *init, bool DirectInit) |
AddInitializerToDecl - Adds the initializer Init to the declaration dcl. | |
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. | |
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. | |
void | CheckThreadLocalForLargeAlignment (VarDecl *VD) |
void | FinalizeDeclaration (Decl *D) |
FinalizeDeclaration - called by ParseDeclarationAfterDeclarator to perform any semantic actions necessary after any initializer has been attached. | |
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. | |
void | ActOnDocumentableDecl (Decl *D) |
Should be called on all declarations that might have attached documentation comments. | |
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. | |
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. | |
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. | |
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. | |
void | DiagnoseUnusedParameters (ArrayRef< ParmVarDecl * > Parameters) |
Diagnose any unused parameters in the given sequence of ParmVarDecl pointers. | |
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. | |
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. | |
Decl * | ParsedFreeStandingDeclSpec (Scope *S, AccessSpecifier AS, DeclSpec &DS, const ParsedAttributesView &DeclAttrs, MultiTemplateParamsArg TemplateParams, bool IsExplicitInstantiation, RecordDecl *&AnonRecord, SourceLocation EllipsisLoc={}) |
ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g. | |
Decl * | BuildAnonymousStructOrUnion (Scope *S, DeclSpec &DS, AccessSpecifier AS, RecordDecl *Record, const PrintingPolicy &Policy) |
BuildAnonymousStructOrUnion - Handle the declaration of an anonymous structure or union. | |
void | ActOnDefinedDeclarationSpecifier (Decl *D) |
Called once it is known whether a tag declaration is an anonymous union or struct. | |
void | DiagPlaceholderFieldDeclDefinitions (RecordDecl *Record) |
Emit diagnostic warnings for placeholder members. | |
Decl * | BuildMicrosoftCAnonymousStruct (Scope *S, DeclSpec &DS, RecordDecl *Record) |
BuildMicrosoftCAnonymousStruct - Handle the declaration of an Microsoft C anonymous structure. | |
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. | |
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. | |
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 {'. | |
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. | |
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. | |
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. | |
bool | CheckNontrivialField (FieldDecl *FD) |
void | ActOnLastBitfield (SourceLocation DeclStart, SmallVectorImpl< Decl * > &AllIvarDecls) |
ActOnLastBitfield - This routine handles synthesized bitfields rules for class and class extensions. | |
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). | |
bool | ActOnDuplicateDefinition (Decl *Prev, SkipBodyInfo &SkipBody) |
Perform ODR-like check for C/ObjC when merging tag types from modules. | |
SkippedDefinitionContext | ActOnTagStartSkippedDefinition (Scope *S, Decl *TD) |
Invoked when we enter a tag definition that we're skipping. | |
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. | |
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). | |
void | ActOnTagFinishSkippedDefinition (SkippedDefinitionContext Context) |
void | ActOnTagDefinitionError (Scope *S, Decl *TagDecl) |
ActOnTagDefinitionError - Invoked when there was an unrecoverable error parsing the definition of a tag. | |
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. | |
bool | CheckEnumRedeclaration (SourceLocation EnumLoc, bool IsScoped, QualType EnumUnderlyingTy, bool IsFixed, const EnumDecl *Prev) |
Check whether this is a valid redeclaration of a previous enumeration. | |
SkipBodyInfo | shouldSkipAnonEnumBody (Scope *S, IdentifierInfo *II, SourceLocation IILoc) |
Determine whether the body of an anonymous enumeration should be skipped. | |
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. | |
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. | |
void | ExitDeclaratorContext (Scope *S) |
void | EnterTemplatedContext (Scope *S, DeclContext *DC) |
Enter a template parameter scope, after it's been associated with a particular DeclContext. | |
void | ActOnReenterFunctionContext (Scope *S, Decl *D) |
Push the parameters of D, which must be a function, into scope. | |
void | ActOnExitFunctionContext () |
void | PushOnScopeChains (NamedDecl *D, Scope *S, bool AddToContext=true) |
Add this decl to the scope shadowed decl chains. | |
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. | |
TypedefDecl * | ParseTypedefDecl (Scope *S, Declarator &D, QualType T, TypeSourceInfo *TInfo) |
Subroutines of ActOnDeclarator(). | |
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. | |
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'. | |
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'. | |
bool | MergeCompatibleFunctionDecls (FunctionDecl *New, FunctionDecl *Old, Scope *S, bool MergeTypeWithOld) |
Completes the merge of two function declarations that are known to be compatible. | |
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'. | |
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'. | |
bool | checkVarDeclRedefinition (VarDecl *OldDefn, VarDecl *NewDefn) |
We've just determined that Old and New both appear to be definitions of the same variable. | |
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. | |
bool | CheckRedeclarationModuleOwnership (NamedDecl *New, NamedDecl *Old) |
We've determined that New is a redeclaration of Old . | |
bool | CheckRedeclarationExported (NamedDecl *New, NamedDecl *Old) |
[module.interface]p6: A redeclaration of an entity X is implicitly exported if X was introduced by an exported declaration; otherwise it shall not be exported. | |
bool | CheckRedeclarationInModule (NamedDecl *New, NamedDecl *Old) |
A wrapper function for checking the semantic restrictions of a redeclaration within a module. | |
bool | IsRedefinitionInModule (const NamedDecl *New, const NamedDecl *Old) const |
Check the redefinition in C++20 Modules. | |
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. | |
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). | |
void | DiagnoseUnusedButSetDecl (const VarDecl *VD, DiagReceiverTy DiagReceiver) |
If VD is set but not otherwise used, diagnose, for a parameter or a variable. | |
Scope * | getNonFieldDeclScope (Scope *S) |
getNonFieldDeclScope - Retrieves the innermost scope, starting from S, where a non-field would be declared. | |
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. | |
const AttributedType * | getCallingConvAttributedType (QualType T) const |
Get the outermost AttributedType node that sets a calling convention. | |
DeclarationNameInfo | GetNameForDeclarator (Declarator &D) |
GetNameForDeclarator - Determine the full declaration name for the given Declarator. | |
DeclarationNameInfo | GetNameFromUnqualifiedId (const UnqualifiedId &Name) |
Retrieves the declaration name from a parsed unqualified-id. | |
NamedDecl * | findLocallyScopedExternCDecl (DeclarationName Name) |
Look for a locally scoped extern "C" declaration by the given name. | |
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. | |
bool | CheckForConstantInitializer (Expr *Init, unsigned DiagID=diag::err_init_element_not_constant) |
type checking declaration initializers (C99 6.7.8) | |
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). | |
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. | |
void | AddKnownFunctionAttributes (FunctionDecl *FD) |
Adds any function attributes that we know a priori based on the declaration of this function. | |
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. | |
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. | |
void | ActOnPragmaWeakID (IdentifierInfo *WeakName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc) |
ActOnPragmaWeakID - Called on well formed #pragma weak ident. | |
void | ActOnPragmaRedefineExtname (IdentifierInfo *WeakName, IdentifierInfo *AliasName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc, SourceLocation AliasNameLoc) |
ActOnPragmaRedefineExtname - Called on well formed #pragma redefine_extname oldname newname. | |
void | ActOnPragmaWeakAlias (IdentifierInfo *WeakName, IdentifierInfo *AliasName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc, SourceLocation AliasNameLoc) |
ActOnPragmaWeakAlias - Called on well formed #pragma weak ident = ident. | |
FunctionEmissionStatus | getEmissionStatus (const FunctionDecl *Decl, bool Final=false) |
bool | shouldIgnoreInHostDeviceCheck (FunctionDecl *Callee) |
static Scope * | getScopeForDeclContext (Scope *S, DeclContext *DC) |
Finds the scope corresponding to the given decl context, if it happens to be an enclosing scope. | |
static bool | adjustContextForLocalExternDecl (DeclContext *&DC) |
Adjust the DeclContext for a function or variable that might be a function-local external declaration. | |
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. | |
ExtVectorDeclsType | ExtVectorDecls |
ExtVectorDecls - This is a list all the extended vector types. | |
SourceLocation | getAttrLoc (const ParsedAttr &AL) |
template<typename AttrInfo > | |
bool | checkUInt32Argument (const AttrInfo &AI, const Expr *Expr, uint32_t &Val, unsigned Idx=UINT_MAX, bool StrictlyUnsigned=false) |
If Expr is a valid integer constant, get the value of the integer expression and return success or failure. | |
SmallVectorImpl< Decl * > & | WeakTopLevelDecls () |
WeakTopLevelDeclDecls - access to #pragma weak-generated Decls. | |
bool | checkStringLiteralArgumentAttr (const AttributeCommonInfo &CI, const Expr *E, StringRef &Str, SourceLocation *ArgLocation=nullptr) |
Check if the argument E is a ASCII string literal. | |
bool | checkStringLiteralArgumentAttr (const ParsedAttr &Attr, unsigned ArgNum, StringRef &Str, SourceLocation *ArgLocation=nullptr) |
Check if the argument ArgNum of Attr is a ASCII string literal. | |
bool | isValidPointerAttrType (QualType T, bool RefOkay=false) |
Determine if type T is a valid subject for a nonnull and similar attributes. | |
void | AddAssumeAlignedAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E, Expr *OE) |
AddAssumeAlignedAttr - Adds an assume_aligned attribute to a particular declaration. | |
void | AddAllocAlignAttr (Decl *D, const AttributeCommonInfo &CI, Expr *ParamExpr) |
AddAllocAlignAttr - Adds an alloc_align attribute to a particular declaration. | |
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) |
Used to implement to perform semantic checking on attribute((section("foo"))) specifiers. | |
bool | checkSectionName (SourceLocation LiteralLoc, StringRef Str) |
CodeSegAttr * | mergeCodeSegAttr (Decl *D, const AttributeCommonInfo &CI, StringRef Name) |
bool | checkTargetAttr (SourceLocation LiteralLoc, StringRef Str) |
bool | checkTargetVersionAttr (SourceLocation Loc, Decl *D, StringRef Str) |
Check Target Version attrs. | |
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. | |
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. | |
Attr * | CreateAnnotationAttr (const AttributeCommonInfo &CI, StringRef Annot, MutableArrayRef< Expr * > Args) |
CreateAnnotationAttr - Creates an annotation Annot with Args arguments. | |
Attr * | CreateAnnotationAttr (const ParsedAttr &AL) |
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. | |
AlwaysInlineAttr * | mergeAlwaysInlineAttr (Decl *D, const AttributeCommonInfo &CI, const IdentifierInfo *Ident) |
MinSizeAttr * | mergeMinSizeAttr (Decl *D, const AttributeCommonInfo &CI) |
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 . | |
bool | CheckRegparmAttr (const ParsedAttr &attr, unsigned &value) |
Checks a regparm attribute, returning true if it is ill-formed and otherwise setting numParams to the appropriate value. | |
CUDALaunchBoundsAttr * | CreateLaunchBoundsAttr (const AttributeCommonInfo &CI, Expr *MaxThreads, Expr *MinBlocks, Expr *MaxBlocks) |
Create an CUDALaunchBoundsAttr attribute. | |
void | AddLaunchBoundsAttr (Decl *D, const AttributeCommonInfo &CI, Expr *MaxThreads, Expr *MinBlocks, Expr *MaxBlocks) |
AddLaunchBoundsAttr - Adds a launch_bounds attribute to a particular declaration. | |
UuidAttr * | mergeUuidAttr (Decl *D, const AttributeCommonInfo &CI, StringRef UuidAsWritten, MSGuidDecl *GuidDecl) |
BTFDeclTagAttr * | mergeBTFDeclTagAttr (Decl *D, const BTFDeclTagAttr &AL) |
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) |
Helper for delayed processing TransparentUnion or BPFPreserveAccessIndexAttr attribute. | |
void | ProcessDeclAttributeList (Scope *S, Decl *D, const ParsedAttributesView &AttrList, const ProcessDeclAttributeOptions &Options=ProcessDeclAttributeOptions()) |
ProcessDeclAttributeList - Apply all the decl attributes in the specified attribute list to the specified decl, ignoring any type attributes. | |
bool | ProcessAccessDeclAttributeList (AccessSpecDecl *ASDecl, const ParsedAttributesView &AttrList) |
Annotation attributes are the only attributes allowed after an access specifier. | |
void | checkUnusedDeclAttributes (Declarator &D) |
checkUnusedDeclAttributes - Given a declarator which is not being used to build a declaration, complain about any decl attributes which might be lying around on it. | |
NamedDecl * | DeclClonePragmaWeak (NamedDecl *ND, const IdentifierInfo *II, SourceLocation Loc) |
DeclClonePragmaWeak - clone existing decl (maybe definition), #pragma weak needs a non-definition decl and source may not have one. | |
void | DeclApplyPragmaWeak (Scope *S, NamedDecl *ND, const WeakInfo &W) |
DeclApplyPragmaWeak - A declaration (maybe definition) needs #pragma weak applied to it, possibly with an alias. | |
void | ProcessPragmaWeak (Scope *S, Decl *D) |
void | ProcessDeclAttributes (Scope *S, Decl *D, const Declarator &PD) |
ProcessDeclAttributes - Given a declarator (PD) with attributes indicated in it, apply them to D. | |
void | PopParsingDeclaration (ParsingDeclState state, Decl *decl) |
void | redelayDiagnostics (sema::DelayedDiagnosticPool &pool) |
Given a set of delayed diagnostics, re-emit them as if they had been delayed in the current context instead of in the given pool. | |
template<typename AttrInfo > | |
bool | checkFunctionOrMethodParameterIndex (const Decl *D, const AttrInfo &AI, unsigned AttrArgNum, const Expr *IdxExpr, ParamIdx &Idx, bool CanIndexImplicitThis=false) |
Check if IdxExpr is a valid parameter index for a function or instance method D. | |
template<typename AttrInfo > | |
static std::enable_if_t< std::is_base_of_v< Attr, AttrInfo >, SourceLocation > | getAttrLoc (const AttrInfo &AL) |
A helper function to provide Attribute Location for the Attr types AND the ParsedAttr. | |
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. | |
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. | |
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). | |
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. | |
std::unique_ptr< CXXFieldCollector > | FieldCollector |
FieldCollector - Collects CXXFieldDecls during parsing of C++ classes. | |
NamedDeclSetType | UnusedPrivateFields |
Set containing all declared private fields that are not used. | |
std::unique_ptr< RecordDeclSetTy > | PureVirtualClassDiagSet |
PureVirtualClassDiagSet - a set of class declarations which we have emitted a list of pure virtual functions. | |
DelegatingCtorDeclsType | DelegatingCtorDecls |
All the delegating constructors seen so far in the file, used for cycle detection at the end of the TU. | |
LazyDeclPtr | StdNamespace |
The C++ "std" namespace, where the standard library resides. | |
ClassTemplateDecl * | StdInitializerList |
The C++ "std::initializer_list" template, which is defined in <initializer_list>. | |
llvm::DenseMap< ParmVarDecl *, SourceLocation > | UnparsedDefaultArgLocs |
llvm::MapVector< NamedDecl *, SourceLocation > | UndefinedButUsed |
UndefinedInternals - all the used, undefined objects which require a definition in this translation unit. | |
llvm::SmallPtrSet< SpecialMemberDecl, 4 > | SpecialMembersBeingDeclared |
The C++ special members which we are currently in the process of declaring. | |
void | CheckDelegatingCtorCycles () |
void | ActOnStartFunctionDeclarationDeclarator (Declarator &D, unsigned TemplateParameterDepth) |
Called before parsing a function declarator belonging to a function declaration. | |
void | ActOnFinishFunctionDeclarationDeclarator (Declarator &D) |
Called after parsing a function declarator belonging to a function declaration. | |
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. | |
void | ActOnFinishNamespaceDef (Decl *Dcl, SourceLocation RBrace) |
ActOnFinishNamespaceDef - This callback is called after a namespace is exited. | |
NamespaceDecl * | getStdNamespace () const |
NamespaceDecl * | getOrCreateStdNamespace () |
Retrieve the special "std" namespace, which may require us to implicitly define the namespace. | |
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. | |
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. | |
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. | |
bool | isInitListConstructor (const FunctionDecl *Ctor) |
Determine whether Ctor is an initializer-list constructor, as defined in [dcl.init.list]p2. | |
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. | |
void | HideUsingShadowDecl (Scope *S, UsingShadowDecl *Shadow) |
Hides a using shadow declaration. | |
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. | |
UsingShadowDecl * | BuildUsingShadowDecl (Scope *S, BaseUsingDecl *BUD, NamedDecl *Target, UsingShadowDecl *PrevDecl) |
Builds a shadow declaration corresponding to a 'using' declaration. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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, SourceRange TyLoc, const IdentifierInfo &II, ParsedType Ty, 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. | |
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. | |
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. | |
void | EvaluateImplicitExceptionSpec (SourceLocation Loc, FunctionDecl *FD) |
Evaluate the implicit exception specification for a defaulted special member function. | |
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. | |
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). | |
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. | |
void | DiagnoseDeletedDefaultedFunction (FunctionDecl *FD) |
Produce notes explaining why a defaulted function was defined as deleted. | |
CXXConstructorDecl * | DeclareImplicitDefaultConstructor (CXXRecordDecl *ClassDecl) |
Declare the implicit default constructor for the given class. | |
void | DefineImplicitDefaultConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor) |
DefineImplicitDefaultConstructor - Checks for feasibility of defining this constructor as the default constructor. | |
CXXDestructorDecl * | DeclareImplicitDestructor (CXXRecordDecl *ClassDecl) |
Declare the implicit destructor for the given class. | |
void | DefineImplicitDestructor (SourceLocation CurrentLocation, CXXDestructorDecl *Destructor) |
DefineImplicitDestructor - Checks for feasibility of defining this destructor as the default destructor. | |
void | AdjustDestructorExceptionSpec (CXXDestructorDecl *Destructor) |
Build an exception spec for destructors that don't have one. | |
void | DefineInheritingConstructor (SourceLocation UseLoc, CXXConstructorDecl *Constructor) |
Define the specified inheriting constructor. | |
CXXConstructorDecl * | DeclareImplicitCopyConstructor (CXXRecordDecl *ClassDecl) |
Declare the implicit copy constructor for the given class. | |
void | DefineImplicitCopyConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor) |
DefineImplicitCopyConstructor - Checks for feasibility of defining this constructor as the copy constructor. | |
CXXConstructorDecl * | DeclareImplicitMoveConstructor (CXXRecordDecl *ClassDecl) |
Declare the implicit move constructor for the given class. | |
void | DefineImplicitMoveConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor) |
DefineImplicitMoveConstructor - Checks for feasibility of defining this constructor as the move constructor. | |
CXXMethodDecl * | DeclareImplicitCopyAssignment (CXXRecordDecl *ClassDecl) |
Declare the implicit copy assignment operator for the given class. | |
void | DefineImplicitCopyAssignment (SourceLocation CurrentLocation, CXXMethodDecl *MethodDecl) |
Defines an implicitly-declared copy assignment operator. | |
CXXMethodDecl * | DeclareImplicitMoveAssignment (CXXRecordDecl *ClassDecl) |
Declare the implicit move assignment operator for the given class. | |
void | DefineImplicitMoveAssignment (SourceLocation CurrentLocation, CXXMethodDecl *MethodDecl) |
Defines an implicitly-declared move assignment operator. | |
void | CheckImplicitSpecialMemberDeclaration (Scope *S, FunctionDecl *FD) |
Check a completed declaration of an implicit special member. | |
bool | isImplicitlyDeleted (FunctionDecl *FD) |
Determine whether the given function is an implicitly-deleted special member function. | |
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. | |
bool | checkThisInStaticMemberFunctionExceptionSpec (CXXMethodDecl *Method) |
Whether this' shows up in the exception specification of a static member function. | |
bool | checkThisInStaticMemberFunctionAttributes (CXXMethodDecl *Method) |
Check whether 'this' shows up in the attributes of the given static member function. | |
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. | |
void | ActOnCXXEnterDeclInitializer (Scope *S, Decl *Dcl) |
ActOnCXXEnterDeclInitializer - Invoked when we are about to parse an initializer for the declaration 'Dcl'. | |
void | ActOnCXXExitDeclInitializer (Scope *S, Decl *Dcl) |
ActOnCXXExitDeclInitializer - Invoked after we are finished parsing an initializer for the declaration 'Dcl'. | |
void | DefineImplicitLambdaToFunctionPointerConversion (SourceLocation CurrentLoc, CXXConversionDecl *Conv) |
Define the "body" of the conversion from a lambda object to a function pointer. | |
void | DefineImplicitLambdaToBlockPointerConversion (SourceLocation CurrentLoc, CXXConversionDecl *Conv) |
Define the "body" of the conversion from a lambda object to a block pointer. | |
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 '{'. | |
Decl * | ActOnFinishLinkageSpecification (Scope *S, Decl *LinkageSpec, SourceLocation RBraceLoc) |
ActOnFinishLinkageSpecification - Complete the definition of the C++ linkage specification LinkageSpec. | |
CXXRecordDecl * | getCurrentClass (Scope *S, const CXXScopeSpec *SS) |
Get the class that is directly named by the current context. | |
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. | |
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. | |
bool | ActOnAccessSpecifier (AccessSpecifier Access, SourceLocation ASLoc, SourceLocation ColonLoc, const ParsedAttributesView &Attrs) |
ActOnAccessSpecifier - Parsed an access specifier followed by a colon. | |
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. | |
void | ActOnStartCXXInClassMemberInitializer () |
Enter a new C++ default initializer scope. | |
void | ActOnFinishCXXInClassMemberInitializer (Decl *VarDecl, SourceLocation EqualLoc, ExprResult 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. | |
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. | |
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. | |
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. | |
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={}) |
void | MarkBaseAndMemberDestructorsReferenced (SourceLocation Loc, CXXRecordDecl *Record) |
MarkBaseAndMemberDestructorsReferenced - Given a record decl, mark all the non-trivial destructors of its members and bases as referenced. | |
void | MarkVirtualBaseDestructorsReferenced (SourceLocation Location, CXXRecordDecl *ClassDecl, llvm::SmallPtrSetImpl< const RecordType * > *DirectVirtualBases=nullptr) |
Mark destructors of virtual bases of this class referenced. | |
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. | |
void | LoadExternalVTableUses () |
Load any externally-stored vtable uses. | |
void | MarkVTableUsed (SourceLocation Loc, CXXRecordDecl *Class, bool DefinitionRequired=false) |
Note that the vtable for the given class was used at the given location. | |
void | MarkVirtualMemberExceptionSpecsNeeded (SourceLocation Loc, const CXXRecordDecl *RD) |
Mark the exception specifications of all virtual member functions in the given class as needed. | |
void | MarkVirtualMembersReferenced (SourceLocation Loc, const CXXRecordDecl *RD, bool ConstexprOnly=false) |
MarkVirtualMembersReferenced - Will mark all members of the given CXXRecordDecl referenced. | |
bool | DefineUsedVTables () |
Define all of the vtables that have been used in this translation unit and reference any virtual members used by those vtables. | |
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). | |
void | ActOnMemInitializers (Decl *ConstructorDecl, SourceLocation ColonLoc, ArrayRef< CXXCtorInitializer * > MemInits, bool AnyErrors) |
ActOnMemInitializers - Handle the member initializers for a constructor. | |
void | checkClassLevelDLLAttribute (CXXRecordDecl *Class) |
Check class-level dllimport/dllexport attribute. | |
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. | |
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. | |
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. | |
void | checkIncorrectVTablePointerAuthenticationAttribute (CXXRecordDecl &RD) |
Check that VTable Pointer authentication is only being set on the first first instantiation of the vtable. | |
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. | |
void | ActOnFinishCXXNonNestedClass () |
void | ActOnReenterCXXMethodParameter (Scope *S, ParmVarDecl *Param) |
This is used to implement the constant expression evaluation part of the attribute enable_if extension. | |
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. | |
void | ActOnDelayedCXXMethodParameter (Scope *S, Decl *Param) |
ActOnDelayedCXXMethodParameter - We've already started a delayed C++ method declaration. | |
void | ActOnFinishDelayedMemberDeclarations (Scope *S, Decl *Record) |
void | ActOnFinishDelayedCXXMethodDeclaration (Scope *S, Decl *Method) |
ActOnFinishDelayedCXXMethodDeclaration - We have finished processing the delayed method declaration for Method. | |
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. | |
Decl * | ActOnFriendTypeDecl (Scope *S, const DeclSpec &DS, MultiTemplateParamsArg TemplateParams, SourceLocation EllipsisLoc) |
Handle a friend type declaration. | |
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 . | |
void | CheckConstructor (CXXConstructorDecl *Constructor) |
CheckConstructor - Checks a fully-formed constructor for well-formedness, issuing any diagnostics required. | |
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 . | |
bool | CheckDestructor (CXXDestructorDecl *Destructor) |
CheckDestructor - Checks a fully-formed destructor definition for well-formedness, issuing any diagnostics required. | |
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 . | |
Decl * | ActOnConversionDeclarator (CXXConversionDecl *Conversion) |
ActOnConversionDeclarator - Called by ActOnDeclarator to complete the declaration of the given C++ conversion function. | |
bool | CheckDeductionGuideDeclarator (Declarator &D, QualType &R, StorageClass &SC) |
Check the validity of a declarator that we parsed for a deduction-guide. | |
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) |
Check the validity of a C++ base class specifier. | |
BaseResult | ActOnBaseSpecifier (Decl *classdecl, SourceRange SpecifierRange, const ParsedAttributesView &Attrs, bool Virtual, AccessSpecifier Access, ParsedType basetype, SourceLocation BaseLoc, SourceLocation EllipsisLoc) |
ActOnBaseSpecifier - Parsed a base specifier. | |
bool | AttachBaseSpecifiers (CXXRecordDecl *Class, MutableArrayRef< CXXBaseSpecifier * > Bases) |
Performs the actual work of attaching the given base class specifiers to a C++ class. | |
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. | |
bool | IsDerivedFrom (SourceLocation Loc, QualType Derived, QualType Base) |
Determine whether the type Derived is a C++ class that is derived from the type Base . | |
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 . | |
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). | |
std::string | getAmbiguousPathsDisplayString (CXXBasePaths &Paths) |
Builds a string representing ambiguous paths from a specific derived class to different subobjects of the same base class. | |
bool | CheckOverridingFunctionAttributes (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. | |
bool | CheckExplicitObjectOverride (CXXMethodDecl *New, const CXXMethodDecl *Old) |
bool | CheckPureMethod (CXXMethodDecl *Method, SourceRange InitRange) |
Mark the given method pure. | |
void | CheckOverrideControl (NamedDecl *D) |
CheckOverrideControl - Check C++11 override control semantics. | |
void | DiagnoseAbsenceOfOverrideControl (NamedDecl *D, bool Inconsistent) |
DiagnoseAbsenceOfOverrideControl - Diagnose if 'override' keyword was not used in the declaration of an overriding method. | |
bool | CheckIfOverriddenFunctionIsMarkedFinal (const CXXMethodDecl *New, const CXXMethodDecl *Old) |
CheckIfOverriddenFunctionIsMarkedFinal - Checks whether a virtual member function overrides a virtual member function marked 'final', according to C++11 [class.virtual]p4. | |
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. | |
bool | CheckLiteralOperatorDeclaration (FunctionDecl *FnDecl) |
CheckLiteralOperatorDeclaration - Check whether the declaration of this literal operator function is well-formed. | |
ExplicitSpecifier | ActOnExplicitBoolSpecifier (Expr *E) |
ActOnExplicitBoolSpecifier - Build an ExplicitSpecifier from an expression found in an explicit(bool) specifier. | |
bool | tryResolveExplicitSpecifier (ExplicitSpecifier &ExplicitSpec) |
tryResolveExplicitSpecifier - Attempt to resolve the explict specifier. | |
DeclResult | ActOnCXXConditionDeclaration (Scope *S, Declarator &D) |
ActOnCXXConditionDeclarationExpr - Parsed a condition declaration of a C++ if/switch/while/for statement. | |
void | MergeVarDeclExceptionSpecs (VarDecl *New, VarDecl *Old) |
Merge the exception specifications of two variable declarations. | |
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. | |
void | CheckCXXDefaultArguments (FunctionDecl *FD) |
Helpers for dealing with blocks and functions. | |
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. | |
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. | |
Decl * | ActOnExceptionDeclarator (Scope *S, Declarator &D) |
ActOnExceptionDeclarator - Parsed the exception-declarator in a C++ catch handler. | |
void | DiagnoseReturnInConstructorExceptionHandler (CXXTryStmt *TryBlock) |
DeclResult | ActOnTemplatedFriendTag (Scope *S, SourceLocation FriendLoc, unsigned TagSpec, SourceLocation TagLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, SourceLocation EllipsisLoc, const ParsedAttributesView &Attr, MultiTemplateParamsArg TempParamLists) |
Handle a friend tag declaration where the scope specifier was templated. | |
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. | |
void | DiagnoseNontrivial (const CXXRecordDecl *Record, CXXSpecialMemberKind CSM) |
Diagnose why the specified class does not have a trivial special member of the given kind. | |
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. | |
DefaultedFunctionKind | getDefaultedFunctionKind (const FunctionDecl *FD) |
Determine the kind of defaulting that would be done for a given function. | |
Decl * | ActOnEmptyDeclaration (Scope *S, const ParsedAttributesView &AttrList, SourceLocation SemiLoc) |
Handle a C++11 empty-declaration and attribute-declaration. | |
bool | CheckConstexprFunctionDefinition (const FunctionDecl *FD, CheckConstexprKind Kind) |
void | DiagnoseHiddenVirtualMethods (CXXMethodDecl *MD) |
Diagnose methods which overload virtual methods in a base class without overriding any. | |
void | FindHiddenVirtualMethods (CXXMethodDecl *MD, SmallVectorImpl< CXXMethodDecl * > &OverloadedMethods) |
Check if a method overloads virtual methods in a base class without overriding any. | |
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. | |
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. | |
void | ActOnParamDefaultArgumentError (Decl *param, SourceLocation EqualLoc, Expr *DefaultArg) |
ActOnParamDefaultArgumentError - Parsing or semantic analysis of the default argument for the parameter param failed. | |
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 | 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. | |
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. | |
CleanupInfo | Cleanup |
Used to control the generation of ExprWithCleanups. | |
SmallVector< ExprWithCleanups::CleanupObject, 8 > | ExprCleanupObjects |
ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current full expression. | |
bool | RebuildingImmediateInvocation = false |
Whether the AST is currently being rebuilt to correct immediate invocations. | |
RecordDecl * | StdSourceLocationImplDecl |
The C++ "std::source_location::__impl" struct, defined in <source_location>. | |
SmallVector< ExpressionEvaluationContextRecord, 8 > | ExprEvalContexts |
A stack of expression evaluation contexts. | |
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. | |
std::vector< std::pair< QualType, unsigned > > | ExcessPrecisionNotSatisfied |
SourceLocation | LocationOfExcessPrecisionNotSatisfied |
const ExpressionEvaluationContextRecord & | currentEvaluationContext () const |
ExpressionEvaluationContextRecord & | currentEvaluationContext () |
ExpressionEvaluationContextRecord & | parentEvaluationContext () |
const ExpressionEvaluationContextRecord & | parentEvaluationContext () const |
bool | isAttrContext () const |
bool | CanUseDecl (NamedDecl *D, bool TreatUnavailableAsInvalid) |
Determine whether the use of this declaration is valid, without emitting diagnostics. | |
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. | |
void | NoteDeletedFunction (FunctionDecl *FD) |
Emit a note explaining that this function is deleted. | |
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. | |
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. | |
ExprResult | ActOnConstantExpression (ExprResult Res) |
void | MarkAnyDeclReferenced (SourceLocation Loc, Decl *D, bool MightBeOdrUse) |
Perform marking for a reference to an arbitrary declaration. | |
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) | |
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). | |
void | MarkDeclRefReferenced (DeclRefExpr *E, const Expr *Base=nullptr) |
Perform reference-marking and odr-use handling for a DeclRefExpr. | |
void | MarkMemberReferenced (MemberExpr *E) |
Perform reference-marking and odr-use handling for a MemberExpr. | |
void | MarkFunctionParmPackReferenced (FunctionParmPackExpr *E) |
Perform reference-marking and odr-use handling for a FunctionParmPackExpr. | |
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. | |
bool | tryCaptureVariable (ValueDecl *Var, SourceLocation Loc, TryCaptureKind Kind=TryCapture_Implicit, SourceLocation EllipsisLoc=SourceLocation()) |
Try to capture the given variable. | |
bool | NeedToCaptureVariable (ValueDecl *Var, SourceLocation Loc) |
Checks if the variable must be captured. | |
QualType | getCapturedDeclRefType (ValueDecl *Var, SourceLocation Loc) |
Given a variable, determine the type that a reference to that variable will have in the given scope. | |
void | MarkDeclarationsReferencedInType (SourceLocation Loc, QualType T) |
Mark all of the declarations referenced within a particular AST node as referenced. | |
void | MarkDeclarationsReferencedInExpr (Expr *E, bool SkipLocalVariables=false, ArrayRef< const Expr * > StopAt={}) |
Mark any declarations that appear within this expression or any potentially-evaluated subexpressions as "referenced". | |
ExprResult | tryConvertExprToType (Expr *E, QualType Ty) |
Try to convert an expression E to type Ty . | |
bool | DiagIfReachable (SourceLocation Loc, ArrayRef< const Stmt * > Stmts, const PartialDiagnostic &PD) |
Conditionally issue a diagnostic based on the statements's reachability analysis. | |
bool | DiagRuntimeBehavior (SourceLocation Loc, const Stmt *Statement, const PartialDiagnostic &PD) |
Conditionally issue a diagnostic based on the current evaluation context. | |
bool | DiagRuntimeBehavior (SourceLocation Loc, ArrayRef< const Stmt * > Stmts, const PartialDiagnostic &PD) |
Similar, but diagnostic is only produced if all the specified statements are reachable. | |
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. | |
bool | DiagnoseDependentMemberLookup (const LookupResult &R) |
Diagnose a lookup that found results in an enclosing class during error recovery. | |
bool | DiagnoseEmptyLookup (Scope *S, CXXScopeSpec &SS, LookupResult &R, CorrectionCandidateCallback &CCC, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr, ArrayRef< Expr * > Args={}, DeclContext *LookupCtx=nullptr, TypoExpr **Out=nullptr) |
Diagnose an empty lookup. | |
NonOdrUseReason | getNonOdrUseReasonInCurrentContext (ValueDecl *D) |
If D cannot be odr-used in the current expression evaluation context, return a reason explaining why. | |
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. | |
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. | |
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. | |
std::vector< Token > | ExpandFunctionLocalPredefinedMacros (ArrayRef< Token > Toks) |
ExprResult | BuildPredefinedExpr (SourceLocation Loc, PredefinedIdentKind IK) |
ExprResult | ActOnPredefinedExpr (SourceLocation Loc, tok::TokenKind Kind) |
ExprResult | ActOnIntegerConstant (SourceLocation Loc, int64_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. | |
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 *. | |
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 *. | |
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) |
Unary Operators. 'Tok' is the token for the operator. | |
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. | |
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. | |
bool | ActOnAlignasTypeArgument (StringRef KWName, ParsedType Ty, SourceLocation OpLoc, SourceRange R) |
ActOnAlignasTypeArgument - Handle alignas (type-id) and _Alignas (type-name) . | |
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. | |
ExprResult | CreateUnaryExprOrTypeTraitExpr (Expr *E, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind) |
Build a sizeof or alignof expression given an expression operand. | |
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. | |
ExprResult | CheckPlaceholderExpr (Expr *E) |
Check for operands with placeholder types and complain if found. | |
bool | CheckVecStepExpr (Expr *E) |
bool | CheckUnaryExprOrTypeTraitOperand (Expr *E, UnaryExprOrTypeTrait ExprKind) |
Check the constraints on expression operands to unary type expression and type traits. | |
bool | CheckUnaryExprOrTypeTraitOperand (QualType ExprType, SourceLocation OpLoc, SourceRange ExprRange, UnaryExprOrTypeTrait ExprKind, StringRef KWName) |
Check the constraints on operands to unary expression and type traits. | |
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. | |
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. | |
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. | |
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. | |
Expr * | BuildBuiltinCallExpr (SourceLocation Loc, Builtin::ID Id, MultiExprArg CallArgs) |
BuildBuiltinCallExpr - Create a call to a builtin function specified by Id. | |
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. | |
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. | |
ExprResult | BuildVectorLiteral (SourceLocation LParenLoc, SourceLocation RParenLoc, Expr *E, TypeSourceInfo *TInfo) |
Build an altivec or OpenCL literal. | |
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. | |
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) |
Binary Operators. 'Tok' is the token for the operator. | |
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 . | |
void | LookupBinOp (Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opc, UnresolvedSetImpl &Functions) |
void | DiagnoseCommaOperator (const Expr *LHS, SourceLocation Loc) |
Look for instances where it is likely the comma operator is confused with another operator. | |
ExprResult | ActOnConditionalOp (SourceLocation QuestionLoc, SourceLocation ColonLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr) |
ActOnConditionalOp - Parse a ?: operation. | |
ExprResult | ActOnAddrLabel (SourceLocation OpLoc, SourceLocation LabLoc, LabelDecl *TheDecl) |
ActOnAddrLabel - Parse the GNU address of label extension: "&&foo". | |
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) | |
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 | ActOnEmbedExpr (SourceLocation EmbedKeywordLoc, StringLiteral *BinaryData) |
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. | |
void | ActOnBlockArguments (SourceLocation CaretLoc, Declarator &ParamInfo, Scope *CurScope) |
ActOnBlockArguments - This callback allows processing of block arguments. | |
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. | |
ExprResult | ActOnBlockStmtExpr (SourceLocation CaretLoc, Stmt *Body, Scope *CurScope) |
ActOnBlockStmtExpr - This is called when the body of a block statement literal was successfully completed. | |
ExprResult | ActOnConvertVectorExpr (Expr *E, ParsedType ParsedDestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc) |
ActOnConvertVectorExpr - create a new convert-vector expression from the provided arguments. | |
ExprResult | ActOnAsTypeExpr (Expr *E, ParsedType ParsedDestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc) |
Parse a __builtin_astype expression. | |
ExprResult | BuildAsTypeExpr (Expr *E, QualType DestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc) |
Create a new AsTypeExpr node (bitcast) from the arguments. | |
ExprResult | CreateRecoveryExpr (SourceLocation Begin, SourceLocation End, ArrayRef< Expr * > SubExprs, QualType T=QualType()) |
Attempts to produce a RecoveryExpr after some AST node cannot be created. | |
ExprResult | PerformObjectMemberConversion (Expr *From, NestedNameSpecifier *Qualifier, NamedDecl *FoundDecl, NamedDecl *Member) |
Cast a base object to a member's actual type. | |
bool | CheckCallReturnType (QualType ReturnType, SourceLocation Loc, CallExpr *CE, FunctionDecl *FD) |
CheckCallReturnType - Checks that a call expression's return type is complete. | |
void | WarnOnPendingNoDerefs (ExpressionEvaluationContextRecord &Rec) |
Emit a warning for all pending noderef expressions that we recorded. | |
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. | |
ExprResult | BuildCXXDefaultArgExpr (SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param, Expr *Init=nullptr) |
BuildCXXDefaultArgExpr - Creates a CXXDefaultArgExpr, instantiating the default expr if needed. | |
ExprResult | CheckForImmediateInvocation (ExprResult E, FunctionDecl *Decl) |
Wrap the expression in a ConstantExpr if it is a potential immediate invocation. | |
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. | |
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. | |
void | DiagnoseEqualityWithExtraParens (ParenExpr *ParenE) |
Redundant parentheses over an equality comparison can indicate that the user intended an assignment used as condition. | |
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. | |
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. | |
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. | |
QualType | CheckVectorOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign, bool AllowBothBool, bool AllowBoolConversion, bool AllowBoolOperation, bool ReportInvalid) |
type checking for vector binary operators. | |
QualType | GetSignedVectorType (QualType V) |
Return a signed ext_vector_type that is of identical size and number of elements. | |
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. | |
QualType | CheckSizelessVectorCompareOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) |
QualType | CheckVectorLogicalOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) |
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. | |
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. | |
bool | areMatrixTypesOfTheSameDimension (QualType srcTy, QualType destTy) |
Are the two types matrix types and do they have the same dimensions i.e. | |
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? | |
bool | isLaxVectorConversion (QualType srcType, QualType destType) |
Is this a legal conversion between two types, one of which is known to be a vector type? | |
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. | |
ExprResult | forceUnknownAnyToType (Expr *E, QualType ToType) |
Force an expression with unknown-type to an expression of the given type. | |
ExprResult | checkUnknownAnyArg (SourceLocation callLoc, Expr *result, QualType ¶mType) |
Type-check an expression that's being passed to an __unknown_anytype parameter. | |
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. | |
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). | |
ExprResult | CallExprUnaryConversions (Expr *E) |
CallExprUnaryConversions - a special case of an unary conversion performed on a function designator of a call expression. | |
ExprResult | DefaultFunctionArrayConversion (Expr *E, bool Diagnose=true) |
DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4). | |
ExprResult | DefaultFunctionArrayLvalueConversion (Expr *E, bool Diagnose=true) |
ExprResult | DefaultLvalueConversion (Expr *E) |
ExprResult | DefaultArgumentPromotion (Expr *E) |
DefaultArgumentPromotion (C99 6.5.2.2p6). | |
VariadicCallType | getVariadicCallType (FunctionDecl *FDecl, const FunctionProtoType *Proto, Expr *Fn) |
VarArgKind | isValidVarArgType (const QualType &Ty) |
Determine the degree of POD-ness for an expression. | |
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. | |
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. | |
ExprResult | DefaultVariadicArgumentPromotion (Expr *E, VariadicCallType CT, FunctionDecl *FDecl) |
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). | |
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. | |
AssignConvertType | CheckAssignmentConstraints (SourceLocation Loc, QualType LHSType, QualType RHSType) |
CheckAssignmentConstraints - Perform type checking for assignment, argument passing, variable initialization, and function return values. | |
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. | |
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. | |
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). | |
QualType | InvalidLogicalVectorOperands (SourceLocation Loc, ExprResult &LHS, ExprResult &RHS) |
Diagnose cases where a scalar was implicitly converted to a vector and diagnose the underlying types. | |
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. | |
bool | isImmediateFunctionContext () const |
bool | isInLifetimeExtendingContext () const |
bool | needsRebuildOfDefaultArgOrInit () const |
bool | isCheckingDefaultArgumentOrInitializer () const |
std::optional< ExpressionEvaluationContextRecord::InitializationContext > | InnermostDeclarationWithDelayedImmediateInvocations () const |
std::optional< ExpressionEvaluationContextRecord::InitializationContext > | OutermostDeclarationWithDelayedImmediateInvocations () const |
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. | |
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. | |
void | maybeExtendBlockObject (ExprResult &E) |
Do an explicit extend of the given block pointer if we're in ARC. | |
void | DiagnosePrecisionLossInComplexDivision () |
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. | |
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. | |
LazyDeclPtr | StdAlignValT |
The C++ "std::align_val_t" enum class, which is defined by the C++ standard library. | |
RecordDecl * | CXXTypeInfoDecl |
The C++ "type_info" declaration, which is defined in <typeinfo>. | |
bool | GlobalNewDeleteDeclared |
A flag to remember whether the implicit forms of operator new and delete have been declared. | |
llvm::MapVector< FieldDecl *, DeleteLocs > | DeleteExprs |
Delete-expressions to be analyzed at the end of translation unit. | |
QualType | CXXThisTypeOverride |
When non-NULL, the C++ 'this' expression is allowed despite the current context not being a non-static member function. | |
ParsedType | getInheritingConstructorName (CXXScopeSpec &SS, SourceLocation NameLoc, const IdentifierInfo &Name) |
Handle the result of the special case name lookup for inheriting constructor declarations. | |
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. | |
ExprResult | BuildCXXTypeId (QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc) |
Build a C++ typeid expression with an expression operand. | |
ExprResult | ActOnCXXTypeid (SourceLocation OpLoc, SourceLocation LParenLoc, bool isType, void *TyOrExpr, SourceLocation RParenLoc) |
ActOnCXXTypeid - Parse typeid( something ). | |
ExprResult | BuildCXXUuidof (QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc) |
Build a Microsoft __uuidof expression with a type operand. | |
ExprResult | BuildCXXUuidof (QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc) |
Build a Microsoft __uuidof expression with an expression operand. | |
ExprResult | ActOnCXXUuidof (SourceLocation OpLoc, SourceLocation LParenLoc, bool isType, void *TyOrExpr, SourceLocation RParenLoc) |
ActOnCXXUuidof - Parse __uuidof( something ). | |
ExprResult | ActOnCXXThis (SourceLocation Loc) |
bool | CheckCXXThisType (SourceLocation Loc, QualType Type) |
Check whether the type of 'this' is valid in the current context. | |
Expr * | BuildCXXThisExpr (SourceLocation Loc, QualType Type, bool IsImplicit) |
Build a CXXThisExpr and mark it referenced in the current context. | |
void | MarkThisReferenced (CXXThisExpr *This) |
QualType | getCurrentThisType () |
Try to retrieve the type of the 'this' pointer. | |
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. | |
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. | |
ExprResult | ActOnCXXBoolLiteral (SourceLocation OpLoc, tok::TokenKind Kind) |
ActOnCXXBoolLiteral - Parse {true,false} literals. | |
ExprResult | ActOnCXXNullPtrLiteral (SourceLocation Loc) |
ActOnCXXNullPtrLiteral - Parse 'nullptr'. | |
ExprResult | ActOnCXXThrow (Scope *S, SourceLocation OpLoc, Expr *expr) |
ExprResult | BuildCXXThrow (SourceLocation OpLoc, Expr *Ex, bool IsThrownVarInScope) |
bool | CheckCXXThrowOperand (SourceLocation ThrowLoc, QualType ThrowTy, Expr *E) |
CheckCXXThrowOperand - Validate the operand of a throw. | |
ExprResult | ActOnCXXTypeConstructExpr (ParsedType TypeRep, SourceLocation LParenOrBraceLoc, MultiExprArg Exprs, SourceLocation RParenOrBraceLoc, bool ListInitialization) |
ActOnCXXTypeConstructExpr - Parse construction of a specified type. | |
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) |
Parsed a C++ 'new' expression (C++ 5.3.4). | |
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. | |
void | diagnoseUnavailableAlignedAllocation (const FunctionDecl &FD, SourceLocation Loc) |
Produce diagnostics if FD is an aligned allocation or deallocation function that is unavailable. | |
bool | CheckAllocatedType (QualType AllocType, SourceLocation Loc, SourceRange R) |
Checks that a type is suitable as the allocated type in a new-expression. | |
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. | |
void | DeclareGlobalNewDelete () |
DeclareGlobalNewDelete - Declare the global forms of operator new and delete. | |
void | DeclareGlobalAllocationFunction (DeclarationName Name, QualType Return, ArrayRef< QualType > Params) |
DeclareGlobalAllocationFunction - Declares a single implicit global allocation function if it doesn't already exist. | |
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 (C++ 5.3.5), as in: | |
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. | |
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. | |
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. | |
ExprResult | CheckCXXBooleanCondition (Expr *CondExpr, bool IsConstexpr=false) |
CheckCXXBooleanCondition - Returns true if conversion to bool is invalid. | |
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). | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
QualType | FindCompositePointerType (SourceLocation Loc, Expr *&E1, Expr *&E2, bool ConvertArgs=true) |
Find a merged pointer type and convert the two expressions to it. | |
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. | |
ExprResult | IgnoredValueConversions (Expr *E) |
IgnoredValueConversions - Given that an expression's result is syntactically ignored, perform any conversions that are required. | |
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. | |
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. | |
unsigned | TyposCorrected |
The number of typos corrected by CorrectTypo. | |
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. | |
llvm::FoldingSet< SpecialMemberOverloadResultEntry > | SpecialMemberCache |
A cache of special member function overload resolution results for C++ records. | |
llvm::SmallVector< TypoExpr *, 2 > | TypoExprs |
Holds TypoExprs that are created from createDelayedTypo . | |
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. | |
bool | LookupBuiltin (LookupResult &R) |
Lookup a builtin function, when name lookup would otherwise fail. | |
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. | |
bool | LookupQualifiedName (LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false) |
Perform qualified name lookup into a given context. | |
bool | LookupQualifiedName (LookupResult &R, DeclContext *LookupCtx, CXXScopeSpec &SS) |
Performs qualified name lookup or special type of lookup for "__super::" scope specifier. | |
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. | |
bool | LookupInSuper (LookupResult &R, CXXRecordDecl *Class) |
Perform qualified name lookup into all base classes of the given class. | |
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. | |
DeclContextLookupResult | LookupConstructors (CXXRecordDecl *Class) |
Look up the constructors for the given class. | |
CXXConstructorDecl * | LookupDefaultConstructor (CXXRecordDecl *Class) |
Look up the default constructor for the given class. | |
CXXConstructorDecl * | LookupCopyingConstructor (CXXRecordDecl *Class, unsigned Quals) |
Look up the copying constructor for the given class. | |
CXXMethodDecl * | LookupCopyingAssignment (CXXRecordDecl *Class, unsigned Quals, bool RValueThis, unsigned ThisQuals) |
Look up the copying assignment operator for the given class. | |
CXXConstructorDecl * | LookupMovingConstructor (CXXRecordDecl *Class, unsigned Quals) |
Look up the moving constructor for the given class. | |
CXXMethodDecl * | LookupMovingAssignment (CXXRecordDecl *Class, unsigned Quals, bool RValueThis, unsigned ThisQuals) |
Look up the moving assignment operator for the given class. | |
CXXDestructorDecl * | LookupDestructor (CXXRecordDecl *Class) |
Look for the destructor of the given class. | |
void | ForceDeclarationOfImplicitMembers (CXXRecordDecl *Class) |
Force the declaration of any implicitly-declared members of this class. | |
void | makeMergedDefinitionVisible (NamedDecl *ND) |
Make a merged definition of an existing hidden definition ND visible at the specified location. | |
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. | |
llvm::DenseSet< Module * > & | getLookupModules () |
Get the set of additional modules that should be checked during name lookup. | |
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. | |
bool | hasReachableDefaultArgument (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr) |
Determine if the template parameter D has a reachable default argument. | |
bool | hasAcceptableDefaultArgument (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules, Sema::AcceptableKind Kind) |
Determine if the template parameter D has a reachable default argument. | |
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. | |
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. | |
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). | |
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). | |
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. | |
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. | |
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. | |
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. | |
void | DiagnoseAmbiguousLookup (LookupResult &Result) |
Produce a diagnostic describing the ambiguity that resulted from name lookup. | |
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]. | |
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. | |
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. | |
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. | |
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. | |
void | ActOnPragmaDump (Scope *S, SourceLocation Loc, IdentifierInfo *II) |
Called on #pragma clang __debug dump II. | |
void | ActOnPragmaDump (Expr *E) |
Called on #pragma clang __debug dump E. | |
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. | |
bool | currentModuleIsImplementation () const |
Is the module scope we are an implementation unit? | |
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. | |
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. | |
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. | |
DeclResult | ActOnModuleImport (SourceLocation StartLoc, SourceLocation ExportLoc, SourceLocation ImportLoc, ModuleIdPath Path, bool IsPartition=false) |
The parser has processed a module import declaration. | |
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. | |
void | BuildModuleInclude (SourceLocation DirectiveLoc, Module *Mod) |
void | ActOnAnnotModuleBegin (SourceLocation DirectiveLoc, Module *Mod) |
The parsed has entered a submodule. | |
void | ActOnAnnotModuleEnd (SourceLocation DirectiveLoc, Module *Mod) |
The parser has left a submodule. | |
void | createImplicitModuleImportForErrorRecovery (SourceLocation Loc, Module *Mod) |
Create an implicit import of the given module at the given source location, for error recovery, if possible. | |
Decl * | ActOnStartExportDecl (Scope *S, SourceLocation ExportLoc, SourceLocation LBraceLoc) |
We have parsed the start of an export declaration, including the '{' (if present). | |
Decl * | ActOnFinishExportDecl (Scope *S, Decl *ExportDecl, SourceLocation RBraceLoc) |
Complete the definition of an export declaration. | |
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. | |
bool | IsBuildingRecoveryCallExpr |
Flag indicating if Sema is building a recovery call expression. | |
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. | |
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. | |
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). | |
bool | IsFloatingPointPromotion (QualType FromType, QualType ToType) |
IsFloatingPointPromotion - Determines whether the conversion from FromType to ToType is a floating point promotion (C++ 4.6). | |
bool | IsComplexPromotion (QualType FromType, QualType ToType) |
Determine if a conversion is a complex promotion. | |
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). | |
bool | isObjCPointerConversion (QualType FromType, QualType ToType, QualType &ConvertedType, bool &IncompatibleObjC) |
isObjCPointerConversion - Determines whether this is an Objective-C pointer conversion. | |
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. | |
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. | |
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. | |
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). | |
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. | |
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). | |
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. | |
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. | |
ExprResult | PerformContextuallyConvertToBool (Expr *From) |
PerformContextuallyConvertToBool - Perform a contextual conversion of the expression From to bool (C++0x [conv]p3). | |
ExprResult | PerformContextuallyConvertToObjCPointer (Expr *From) |
PerformContextuallyConvertToObjCPointer - Perform a contextual conversion of the expression From to an Objective-C pointer type. | |
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) | |
ExprResult | PerformContextualImplicitConversion (SourceLocation Loc, Expr *FromE, ContextualImplicitConverter &Converter) |
Perform a contextual implicit conversion. | |
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). | |
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={}, OverloadCandidateParamOrder PO={}, bool AggregateCandidateDeduction=false) |
AddOverloadCandidate - Adds the given function to the set of candidate functions, using the given function call arguments. | |
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. | |
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. | |
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={}, 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 ). | |
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. | |
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. | |
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. | |
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]). | |
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]). | |
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). | |
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. | |
void | AddMemberOperatorCandidates (OverloadedOperatorKind Op, SourceLocation OpLoc, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, OverloadCandidateParamOrder PO={}) |
Add overload candidates for overloaded operators that are member functions. | |
void | AddBuiltinCandidate (QualType *ParamTys, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool IsAssignmentOperator=false, unsigned NumContextualBoolArguments=0) |
AddBuiltinCandidate - Add a candidate for a built-in operator. | |
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. | |
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. | |
EnableIfAttr * | CheckEnableIf (FunctionDecl *Function, SourceLocation CallLoc, ArrayRef< Expr * > Args, bool MissingImplicitThis=false) |
Check the enable_if expressions on the given function. | |
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. | |
bool | diagnoseArgIndependentDiagnoseIfAttrs (const NamedDecl *ND, SourceLocation Loc) |
Emit diagnostics for the diagnose_if attributes on Function, ignoring any ArgDependent DiagnoseIfAttrs. | |
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. | |
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. | |
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. | |
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. | |
bool | resolveAndFixAddressOfSingleOverloadCandidate (ExprResult &SrcExpr, bool DoFunctionPointerConversion=false) |
Given an overloaded function, tries to turn it into a non-overloaded function reference using resolveAddressOfSingleOverloadCandidate. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
void | LookupOverloadedBinOp (OverloadCandidateSet &CandidateSet, OverloadedOperatorKind Op, const UnresolvedSetImpl &Fns, ArrayRef< Expr * > Args, bool RequiresADL=true) |
Perform lookup for an overloaded binary operator. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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). | |
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. | |
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 | DiagnoseDiscardedExprMarkedNodiscard (const Expr *E) |
DiagnoseDiscardedExprMarkedNodiscard - Given an expression that is semantically a discarded-value expression, diagnose if any [[nodiscard]] value has been discarded. | |
void | DiagnoseUnusedExprResult (const Stmt *S, unsigned DiagID) |
DiagnoseUnusedExprResult - If the statement passed in is an expression whose result is unused, warn. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
StmtResult | FinishCXXForRangeStmt (Stmt *ForRange, Stmt *Body) |
FinishCXXForRangeStmt - Attach the body to a C++0x for-range statement. | |
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. | |
NamedReturnInfo | getNamedReturnInfo (const VarDecl *VD) |
Determine whether the given NRVO candidate variable is move-eligible or copy-elidable, without considering function return type. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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). | |
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. | |
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. | |
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. | |
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, QualType ConstrainedType, SourceLocation EllipsisLoc) |
Attach a type-constraint to a template parameter. | |
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. | |
QualType | CheckNonTypeTemplateParameterType (TypeSourceInfo *&TSI, SourceLocation Loc) |
Check that the type of a non-type template parameter is well-formed. | |
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. | |
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. | |
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. | |
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. | |
TemplateParameterList * | GetTemplateParameterList (TemplateDecl *TD) |
Returns the template parameter list with all default template argument information. | |
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. | |
ParsedTemplateArgument | ActOnTemplateTypeArgument (TypeResult ParsedType) |
Convert a parsed type into a parsed template argument. | |
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. | |
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. | |
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. | |
ExprResult | CheckConceptTemplateId (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const TemplateArgumentListInfo *TemplateArgs) |
void | diagnoseMissingTemplateArguments (TemplateName Name, SourceLocation Loc) |
void | diagnoseMissingTemplateArguments (const CXXScopeSpec &SS, bool TemplateKeyword, TemplateDecl *TD, 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). | |
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. | |
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. | |
bool | CheckDependentFunctionTemplateSpecialization (FunctionDecl *FD, const TemplateArgumentListInfo *ExplicitTemplateArgs, LookupResult &Previous) |
Perform semantic analysis for the given dependent function template specialization. | |
bool | CheckFunctionTemplateSpecialization (FunctionDecl *FD, TemplateArgumentListInfo *ExplicitTemplateArgs, LookupResult &Previous, bool QualifiedFriend=false) |
Perform semantic analysis for the given function template specialization. | |
bool | CheckMemberSpecialization (NamedDecl *Member, LookupResult &Previous) |
Perform semantic analysis for the given non-template member specialization. | |
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. | |
SourceLocation | getTopMostPointOfInstantiation (const NamedDecl *) const |
Returns the top most location responsible for the definition of N . | |
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. | |
bool | CheckTemplateArgumentList (TemplateDecl *Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs, const DefaultArguments &DefaultArgs, 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. | |
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. | |
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. | |
bool | CheckTemplateTemplateArgument (TemplateTemplateParmDecl *Param, TemplateParameterList *Params, TemplateArgumentLoc &Arg, bool IsDeduced) |
Check a template argument against its corresponding template template parameter. | |
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. | |
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. | |
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. | |
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". | |
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>". | |
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". | |
TypeSourceInfo * | RebuildTypeInCurrentInstantiation (TypeSourceInfo *T, SourceLocation Loc, DeclarationName Name) |
Rebuilds a type within the context of the current instantiation. | |
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. | |
std::string | getTemplateArgumentBindingsText (const TemplateParameterList *Params, const TemplateArgumentList &Args) |
Produces a formatted string that describes the binding of template parameters to template arguments. | |
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. | |
ExprResult | BuildDependentDeclRefExpr (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs) |
bool | ConstraintExpressionDependsOnEnclosingTemplate (const FunctionDecl *Friend, unsigned TemplateDepth, const Expr *Constraint) |
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. | |
void | CheckDeductionGuideTemplate (FunctionTemplateDecl *TD) |
ConceptDecl * | ActOnStartConceptDefinition (Scope *S, MultiTemplateParamsArg TemplateParameterLists, const IdentifierInfo *Name, SourceLocation NameLoc) |
ConceptDecl * | ActOnFinishConceptDefinition (Scope *S, ConceptDecl *C, Expr *ConstraintExpr, const ParsedAttributesView &Attrs) |
void | CheckConceptRedefinition (ConceptDecl *NewDecl, LookupResult &Previous, bool &AddToScope) |
bool | CheckConceptUseInDefinition (ConceptDecl *Concept, SourceLocation Loc) |
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. | |
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. | |
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. | |
bool | DiagnoseUnexpandedParameterPacks (SourceLocation Loc, UnexpandedParameterPackContext UPPC, ArrayRef< UnexpandedParameterPack > Unexpanded) |
Diagnose unexpanded parameter packs. | |
bool | DiagnoseUnexpandedParameterPack (SourceLocation Loc, TypeSourceInfo *T, UnexpandedParameterPackContext UPPC) |
If the given type contains an unexpanded parameter pack, diagnose the error. | |
bool | DiagnoseUnexpandedParameterPack (Expr *E, UnexpandedParameterPackContext UPPC=UPPC_Expression) |
If the given expression contains an unexpanded parameter pack, diagnose the error. | |
bool | DiagnoseUnexpandedParameterPackInRequiresExpr (RequiresExpr *RE) |
If the given requirees-expression contains an unexpanded reference to one of its own parameter packs, diagnose the error. | |
bool | DiagnoseUnexpandedParameterPack (const CXXScopeSpec &SS, UnexpandedParameterPackContext UPPC) |
If the given nested-name-specifier contains an unexpanded parameter pack, diagnose the error. | |
bool | DiagnoseUnexpandedParameterPack (const DeclarationNameInfo &NameInfo, UnexpandedParameterPackContext UPPC) |
If the given name contains an unexpanded parameter pack, diagnose the error. | |
bool | DiagnoseUnexpandedParameterPack (SourceLocation Loc, TemplateName Template, UnexpandedParameterPackContext UPPC) |
If the given template name contains an unexpanded parameter pack, diagnose the error. | |
bool | DiagnoseUnexpandedParameterPack (TemplateArgumentLoc Arg, UnexpandedParameterPackContext UPPC) |
If the given template argument contains an unexpanded parameter pack, diagnose the error. | |
void | collectUnexpandedParameterPacks (TemplateArgument Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given template argument. | |
void | collectUnexpandedParameterPacks (TemplateArgumentLoc Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given template argument. | |
void | collectUnexpandedParameterPacks (QualType T, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given type. | |
void | collectUnexpandedParameterPacks (TypeLoc TL, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given type. | |
void | collectUnexpandedParameterPacks (NestedNameSpecifierLoc NNS, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given nested-name-specifier. | |
void | collectUnexpandedParameterPacks (const DeclarationNameInfo &NameInfo, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given name. | |
ParsedTemplateArgument | ActOnPackExpansion (const ParsedTemplateArgument &Arg, SourceLocation EllipsisLoc) |
Invoked when parsing a template argument followed by an ellipsis, which creates a pack expansion. | |
TypeResult | ActOnPackExpansion (ParsedType Type, SourceLocation EllipsisLoc) |
Invoked when parsing a type followed by an ellipsis, which creates a pack expansion. | |
TypeSourceInfo * | CheckPackExpansion (TypeSourceInfo *Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions) |
Construct a pack expansion type from the pattern of the pack expansion. | |
QualType | CheckPackExpansion (QualType Pattern, SourceRange PatternRange, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions) |
Construct a pack expansion type from the pattern of the pack expansion. | |
ExprResult | ActOnPackExpansion (Expr *Pattern, SourceLocation EllipsisLoc) |
Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion. | |
ExprResult | CheckPackExpansion (Expr *Pattern, SourceLocation EllipsisLoc, std::optional< unsigned > NumExpansions) |
Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion. | |
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. | |
std::optional< unsigned > | getNumArgumentsInExpansion (QualType T, const MultiLevelTemplateArgumentList &TemplateArgs) |
Determine the number of arguments in the given pack expansion type. | |
std::optional< unsigned > | getNumArgumentsInExpansionFromUnexpanded (llvm::ArrayRef< UnexpandedParameterPack > Unexpanded, const MultiLevelTemplateArgumentList &TemplateArgs) |
bool | containsUnexpandedParameterPacks (Declarator &D) |
Determine whether the given declarator contains any unexpanded parameter packs. | |
TemplateArgumentLoc | getTemplateArgumentPackExpansionPattern (TemplateArgumentLoc OrigLoc, SourceLocation &Ellipsis, std::optional< unsigned > &NumExpansions) const |
Returns the pattern of the pack expansion for a template argument. | |
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. | |
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. | |
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 FullySubstituted=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 ). | |
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) |
static void | collectUnexpandedParameterPacks (Expr *E, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
Collect the set of unexpanded parameter packs within the given expression. | |
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. | |
bool | AccessCheckingSFINAE |
When true, access checking violations are treated as SFINAE failures rather than hard errors. | |
SuppressedDiagnosticsMap | SuppressedDiagnostics |
bool | isSameOrCompatibleFunctionType (QualType Param, QualType Arg) |
Compare types for equality with respect to possibly compatible function types (noreturn adjustment, implicit calling conventions). | |
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. | |
TemplateArgumentLoc | getIdentityTemplateArgumentLoc (NamedDecl *Param, SourceLocation Location) |
Get a template argument mapping the given template parameter to itself, e.g. | |
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 . | |
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 . | |
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]. | |
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. | |
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]). | |
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. | |
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. | |
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). | |
QualType | SubstAutoType (QualType TypeWithAuto, QualType Replacement) |
Substitute Replacement for auto in TypeWithAuto . | |
TypeSourceInfo * | SubstAutoTypeSourceInfo (TypeSourceInfo *TypeWithAuto, QualType Replacement) |
Substitute Replacement for auto in TypeWithAuto. | |
QualType | SubstAutoTypeDependent (QualType TypeWithAuto) |
TypeSourceInfo * | SubstAutoTypeSourceInfoDependent (TypeSourceInfo *TypeWithAuto) |
QualType | ReplaceAutoType (QualType TypeWithAuto, QualType Replacement) |
Completely replace the auto in TypeWithAuto by Replacement . | |
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) | |
void | DiagnoseAutoDeductionFailure (const VarDecl *VDecl, const 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]). | |
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, const DefaultArguments &DefaultArgs, 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. | |
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. | |
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]). | |
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. | |
FunctionDecl * | getMoreConstrainedFunction (FunctionDecl *FD1, FunctionDecl *FD2) |
Returns the more constrained function according to the rules of partial ordering by constraints (C++ [temp.constr.order]). | |
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. | |
C++ Template Instantiation | |
Implementations are in SemaTemplateInstantiate.cpp | |
typedef llvm::DenseMap< ParmVarDecl *, llvm::TinyPtrVector< ParmVarDecl * > > | UnparsedDefaultArgInstantiationsMap |
using | EntityPrinter = llvm::function_ref< void(llvm::raw_ostream &)> |
LocalInstantiationScope * | CurrentInstantiationScope |
The current instantiation scope used to store local variables. | |
UnparsedDefaultArgInstantiationsMap | UnparsedDefaultArgInstantiations |
A mapping from parameters with unparsed default arguments to the set of instantiations of each parameter. | |
SmallVector< CodeSynthesisContext, 16 > | CodeSynthesisContexts |
List of active code synthesis contexts. | |
llvm::DenseSet< std::pair< Decl *, unsigned > > | InstantiatingSpecializations |
Specializations whose definitions are currently being instantiated. | |
llvm::DenseSet< QualType > | InstantiatedNonDependentTypes |
Non-dependent types used in templates that have already been instantiated by some template instantiation. | |
SmallVector< Module *, 16 > | CodeSynthesisContextLookupModules |
Extra modules inspected when performing a lookup during a template instantiation. | |
llvm::DenseSet< Module * > | LookupModulesCache |
Cache of additional modules that should be used for name lookup within the current template instantiation. | |
llvm::DenseMap< NamedDecl *, NamedDecl * > | VisibleNamespaceCache |
Map from the most recent declaration of a namespace to the most recent visible declaration of that namespace. | |
bool | InNonInstantiationSFINAEContext |
Whether we are in a SFINAE context that is not associated with template instantiation. | |
unsigned | NonInstantiationEntries |
The number of CodeSynthesisContexts that are not template instantiations and, therefore, should not be counted as part of the instantiation depth. | |
unsigned | LastEmittedCodeSynthesisContextDepth = 0 |
The depth of the context stack at the point when the most recent error or warning was produced. | |
std::vector< std::unique_ptr< TemplateInstantiationCallback > > | TemplateInstCallbacks |
The template instantiation callbacks to trace or track instantiations (objects can be chained). | |
int | ArgumentPackSubstitutionIndex |
The current index into pack expansion arguments that will be used for substitution of parameter packs. | |
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, bool ForDefaultArgumentSubstitution=false) |
Retrieve the template argument list(s) that should be used to instantiate the definition of the given declaration. | |
void | pushCodeSynthesisContext (CodeSynthesisContext Ctx) |
void | popCodeSynthesisContext () |
void | PrintContextStack () |
void | PrintInstantiationStack () |
Prints the current instantiation stack through a series of notes. | |
std::optional< sema::TemplateDeductionInfo * > | isSFINAEContext () const |
Determines whether we are currently in a context where template argument substitution failures are not considered errors. | |
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. | |
QualType | SubstType (QualType T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity, bool *IsIncompleteSubstitution=nullptr) |
Deprecated form of the above. | |
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. | |
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. | |
bool | SubstDefaultArgument (SourceLocation Loc, ParmVarDecl *Param, const MultiLevelTemplateArgumentList &TemplateArgs, bool ForCallExpr=false) |
Substitute the given template arguments into the default argument. | |
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. | |
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. | |
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. | |
bool | InstantiateEnum (SourceLocation PointOfInstantiation, EnumDecl *Instantiation, EnumDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK) |
Instantiate the definition of an enum from a given pattern. | |
bool | InstantiateInClassInitializer (SourceLocation PointOfInstantiation, FieldDecl *Instantiation, FieldDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs) |
Instantiate the definition of a field from the given pattern. | |
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. | |
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. | |
NestedNameSpecifierLoc | SubstNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS, const MultiLevelTemplateArgumentList &TemplateArgs) |
DeclarationNameInfo | SubstDeclarationNameInfo (const DeclarationNameInfo &NameInfo, const MultiLevelTemplateArgumentList &TemplateArgs) |
Do template substitution on declaration name info. | |
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. | |
concepts::Requirement::SubstitutionDiagnostic * | createSubstDiagAt (SourceLocation Location, EntityPrinter Printer) |
create a Requirement::SubstitutionDiagnostic with only a SubstitutedEntity and DiagLoc using ASTContext's allocator. | |
C++ Template Declaration Instantiation | |
Implementations are in SemaTemplateInstantiateDecl.cpp | |
typedef std::pair< ValueDecl *, SourceLocation > | PendingImplicitInstantiation |
An entity for which implicit template instantiation is required. | |
typedef SmallVector< LateInstantiatedAttribute, 16 > | LateInstantiatedAttrVec |
std::deque< PendingImplicitInstantiation > | PendingInstantiations |
The queue of implicit template instantiations that are required but have not yet been performed. | |
SmallVector< PendingImplicitInstantiation, 1 > | LateParsedInstantiations |
Queue of implicit template instantiations that cannot be performed eagerly. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
void | InstantiateVariableInitializer (VarDecl *Var, VarDecl *OldVar, const MultiLevelTemplateArgumentList &TemplateArgs) |
Instantiate the initializer of a variable. | |
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. | |
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. | |
DeclContext * | FindInstantiatedContext (SourceLocation Loc, DeclContext *DC, const MultiLevelTemplateArgumentList &TemplateArgs) |
Finds the instantiation of the given declaration context within the current instantiation. | |
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=='. | |
void | PerformPendingInstantiations (bool LocalOnly=false) |
Performs template instantiation for all implicit template instantiations we have seen until this point. | |
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. | |
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. | |
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. | |
bool | CheckConstraintSatisfaction (const Expr *ConstraintExpr, ConstraintSatisfaction &Satisfaction) |
Check whether the given non-dependent constraint expression is satisfied. | |
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. | |
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. | |
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. | |
void | DiagnoseUnsatisfiedConstraint (const ASTConstraintSatisfaction &Satisfaction, bool First=true) |
Emit diagnostics explaining why a constraint expression was deemed unsatisfied. | |
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. | |
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. | |
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. | |
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. | |
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. | |
ExprResult | ActOnNoexceptSpec (Expr *NoexceptExpr, ExceptionSpecificationType &EST) |
Check the given noexcept-specifier, convert its expression, and compute the appropriate ExceptionSpecificationType. | |
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. | |
bool | CheckDistantExceptionSpec (QualType T) |
CheckDistantExceptionSpec - Check if the given type is a pointer or pointer to member to a function with an exception specification. | |
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. | |
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. | |
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. | |
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. | |
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. | |
Function Effects | |
Implementations are in SemaFunctionEffects.cpp | |
SmallVector< const Decl * > | DeclsWithEffectsToVerify |
All functions/lambdas/blocks which have bodies and which have a non-empty FunctionEffectsRef to be verified. | |
FunctionEffectKindSet | AllEffectsToVerify |
The union of all effects present on DeclsWithEffectsToVerify. | |
bool | diagnoseConflictingFunctionEffect (const FunctionEffectsRef &FX, const FunctionEffectWithCondition &EC, SourceLocation NewAttrLoc) |
Warn and return true if adding a function effect to a set would create a conflict. | |
void | diagnoseFunctionEffectMergeConflicts (const FunctionEffectSet::Conflicts &Errs, SourceLocation NewLoc, SourceLocation OldLoc) |
template<class FuncOrBlockDecl > | |
void | maybeAddDeclWithEffects (FuncOrBlockDecl *D) |
Inline checks from the start of maybeAddDeclWithEffects, to minimize performance impact on code not using effects. | |
void | maybeAddDeclWithEffects (const Decl *D, const FunctionEffectsRef &FX) |
Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify. | |
void | addDeclWithEffects (const Decl *D, const FunctionEffectsRef &FX) |
Unconditionally add a Decl to DeclsWithEfffectsToVerify. | |
void | performFunctionEffectAnalysis (TranslationUnitDecl *TU) |
API Notes | |
Implementations are in SemaAPINotes.cpp | |
void | ProcessAPINotes (Decl *D) |
Map any API notes provided for this declaration to attributes on the declaration. | |
Availability Attribute Handling | |
Implementations are in SemaAvailability.cpp | |
void | DiagnoseUnguardedAvailabilityViolations (Decl *FD) |
Issue any -Wunguarded-availability warnings in FD . | |
void | handleDelayedAvailabilityCheck (sema::DelayedDiagnostic &DD, Decl *Ctx) |
sema::FunctionScopeInfo * | getCurFunctionAvailabilityContext () |
Retrieve the current function, if any, that should be analyzed for potential availability violations. | |
void | DiagnoseAvailabilityOfDecl (NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass, bool ObjCPropertyAccess, bool AvoidPartialAvailabilityChecks=false, ObjCInterfaceDecl *ClassReceiver=nullptr) |
Bounds Safety | |
Implementations are in SemaBoundsSafety.cpp | |
bool | CheckCountedByAttrOnField (FieldDecl *FD, Expr *E, bool CountInBytes, bool OrNull) |
Check if applying the specified attribute variant from the "counted by" family of attributes to FieldDecl FD is semantically valid. | |
C++ Scope Specifiers | |
Implementations are in SemaCXXScopeSpec.cpp | |
bool | RequireCompleteDeclContext (CXXScopeSpec &SS, DeclContext *DC) |
Require that the context specified by SS be complete. | |
bool | RequireCompleteEnumDecl (EnumDecl *D, SourceLocation L, CXXScopeSpec *SS=nullptr) |
Require that the EnumDecl is completed with its enumerators defined or instantiated. | |
DeclContext * | computeDeclContext (QualType T) |
Compute the DeclContext that is associated with the given type. | |
DeclContext * | computeDeclContext (const CXXScopeSpec &SS, bool EnteringContext=false) |
Compute the DeclContext that is associated with the given scope specifier. | |
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). | |
bool | ActOnCXXGlobalScopeSpecifier (SourceLocation CCLoc, CXXScopeSpec &SS) |
The parser has parsed a global nested-name-specifier '::'. | |
bool | ActOnSuperScopeSpecifier (SourceLocation SuperLoc, SourceLocation ColonColonLoc, CXXScopeSpec &SS) |
The parser has parsed a '__super' nested-name-specifier. | |
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. | |
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. | |
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. | |
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::'. | |
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 >::'. | |
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. | |
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. | |
void | RestoreNestedNameSpecifierAnnotation (void *Annotation, SourceRange AnnotationRange, CXXScopeSpec &SS) |
Given an annotation pointer for a nested-name-specifier, restore the nested-name-specifier structure. | |
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. | |
void | ActOnCXXExitDeclaratorScope (Scope *S, const CXXScopeSpec &SS) |
ActOnCXXExitDeclaratorScope - Called when a declarator that previously invoked ActOnCXXEnterDeclaratorScope(), is finished. | |
C++ Lambda Expressions | |
Implementations are in SemaLambda.cpp | |
CXXRecordDecl * | createLambdaClosureType (SourceRange IntroducerRange, TypeSourceInfo *Info, unsigned LambdaDependencyKind, LambdaCaptureDefault CaptureDefault) |
Create a new lambda closure type. | |
void | handleLambdaNumbering (CXXRecordDecl *Class, CXXMethodDecl *Method, std::optional< CXXRecordDecl::LambdaNumbering > NumberingOverride=std::nullopt) |
Number lambda for linkage purposes if necessary. | |
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. | |
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. | |
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. | |
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. | |
void | addInitCapture (sema::LambdaScopeInfo *LSI, VarDecl *Var, bool ByRef) |
Add an init-capture to a lambda scope. | |
void | finishLambdaExplicitCaptures (sema::LambdaScopeInfo *LSI) |
Note that we have finished the explicit captures for the given lambda. | |
void | deduceClosureReturnType (sema::CapturingScopeInfo &CSI) |
Deduce a block or lambda's return type based on the return statements present in the body. | |
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. | |
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. | |
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. | |
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. | |
ExprResult | ActOnLambdaExpr (SourceLocation StartLoc, Stmt *Body) |
ActOnLambdaExpr - This is called when the body of a lambda expression was successfully completed. | |
bool | CaptureHasSideEffects (const sema::Capture &From) |
Does copying/destroying the captured variable have side effects? | |
bool | DiagnoseUnusedLambdaCapture (SourceRange CaptureRange, const sema::Capture &From) |
Diagnose if an explicit lambda capture is unused. | |
FieldDecl * | BuildCaptureField (RecordDecl *RD, const sema::Capture &Capture) |
Build a FieldDecl suitable to hold the given capture. | |
ExprResult | BuildCaptureInit (const sema::Capture &Capture, SourceLocation ImplicitCaptureLoc, bool IsOpenMPMapping=false) |
Initialize the given capture with a suitable expression. | |
ExprResult | BuildLambdaExpr (SourceLocation StartLoc, SourceLocation EndLoc, sema::LambdaScopeInfo *LSI) |
Complete a lambda-expression having processed and attached the lambda body. | |
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. | |
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. | |
<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) |
Statement Attribute Handling | |
Implementations are in SemaStmtAttr.cpp | |
bool | CheckNoInlineAttr (const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A) |
bool | CheckAlwaysInlineAttr (const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A) |
CodeAlignAttr * | BuildCodeAlignAttr (const AttributeCommonInfo &CI, Expr *E) |
bool | CheckRebuiltStmtAttributes (ArrayRef< const Attr * > Attrs) |
void | ProcessStmtAttributes (Stmt *Stmt, const ParsedAttributes &InAttrs, SmallVectorImpl< const Attr * > &OutAttrs) |
Process the attributes before creating an attributed statement. | |
ExprResult | ActOnCXXAssumeAttr (Stmt *St, const ParsedAttr &A, SourceRange Range) |
ExprResult | BuildCXXAssumeExpr (Expr *Assumption, const IdentifierInfo *AttrName, SourceRange Range) |
C++ Template Deduction Guide | |
Implementations are in SemaTemplateDeductionGuide.cpp | |
void | DeclareImplicitDeductionGuides (TemplateDecl *Template, SourceLocation Loc) |
Declare implicit deduction guides for a class template if we've not already done so. | |
FunctionTemplateDecl * | DeclareAggregateDeductionGuideFromInitList (TemplateDecl *Template, MutableArrayRef< QualType > ParamTypes, SourceLocation Loc) |
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. | |
std::string | getFixItZeroLiteralForType (QualType T, SourceLocation Loc) const |
Additional Inherited Members | |
![]() | |
SemaBase (Sema &S) | |
ASTContext & | getASTContext () const |
DiagnosticsEngine & | getDiagnostics () const |
const LangOptions & | getLangOpts () const |
SemaDiagnosticBuilder | Diag (SourceLocation Loc, unsigned DiagID, bool DeferHint=false) |
Emit a diagnostic. | |
SemaDiagnosticBuilder | Diag (SourceLocation Loc, const PartialDiagnostic &PD, bool DeferHint=false) |
Emit a partial diagnostic. | |
PartialDiagnostic | PDiag (unsigned DiagID=0) |
Build a partial diagnostic. | |
![]() | |
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 |
using clang::Sema::EntityPrinter = llvm::function_ref<void(llvm::raw_ostream &)> |
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 |
||
) |
Definition at line 212 of file Sema.cpp.
References clang::Preprocessor::addPPCallbacks(), Context, clang::CPlusPlus, CurFPFeatures, Diags, clang::Sema::ExpressionEvaluationContextRecord::EK_Other, ExprEvalContexts, FieldCollector, clang::FormatASTNodeDiagnosticArgument(), clang::Preprocessor::getCurrentFPEvalMethod(), getLangOpts(), clang::SemaObjC::NSAPIObj, clang::SemaObjC::NSNumberLiteralMethods, clang::NSAPI::NumNSNumberLiteralMethods, ObjC(), OpenMP(), PotentiallyEvaluated, PP, clang::sema::SemaPPCallbacks::set(), clang::DiagnosticsEngine::SetArgToStringFn(), clang::Preprocessor::TUKind, TUKind, and TUScope.
Sema::~Sema | ( | ) |
Definition at line 527 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 4457 of file SemaStmt.cpp.
References CurrentSEHFinally.
bool Sema::ActOnAccessSpecifier | ( | AccessSpecifier | Access, |
SourceLocation | ASLoc, | ||
SourceLocation | ColonLoc, | ||
const ParsedAttributesView & | Attrs | ||
) |
ActOnAccessSpecifier - Parsed an access specifier followed by a colon.
Definition at line 3124 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 15827 of file SemaExpr.cpp.
References clang::sema::FunctionScopeInfo::AddrLabels, Context, getCurFunction(), clang::ASTContext::getPointerType(), clang::Decl::markUsed(), and clang::ASTContext::VoidTy.
Referenced by clang::TreeTransform< Derived >::RebuildAddrLabelExpr().
void Sema::ActOnAfterCompoundStatementLeadingPragmas | ( | ) |
Definition at line 435 of file SemaStmt.cpp.
References getCurFPFeatures(), getCurFunction(), and 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 13395 of file SemaDeclCXX.cpp.
References ActOnDocumentableDecl(), ActOnTypedefNameDecl(), AddPragmaAttributes(), CheckRedeclarationInModule(), CheckTemplateDeclScope(), CheckTemplateParameterList(), CheckTypedefForVariablyModifiedType(), Context, clang::TypeAliasTemplateDecl::Create(), clang::TypeAliasDecl::Create(), CurContext, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), FilterLookupForScope(), forRedeclarationInCurContext(), clang::TypeLoc::getBeginLoc(), clang::Decl::getLocation(), clang::Redeclarable< decl_type >::getMostRecentDecl(), GetNameFromUnqualifiedId(), clang::TypeAliasTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::TypedefNameDecl::getUnderlyingType(), handleTagNumbering(), clang::ASTContext::hasSameType(), clang::IK_Identifier, clang::ASTContext::IntTy, clang::Invalid, clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), LookupName(), LookupOrdinaryName, Previous, ProcessAPINotes(), ProcessDeclAttributeList(), PushOnScopeChains(), clang::Decl::setAccess(), clang::TypeAliasDecl::setDescribedAliasTemplate(), clang::Decl::setInvalidDecl(), clang::Redeclarable< decl_type >::setPreviousDecl(), setTagNameForLinkagePurposes(), TemplateParameterListsAreEqual(), TPC_TypeAliasTemplate, TPL_TemplateMatch, and UPPC_DeclarationType.
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 4711 of file SemaExpr.cpp.
References CheckAlignasTypeArgument(), clang::OpaquePtr< PtrTy >::getAsOpaquePtr(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), and GetTypeFromParser().
void Sema::ActOnAnnotModuleBegin | ( | SourceLocation | DirectiveLoc, |
Module * | Mod | ||
) |
The parsed has entered a submodule.
Definition at line 768 of file SemaModule.cpp.
References checkModuleImportContext(), CurContext, getLangOpts(), clang::DeclContext::getLexicalParent(), clang::VisibleModuleSet::setVisible(), 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 792 of file SemaModule.cpp.
References BuildModuleInclude(), CurContext, clang::File, getCurrentModule(), clang::SourceManager::getFileID(), clang::SourceManager::getIncludeLoc(), getLangOpts(), clang::DeclContext::getLexicalParent(), getSourceManager(), clang::Decl::Unowned, and VisibleNamespaceCache.
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 729 of file SemaModule.cpp.
References BuildModuleInclude(), checkModuleImportContext(), and CurContext.
Referenced by clang::Parser::ParseTopLevelDecl().
ExprResult Sema::ActOnArraySubscriptExpr | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | LLoc, | ||
MultiExprArg | ArgExprs, | ||
SourceLocation | RLoc | ||
) |
Definition at line 4829 of file SemaExpr.cpp.
References clang::SemaOpenACC::ActOnArraySectionExpr(), clang::SemaOpenMP::ActOnOMPArraySectionExpr(), CheckArgsForPlaceholders(), CheckPlaceholderExpr(), Context, clang::CPlusPlus, clang::CPlusPlus20, CreateBuiltinArraySubscriptExpr(), CreateBuiltinMatrixSubscriptExpr(), CreateOverloadedArraySubscriptExpr(), clang::SemaBase::Diag(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getASTContext(), clang::Stmt::getBeginLoc(), getDependentArraySubscriptType(), clang::Expr::getExprLoc(), getLangOpts(), clang::Expr::getType(), clang::Expr::hasAnyTypeDependentArguments(), clang::Expr::hasPlaceholderType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMatrixType(), isMSPropertySubscriptExpr(), clang::Type::isNonOverloadPlaceholderType(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::Type::isRecordType(), clang::Expr::isTypeDependent(), clang::Type::isWebAssemblyTableType(), MaybeConvertParenListExprToParenExpr(), clang::OK_Ordinary, OpenACC(), OpenMP(), clang::ASTContext::PseudoObjectTy, and clang::VK_LValue.
Referenced by clang::TreeTransform< Derived >::RebuildArraySubscriptExpr(), clang::TreeTransform< Derived >::RebuildCxxSubscriptExpr(), and rebuildPotentialResultsAsNonOdrUsed().
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 6320 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 | ||
) |
Parse a __builtin_astype expression.
__builtin_astype( value, dst type )
Definition at line 6703 of file SemaExpr.cpp.
References BuildAsTypeExpr(), E, and GetTypeFromParser().
StmtResult Sema::ActOnAttributedStmt | ( | const ParsedAttributes & | AttrList, |
Stmt * | SubStmt | ||
) |
Definition at line 668 of file SemaStmt.cpp.
References BuildAttributedStmt(), clang::SourceRange::getBegin(), ProcessStmtAttributes(), and clang::ParsedAttributesView::Range.
BaseResult Sema::ActOnBaseSpecifier | ( | Decl * | classdecl, |
SourceRange | SpecifierRange, | ||
const ParsedAttributesView & | Attrs, | ||
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 2745 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 2929 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), and AttachBaseSpecifiers().
ExprResult Sema::ActOnBinOp | ( | Scope * | S, |
SourceLocation | TokLoc, | ||
tok::TokenKind | Kind, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) |
Binary Operators. 'Tok' is the token for the operator.
Definition at line 15271 of file SemaExpr.cpp.
References BuildBinOp(), DetectPrecisionLossInComplexDivision(), DiagnoseBinOpPrecedence(), and clang::BinaryOperator::isAssignmentOp().
Referenced by clang::SemaHLSL::ActOnOutParamExpr(), BuildCXXForRangeStmt(), DefaultVariadicArgumentPromotion(), MaybeConvertParenListExprToParenExpr(), 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 16182 of file SemaExpr.cpp.
References clang::BlockLiteral, BuildParmVarDeclForTypedef(), clang::Type::castAs(), CheckParmsForFunctionDef(), CheckShadow(), Context, clang::ASTContext::CreateTypeSourceInfo(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), E, clang::sema::BlockScopeInfo::FunctionType, clang::Type::getAs(), clang::TypeLoc::getAsAdjusted(), clang::Declarator::getBeginLoc(), clang::Declarator::getContext(), getCurBlock(), clang::NamedDecl::getIdentifier(), clang::Declarator::getIdentifier(), getLangOpts(), clang::FunctionTypeLoc::getLocalRangeBegin(), clang::FunctionTypeLoc::getLocalRangeEnd(), clang::Decl::getLocation(), clang::FunctionTypeLoc::getNumParams(), clang::FunctionTypeLoc::getParam(), clang::FunctionTypeLoc::getReturnLoc(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::TypeSourceInfo::getTypeLoc(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::TypeLoc::initializeFullCopy(), clang::Type::isFunctionType(), clang::Decl::isImplicit(), clang::Decl::isInvalidDecl(), clang::BlockDecl::parameters(), ProcessDeclAttributes(), PushOnScopeChains(), clang::Result, clang::sema::CapturingScopeInfo::ReturnType, clang::BlockDecl::setBlockMissingReturnType(), clang::Decl::setInvalidDecl(), clang::BlockDecl::setIsVariadic(), clang::BlockDecl::setParams(), clang::BlockDecl::setSignatureAsWritten(), clang::T, clang::sema::BlockScopeInfo::TheDecl, clang::sema::BlockScopeInfo::TheScope, and UPPC_Block.
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 16291 of file SemaExpr.cpp.
References DiscardCleanupsInEvaluationContext(), PopDeclContext(), PopExpressionEvaluationContext(), and PopFunctionScopeInfo().
void Sema::ActOnBlockStart | ( | SourceLocation | CaretLoc, |
Scope * | CurScope | ||
) |
ActOnBlockStart - This callback is invoked when a block literal is started.
Definition at line 16153 of file SemaExpr.cpp.
References clang::DeclContext::addDecl(), clang::Block, Context, clang::BlockDecl::Create(), CurContext, getCurBlock(), getCurrentMangleNumberContext(), clang::MangleNumberingContext::getManglingNumber(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, LangOpts, PotentiallyEvaluated, PushBlockScope(), PushDeclContext(), and PushExpressionEvaluationContext().
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 16301 of file SemaExpr.cpp.
References clang::sema::FunctionScopeInfo::addBlock(), AnalysisWarnings, BuildDeclarationNameExpr(), clang::sema::CapturingScopeInfo::Captures, clang::Type::castAs(), checkNonTrivialCUnion(), Cleanup, computeNRVO(), clang::sema::CapturingScopeInfo::ContainsUnexpandedParameterPack, Context, clang::CPlusPlus, CreateRecoveryExpr(), clang::sema::CapturingScopeInfo::CXXThisCaptureIndex, deduceClosureReturnType(), clang::SemaBase::Diag(), DiagnoseInvalidJumps(), DiagnoseUnguardedAvailabilityViolations(), DiagnoseUnusedParameters(), DiscardCleanupsInEvaluationContext(), clang::QualType::DK_none, ExprCleanupObjects, clang::CleanupInfo::exprNeedsCleanups(), clang::FunctionProtoType::ExtProtoInfo::ExtInfo, FinalizeVarWithDestructor(), FunctionScopes, clang::sema::BlockScopeInfo::FunctionType, clang::Type::getAs(), clang::ASTContext::getBlockPointerType(), clang::sema::Capture::getCaptureType(), clang::BlockDecl::getCaretLocation(), getCurFunction(), clang::sema::AnalysisBasedWarnings::getDefaultPolicy(), clang::FunctionType::getExtInfo(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), getLangOpts(), clang::sema::Capture::getLocation(), clang::FunctionType::getNoReturnAttr(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::getReturnType(), clang::sema::Capture::getVariable(), hasAnyUnrecoverableErrorsInThisFunction(), clang::Decl::hasAttr(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), ImpCastExprToType(), clang::InitializedEntity::InitializeBlock(), clang::sema::Capture::isBlockCapture(), clang::Preprocessor::isCodeCompletionEnabled(), clang::sema::Capture::isCopyCapture(), clang::DeclContext::isDependentContext(), clang::sema::Capture::isInvalid(), clang::Decl::isInvalidDecl(), clang::sema::Capture::isNested(), clang::QualType::isNull(), clang::Type::isRecordType(), clang::sema::Capture::isThisCapture(), LangOpts, Loc, maybeAddDeclWithEffects(), MaybeCreateExprWithCleanups(), NTCUC_FunctionReturn, NTCUK_Copy, NTCUK_Destruct, clang::BlockDecl::parameters(), PerformCopyInitialization(), PopDeclContext(), PopExpressionEvaluationContext(), PopFunctionScopeInfo(), PotentiallyEvaluated, PP, clang::Result, clang::sema::CapturingScopeInfo::ReturnType, clang::BlockDecl::setBody(), clang::BlockDecl::setCaptures(), clang::CleanupInfo::setExprNeedsCleanups(), setFunctionHasBranchProtectedScope(), clang::sema::BlockScopeInfo::TheDecl, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, clang::VK_LValue, clang::ASTContext::VoidTy, and clang::FunctionType::ExtInfo::withNoReturn().
StmtResult Sema::ActOnBreakStmt | ( | SourceLocation | BreakLoc, |
Scope * | CurScope | ||
) |
Definition at line 3300 of file SemaStmt.cpp.
References CheckJumpOutOfSEHFinally(), Context, clang::SemaBase::Diag(), clang::Scope::getBreakParent(), and clang::StmtError().
ExprResult Sema::ActOnBuiltinBitCastExpr | ( | SourceLocation | KWLoc, |
Declarator & | Dcl, | ||
ExprResult | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 382 of file SemaCast.cpp.
References BuildBuiltinBitCastExpr(), D, clang::ExprError(), and GetTypeForDeclaratorCast().
ExprResult Sema::ActOnBuiltinOffsetOf | ( | Scope * | S, |
SourceLocation | BuiltinLoc, | ||
SourceLocation | TypeLoc, | ||
ParsedType | ParsedArgTy, | ||
ArrayRef< OffsetOfComponent > | Components, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 16096 of file SemaExpr.cpp.
References BuildBuiltinOffsetOf(), Context, clang::ExprError(), clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), and clang::QualType::isNull().
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 6437 of file SemaExpr.cpp.
References clang::SemaOpenMP::ActOnOpenMPCall(), BuildCallExpr(), clang::Call, clang::CPlusPlus20, currentEvaluationContext(), clang::SemaBase::Diag(), DiagnosedUnqualifiedCallsToStdFunctions(), getLangOpts(), LangOpts, OpenMP(), and clang::Sema::ExpressionEvaluationContextRecord::ReferenceToConsteval.
Referenced by clang::TreeTransform< Derived >::RebuildCallExpr().
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 3504 of file SemaStmt.cpp.
References ActOnFinishFullExpr(), clang::sema::LambdaScopeInfo::CallOperator, clang::Type::castAs(), clang::Expr::containsErrors(), Context, clang::CPlusPlus, clang::ReturnStmt::Create(), CurContext, DeduceFunctionTypeFromReturnExpr(), DefaultFunctionArrayLvalueConversion(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), ExprEvalContexts, FunctionScopes, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getContainedAutoType(), getCopyElisionCandidate(), getCurFunction(), getLangOpts(), clang::FunctionType::getNoReturnAttr(), clang::FunctionDecl::getReturnType(), clang::Stmt::getSourceRange(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), hasDeducedReturnType(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::InitializedEntity::InitializeResult(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::Type::isVoidType(), PerformMoveOrCopyInitialization(), clang::Result, clang::sema::CapturingScopeInfo::ReturnType, clang::Decl::setInvalidDecl(), clang::StmtError(), and clang::ASTContext::VoidTy.
Referenced by BuildReturnStmt().
StmtResult Sema::ActOnCapturedRegionEnd | ( | Stmt * | S | ) |
Definition at line 4675 of file SemaStmt.cpp.
References buildCapturedStmtCaptureList(), clang::sema::CapturedRegionScopeInfo::CapRegionKind, clang::RecordDecl::completeDefinition(), clang::CapturedStmt::Create(), DiscardCleanupsInEvaluationContext(), getASTContext(), clang::CapturedStmt::getCapturedStmt(), PopDeclContext(), PopExpressionEvaluationContext(), PopFunctionScopeInfo(), clang::CapturedDecl::setBody(), clang::StmtError(), clang::sema::CapturedRegionScopeInfo::TheCapturedDecl, and clang::sema::CapturedRegionScopeInfo::TheRecordDecl.
Referenced by clang::SemaOpenMP::ActOnOpenMPRegionEnd(), buildDistanceFunc(), and buildLoopVarFunc().
void Sema::ActOnCapturedRegionError | ( | ) |
Definition at line 4660 of file SemaStmt.cpp.
References ActOnFields(), DiscardCleanupsInEvaluationContext(), PopDeclContext(), PopExpressionEvaluationContext(), PopFunctionScopeInfo(), 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 4601 of file SemaStmt.cpp.
References clang::DeclContext::addDecl(), clang::CapturedContext, clang::CapturedDecl::castToDeclContext(), Context, clang::ImplicitParamDecl::Create(), CreateCapturedStmtRecordDecl(), CurContext, E, clang::IdentifierTable::get(), clang::ASTContext::getPointerType(), clang::ASTContext::getTagDeclType(), clang::ASTContext::Idents, Loc, PotentiallyEvaluated, PushCapturedRegionScope(), PushDeclContext(), PushExpressionEvaluationContext(), clang::CapturedDecl::setContextParam(), clang::CapturedDecl::setParam(), clang::QualType::withConst(), and clang::QualType::withRestrict().
void Sema::ActOnCapturedRegionStart | ( | SourceLocation | Loc, |
Scope * | CurScope, | ||
CapturedRegionKind | Kind, | ||
unsigned | NumParams | ||
) |
Definition at line 4571 of file SemaStmt.cpp.
References clang::DeclContext::addDecl(), clang::CapturedContext, clang::CapturedDecl::castToDeclContext(), Context, clang::ImplicitParamDecl::Create(), CreateCapturedStmtRecordDecl(), CurContext, ExprEvalContexts, clang::IdentifierTable::get(), clang::ASTContext::getPointerType(), clang::ASTContext::getTagDeclType(), clang::ASTContext::Idents, Loc, PotentiallyEvaluated, PushCapturedRegionScope(), PushDeclContext(), PushExpressionEvaluationContext(), and clang::CapturedDecl::setContextParam().
Referenced by buildDistanceFunc(), buildLoopVarFunc(), and processCapturedRegions().
ExprResult Sema::ActOnCaseExpr | ( | SourceLocation | CaseLoc, |
ExprResult | Val | ||
) |
Definition at line 500 of file SemaStmt.cpp.
References ActOnFinishFullExpr(), AllowFold, CCEK_CaseValue, CheckConvertedConstantExpression(), CorrectDelayedTyposInExpr(), clang::CPlusPlus11, DefaultLvalueConversion(), DiagnoseUnexpandedParameterPack(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getCurFunction(), clang::Expr::getExprLoc(), getLangOpts(), clang::Expr::getType(), ImpCastExprToType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::sema::FunctionScopeInfo::SwitchStack, and VerifyIntegerConstantExpression().
Referenced by clang::Parser::ParseCaseExpression().
StmtResult Sema::ActOnCaseStmt | ( | SourceLocation | CaseLoc, |
ExprResult | LHS, | ||
SourceLocation | DotDotDotLoc, | ||
ExprResult | RHS, | ||
SourceLocation | ColonLoc | ||
) |
Definition at line 552 of file SemaStmt.cpp.
References Context, clang::CaseStmt::Create(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), getCurFunction(), getCurScope(), clang::SourceLocation::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUnset(), LangOpts, clang::StmtError(), clang::Scope::SwitchScope, and clang::sema::FunctionScopeInfo::SwitchStack.
Referenced by clang::TreeTransform< Derived >::RebuildCaseStmt().
ActOnCaseStmtBody - This installs a statement as the body of a case.
Definition at line 583 of file SemaStmt.cpp.
Referenced by clang::TreeTransform< Derived >::RebuildCaseStmtBody().
ExprResult Sema::ActOnCastExpr | ( | Scope * | S, |
SourceLocation | LParenLoc, | ||
Declarator & | D, | ||
ParsedType & | Ty, | ||
SourceLocation | RParenLoc, | ||
Expr * | CastExpr | ||
) |
Definition at line 7737 of file SemaExpr.cpp.
References BuildCStyleCastExpr(), BuildVectorLiteral(), CheckExtraCXXDefaultArguments(), clang::SemaObjC::CheckObjCBridgeRelatedCast(), clang::SemaObjC::CheckTollFreeBridgeCast(), checkUnusedDeclAttributes(), CorrectDelayedTyposInExpr(), clang::CPlusPlus, CreateParsedType(), D, clang::SemaBase::Diag(), DiscardMisalignedMemberAddress(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ParenListExpr::getExpr(), clang::Expr::getExprLoc(), getLangOpts(), clang::ParenListExpr::getNumExprs(), clang::Stmt::getSourceRange(), clang::ParenExpr::getSubExpr(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), GetTypeForDeclaratorCast(), clang::QualType::getTypePtr(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Type::isVectorType(), clang::Type::isVoidType(), MaybeConvertParenListExprToParenExpr(), ObjC(), OpenCL(), and clang::Result.
ExprResult Sema::ActOnCharacterConstant | ( | const Token & | Tok, |
Scope * | UDLScope = nullptr |
||
) |
Definition at line 3538 of file SemaExpr.cpp.
References clang::Ascii, BuildCookedLiteralOperatorCall(), clang::C23, clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::Char8Ty, clang::ASTContext::CharTy, Context, clang::CPlusPlus, clang::SemaBase::Diag(), clang::ExprError(), clang::IdentifierTable::get(), clang::Token::getKind(), getLangOpts(), clang::Token::getLocation(), clang::Preprocessor::getSpelling(), getUDSuffixLoc(), clang::ASTContext::Idents, clang::ASTContext::IntTy, clang::Invalid, PP, clang::ASTContext::UnsignedCharTy, clang::UTF16, clang::UTF32, clang::UTF8, clang::Wide, and clang::ASTContext::WideCharTy.
ExprResult Sema::ActOnChooseExpr | ( | SourceLocation | BuiltinLoc, |
Expr * | CondExpr, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 16115 of file SemaExpr.cpp.
References Context, clang::ASTContext::DependentTy, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getObjectKind(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::OK_Ordinary, VerifyIntegerConstantExpression(), and clang::VK_PRValue.
Referenced by clang::TreeTransform< Derived >::RebuildChooseExpr(), and rebuildPotentialResultsAsNonOdrUsed().
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 8290 of file SemaTemplate.cpp.
References AddAlignmentAttributesForRecord(), clang::DeclContext::addDecl(), AddMsStructLayoutForRecord(), clang::TemplateSpecializationType::anyDependentTemplateArguments(), clang::AS_none, clang::AS_public, CheckClassTemplate(), CheckTemplateArgumentList(), CheckTemplateDeclScope(), CheckTemplatePartialSpecialization(), CheckTemplatePartialSpecializationArgs(), CheckTemplateSpecializationScope(), ClassTemplate, Context, clang::FriendDecl::Create(), clang::ClassTemplateSpecializationDecl::Create(), clang::ClassTemplatePartialSpecializationDecl::Create(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), CurContext, clang::Definition, clang::SemaBase::Diag(), diagnoseQualifiedDeclaration(), DiagnoseUnexpandedParameterPack(), EnterTemplatedContext(), clang::Enum, clang::Friend, clang::OpaquePtr< PtrTy >::get(), clang::ASTContext::getCanonicalTemplateName(), clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::ClassTemplatePartialSpecializationDecl::getInstantiatedFromMember(), clang::ASTContext::getLangOpts(), clang::Decl::getLocation(), clang::TemplateArgumentLoc::getLocation(), clang::TemplateParameterList::getParam(), clang::ClassTemplateSpecializationDecl::getPointOfInstantiation(), clang::CXXRecordDecl::getPreviousDecl(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateArgumentLoc::getSourceRange(), clang::TypeWithKeyword::getTagTypeKindForTypeSpec(), clang::TemplateParameterList::getTemplateLoc(), clang::CXXRecordDecl::getTemplateSpecializationKind(), getTemplateSpecializationKind(), clang::ASTContext::getTemplateSpecializationType(), clang::ASTContext::getTemplateSpecializationTypeInfo(), clang::ASTContext::getTypeDeclType(), clang::TemplateParameterList::hasAssociatedConstraints(), clang::TemplateTemplateParmDecl::hasDefaultArgument(), clang::ASTContext::hasSameType(), hasVisibleDefinition(), inferGslOwnerPointerAttribute(), clang::Invalid, isAcceptableTagRedeclaration(), clang::DeclContext::isDependentContext(), clang::CXXScopeSpec::isSet(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, makeMergedDefinitionVisible(), makeTemplateArgumentListInfo(), MatchTemplateParametersToScopeSpecifier(), clang::SkipBodyInfo::Previous, ProcessAPINotes(), ProcessDeclAttributeList(), Range, clang::TemplateIdAnnotation::RAngleLoc, RebuildTemplateParamsInCurrentInstantiation(), clang::Reference, clang::TemplateTemplateParmDecl::removeDefaultArgument(), clang::ClassTemplatePartialSpecializationDecl::setMemberSpecialization(), SetNestedNameSpecifier(), clang::ClassTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::TagDecl::setTemplateParameterListsInfo(), clang::SkipBodyInfo::ShouldSkip, clang::TemplateParameterList::size(), clang::TemplateArgumentListInfo::size(), clang::Specialization, clang::TemplateIdAnnotation::Template, clang::TemplateIdAnnotation::TemplateNameLoc, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, UPPC_ExplicitSpecialization, and UPPC_PartialSpecialization.
ExprResult Sema::ActOnCoawaitExpr | ( | Scope * | S, |
SourceLocation | KwLoc, | ||
Expr * | E | ||
) |
Definition at line 805 of file SemaCoroutine.cpp.
References ActOnCoroutineBodyStart(), BuildOperatorCoawaitLookupExpr(), BuildUnresolvedCoawaitExpr(), CheckPlaceholderExpr(), checkSuspensionContext(), CorrectDelayedTyposInExpr(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::hasPlaceholderType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
Referenced by BuildCXXForRangeStmt(), and BuildNonArrayForRange().
void Sema::ActOnComment | ( | SourceRange | Comment | ) |
Definition at line 2440 of file Sema.cpp.
References clang::ASTContext::addComment(), clang::LangOptions::CommentOpts, clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::SourceRange::getBegin(), clang::RawComment::getKind(), clang::SourceLocation::getLocWithOffset(), clang::RawComment::hasUnsupportedSplice(), clang::RawComment::isAlmostTrailingComment(), clang::RawComment::RCK_Invalid, clang::RawComment::RCK_OrdinaryBCPL, and clang::RawComment::RCK_OrdinaryC.
ExprResult Sema::ActOnCompoundLiteral | ( | SourceLocation | LParenLoc, |
ParsedType | Ty, | ||
SourceLocation | RParenLoc, | ||
Expr * | InitExpr | ||
) |
Definition at line 7040 of file SemaExpr.cpp.
References BuildCompoundLiteralExpr(), Context, clang::ASTContext::getTrivialTypeSourceInfo(), and GetTypeFromParser().
concepts::Requirement * Sema::ActOnCompoundRequirement | ( | Expr * | E, |
SourceLocation | NoexceptLoc | ||
) |
Definition at line 9393 of file SemaExprCXX.cpp.
References BuildExprRequirement(), and E.
concepts::Requirement * Sema::ActOnCompoundRequirement | ( | Expr * | E, |
SourceLocation | NoexceptLoc, | ||
CXXScopeSpec & | SS, | ||
TemplateIdAnnotation * | TypeConstraint, | ||
unsigned | Depth | ||
) |
Definition at line 9399 of file SemaExprCXX.cpp.
References BuildExprRequirement(), BuildTypeConstraint(), Context, clang::TemplateTypeParmDecl::Create(), clang::TemplateParameterList::Create(), CurContext, E, clang::IdentifierTable::get(), and clang::ASTContext::Idents.
StmtResult Sema::ActOnCompoundStmt | ( | SourceLocation | L, |
SourceLocation | R, | ||
ArrayRef< Stmt * > | Elts, | ||
bool | isStmtExpr | ||
) |
Definition at line 451 of file SemaStmt.cpp.
References clang::sema::FunctionScopeInfo::CompoundScopes, Context, clang::CPlusPlus, clang::CompoundStmt::Create(), CurrentInstantiationScope, D, clang::SemaBase::Diag(), DiagnoseEmptyLoopBody(), Diags, clang::FPOptions::getChangesFrom(), getCurCompoundScope(), getCurFPFeatures(), getCurFunction(), getLangOpts(), clang::Decl::getLocation(), clang::sema::CompoundScopeInfo::InitialFPFeatures, and clang::DiagnosticsEngine::isIgnored().
Referenced by buildDistanceFunc(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), and clang::TreeTransform< Derived >::RebuildCompoundStmt().
Sema::ConditionResult Sema::ActOnCondition | ( | Scope * | S, |
SourceLocation | Loc, | ||
Expr * | SubExpr, | ||
ConditionKind | CK, | ||
bool | MissingOK = false |
||
) |
Definition at line 20418 of file SemaExpr.cpp.
References Boolean, CheckBooleanCondition(), CheckSwitchCondition(), ConditionError(), ConstexprIf, CreateRecoveryExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::Stmt::getEndLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, MakeFullExpr(), PreferredConditionType(), and Switch.
Referenced by buildSingleCopyAssignRecursively().
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 8776 of file SemaExpr.cpp.
References CheckConditionalOperands(), CheckPlaceholderExpr(), computeConditionalNullability(), Context, CorrectDelayedTyposInExpr(), clang::CPlusPlus, DiagnoseConditionalPrecedence(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), getLangOpts(), clang::Expr::getObjectKind(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::Expr::hasPlaceholderType(), clang::ASTContext::hasSameType(), clang::Type::isArrayType(), clang::ASTContext::isDependenceAllowed(), clang::Expr::isGLValue(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isOrdinaryOrBitFieldObject(), clang::Expr::isPRValue(), clang::Type::isRecordType(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OK_Ordinary, TemporaryMaterializationConversion(), UsualUnaryConversions(), and clang::VK_PRValue.
Referenced by clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), buildDistanceFunc(), checkOpenMPLoop(), clang::TreeTransform< Derived >::RebuildConditionalOperator(), and rebuildPotentialResultsAsNonOdrUsed().
Sema::ConditionResult Sema::ActOnConditionVariable | ( | Decl * | ConditionVar, |
SourceLocation | StmtLoc, | ||
ConditionKind | CK | ||
) |
Definition at line 4047 of file SemaExprCXX.cpp.
References CheckConditionVariable(), ConditionError(), ConstexprIf, E, and MakeFullExpr().
ExprResult Sema::ActOnConstantExpression | ( | ExprResult | Res | ) |
Definition at line 19654 of file SemaExpr.cpp.
References CheckLValueToRValueConversionOperand(), CorrectDelayedTyposInExpr(), clang::ActionResult< PtrTy, Compress >::get(), and clang::ActionResult< PtrTy, Compress >::isUsable().
Referenced by CheckTemplateArgument(), clang::Parser::ParseConstantExpressionInExprEvalContext(), and clang::TreeTransform< Derived >::TransformTemplateArgument().
StmtResult Sema::ActOnContinueStmt | ( | SourceLocation | ContinueLoc, |
Scope * | CurScope | ||
) |
Definition at line 3273 of file SemaStmt.cpp.
References CheckJumpOutOfSEHFinally(), Context, clang::SemaBase::Diag(), clang::Scope::getContinueParent(), and clang::StmtError().
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 11208 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.
Referenced by CheckFunctionDeclaration().
ExprResult Sema::ActOnConvertVectorExpr | ( | Expr * | E, |
ParsedType | ParsedDestTy, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RParenLoc | ||
) |
ActOnConvertVectorExpr - create a new convert-vector expression from the provided arguments.
__builtin_convertvector( value, dst type )
Definition at line 6724 of file SemaExpr.cpp.
References E, and GetTypeFromParser().
StmtResult Sema::ActOnCoreturnStmt | ( | Scope * | S, |
SourceLocation | KwLoc, | ||
Expr * | E | ||
) |
Definition at line 1022 of file SemaCoroutine.cpp.
References ActOnCoroutineBodyStart(), BuildCoreturnStmt(), CorrectDelayedTyposInExpr(), E, Loc, and clang::StmtError().
bool Sema::ActOnCoroutineBodyStart | ( | Scope * | S, |
SourceLocation | KwLoc, | ||
StringRef | Keyword | ||
) |
Definition at line 698 of file SemaCoroutine.cpp.
References ActOnFinishFullExpr(), buildOperatorCoawaitCall(), buildPromiseCall(), BuildResolvedCoawaitExpr(), checkCoroutineContext(), checkFinalSuspendNoThrow(), checkReturnStmtInCoroutine(), CurContext, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), getCurFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, PotentiallyEvaluated, and clang::StmtError().
Referenced by ActOnCoawaitExpr(), ActOnCoreturnStmt(), ActOnCoyieldExpr(), and ActOnCXXForRangeStmt().
ExprResult Sema::ActOnCoyieldExpr | ( | Scope * | S, |
SourceLocation | KwLoc, | ||
Expr * | E | ||
) |
Definition at line 964 of file SemaCoroutine.cpp.
References ActOnCoroutineBodyStart(), BuildCoyieldExpr(), buildOperatorCoawaitCall(), buildPromiseCall(), checkSuspensionContext(), CorrectDelayedTyposInExpr(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getCurFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
ExprResult Sema::ActOnCXXAssumeAttr | ( | Stmt * | St, |
const ParsedAttr & | A, | ||
SourceRange | Range | ||
) |
Definition at line 718 of file SemaStmtAttr.cpp.
References clang::AttributeCommonInfo::AS_CXX11, BuildCXXAssumeExpr(), clang::CPlusPlus23, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ParsedAttr::getArgAsExpr(), clang::AttributeCommonInfo::getAttrName(), getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getNumArgs(), clang::AttributeCommonInfo::getSyntax(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Range.
Referenced by handleCXXAssumeAttr().
ExprResult Sema::ActOnCXXBoolLiteral | ( | SourceLocation | OpLoc, |
tok::TokenKind | Kind | ||
) |
ActOnCXXBoolLiteral - Parse {true,false} literals.
Definition at line 818 of file SemaExprCXX.cpp.
References clang::ASTContext::BoolTy, and Context.
Referenced by clang::SemaObjC::ActOnObjCBoolLiteral(), and 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 4170 of file SemaStmt.cpp.
References Context.
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 18450 of file SemaDeclCXX.cpp.
References ActOnDeclarator(), D, clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::Decl::getSourceRange(), clang::DeclSpec::SCS_typedef, and clang::VarDecl::setCXXCondDecl().
ExprResult Sema::ActOnCXXDelete | ( | SourceLocation | StartLoc, |
bool | UseGlobal, | ||
bool | ArrayForm, | ||
Expr * | Operand | ||
) |
ActOnCXXDelete - Parsed a C++ 'delete' expression (C++ 5.3.5), as in:
or
Definition at line 3639 of file SemaExprCXX.cpp.
References clang::AS_public, clang::Type::castAs(), CheckDestructorAccess(), CheckVirtualDtorCall(), Context, clang::FixItHint::CreateInsertion(), clang::ASTContext::DeclarationNames, clang::Default, DefaultLvalueConversion(), clang::SemaBase::Diag(), DiagnoseUseOfDecl(), doesUsualArrayDeleteWantSize(), clang::ExprError(), FindDeallocationFunction(), FindUsualDeallocationFunction(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Qualifiers::getAddressSpaceAttributePrintValue(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::Stmt::getBeginLoc(), clang::DeclarationNameTable::getCXXOperatorName(), clang::CXXRecordDecl::getDestructor(), clang::Expr::getExprLoc(), getLangOpts(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::Type::getPointeeType(), getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Qualifiers::hasCVRQualifiers(), clang::CXXRecordDecl::hasIrrelevantDestructor(), hasNewExtendedAlignment(), ImpCastExprToType(), clang::Type::isArrayType(), isCompleteType(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::Type::isEnumeralType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isSFINAEContext(), clang::Type::isSizelessType(), clang::Expr::isTypeDependent(), clang::Type::isVoidType(), LangOpts, Loc, LookupDestructor(), clang::DeclAccessPair::make(), MarkFunctionReferenced(), clang::ast_matchers::match(), clang::Passing, clang::SemaBase::PDiag(), PerformContextualImplicitConversion(), PerformImplicitConversion(), clang::Qualifiers::removeCVRQualifiers(), RequireCompleteType(), clang::Result, clang::T, and clang::ASTContext::VoidTy.
Referenced by clang::TreeTransform< Derived >::RebuildCXXDeleteExpr().
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 1019 of file SemaCXXScopeSpec.cpp.
References computeDeclContext(), EnterDeclaratorContext(), clang::DeclContext::isDependentContext(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isSet(), RebuildNestedNameSpecifierInCurrentInstantiation(), and RequireCompleteDeclContext().
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 18404 of file SemaDeclCXX.cpp.
References D, EnterDeclaratorContext(), clang::Decl::getDeclContext(), clang::Decl::isInvalidDecl(), clang::Decl::isOutOfLine(), PotentiallyEvaluated, and PushExpressionEvaluationContext().
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 1041 of file SemaCXXScopeSpec.cpp.
References computeDeclContext(), ExitDeclaratorContext(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isSet().
ActOnCXXExitDeclInitializer - Invoked after we are finished parsing an initializer for the declaration 'Dcl'.
Definition at line 18418 of file SemaDeclCXX.cpp.
References Context, clang::CPlusPlus23, D, ExitDeclaratorContext(), ExprEvalContexts, getLangOpts(), clang::VarDecl::hasConstantInitialization(), clang::Decl::isOutOfLine(), clang::VarDecl::isUsableInConstantExpressions(), and PopExpressionEvaluationContext().
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 1381 of file SemaTemplateVariadic.cpp.
References BuildCXXFoldExpr(), CheckFoldOperand(), clang::Expr::containsUnexpandedParameterPack(), Context, CorrectDelayedTyposInExpr(), CreateUnresolvedLookupExpr(), clang::ASTContext::DeclarationNames, clang::SemaBase::Diag(), clang::UnresolvedSetImpl::empty(), clang::ExprError(), clang::DeclarationNameTable::getCXXOperatorName(), clang::BinaryOperator::getOverloadedOperator(), clang::Stmt::getSourceRange(), and LookupBinOp().
void Sema::ActOnCXXForRangeDecl | ( | Decl * | D | ) |
Definition at line 14221 of file SemaDecl.cpp.
References D, clang::SemaBase::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 14275 of file SemaDecl.cpp.
References ActOnDeclarator(), ActOnDeclStmt(), D, FinalizeDeclaration(), FinalizeDeclaratorGroup(), clang::ForInit, clang::SourceRange::getEnd(), clang::AttributePool::getFactory(), clang::ParsedAttributes::getPool(), getPrintingPolicy(), clang::DeclaratorChunk::getReference(), clang::SourceLocation::isValid(), clang::ParsedAttributesView::none(), clang::ParsedAttributesView::Range, clang::DeclSpec::SetTypeSpecType(), and clang::DeclSpec::TST_auto.
StmtResult Sema::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.
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 2425 of file SemaStmt.cpp.
References ActOnCoroutineBodyStart(), ActOnDeclStmt(), ActOnInitializerError(), clang::SemaObjC::ActOnObjCForCollectionStmt(), BuildCXXForRangeStmt(), BuildDeclaratorGroup(), Context, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), FinishForRangeVarDecl(), clang::First, clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getAutoRRefDeductType(), clang::Stmt::getBeginLoc(), clang::DeclStmt::getBeginLoc(), clang::DeclStmt::getSingleDecl(), clang::Stmt::getSourceRange(), clang::SourceLocation::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::DeclStmt::isSingleDecl(), ObjC(), ObjCEnumerationCollection(), Range, clang::StmtError(), and UPPC_Expression.
Referenced by RebuildForRangeWithDereference().
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 279 of file SemaCXXScopeSpec.cpp.
References Context, and clang::CXXScopeSpec::MakeGlobal().
NamedDecl * Sema::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.
'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 3311 of file SemaDeclCXX.cpp.
References clang::AS_private, clang::AS_public, CheckOverrideControl(), clang::CXXScopeSpec::clear(), computeDeclContext(), Context, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), CurContext, clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXOperatorName, D, clang::SemaBase::Diag(), diagnoseQualifiedDeclaration(), Diags, FieldCollector, clang::Decl::getAccess(), clang::Type::getAs(), clang::Type::getAsTagDecl(), clang::Decl::getBeginLoc(), clang::DeclSpec::getConstexprSpecLoc(), clang::NamedDecl::getDeclName(), clang::VirtSpecifiers::getFinalLoc(), clang::Decl::getKind(), getLangOpts(), clang::VirtSpecifiers::getLastLocation(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), GetNameForDeclarator(), clang::VirtSpecifiers::getOverrideLoc(), clang::FieldDecl::getParent(), clang::ASTContext::getPrintingPolicy(), clang::CXXScopeSpec::getRange(), clang::Stmt::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::ValueDecl::getType(), HandleDeclarator(), HandleField(), HandleMSProperty(), clang::Decl::hasAttr(), clang::DeclSpec::hasConstexprSpecifier(), clang::ICIS_NoInit, clang::IK_TemplateId, InitializationHasSideEffects(), clang::DeclContext::isDependentContext(), clang::VirtSpecifiers::isFinalSpecified(), clang::VirtSpecifiers::isFinalSpelledSealed(), clang::DeclSpec::isFriendSpecified(), clang::DiagnosticsEngine::isIgnored(), clang::Decl::isImplicit(), clang::SourceLocation::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::VirtSpecifiers::isOverrideSpecified(), clang::CXXScopeSpec::isSet(), clang::SourceLocation::isValid(), Loc, clang::Member, clang::DeclSpec::SCS_mutable, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::T, clang::DeclSpec::TQ_const, and UnusedPrivateFields.
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 273 of file SemaCast.cpp.
References BuildCXXNamedCast(), CheckExtraCXXDefaultArguments(), clang::CPlusPlus, D, E, clang::ExprError(), getLangOpts(), clang::Expr::getType(), and GetTypeForDeclaratorCast().
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 845 of file SemaCXXScopeSpec.cpp.
References clang::TemplateArgumentListInfo::arguments(), CheckTemplateIdType(), Context, clang::SemaBase::Diag(), clang::CXXScopeSpec::Extend(), clang::OpaquePtr< PtrTy >::get(), clang::Type::getAs(), clang::TemplateName::getAsAssumedTemplateName(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateName::getAsOverloadedTemplate(), clang::TemplateName::getAsTemplateDecl(), clang::SourceRange::getBegin(), clang::ASTContext::getDependentTemplateSpecializationType(), clang::DependentTemplateName::getIdentifier(), clang::DependentTemplateName::getQualifier(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::getWithLocInContext(), clang::Type::isDependentType(), clang::DependentTemplateName::isIdentifier(), clang::CXXScopeSpec::isInvalid(), clang::SourceRange::isValid(), clang::None, NoteAllFoundTemplates(), resolveAssumedTemplateNameAsType(), clang::TemplateSpecializationTypeLoc::setArgLocInfo(), clang::DependentTemplateSpecializationTypeLoc::setArgLocInfo(), clang::SourceRange::setBegin(), clang::DependentTemplateSpecializationTypeLoc::setElaboratedKeywordLoc(), clang::TemplateSpecializationTypeLoc::setLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::TemplateSpecializationTypeLoc::setRAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setRAngleLoc(), clang::TemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::TemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::TemplateArgumentListInfo::size(), clang::T, and translateTemplateArguments().
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 773 of file SemaCXXScopeSpec.cpp.
References BuildCXXNestedNameSpecifier(), and clang::CXXScopeSpec::isInvalid().
bool Sema::ActOnCXXNestedNameSpecifierDecltype | ( | CXXScopeSpec & | SS, |
const DeclSpec & | DS, | ||
SourceLocation | ColonColonLoc | ||
) |
Definition at line 785 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 812 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 | ||
) |
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 1923 of file SemaExprCXX.cpp.
References AllowFold, clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, BuildCXXNew(), CCEK_ArrayBound, CheckConvertedConstantExpression(), Context, D, clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getEndLoc(), clang::ASTContext::getIntWidth(), getLangOpts(), clang::ASTContext::getSizeType(), clang::Decl::getSourceRange(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::Initializer, clang::DeclaratorChunk::Loc, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, and VerifyIntegerConstantExpression().
ExprResult Sema::ActOnCXXNullPtrLiteral | ( | SourceLocation | Loc | ) |
ActOnCXXNullPtrLiteral - Parse 'nullptr'.
Definition at line 826 of file SemaExprCXX.cpp.
References Context, Loc, and clang::ASTContext::NullPtrTy.
ExprResult Sema::ActOnCXXThis | ( | SourceLocation | Loc | ) |
Definition at line 1415 of file SemaExprCXX.cpp.
References BuildCXXThisExpr(), CheckCXXThisType(), clang::ExprError(), getCurrentThisType(), and Loc.
Referenced by buildCoroutinePromise(), CheckDestructor(), collectPlacementArgs(), and DefineImplicitLambdaToBlockPointerConversion().
ExprResult Sema::ActOnCXXThrow | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
Expr * | expr | ||
) |
Definition at line 831 of file SemaExprCXX.cpp.
References clang::Scope::BlockScope, BuildCXXThrow(), clang::Scope::ClassScope, clang::Scope::FnScope, clang::Expr::IgnoreParens(), clang::Scope::ObjCMethodScope, and clang::Scope::TryScope.
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 4290 of file SemaStmt.cpp.
References Context, clang::CXXTryStmt::Create(), clang::CanQual< Type >::CreateUnsafe(), CUDA(), clang::SemaBase::Diag(), clang::SemaCUDA::DiagIfDeviceCode(), clang::sema::FunctionScopeInfo::FirstSEHTryLoc, clang::Type::getAsCXXRecordDecl(), clang::CXXCatchStmt::getBeginLoc(), clang::QualType::getCanonicalType(), clang::CXXCatchStmt::getCaughtType(), getCurFunction(), getCurScope(), clang::CXXCatchStmt::getExceptionDecl(), getLangOpts(), getSourceManager(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::QualType::getUnqualifiedType(), clang::SourceManager::isInSystemHeader(), clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), clang::sema::FunctionScopeInfo::setHasCXXTry(), clang::StmtError(), clang::T, and targetDiag().
Referenced by clang::TreeTransform< Derived >::RebuildCXXTryStmt().
ExprResult Sema::ActOnCXXTypeConstructExpr | ( | ParsedType | TypeRep, |
SourceLocation | LParenOrBraceLoc, | ||
MultiExprArg | Exprs, | ||
SourceLocation | RParenOrBraceLoc, | ||
bool | ListInitialization | ||
) |
ActOnCXXTypeConstructExpr - 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 1514 of file SemaExprCXX.cpp.
References BuildCXXTypeConstructExpr(), Context, CorrectDelayedTyposInExpr(), CreateRecoveryExpr(), clang::ExprError(), clang::TypeLoc::getBeginLoc(), clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), and clang::Result.
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 654 of file SemaExprCXX.cpp.
References BuildCXXTypeId(), Context, CXXTypeInfoDecl, clang::SemaBase::Diag(), clang::ExprError(), clang::IdentifierTable::get(), clang::LookupResult::getAsSingle(), clang::DiagnosticsEngine::getDiagnosticOptions(), getDiagnostics(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), clang::Preprocessor::getIdentifierTable(), getLangOpts(), getStdNamespace(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ASTContext::getTypeDeclType(), GetTypeFromParser(), LangOpts, LookupQualifiedName(), LookupTagName, clang::DiagnosticOptions::MSVC, PP, clang::Result, and clang::T.
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.
References clang::QualType::addConst(), BuildCXXUuidof(), Context, clang::ExprError(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), clang::ASTContext::getMSGuidType(), clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), and clang::T.
Decl * Sema::ActOnDeclarator | ( | Scope * | S, |
Declarator & | D | ||
) |
Definition at line 6088 of file SemaDecl.cpp.
References clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), D, clang::Declaration, clang::Decl::getDeclContext(), HandleDeclarator(), clang::DeclContext::isFileContext(), clang::DeclContext::isObjCContainer(), LangOpts, OpenMP(), OriginalLexicalContext, and clang::Decl::setTopLevelDeclInObjCContainer().
Referenced by ActOnCXXConditionDeclaration(), ActOnCXXForRangeIdentifier(), and ImplicitlyDefineFunction().
StmtResult Sema::ActOnDeclStmt | ( | DeclGroupPtrTy | Decl, |
SourceLocation | StartLoc, | ||
SourceLocation | EndLoc | ||
) |
Definition at line 76 of file SemaStmt.cpp.
References Context, clang::OpaquePtr< PtrTy >::get(), clang::DeclGroupRef::isNull(), and clang::StmtError().
Referenced by ActOnCXXForRangeIdentifier(), ActOnCXXForRangeStmt(), buildCoroutineParameterMoves(), BuildCXXForRangeStmt(), precomputeExpr(), and clang::TreeTransform< Derived >::RebuildDeclStmt().
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 7853 of file SemaExprCXX.cpp.
References ActOnDecltypeExpression(), ActOnParenExpr(), clang::Bind, clang::Call, CheckCallReturnType(), CheckDestructorAccess(), CheckPlaceholderExpr(), CheckUnevaluatedOperand(), Cleanup, Context, clang::BinaryOperator::Create(), clang::Destructor, DiagnoseUseOfDecl(), E, 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(), clang::SemaBase::PDiag(), clang::Result, clang::CXXTemporary::setDestructor(), and clang::CleanupInfo::setExprNeedsCleanups().
Referenced by ActOnDecltypeExpression().
NamedDecl * Sema::ActOnDecompositionDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParamLists | ||
) |
Definition at line 721 of file SemaDeclCXX.cpp.
References ActOnVariableDeclarator(), clang::DeclContext::addHiddenDecl(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), CheckShadow(), clang::Condition, Context, clang::CPlusPlus17, clang::CPlusPlus20, clang::BindingDecl::Create(), clang::FixItHint::CreateRemoval(), CurContext, D, clang::SemaBase::Diag(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), DiagPlaceholderVariableDefinition(), FilterLookupForScope(), getLangOpts(), clang::DecompositionDeclarator::getLSquareLoc(), clang::DeclContext::getRedeclContext(), getShadowedDeclaration(), clang::DecompositionDeclarator::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), int, isDeclInScope(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isFunctionType(), clang::IdentifierInfo::isPlaceholder(), clang::DeclContext::isTranslationUnit(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::Kind, Loc, LookupName(), LookupOrdinaryName, OpenMP(), clang::DeclaratorChunk::Paren, ParsingInitForAutoVars, Previous, ProcessDeclAttributeList(), PushOnScopeChains(), clang::TemplateIdAnnotation::RAngleLoc, clang::DeclaratorChunk::Reference, clang::DeclSpec::SCS_extern, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::TemplateIdAnnotation::TemplateNameLoc, clang::TNK_Concept_template, clang::DeclSpec::TQ_volatile, clang::DeclSpec::TST_auto, and UPPC_DeclarationType.
Referenced by HandleDeclarator().
void Sema::ActOnDefaultCtorInitializers | ( | Decl * | CDtorDecl | ) |
Definition at line 5838 of file SemaDeclCXX.cpp.
References SetCtorInitializers().
StmtResult Sema::ActOnDefaultStmt | ( | SourceLocation | DefaultLoc, |
SourceLocation | ColonLoc, | ||
Stmt * | SubStmt, | ||
Scope * | CurScope | ||
) |
Definition at line 588 of file SemaStmt.cpp.
References Context, clang::SemaBase::Diag(), getCurFunction(), getCurScope(), LangOpts, clang::StmtError(), clang::Scope::SwitchScope, and clang::sema::FunctionScopeInfo::SwitchStack.
Referenced by clang::TreeTransform< Derived >::RebuildDefaultStmt().
void Sema::ActOnDefinedDeclarationSpecifier | ( | Decl * | D | ) |
Called once it is known whether a tag declaration is an anonymous union or struct.
Definition at line 5345 of file SemaDecl.cpp.
References D, and DiagPlaceholderFieldDeclDefinitions().
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 10708 of file SemaDeclCXX.cpp.
References clang::IdentifierResolver::AddDecl(), clang::NamedDecl::getDeclName(), and IdResolver.
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 18966 of file SemaDeclCXX.cpp.
References clang::ASTContext::adjustExceptionSpec(), checkExceptionSpecification(), CheckOverridingFunctionExceptionSpec(), checkThisInStaticMemberFunctionExceptionSpec(), Context, D, 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 721 of file SemaTemplate.cpp.
References BuildDependentDeclRefExpr(), Context, clang::CXXDependentScopeMemberExpr::Create(), clang::ExprError(), getCurrentThisType(), clang::ASTContext::getLangOpts(), clang::CXXScopeSpec::isEmpty(), and clang::QualType::isNull().
Referenced by ActOnIdExpression(), and ActOnNameClassifiedAsDependentNonType().
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 557 of file SemaExprMember.cpp.
References clang::TemplateArgumentListInfo::arguments(), Context, clang::CXXDependentScopeMemberExpr::Create(), clang::SemaBase::Diag(), clang::ExprError(), clang::Type::getAs(), getLangOpts(), clang::DeclarationNameInfo::getName(), clang::PointerType::getPointeeType(), clang::DeclarationNameInfo::getSourceRange(), clang::Stmt::getSourceRange(), clang::CXXScopeSpec::getWithLocInContext(), clang::DeclarationName::isDependentName(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::Type::isRecordType(), and ObjC().
Referenced by BuildMemberReferenceExpr().
TypeResult Sema::ActOnDependentTag | ( | Scope * | S, |
unsigned | TagSpec, | ||
TagUseKind | TUK, | ||
const CXXScopeSpec & | SS, | ||
const IdentifierInfo * | Name, | ||
SourceLocation | TagLoc, | ||
SourceLocation | NameLoc | ||
) |
Definition at line 10590 of file SemaTemplate.cpp.
References Context, CreateParsedType(), clang::Declaration, clang::Definition, clang::SemaBase::Diag(), clang::ASTContext::getDependentNameType(), clang::TypeWithKeyword::getKeywordForTagTypeKind(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::TypeWithKeyword::getTagTypeKindForTypeSpec(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), clang::TypeLocBuilder::push(), clang::Result, clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), and clang::DependentNameTypeLoc::setQualifierLoc().
ExprResult Sema::ActOnDesignatedInitializer | ( | Designation & | Desig, |
SourceLocation | EqualOrColonLoc, | ||
bool | GNUSyntax, | ||
ExprResult | Init | ||
) |
Definition at line 3503 of file SemaInit.cpp.
References CheckArrayDesignatorExpr(), Context, clang::DesignatedInitExpr::Create(), D, clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Designation::getDesignator(), clang::Designation::getNumDesignators(), clang::Stmt::getSourceRange(), clang::Init, clang::Invalid, clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and toString().
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 14940 of file SemaDecl.cpp.
References ActOnDocumentableDecls(), and D.
Referenced by ActOnAliasDeclaration(), clang::SemaObjC::ActOnAtEnd(), ActOnEnumConstant(), ActOnFinishConceptDefinition(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaObjC::ActOnProperty(), ActOnStartNamespaceDef(), ActOnStartOfFunctionDef(), ActOnTagStartDefinition(), ActOnTemplateDeclarator(), ActOnVariableDeclarator(), CheckClassTemplate(), and ParsedFreeStandingDeclSpec().
Definition at line 14944 of file SemaDecl.cpp.
References clang::ASTContext::attachCommentsToJustParsedDecls(), Context, Diags, getPreprocessor(), and clang::DiagnosticsEngine::isIgnored().
Referenced by ActOnDocumentableDecl(), and BuildDeclaratorGroup().
StmtResult Sema::ActOnDoStmt | ( | SourceLocation | DoLoc, |
Stmt * | Body, | ||
SourceLocation | WhileLoc, | ||
SourceLocation | CondLParen, | ||
Expr * | Cond, | ||
SourceLocation | CondRParen | ||
) |
Definition at line 1822 of file SemaStmt.cpp.
References ActOnFinishFullExpr(), clang::C99, CheckBooleanCondition(), Context, clang::CPlusPlus, clang::SemaBase::Diag(), Diags, clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), getLangOpts(), clang::DiagnosticsEngine::isIgnored(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::StmtError().
Referenced by clang::TreeTransform< Derived >::RebuildDoStmt().
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 18166 of file SemaDecl.cpp.
References hasStructuralCompatLayout(), makeMergedDefinitionVisible(), 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 9247 of file Sema.h.
References makeMergedDefinitionVisible(), and Previous.
std::optional< FunctionEffectMode > Sema::ActOnEffectExpression | ( | Expr * | CondExpr, |
StringRef | AttributeName | ||
) |
Try to parse the conditional expression attached to an effect attribute (e.g.
'nonblocking'). (c.f. Sema::ActOnNoexceptSpec). Return an empty optional on error.
Definition at line 7625 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, Context, clang::Dependent, clang::SemaBase::Diag(), clang::False, clang::Expr::getExprLoc(), clang::Expr::getIntegerConstantExpr(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::True.
Referenced by handleNonBlockingNonAllocatingTypeAttr(), and clang::TreeTransform< Derived >::TransformFunctionProtoType().
ExprResult Sema::ActOnEmbedExpr | ( | SourceLocation | EmbedKeywordLoc, |
StringLiteral * | BinaryData | ||
) |
Definition at line 16791 of file SemaExpr.cpp.
References Context, and clang::Data.
Decl * Sema::ActOnEmptyDeclaration | ( | Scope * | S, |
const ParsedAttributesView & | AttrList, | ||
SourceLocation | SemiLoc | ||
) |
Handle a C++11 empty-declaration and attribute-declaration.
Definition at line 16762 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), Context, clang::EmptyDecl::Create(), CurContext, and ProcessDeclAttributeList().
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 1171 of file Sema.cpp.
References ActOnEndOfTranslationUnitFragment(), AnalysisWarnings, clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::begin(), CheckCompleteVariableDeclaration(), CheckDelayedMemberExceptionSpecs(), CheckDelegatingCtorCycles(), checkUndefinedButUsed(), clang::LangOptionsBase::CMK_ModuleInterface, clang::ASTConsumer::CompleteExternalDeclaration(), clang::ASTConsumer::CompleteTentativeDefinition(), Consumer, Context, D, DelayedDllExportClasses, DelayedDllExportMemberFunctions, DelayedEquivalentExceptionSpecChecks, DelayedOverridingExceptionSpecChecks, DeleteExprs, clang::SemaBase::Diag(), clang::SemaHLSL::DiagnoseAvailabilityViolations(), DiagnosePrecisionLossInComplexDivision(), clang::SemaOpenMP::DiagnoseUnterminatedOpenMPDeclareTarget(), DiagnoseUnterminatedPragmaAlignPack(), DiagnoseUnterminatedPragmaAttribute(), clang::SemaObjC::DiagnoseUseOfUnimplementedSelectors(), Diags, E, emitAndClearUnusedLocalTypedefWarnings(), clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::end(), clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::erase(), clang::ExpectedVariableOrFunction, clang::Module::ExplicitGlobalModuleFragment, ExternalDeclarations, clang::VarDecl::getActingDefinition(), clang::ASTContext::getAsIncompleteArrayType(), getASTContext(), clang::ASTContext::getConstantArrayType(), clang::Preprocessor::getCurrentModule(), getCurrentModule(), clang::Sema::DelayedDiagnostics::getCurrentPool(), clang::Decl::getDeclContext(), clang::VarDecl::getDefinition(), clang::VarDecl::getDescribedVarTemplate(), clang::SourceManager::getExpansionLoc(), clang::Preprocessor::getHeaderSearchInfo(), clang::Preprocessor::getLangOpts(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getModuleInitializers(), clang::HeaderSearch::getModuleMap(), clang::Decl::getPreviousDecl(), clang::ASTContext::getSizeType(), getSourceManager(), clang::FunctionDecl::getTemplateSpecializationArgsAsWritten(), clang::ASTContext::getTranslationUnitDecl(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasAnyFunctionEffects(), clang::DiagnosticsEngine::hasErrorOccurred(), HLSL(), clang::Module::Imports, clang::Preprocessor::isCodeCompletionEnabled(), clang::QualType::isConstQualified(), clang::FunctionDecl::isDeleted(), clang::LangOptions::IsHeaderFile, clang::DiagnosticsEngine::isIgnored(), clang::Preprocessor::isIncrementalProcessingEnabled(), clang::SourceManager::isInMainFile(), clang::Module::isInterfaceOrPartition(), clang::Decl::isInvalidDecl(), clang::Module::isNamedModuleInterfaceHasInit(), IsRecordFullyDefined(), clang::Decl::isReferenced(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::TagDecl::isUnion(), clang::Decl::isUsed(), LangOpts, LateParsedInstantiations, LateTemplateParserCleanup, LoadExternalWeakUndeclaredIdentifiers(), LookupOrdinaryName, LookupSingleName(), clang::Normal, Normal, ObjC(), OpaqueParser, OpenMP(), ParsingInitForAutoVars, PendingInstantiations, performFunctionEffectAnalysis(), PerformPendingInstantiations(), PP, Private, clang::Module::PrivateModuleFragment, RequireCompleteType(), clang::ModuleMap::resolveConflicts(), clang::ModuleMap::resolveExports(), clang::ModuleMap::resolveUses(), clang::SC_Static, clang::SourceRange::setEnd(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), ShouldRemoveFromUnused(), SM, SourceMgr, clang::Module::submodules(), clang::T, TentativeDefinitions, clang::TU_ClangModule, clang::TU_Prefix, TUKind, TUScope, UndefinedButUsed, UnusedFileScopedDecls, UnusedPrivateFields, and WeakUndeclaredIdentifiers.
Referenced by clang::Parser::ParseTopLevelDecl().
void Sema::ActOnEndOfTranslationUnitFragment | ( | TUFragmentKind | Kind | ) |
Definition at line 1106 of file Sema.cpp.
References DefineUsedVTables(), emitDeferredDiags(), clang::Func, Global, LateParsedInstantiations, PendingInstantiations, and PerformPendingInstantiations().
Referenced by ActOnEndOfTranslationUnit(), ActOnModuleDecl(), and ActOnPrivateModuleFragmentDecl().
void Sema::ActOnEnumBody | ( | SourceLocation | EnumLoc, |
SourceRange | BraceRange, | ||
Decl * | EnumDecl, | ||
ArrayRef< Decl * > | Elements, | ||
Scope * | S, | ||
const ParsedAttributesView & | Attr | ||
) |
Definition at line 20024 of file SemaDecl.cpp.
References CheckAlignasUnderalignment(), CheckForDuplicateEnumValues(), Context, clang::CPlusPlus, clang::ImplicitCastExpr::Create(), D, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::Enum, clang::TargetInfo::getCharWidth(), clang::EnumConstantDecl::getInitVal(), clang::TargetInfo::getIntWidth(), clang::ASTContext::getIntWidth(), getLangOpts(), clang::Decl::getLocation(), clang::TargetInfo::getLongLongWidth(), clang::TargetInfo::getLongWidth(), clang::ASTContext::getPromotedIntegerType(), clang::TargetInfo::getShortWidth(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::hasSameType(), clang::ASTContext::IntTy, clang::ASTContext::isPromotableIntegerType(), isRepresentableIntegerValue(), clang::Type::isSignedIntegerOrEnumerationType(), IsValueInFlagEnum(), LangOpts, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, ProcessAPINotes(), ProcessDeclAttributeList(), clang::ValueDecl::setType(), clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortTy, and clang::VK_PRValue.
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 19769 of file SemaDecl.cpp.
References ActOnDocumentableDecl(), AddPragmaAttributes(), CheckEnumConstant(), CheckShadow(), clang::CPlusPlus, CurContext, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), DiagnoseTemplateParameterShadow(), clang::Decl::getAccess(), clang::LookupResult::getAsSingle(), clang::Decl::getDeclContext(), getLangOpts(), getNonFieldDeclScope(), Id, isDeclInScope(), clang::EnumDecl::isScoped(), clang::Decl::isTemplateParameter(), LookupName(), LookupOrdinaryName, notePreviousDefinition(), ProcessAPINotes(), ProcessDeclAttributeList(), PushOnScopeChains(), and clang::Decl::setAccess().
Decl * Sema::ActOnExceptionDeclarator | ( | Scope * | S, |
Declarator & | D | ||
) |
ActOnExceptionDeclarator - Parsed the exception-declarator in a C++ catch handler.
Definition at line 16908 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), BuildExceptionDeclaration(), Context, CurContext, D, clang::SemaBase::Diag(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), clang::Decl::getBeginLoc(), clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeForDeclarator(), clang::ASTContext::IntTy, clang::Invalid, isDeclInScope(), LookupOrdinaryName, LookupSingleName(), ProcessDeclAttributes(), PushOnScopeChains(), clang::Decl::setInvalidDecl(), and UPPC_ExceptionType.
void Sema::ActOnExitFunctionContext | ( | ) |
Definition at line 1457 of file SemaDecl.cpp.
References CurContext, and clang::DeclContext::getLexicalParent().
ExplicitSpecifier Sema::ActOnExplicitBoolSpecifier | ( | Expr * | E | ) |
ActOnExplicitBoolSpecifier - Build an ExplicitSpecifier from an expression found in an explicit(bool) specifier.
Definition at line 13718 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 10135 of file SemaTemplate.cpp.
References clang::TemplateSpecCandidateSet::addCandidate(), clang::OverloadCandidateSet::addCandidate(), clang::UnresolvedSetImpl::addDecl(), adjustCCAndNoReturn(), clang::UnresolvedSetImpl::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::C, CheckEquivalentExceptionSpec(), CheckExplicitInstantiation(), CheckFunctionConstraints(), CheckSpecializationInstantiationRedecl(), CheckVarTemplateId(), Consumer, Context, clang::CPlusPlus11, clang::FixItHint::CreateRemoval(), clang::OverloadCandidateSet::CSK_Normal, CUDA(), clang::CUDATargetMismatch, clang::DeclarationName::CXXDeductionGuideName, D, DeduceTemplateArguments(), clang::SemaBase::Diag(), clang::OverloadCandidateSet::empty(), clang::UnresolvedSetImpl::end(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Decl::getBeginLoc(), clang::TargetInfo::getCXXABI(), clang::VarDecl::getInstantiatedFromStaticDataMember(), clang::Decl::getKind(), getLangOpts(), clang::Decl::getLocation(), clang::TemplateSpecCandidateSet::getLocation(), getMostSpecialized(), clang::DeclarationNameInfo::getName(), GetNameForDeclarator(), clang::VarDecl::getPointOfInstantiation(), clang::FunctionDecl::getPointOfInstantiation(), clang::Decl::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::VarDecl::getTemplateSpecializationKind(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), GetTypeForDeclarator(), clang::ASTConsumer::HandleTopLevelDecl(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::SemaCUDA::IdentifyTarget(), clang::IK_TemplateId, InstantiateFunctionDefinition(), InstantiateVariableDefinition(), clang::Type::isFunctionType(), clang::SourceLocation::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::TargetCXXABI::isMicrosoft(), clang::QualType::isNull(), clang::VarDecl::isStaticDataMember(), clang::Type::isUndeducedType(), clang::ActionResult< PtrTy, Compress >::isUsable(), LangOpts, LookupOrdinaryName, LookupParsedName(), clang::MakeDeductionFailureInfo(), makeTemplateArgumentListInfo(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::ovl_fail_constraints_not_satisfied, P, clang::SemaBase::PDiag(), Previous, ProcessAPINotes(), ProcessDeclAttributeList(), clang::Result, ScopeSpecifierHasTemplateId(), clang::DeclSpec::SCS_typedef, clang::DeclSpec::SCS_unspecified, clang::TemplateSpecCandidate::set(), clang::VarDecl::setTemplateSpecializationKind(), clang::Specialization, clang::Success, clang::T, clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, and clang::TSK_Undeclared.
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 9725 of file SemaTemplate.cpp.
References clang::Decl::addAttr(), clang::DeclContext::addDecl(), clang::ASTConsumer::AssignInheritanceModel(), CheckExplicitInstantiation(), CheckSpecializationInstantiationRedecl(), CheckTemplateArgumentList(), ClassTemplate, Consumer, Context, clang::ClassTemplateSpecializationDecl::Create(), clang::FixItHint::CreateReplacement(), CurContext, clang::SemaBase::Diag(), dllExportImportClassTemplateSpecialization(), clang::Enum, clang::OpaquePtr< PtrTy >::get(), getASTContext(), clang::Decl::getAttr(), clang::TargetInfo::getCXXABI(), clang::getDLLAttr(), clang::Decl::getLocation(), getNonTagTypeDeclKind(), clang::ClassTemplateSpecializationDecl::getPointOfInstantiation(), clang::TypeWithKeyword::getTagTypeKindForTypeSpec(), clang::ASTContext::getTargetInfo(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::TargetInfo::getTriple(), clang::Decl::hasAttr(), InstantiateClassTemplateSpecialization(), InstantiateClassTemplateSpecializationMembers(), isAcceptableTagRedeclaration(), clang::SourceLocation::isInvalid(), clang::TargetCXXABI::isMicrosoft(), clang::CXXScopeSpec::isSet(), MarkVTableUsed(), ProcessAPINotes(), ProcessDeclAttributeList(), SetNestedNameSpecifier(), clang::CXXRecordDecl::setTemplateSpecializationKind(), clang::TargetInfo::shouldDLLImportComdatSymbols(), clang::Specialization, translateTemplateArguments(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
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 10021 of file SemaTemplate.cpp.
References ActOnTag(), clang::AS_none, CheckExplicitInstantiation(), CheckSpecializationInstantiationRedecl(), Context, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CXXRecordDecl::getDefinition(), clang::CXXRecordDecl::getInstantiatedFromMemberClass(), clang::Decl::getLocation(), clang::CXXRecordDecl::getMemberSpecializationInfo(), clang::MemberSpecializationInfo::getPointOfInstantiation(), clang::CXXScopeSpec::getRange(), getTemplateInstantiationArgs(), clang::MemberSpecializationInfo::getTemplateSpecializationKind(), clang::ASTContext::getTypeDeclType(), InstantiateClass(), InstantiateClassMembers(), clang::SourceLocation::isInvalid(), MarkVTableUsed(), OOK_Outside, clang::Reference, ScopeSpecifierHasTemplateId(), clang::TSK_ExplicitInstantiationDeclaration, and clang::TSK_ExplicitInstantiationDefinition.
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 6409 of file SemaExprCXX.cpp.
References BuildExpressionTrait(), clang::ExprError(), and clang::Result.
StmtResult Sema::ActOnExprStmt | ( | ExprResult | Arg, |
bool | DiscardedValue = true |
||
) |
Definition at line 49 of file SemaStmt.cpp.
References ActOnFinishFullExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Expr::getExprLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::StmtError().
Referenced by buildSingleCopyAssignRecursively().
StmtResult Sema::ActOnExprStmtError | ( | ) |
Definition at line 66 of file SemaStmt.cpp.
References DiscardCleanupsInEvaluationContext(), and 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 18394 of file SemaDecl.cpp.
References clang::AS_public, D, HandleField(), and clang::ICIS_NoInit.
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 19003 of file SemaDecl.cpp.
References AbstractIvarType, clang::Decl::addAttr(), AddImplicitlyDeclaredMembersToClass(), clang::C99, clang::CanNeverPassInRegs, clang::Type::castAs(), CheckAlignasUnderalignment(), clang::SemaObjC::CheckImplementationIvars(), checkMSInheritanceAttrOnDefinition(), ComputeSelectedDestructor(), ComputeSpecialMemberFunctionsEligiblity(), Context, clang::CPlusPlus, clang::FixItHint::CreateInsertion(), D, clang::Destructor, clang::SemaBase::Diag(), clang::SemaObjC::DiagnoseDuplicateIvars(), E, clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getBaseElementType(), clang::RecordType::getDecl(), clang::NamedDecl::getDeclName(), clang::QualType::getDesugaredType(), clang::NamedDecl::getIdentifier(), clang::ObjCContainerDecl::getIvarDecl(), clang::Decl::getKind(), getLangOpts(), clang::Decl::getLocation(), clang::Qualifiers::getObjCLifetime(), clang::QualType::getObjCLifetime(), clang::ASTContext::getObjCObjectPointerType(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), getSourceManager(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSizeInChars(), clang::Decl::hasAttr(), clang::ASTContext::hasDirectOwnershipQualifier(), clang::QualType::hasNonTrivialObjCLifetime(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), clang::RecordDecl::hasObjectMember(), inTemplateInstantiation(), clang::FieldDecl::isAnonymousStructOrUnion(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::Type::isFunctionType(), clang::Type::isIncompleteArrayType(), clang::Type::isIncompleteType(), clang::Decl::isInvalidDecl(), clang::QualType::isNonTrivialToPrimitiveCopy(), clang::QualType::isNonTrivialToPrimitiveDefaultInitialize(), clang::QualType::isObjCGCStrong(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjCObjectType(), clang::Type::isRecordType(), clang::QualType::isVolatileQualified(), clang::CharUnits::isZero(), clang::ObjCInterfaceDecl::known_extensions(), LangOpts, clang::LangOptionsBase::NonGC, ObjC(), clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, Parent, clang::QualType::PCK_Trivial, clang::QualType::PCK_VolatileTrivial, ProcessAPINotes(), ProcessDeclAttributeList(), clang::randstruct::randomizeStructureLayout(), RequireCompleteSizedType(), RequireCompleteType(), RequireNonAbstractType(), clang::ASTContext::ResetObjCLayout(), SetDeclDeleted(), clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), clang::ValueDecl::setType(), ShouldDeleteSpecialMember(), and clang::T.
Referenced by ActOnCapturedRegionError(), ActOnFinishCXXMemberSpecification(), ActOnLambdaError(), BuildLambdaExpr(), and InstantiateClass().
Decl * Sema::ActOnFileScopeAsmDecl | ( | Expr * | expr, |
SourceLocation | AsmLoc, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 20272 of file SemaDecl.cpp.
References clang::DeclContext::addDecl(), Context, clang::FileScopeAsmDecl::Create(), CurContext, and clang::ast_matchers::expr.
ConceptDecl * Sema::ActOnFinishConceptDefinition | ( | Scope * | S, |
ConceptDecl * | C, | ||
Expr * | ConstraintExpr, | ||
const ParsedAttributesView & | Attrs | ||
) |
Definition at line 8764 of file SemaTemplate.cpp.
References ActOnDocumentableDecl(), clang::C, CheckConceptRedefinition(), CurContext, DiagnoseUnexpandedParameterPack(), FilterLookupForScope(), forRedeclarationInCurContext(), LookupName(), LookupOrdinaryName, Previous, ProcessDeclAttributeList(), PushOnScopeChains(), and RemoveLookupResult().
void Sema::ActOnFinishCXXInClassMemberInitializer | ( | Decl * | VarDecl, |
SourceLocation | EqualLoc, | ||
ExprResult | 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.
Such actions are deferred until the class is complete.
Definition at line 4075 of file SemaDeclCXX.cpp.
References ActOnFinishFullExpr(), ConvertMemberDefaultInitExpression(), CorrectDelayedTyposInExpr(), CreateRecoveryExpr(), D, DiagnoseUnexpandedParameterPack(), clang::ActionResult< PtrTy, Compress >::get(), clang::FieldDecl::getInClassInitStyle(), clang::ValueDecl::getType(), clang::ICIS_NoInit, clang::Init, clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isUsable(), PopFunctionScopeInfo(), 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 14274 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 10452 of file SemaDeclCXX.cpp.
References ActOnFields(), AdjustDeclIfTemplate(), CheckCompletedCXXClass(), clang::SemaBase::Diag(), and FieldCollector.
void Sema::ActOnFinishCXXNonNestedClass | ( | ) |
Definition at line 14286 of file SemaDeclCXX.cpp.
References ActOnFinishInlineFunctionDef(), DefineDefaultedFunction(), DelayedDllExportMemberFunctions, referenceDLLExportedClassMethods(), and clang::TSK_ExplicitInstantiationDefinition.
Referenced by InstantiateClass().
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 16412 of file SemaDecl.cpp.
References checkThisInStaticMemberFunctionAttributes(), D, ProcessAPINotes(), and ProcessDeclAttributeList().
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 10719 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), CheckConstructor(), CheckCXXDefaultArguments(), and clang::Decl::isInvalidDecl().
Definition at line 10686 of file SemaDeclCXX.cpp.
References PopDeclContext().
Referenced by clang::Parser::ReenterClassScopeRAII::~ReenterClassScopeRAII().
void Sema::ActOnFinishDelayedMemberInitializers | ( | Decl * | Record | ) |
Definition at line 13965 of file SemaDeclCXX.cpp.
References CheckDelayedMemberExceptionSpecs().
Referenced by InstantiateClass().
Decl * Sema::ActOnFinishExportDecl | ( | Scope * | S, |
Decl * | ExportDecl, | ||
SourceLocation | RBraceLoc | ||
) |
Complete the definition of an export declaration.
Definition at line 1000 of file SemaModule.cpp.
References checkExportedDecl(), D, getASTContext(), clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), and PopDeclContext().
|
inline |
Definition at line 8268 of file Sema.h.
References ActOnFinishFullExpr(), and clang::Expr::getExprLoc().
Referenced by ActOnCapScopeReturnStmt(), ActOnCaseExpr(), ActOnCoroutineBodyStart(), ActOnDoStmt(), ActOnExprStmt(), ActOnFinishCXXInClassMemberInitializer(), ActOnFinishFullExpr(), ActOnForEachLValueExpr(), ActOnIndirectGotoStmt(), clang::SemaObjC::ActOnObjCAtSynchronizedOperand(), clang::SemaObjC::ActOnObjCForCollectionStmt(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPCopyinClause(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), AddInitializerToDecl(), BuildBaseInitializer(), BuildBlockForLambdaConversion(), BuildConvertedConstantExpression(), BuildCoreturnStmt(), BuildCXXDefaultInitExpr(), BuildCXXForRangeStmt(), BuildDelegatingInitializer(), BuildMemberInitializer(), clang::SemaObjC::BuildObjCAtThrowStmt(), BuildReturnStmt(), BuildStaticAssertDeclaration(), checkOpenMPLoop(), CheckTemplateArgument(), checkTupleLikeDecomposition(), FinishOpenMPLinearClause(), instantiateOMPDeclareSimdDeclAttr(), instantiateOMPDeclareVariantAttr(), 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 9205 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 9300 of file SemaExprCXX.cpp.
References MaybeCreateStmtWithCleanups(), and clang::StmtError().
Definition at line 15877 of file SemaDecl.cpp.
References ActOnFinishFunctionBody(), and D.
Referenced by ActOnFinishFunctionBody(), ActOnLambdaExpr(), and InstantiateFunctionDefinition().
Definition at line 15950 of file SemaDecl.cpp.
References clang::Decl::addAttr(), AnalysisWarnings, clang::TargetCXXABI::canKeyFunctionBeInline(), clang::Type::castAs(), CheckCompletedCoroutineBody(), CheckConstexprFunctionDefinition(), CheckCoroutineWrapper(), CheckDestructor(), CheckImmediateEscalatingFunctionDefinition(), checkTypeSupport(), clang::Stmt::children(), clang::NSAPI::ClassId_NSObject, Cleanup, computeNRVO(), Context, clang::CPlusPlus, clang::CPlusPlus14, clang::FixItHint::CreateInsertion(), deduceClosureReturnType(), DeduceFunctionTypeFromReturnExpr(), Definition, clang::Destructor, clang::SemaBase::Diag(), Diagnose, diagnoseImplicitlyRetainedSelf(), DiagnoseInvalidJumps(), DiagnoseReturnInConstructorExceptionHandler(), DiagnoseSizeOfParametersAndReturnValue(), DiagnoseUnguardedAvailabilityViolations(), DiagnoseUnusedParameters(), clang::sema::AnalysisBasedWarnings::Policy::disableCheckFallThrough(), DiscardCleanupsInEvaluationContext(), Emitted, ExprCleanupObjects, ExprEvalContexts, clang::CleanupInfo::exprNeedsCleanups(), FindPossiblePrototype(), clang::Type::getAs(), clang::TypeLoc::getAs(), clang::Decl::getAsFunction(), clang::Decl::getAttr(), clang::DeclaratorDecl::getBeginLoc(), clang::CXXMethodDecl::getCanonicalDecl(), getCurFunction(), getCurFunctionDecl(), getCurLambda(), getCurMethodDecl(), clang::ASTContext::getCurrentKeyFunction(), clang::TargetInfo::getCXXABI(), clang::sema::AnalysisBasedWarnings::getDefaultPolicy(), getDiagnostics(), getEmissionStatus(), clang::Decl::getEndLoc(), clang::ASTContext::getFunctionType(), clang::NamedDecl::getIdentifier(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::FunctionDecl::getReturnType(), getSourceManager(), clang::FunctionDecl::getStorageClass(), clang::ASTContext::getTargetInfo(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), hasAnyUnrecoverableErrorsInThisFunction(), clang::Decl::hasAttr(), clang::FunctionDecl::hasImplicitReturnZero(), clang::sema::FunctionScopeInfo::HasPotentialAvailabilityViolations, clang::FunctionDecl::hasSkippedBody(), hasUncompilableErrorOccurred(), clang::FunctionDecl::hasWrittenPrototype(), clang::Invalid, clang::Type::isAnyPointerType(), clang::Preprocessor::isCodeCompletionEnabled(), clang::FunctionDecl::isConstexpr(), clang::QualType::isConstQualified(), clang::sema::FunctionScopeInfo::isCoroutine(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDefined(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isDeletedAsWritten(), clang::DeclContext::isDependentContext(), clang::Decl::isImplicit(), clang::FunctionDecl::isInlined(), clang::Decl::isInvalidDecl(), clang::isLambdaCallOperator(), clang::FunctionDecl::isMultiVersion(), clang::FunctionDecl::isOutOfLine(), clang::FunctionDecl::isPureVirtual(), clang::Type::isRecordType(), clang::Decl::isUnavailable(), clang::Type::isUndeducedType(), clang::CXXMethodDecl::isVirtual(), clang::isWhitespace(), LangOpts, Loc, MarkBaseAndMemberDestructorsReferenced(), MarkVTableUsed(), MaybeODRUseExprs, clang::sema::FunctionScopeInfo::NeedsScopeChecking(), clang::SemaObjC::NSAPIObj, ObjC(), clang::sema::FunctionScopeInfo::ObjCShouldCallSuper, clang::sema::FunctionScopeInfo::ObjCWarnForNoDesignatedInitChain, clang::sema::FunctionScopeInfo::ObjCWarnForNoInitDelegation, clang::LangOptions::OMPTargetTriples, clang::FunctionDecl::parameters(), PopDeclContext(), PopFunctionScopeInfo(), PP, clang::SC_None, clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::ASTContext::setNonKeyFunction(), clang::ValueDecl::setType(), clang::FunctionDecl::setWillHaveBody(), ShouldWarnAboutMissingPrototype(), SM, Unknown, clang::sema::FunctionScopeInfo::UsesFPIntrin, and clang::ASTContext::VoidTy.
void Sema::ActOnFinishFunctionDeclarationDeclarator | ( | Declarator & | D | ) |
Called after parsing a function declarator belonging to a function declaration.
Definition at line 19130 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 15373 of file SemaDecl.cpp.
References Consumer, D, and clang::ASTConsumer::HandleInlineFunctionDefinition().
Referenced by ActOnFinishCXXNonNestedClass().
void Sema::ActOnFinishKNRParamDeclarations | ( | Scope * | S, |
Declarator & | D, | ||
SourceLocation | LocAfterDecls | ||
) |
Definition at line 15295 of file SemaDecl.cpp.
References ActOnParamDeclarator(), clang::C99, Context, clang::FixItHint::CreateInsertion(), D, clang::SemaBase::Diag(), getLangOpts(), clang::IdentifierInfo::getName(), clang::ASTContext::getPrintingPolicy(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::DeclaratorChunk::ParamInfo::Ident, clang::DeclaratorChunk::ParamInfo::IdentLoc, clang::KNRTypeList, clang::ParsedAttributesView::none(), clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::Declarator::SetIdentifier(), clang::DeclSpec::SetRangeEnd(), clang::DeclSpec::SetRangeStart(), clang::DeclSpec::SetTypeSpecType(), and clang::DeclSpec::TST_int.
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 16742 of file SemaDeclCXX.cpp.
References getCurrentModule(), getLangOpts(), clang::SourceLocation::isValid(), Parent, PopDeclContext(), and clang::LinkageSpecDecl::setRBraceLoc().
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 11728 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 443 of file SemaStmt.cpp.
References PopCompoundScope().
Referenced by clang::Sema::CompoundScopeRAII::~CompoundScopeRAII().
void Sema::ActOnFinishRequiresExpr | ( | ) |
Definition at line 9589 of file SemaExprCXX.cpp.
References CurContext, and clang::DeclContext::getLexicalParent().
StmtResult Sema::ActOnFinishSEHFinallyBlock | ( | SourceLocation | Loc, |
Stmt * | Block | ||
) |
Definition at line 4461 of file SemaStmt.cpp.
References clang::Block, Context, clang::SEHFinallyStmt::Create(), CurrentSEHFinally, and Loc.
StmtResult Sema::ActOnFinishSwitchStmt | ( | SourceLocation | SwitchLoc, |
Stmt * | Switch, | ||
Stmt * | Body | ||
) |
Definition at line 1308 of file SemaStmt.cpp.
References AdjustAPSInt(), clang::AR_Available, clang::AR_Deprecated, clang::AR_NotYetIntroduced, clang::AR_Unavailable, checkCaseValue(), checkEnumTypesInSwitchStmt(), CmpCaseVals(), CmpEnumVals(), Context, clang::SemaBase::Diag(), DiagnoseEmptyStmtBody(), E, clang::EnumDecl::enumerators(), EqEnumVals(), clang::Expr::EvaluateAsInt(), clang::Expr::EvaluateKnownConstInt(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::SwitchStmt::getCond(), getCurFunction(), clang::EnumType::getDecl(), clang::DefaultStmt::getDefaultLoc(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), clang::ASTContext::getIntWidth(), clang::CaseStmt::getLHS(), clang::SwitchCase::getNextSwitchCase(), clang::CaseStmt::getRHS(), clang::Stmt::getSourceRange(), clang::SwitchStmt::getSwitchCaseList(), clang::Expr::getType(), GetTypeBeforeIntegralPromotion(), clang::Expr::IgnoreParenCasts(), int, clang::EnumDecl::isClosedNonFlag(), clang::TagDecl::isCompleteDefinition(), clang::Type::isSignedIntegerOrEnumerationType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Result, clang::Expr::SE_AllowSideEffects, clang::SwitchStmt::setAllEnumCasesCovered(), clang::SwitchStmt::setBody(), ShouldDiagnoseSwitchCaseNotInEnum(), clang::StmtError(), Switch, clang::sema::FunctionScopeInfo::SwitchStack, and toString().
Referenced by clang::TreeTransform< Derived >::RebuildSwitchStmtBody().
void Sema::ActOnFinishTopLevelStmtDecl | ( | TopLevelStmtDecl * | D, |
Stmt * | Statement | ||
) |
Definition at line 20293 of file SemaDecl.cpp.
References D, PopCompoundScope(), PopDeclContext(), and PopFunctionScopeInfo().
ExprResult Sema::ActOnFinishTrailingRequiresClause | ( | ExprResult | ConstraintExpr | ) |
Definition at line 4041 of file SemaDeclCXX.cpp.
References ActOnRequiresClause().
void Sema::ActOnForEachDeclStmt | ( | DeclGroupPtrTy | Decl | ) |
Definition at line 86 of file SemaStmt.cpp.
References clang::ast_matchers::decl, clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), getLangOpts(), clang::DeclGroupRef::getSingleDecl(), clang::DeclGroupRef::isNull(), clang::DeclGroupRef::isSingleDecl(), clang::Qualifiers::OCL_Strong, and clang::ast_matchers::type.
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 2313 of file SemaStmt.cpp.
References ActOnFinishFullExpr(), CheckPlaceholderExpr(), E, 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 2255 of file SemaStmt.cpp.
References Context, clang::CPlusPlus, clang::SemaBase::Diag(), Diags, clang::First, clang::Sema::FullExprArg::get(), clang::Sema::ConditionResult::get(), clang::ActionResult< PtrTy, Compress >::getAs(), getCurCompoundScope(), getLangOpts(), clang::Decl::getLocation(), clang::VarDecl::hasLocalStorage(), clang::DiagnosticsEngine::isIgnored(), clang::Sema::ConditionResult::isInvalid(), clang::VarDecl::isLocalVarDecl(), clang::Sema::FullExprArg::release(), clang::sema::CompoundScopeInfo::setHasEmptyLoopBodies(), and clang::StmtError().
Referenced by buildSingleCopyAssignRecursively(), and clang::TreeTransform< Derived >::RebuildForStmt().
NamedDecl * Sema::ActOnFriendFunctionDecl | ( | Scope * | S, |
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParams | ||
) |
Definition at line 17668 of file SemaDeclCXX.cpp.
References ActOnFunctionDeclarator(), clang::DeclContext::addDecl(), adjustContextForLocalExternDecl(), clang::AS_public, CheckFriendAccess(), computeDeclContext(), Context, clang::CPlusPlus11, clang::FriendDecl::Create(), clang::FixItHint::CreateRemoval(), CurContext, D, clang::Scope::DeclScope, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), Diags, clang::DeclContext::Equals(), functionDeclHasDefaultArgument(), clang::SourceRange::getBegin(), clang::DeclarationNameInfo::getBeginLoc(), clang::Decl::getDeclContext(), clang::DeclSpec::getFriendSpecLoc(), clang::Decl::getKind(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), GetNameForDeclarator(), clang::DeclContext::getNonTransparentContext(), clang::DeclaratorDecl::getNumTemplateParameterLists(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), getScopeForDeclContext(), clang::CXXScopeSpec::getScopeRep(), clang::DeclSpec::getStorageClassSpec(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::IK_ConstructorName, clang::IK_ConstructorTemplateId, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::IK_DestructorName, clang::IK_Identifier, clang::IK_ImplicitSelfParam, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::IK_TemplateId, clang::NestedNameSpecifier::isDependent(), clang::DeclContext::isDependentContext(), clang::DeclContext::isFileContext(), clang::DeclSpec::isFriendSpecified(), clang::Type::isFunctionType(), clang::CXXScopeSpec::isInvalid(), clang::Decl::isInvalidDecl(), clang::CXXScopeSpec::isNotEmpty(), clang::DeclContext::isRecord(), clang::CXXScopeSpec::isSet(), clang::CXXScopeSpec::isValid(), Loc, LookupLocalFriendName, LookupName(), LookupOrdinaryName, LookupQualifiedName(), clang::DeclContext::makeDeclVisibleInContext(), Previous, PushOnScopeChains(), RequireCompleteDeclContext(), clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::Scope::setEntity(), clang::Decl::setInvalidDecl(), clang::FriendDecl::setUnsupportedFriend(), UPPC_FriendDeclaration, and warnOnReservedIdentifier().
Decl * Sema::ActOnFriendTypeDecl | ( | Scope * | S, |
const DeclSpec & | DS, | ||
MultiTemplateParamsArg | TemplateParams, | ||
SourceLocation | EllipsisLoc | ||
) |
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 17549 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, clang::Type::containsUnexpandedParameterPack(), Context, clang::CPlusPlus11, clang::FriendDecl::Create(), clang::FriendTemplateDecl::Create(), clang::FixItHint::CreateInsertion(), CurContext, D, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::Type::getAsRecordDecl(), clang::DeclSpec::getAtomicSpecLoc(), clang::TypeLoc::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getConstSpecLoc(), clang::DeclSpec::getFriendSpecLoc(), clang::TagDecl::getKindName(), getLangOpts(), getLocForEndOfToken(), clang::DeclSpec::getRestrictSpecLoc(), clang::TypeLoc::getSourceRange(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::TagDecl::getTagKind(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getUnalignedSpecLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::Invalid, clang::Type::isElaboratedTypeSpecifier(), clang::DeclSpec::isFriendSpecified(), clang::DeclSpec::isFriendSpecifiedFirst(), clang::SourceLocation::isInvalid(), clang::Declarator::isInvalidType(), clang::SourceLocation::isValid(), Loc, clang::Member, clang::ParsedAttributesView::none(), clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::Decl::setInvalidDecl(), clang::T, clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, clang::DeclSpec::TQ_unaligned, clang::DeclSpec::TQ_volatile, and UPPC_FriendDeclaration.
Referenced by ParsedFreeStandingDeclSpec().
NamedDecl * Sema::ActOnFunctionDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
DeclContext * | DC, | ||
TypeSourceInfo * | TInfo, | ||
LookupResult & | Previous, | ||
MultiTemplateParamsArg | TemplateParamLists, | ||
bool & | AddToScope | ||
) |
Definition at line 9816 of file SemaDecl.cpp.
References clang::SemaHLSL::ActOnTopLevelFunction(), clang::Decl::addAttr(), clang::SemaObjC::AddCFAuditedAttribute(), clang::DeclContext::addDecl(), AddImplicitMSFunctionNoBuiltinAttr(), AddKnownFunctionAttributes(), AddPushedVisibilityAttribute(), AddRangeBasedOptnone(), AddSectionMSAllocText(), adjustContextForLocalExternDecl(), adjustMemberFunctionCC(), clang::TargetInfo::allowDebugInfoForExternalRef(), clang::Builtin::Context::allowTypeMismatch(), clang::TemplateSpecializationType::anyInstantiationDependentTemplateArguments(), clang::TemplateArgumentListInfo::arguments(), clang::AS_public, clang::ast_matchers::attr, BuildParmVarDeclForTypedef(), clang::ASTContext::BuiltinInfo, clang::Type::castAs(), clang::CC_X86StdCall, checkAttributesAfterMerging(), CheckDependentFunctionTemplateSpecialization(), checkDLLAttributeRedeclaration(), clang::SemaHLSL::CheckEntryPoint(), CheckFunctionDeclaration(), CheckFunctionTemplateSpecialization(), checkIsValidOpenCLKernelParameter(), CheckMain(), CheckMemberSpecialization(), CheckMSVCRTEntryPoint(), checkNonTrivialCUnion(), CheckTemplateDeclScope(), CheckTemplateParameterList(), clang::CLanguageLinkage, CodeSegStack, CompleteMemberSpecialization(), clang::Consteval, clang::Constexpr, clang::DeclContext::containsDecl(), Context, clang::CPlusPlus, clang::CPlusPlus14, clang::CPlusPlus20, clang::FunctionTemplateDecl::Create(), clang::FixItHint::CreateInsertion(), CreateNewFunctionDecl(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), CUDA(), CurContext, clang::Sema::PragmaStack< ValueType >::CurrentValue, clang::DeclarationName::CXXDestructorName, D, clang::Declaration, clang::Default, clang::Defaulted, clang::Definition, clang::Deleted, clang::SemaBase::Diag(), DiagnoseInvalidRedeclaration(), DiagnoseUnexpandedParameterPack(), clang::Decl::dropAttr(), E, clang::EST_BasicNoexcept, ExternalDeclarations, ExtnameUndeclaredIdentifiers, FilterLookupForScope(), clang::LookupResult::FoundOverloaded, FriendConstraintsDependOnEnclosingTemplate(), clang::FTIHasNonVoidParameters(), FunctionTemplate, clang::Decl::getAccess(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::Decl::getAttr(), clang::SourceRange::getBegin(), clang::DeclaratorDecl::getBeginLoc(), clang::Decl::getBeginLoc(), clang::ASTContext::GetBuiltinType(), clang::QualType::getCanonicalType(), clang::FunctionType::ExtInfo::getCC(), clang::FunctionType::getCmseNSCallAttr(), clang::SemaCUDA::getConfigureFuncName(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::DeclaratorChunk::FunctionTypeInfo::getDeclsInPrototype(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::SourceRange::getEnd(), clang::FunctionType::getExtInfo(), clang::FunctionProtoType::getExtProtoInfo(), getFunctionStorageClass(), clang::ASTContext::getFunctionType(), clang::NamedDecl::getIdentifier(), getImplicitCodeSegOrSectionAttrForFunction(), clang::Decl::getKind(), getLangOpts(), clang::FunctionDecl::getLanguageLinkage(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::NamedDecl::getName(), clang::DeclarationNameInfo::getName(), clang::FunctionType::getNameForCallConv(), GetNameForDeclarator(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getOverloadedOperator(), clang::Decl::getOwningModule(), clang::FunctionProtoType::getParamTypes(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::DeclContext::getRedeclContext(), clang::FunctionDecl::getReturnType(), clang::FunctionType::getReturnType(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::Decl::getSourceRange(), clang::TemplateParameterList::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::StringLiteral::getString(), clang::StringLiteral::getStrTokenLoc(), getTagInjectionContext(), clang::ASTContext::getTargetInfo(), clang::TemplateIdAnnotation::getTemplateArgs(), clang::TemplateDecl::getTemplateParameters(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getType(), clang::Type::getUnqualifiedDesugaredType(), clang::Decl::hasAttr(), clang::FunctionProtoType::hasExceptionSpec(), clang::TargetInfo::hasFeature(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), clang::ASTContext::hasSameFunctionTypeIgnoringExceptionSpec(), HLSL(), clang::Decl::IDNS_Ordinary, clang::IK_TemplateId, clang::Invalid, clang::FunctionDecl::isCPUDispatchMultiVersion(), clang::FunctionDecl::isCPUSpecificMultiVersion(), isDeclExternC(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::NamedDecl::isExternallyVisible(), clang::FunctionDecl::isExternC(), clang::DeclContext::isFileContext(), clang::Redeclarable< decl_type >::isFirstDecl(), clang::Decl::isFromGlobalModule(), clang::Type::isFunctionNoProtoType(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isFunctionType(), clang::Module::isHeaderLikeModule(), isIncompleteDeclExternC(), clang::Decl::isInIdentifierNamespace(), clang::Decl::isInNamedModule(), clang::Decl::isInStdNamespace(), clang::Builtin::Context::isInStdNamespace(), clang::Decl::isInvalidDecl(), clang::FunctionDecl::isMain(), clang::FunctionDecl::isMSVCRTEntryPoint(), clang::FunctionDecl::isMultiVersion(), clang::DeclContext::isObjCContainer(), clang::FunctionDecl::isOutOfLine(), clang::FunctionDecl::isOverloadedOperator(), clang::Type::isPointerOrReferenceType(), clang::DeclContext::isRecord(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::Type::isScalarType(), isStdBuiltin(), clang::IdentifierInfo::isStr(), clang::Decl::isTemplated(), clang::DeclContext::isTranslationUnit(), clang::Type::isUndeducedType(), clang::SourceRange::isValid(), clang::Type::isVariablyModifiedType(), clang::FunctionDecl::isVariadic(), clang::Type::isVoidType(), clang::Type::isWebAssemblyTableType(), clang::TemplateIdAnnotation::LAngleLoc, LookupNecessaryTypesForBuiltin(), MarkUnusedFileScopedDecl(), MatchTemplateParametersToScopeSpecifier(), clang::SemaCUDA::maybeAddHostDeviceAttrs(), ModifyFnAttributesMSPragmaOptimize(), clang::LangOptionsBase::MSVC2015, NTCUC_FunctionReturn, NTCUK_Copy, NTCUK_Destruct, clang::TemplateIdAnnotation::NumArgs, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, ObjC(), OpenCL(), OriginalLexicalContext, clang::DeclaratorChunk::ParamInfo::Param, clang::FunctionDecl::parameters(), clang::DeclaratorChunk::FunctionTypeInfo::Params, Parent, PragmaClangTextSection, clang::Sema::PragmaClangSection::PragmaLocation, Previous, ProcessDeclAttributes(), ProcessPragmaWeak(), clang::ASTContext::PSF_Execute, clang::ASTContext::PSF_Implicit, clang::ASTContext::PSF_Read, clang::TemplateIdAnnotation::RAngleLoc, RebuildTemplateParamsInCurrentInstantiation(), RegisterLocallyScopedExternCDecl(), clang::DeclContext::removeDecl(), clang::Result, clang::SC_None, clang::SC_Static, clang::Sema::PragmaClangSection::SectionName, clang::Decl::setAccess(), clang::FunctionDecl::setConstexprKind(), clang::ASTContext::setcudaConfigureCallDecl(), clang::Decl::setDeclContext(), clang::FunctionDecl::setDefaulted(), clang::FunctionDecl::setDeletedAsWritten(), clang::FunctionDecl::setDescribedFunctionTemplate(), clang::FunctionDecl::setFriendConstraintRefersToEnclosingTemplate(), clang::FunctionDecl::setImplicitlyInline(), clang::Decl::setInvalidDecl(), clang::FunctionDecl::setIsPureVirtual(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::Decl::setLexicalDeclContext(), clang::Decl::setLocalExternDecl(), clang::NamedDecl::setModulePrivate(), SetNestedNameSpecifier(), clang::Decl::setNonMemberOperator(), clang::Decl::setObjectOfFriendDecl(), clang::FunctionDecl::setRangeEnd(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::ParmVarDecl::setScopeInfo(), clang::DeclaratorDecl::setTemplateParameterListsInfo(), clang::Decl::setTopLevelDeclInObjCContainer(), clang::ValueDecl::setType(), clang::FunctionDecl::setVirtualAsWritten(), shouldConsiderLinkage(), clang::TemplateParameterList::size(), StrictGuardStackCheckStack, clang::supportsVariadicCall(), TPC_ClassTemplateMember, TPC_FriendFunctionTemplate, TPC_FriendFunctionTemplateDefinition, TPC_FunctionTemplate, translateTemplateArguments(), UnifySection(), clang::Unspecified, UPPC_ExplicitSpecialization, UPPC_FriendDeclaration, clang::Sema::PragmaClangSection::Valid, and clang::FunctionProtoType::ExtProtoInfo::withExceptionSpec().
Referenced by ActOnFriendFunctionDecl(), DiagnoseInvalidRedeclaration(), and HandleDeclarator().
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 236 of file SemaStmtAsm.cpp.
References clang::TargetInfo::ConstraintInfo::allowsMemory(), clang::TargetInfo::ConstraintInfo::allowsRegister(), CheckAsmLValue(), checkExprMemoryConstraintCompat(), CheckNakedParmReference(), CheckPlaceholderExpr(), CleanupVarDeclMarking(), Context, clang::FixItHint::CreateReplacement(), DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), DiscardCleanupsInEvaluationContext(), E, emitAndFixInvalidAsmCastLValue(), clang::Expr::EvaluateAsRValue(), clang::Found, clang::ActionResult< PtrTy, Compress >::get(), clang::CharSourceRange::getBegin(), clang::Stmt::getBeginLoc(), getClobberConflictLocation(), clang::TargetInfo::ConstraintInfo::getConstraintStr(), getCurLexicalContext(), clang::Expr::getExprLoc(), clang::ASTContext::getFunctionFeatureMap(), clang::ASTContext::getIntTypeForBitwidth(), getLocationOfStringLiteralByte(), clang::GCCAsmStmt::AsmStringPiece::getModifier(), clang::IdentifierInfo::getName(), getName(), clang::GCCAsmStmt::AsmStringPiece::getOperandNo(), clang::GCCAsmStmt::AsmStringPiece::getRange(), clang::Stmt::getSourceRange(), clang::GCCAsmStmt::AsmStringPiece::getString(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::ConstraintInfo::getTiedOperand(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasSameType(), clang::TargetInfo::ConstraintInfo::hasTiedOperand(), clang::Expr::IgnoreParenNoopCasts(), ImpCastExprToType(), clang::Type::isBitIntType(), clang::Type::isBooleanType(), clang::Type::isDependentType(), clang::Expr::isEvaluatable(), clang::Type::isIncompleteType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMemberPointerType(), clang::Expr::isModifiableLvalue(), clang::QualType::isNull(), clang::GCCAsmStmt::AsmStringPiece::isOperand(), isOperandMentioned(), clang::StringLiteral::isOrdinary(), clang::Type::isPointerType(), clang::Type::isRealFloatingType(), clang::Type::isStructureType(), clang::Expr::isTypeDependent(), clang::SourceLocation::isValid(), clang::TargetInfo::ConstraintInfo::isValidAsmImmediate(), clang::TargetInfo::isValidClobber(), clang::Expr::isValueDependent(), clang::Type::isVoidType(), LangOpts, clang::Expr::MLV_ArrayType, clang::Expr::MLV_IncompleteType, clang::Expr::MLV_IncompleteVoidType, clang::Expr::MLV_LValueCast, clang::Expr::MLV_Valid, NS, RequireCompleteType(), clang::TargetInfo::ConstraintInfo::requiresImmediateConstant(), clang::Result, setFunctionHasBranchIntoScope(), clang::StmtError(), targetDiag(), clang::APValue::toIntegralConstant(), toString(), clang::Expr::EvalResult::Val, clang::TargetInfo::validateConstraintModifier(), clang::TargetInfo::validateInputConstraint(), clang::TargetInfo::validateInputSize(), clang::TargetInfo::validateOutputConstraint(), and clang::TargetInfo::validateOutputSize().
Referenced by clang::TreeTransform< Derived >::RebuildGCCAsmStmt().
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 1639 of file SemaExpr.cpp.
References CreateGenericSelectionExpr(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), and GetTypeFromParser().
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.
References Context, clang::ASTContext::getTranslationUnitDecl(), clang::Decl::ReachableWhenImported, and clang::Decl::setModuleOwnershipKind().
ExprResult Sema::ActOnGNUNullExpr | ( | SourceLocation | TokenLoc | ) |
Definition at line 16665 of file SemaExpr.cpp.
References Context, clang::Default, clang::TargetInfo::getIntWidth(), clang::TargetInfo::getLongLongWidth(), clang::TargetInfo::getLongWidth(), clang::TargetInfo::getPointerWidth(), clang::ASTContext::getTargetInfo(), clang::ASTContext::IntTy, clang::ASTContext::LongLongTy, and clang::ASTContext::LongTy.
StmtResult Sema::ActOnGotoStmt | ( | SourceLocation | GotoLoc, |
SourceLocation | LabelLoc, | ||
LabelDecl * | TheDecl | ||
) |
Definition at line 3217 of file SemaStmt.cpp.
References Context, getCurScope(), clang::Decl::markUsed(), setFunctionHasBranchIntoScope(), and setFunctionHasBranchProtectedScope().
Referenced by clang::TreeTransform< Derived >::RebuildGotoStmt().
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 2676 of file SemaExpr.cpp.
References ActOnDependentIdExpression(), clang::LookupResult::addDecl(), BuildDeclarationNameExpr(), BuildDeclRefExpr(), BuildPossibleImplicitMemberExpr(), BuildTemplateIdExpr(), clang::LookupResult::clear(), clearDelayedTypo(), Context, clang::CPlusPlus, D, DecomposeUnqualifiedId(), DiagnoseEmptyLookup(), E, clang::LookupResult::empty(), clang::ExprError(), clang::LookupResult::getAsSingle(), getCurMethodDecl(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getScopeRep(), clang::IdentifierInfo::getTokenID(), getTypoExprState(), Id, clang::IK_ImplicitSelfParam, clang::IK_TemplateId, ImplicitlyDefineFunction(), clang::CorrectionCandidateCallback::IsAddressOfOperand, clang::LookupResult::isAmbiguous(), isAttrContext(), clang::IdentifierInfo::isEditorPlaceholder(), clang::CXXScopeSpec::isEmpty(), clang::CXXScopeSpec::isInvalid(), isPotentialImplicitMemberAccess(), clang::CXXScopeSpec::isSet(), clang::SourceLocation::isValid(), clang::CXXScopeSpec::isValid(), LookupMemberName, LookupName(), LookupObjCImplicitSelfParam, LookupOrdinaryName, LookupParsedName(), LookupTemplateName(), ObjC(), recoverFromMSUnqualifiedLookup(), clang::Token::setIdentifierInfo(), clang::Token::setKind(), clang::Token::setLocation(), clang::CorrectionCandidateCallback::setTypoName(), clang::CorrectionCandidateCallback::setTypoNNS(), clang::Token::startToken(), clang::TNK_Var_template, clang::ast_matchers::type, UseArgumentDependentLookup(), clang::VK_LValue, and clang::LookupResult::wasNotFoundInCurrentInstantiation().
Referenced by clang::SemaObjC::BuildIvarRefExpr(), clang::SemaCodeCompletion::CodeCompleteObjCSuperMessage(), DefaultVariadicArgumentPromotion(), and LookupInlineAsmIdentifier().
StmtResult Sema::ActOnIfStmt | ( | SourceLocation | IfLoc, |
IfStatementKind | StatementKind, | ||
SourceLocation | LParenLoc, | ||
Stmt * | InitStmt, | ||
ConditionResult | Cond, | ||
SourceLocation | RParenLoc, | ||
Stmt * | ThenVal, | ||
SourceLocation | ElseLoc, | ||
Stmt * | ElseVal | ||
) |
Definition at line 962 of file SemaStmt.cpp.
References BuildIfStmt(), clang::C99, clang::Decl::castFromDeclContext(), clang::ConstevalNegated, clang::ConstevalNonNegated, clang::Constexpr, Context, clang::CPlusPlus, CurContext, clang::Stmt::determineLikelihoodConflict(), clang::SemaBase::Diag(), DiagnoseEmptyStmtBody(), Diags, ExprEvalContexts, clang::Sema::ConditionResult::get(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), getLangOpts(), clang::Stmt::getLikelihoodAttr(), clang::Attr::getLocation(), clang::SourceLocation::getLocWithOffset(), clang::AttributeCommonInfo::getRange(), ImmediateFunctionContext, clang::DeclContext::isFunctionOrMethod(), clang::DiagnosticsEngine::isIgnored(), clang::Sema::ConditionResult::isInvalid(), isUnevaluatedContext(), clang::DiagnosticsEngine::Report(), and clang::StmtError().
Referenced by clang::TreeTransform< Derived >::RebuildIfStmt().
StmtResult Sema::ActOnIndirectGotoStmt | ( | SourceLocation | GotoLoc, |
SourceLocation | StarLoc, | ||
Expr * | DestExp | ||
) |
Definition at line 3232 of file SemaStmt.cpp.
References ActOnFinishFullExpr(), CheckSingleAssignmentConstraints(), Context, DiagnoseAssignmentResult(), E, clang::ActionResult< PtrTy, Compress >::get(), getCurScope(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), clang::Passing, setFunctionHasBranchProtectedScope(), setFunctionHasIndirectGoto(), clang::StmtError(), clang::ASTContext::VoidTy, and clang::CanQual< T >::withConst().
Referenced by clang::TreeTransform< Derived >::RebuildIndirectGotoStmt().
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 13894 of file SemaDecl.cpp.
References AbstractVariableType, Context, D, clang::ASTContext::getBaseElementType(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Type::isDependentType(), clang::Decl::isInvalidDecl(), clang::Type::isUndeducedType(), RequireCompleteType(), RequireNonAbstractType(), and clang::Decl::setInvalidDecl().
Referenced by ActOnCXXForRangeStmt().
ExprResult Sema::ActOnInitList | ( | SourceLocation | LBraceLoc, |
MultiExprArg | InitArgList, | ||
SourceLocation | RBraceLoc | ||
) |
Definition at line 7186 of file SemaExpr.cpp.
References BuildInitList(), clang::C99, clang::CPlusPlus, clang::CPlusPlus20, clang::SemaBase::Diag(), E, getLangOpts(), clang::SourceLocation::isInvalid(), and clang::SourceLocation::isValid().
ExprResult Sema::ActOnIntegerConstant | ( | SourceLocation | Loc, |
int64_t | Val | ||
) |
Definition at line 3598 of file SemaExpr.cpp.
References Context, clang::IntegerLiteral::Create(), clang::TargetInfo::getIntWidth(), clang::ASTContext::getTargetInfo(), clang::ASTContext::IntTy, and Loc.
Referenced by ActOnNumericConstant(), clang::SemaObjC::ActOnObjCBoolLiteral(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), checkArrayLikeDecomposition(), checkOpenMPIterationSpace(), checkOpenMPLoop(), and FinishOpenMPLinearClause().
StmtResult Sema::ActOnLabelStmt | ( | SourceLocation | IdentLoc, |
LabelDecl * | TheDecl, | ||
SourceLocation | ColonLoc, | ||
Stmt * | SubStmt | ||
) |
Definition at line 608 of file SemaStmt.cpp.
References Context, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), getCurScope(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getSourceManager(), clang::LabelDecl::getStmt(), clang::LabelDecl::isGnuLocal(), clang::SourceManager::isInSystemHeader(), clang::LabelDecl::isMSAsmLabel(), clang::NamedDecl::isReserved(), clang::isReservedInAllContexts(), setFunctionHasBranchProtectedScope(), clang::Decl::setLocation(), clang::LabelDecl::setLocStart(), and clang::LabelDecl::setStmt().
Referenced by clang::TreeTransform< Derived >::RebuildLabelStmt().
void Sema::ActOnLambdaClosureParameters | ( | Scope * | LambdaScope, |
MutableArrayRef< DeclaratorChunk::ParamInfo > | ParamInfo | ||
) |
Definition at line 1367 of file SemaLambda.cpp.
References AddTemplateParametersToLambdaCallOperator(), clang::sema::LambdaScopeInfo::AfterParameterList, clang::sema::LambdaScopeInfo::CallOperator, clang::TemplateParameterList::containsUnexpandedParameterPack(), clang::sema::CapturingScopeInfo::ContainsUnexpandedParameterPack, getCurrentLambdaScopeUnsafe(), getGenericLambdaTemplateParameterList(), clang::sema::LambdaScopeInfo::Lambda, P, PushDeclContext(), PushOnScopeChains(), and clang::CXXRecordDecl::setLambdaIsGeneric().
void Sema::ActOnLambdaClosureQualifiers | ( | LambdaIntroducer & | Intro, |
SourceLocation | MutableLoc | ||
) |
Definition at line 1341 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::CallOperator, CheckCXXThisCapture(), Context, clang::LambdaIntroducer::Default, clang::LambdaIntroducer::DefaultLoc, clang::SemaBase::Diag(), getCurrentLambdaScopeUnsafe(), getCurrentThisType(), clang::DeclContext::getParent(), clang::DeclContext::isFunctionOrMethod(), clang::SourceLocation::isValid(), clang::sema::LambdaScopeInfo::Lambda, clang::LCD_None, 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 1564 of file SemaLambda.cpp.
References ActOnFields(), CheckCompletedCXXClass(), clang::Class, DiscardCleanupsInEvaluationContext(), FunctionScopes, clang::sema::LambdaScopeInfo::Lambda, PopDeclContext(), PopExpressionEvaluationContext(), and PopFunctionScopeInfo().
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 547 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::ExplicitTemplateParamsRange, getCurLambda(), 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 1954 of file SemaLambda.cpp.
References ActOnFinishFunctionBody(), BuildLambdaExpr(), clang::sema::LambdaScopeInfo::CallOperator, clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), FunctionScopes, clang::Stmt::getEndLoc(), clang::Decl::hasAttr(), and SYCL().
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 1064 of file SemaLambda.cpp.
References addInitCapture(), clang::sema::LambdaScopeInfo::AfterParameterList, clang::C, clang::VarDecl::CallInit, clang::sema::LambdaScopeInfo::CallOperator, clang::sema::LambdaScopeInfo::CaptureDefaultLoc, clang::LambdaIntroducer::Captures, clang::sema::CapturingScopeInfo::Captures, CheckCXXThisCapture(), CheckShadow(), clang::VarDecl::CInit, clang::Class, clang::sema::CapturingScopeInfo::ContainsUnexpandedParameterPack, clang::CopyInit, clang::CPlusPlus14, clang::CPlusPlus17, clang::CPlusPlus20, CreateLambdaCallOperator(), createLambdaClosureType(), createLambdaInitCaptureVarDecl(), clang::FixItHint::CreateRemoval(), CurContext, D, clang::LambdaIntroducer::Default, clang::LambdaIntroducer::DefaultLoc, clang::SemaBase::Diag(), DiagnoseEmptyLookup(), DiagnoseUnexpandedParameterPack(), DiagnoseUseOfDecl(), DiagPlaceholderVariableDefinition(), clang::DirectInit, E, clang::LookupResult::empty(), clang::sema::LambdaScopeInfo::ExplicitCaptureRanges, finishLambdaExplicitCaptures(), clang::LookupResult::getAsSingle(), clang::SourceRange::getBegin(), getCurLambda(), getCurrentThisType(), clang::sema::CapturingScopeInfo::getCXXThisCapture(), getLangOpts(), clang::Decl::getLocation(), clang::sema::Capture::getLocation(), getLocForEndOfToken(), clang::Scope::getParent(), clang::ValueDecl::getPotentiallyDecomposedVarDecl(), clang::Scope::getTemplateParamParent(), clang::VarDecl::hasLocalStorage(), clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::sema::LambdaScopeInfo::IntroducerRange, clang::LookupResult::isAmbiguous(), clang::sema::CapturingScopeInfo::isCXXThisCaptured(), clang::ValueDecl::isInitCapture(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), clang::Decl::isParameterPack(), clang::NamedDecl::isPlaceholderVar(), 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, LookupName(), LookupOrdinaryName, clang::NoInit, clang::InventedTemplateParameterInfo::NumExplicitTemplateParams, P, PopDeclContext(), PushDeclContext(), PushOnScopeChains(), clang::LambdaIntroducer::Range, clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), TryCapture_ExplicitByRef, TryCapture_ExplicitByVal, tryCaptureVariable(), UPPC_Initializer, 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 8766 of file Sema.h.
References buildLambdaInitCaptureInitialization(), clang::CopyInit, Id, clang::Init, Loc, and clang::OpaquePtr< QualType >::make().
void Sema::ActOnLastBitfield | ( | SourceLocation | DeclStart, |
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 18758 of file SemaDecl.cpp.
References clang::ASTContext::CharTy, Context, clang::ObjCIvarDecl::Create(), clang::IntegerLiteral::Create(), clang::ConstantExpr::Create(), CurContext, clang::ASTContext::getTrivialTypeSourceInfo(), clang::ASTContext::getTypeSize(), clang::ASTContext::IntTy, clang::FieldDecl::isBitField(), clang::ObjCRuntime::isFragile(), clang::FieldDecl::isZeroLengthBitField(), LangOpts, clang::LangOptions::ObjCRuntime, and clang::ObjCIvarDecl::Private.
ExprResult Sema::ActOnMemberAccessExpr | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | TemplateKWLoc, | ||
UnqualifiedId & | Member, | ||
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 1793 of file SemaExprMember.cpp.
References BuildMemberReferenceExpr(), DecomposeUnqualifiedId(), clang::SemaBase::Diag(), clang::ExprError(), FindFirstQualifierInScope(), clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::CXXScopeSpec::getScopeRep(), Id, clang::IK_ConstructorName, clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXScopeSpec::isSet(), MaybeConvertParenListExprToParenExpr(), and clang::Result.
Referenced by BuildMemberReferenceExpr().
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 4166 of file SemaDeclCXX.cpp.
References BuildMemInitializer().
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 4181 of file SemaDeclCXX.cpp.
References BuildMemInitializer(), Context, and clang::ParenListExpr::Create().
void Sema::ActOnMemInitializers | ( | Decl * | ConstructorDecl, |
SourceLocation | ColonLoc, | ||
ArrayRef< CXXCtorInitializer * > | MemInits, | ||
bool | AnyErrors | ||
) |
ActOnMemInitializers - Handle the member initializers for a constructor.
Definition at line 5627 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), Context, clang::SemaBase::Diag(), DiagnoseBaseOrMemInitializerOrder(), GetKeyForMember(), clang::Init, 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 ActOnEndOfTranslationUnitFragment(), clang::DeclContext::addDecl(), clang::ASTContext::addModuleInitializer(), clang::Module::AllVisible, clang::LangOptionsBase::CMK_HeaderUnit, clang::LangOptionsBase::CMK_ModuleInterface, clang::LangOptionsBase::CMK_ModuleMap, clang::LangOptionsBase::CMK_None, Context, ConvertDeclToDeclGroup(), clang::ImportDecl::Create(), clang::FixItHint::CreateInsertion(), CurContext, clang::LangOptions::CurrentModule, clang::SemaBase::Diag(), DiagReservedModuleName(), FirstDecl, getASTContext(), getASTMutationListener(), clang::Preprocessor::getHeaderSearchInfo(), clang::Preprocessor::getIdentifierInfo(), clang::VisibleModuleSet::getImportLoc(), getLangOpts(), clang::SourceManager::getLocForStartOfFile(), clang::SourceManager::getMainFileID(), getModuleLoader(), clang::HeaderSearch::getModuleMap(), getSourceManager(), clang::ASTContext::getTranslationUnitDecl(), Global, GlobalFragment, Implementation, ImportAllowed, clang::Module::Imports, Interface, clang::SourceLocation::isValid(), clang::Module::Kind, clang::ModuleLoader::loadModule(), makeTransitiveImportsVisible(), clang::Module::ModulePartitionImplementation, clang::Module::ModulePartitionInterface, NotACXX20Module, PartitionImplementation, PartitionInterface, Path, PP, clang::Decl::ReachableWhenImported, clang::ASTContext::setCurrentNamedModule(), clang::Decl::setModuleOwnershipKind(), clang::VisibleModuleSet::setVisible(), SourceMgr, and stringFromPath().
DeclResult Sema::ActOnModuleImport | ( | SourceLocation | StartLoc, |
SourceLocation | ExportLoc, | ||
SourceLocation | ImportLoc, | ||
Module * | M, | ||
ModuleIdPath | Path = {} |
||
) |
Definition at line 639 of file SemaModule.cpp.
References clang::DeclContext::addDecl(), clang::ASTContext::addModuleInitializer(), checkModuleImportContext(), Context, clang::ImportDecl::Create(), CurContext, clang::LangOptions::CurrentModule, currentModuleIsImplementation(), clang::SemaBase::Diag(), clang::Module::Exports, getASTContext(), getCurrentModule(), getEnclosingExportDecl(), clang::Module::getFullModuleName(), getLangOpts(), clang::Module::Imports, clang::Module::isForBuilding(), clang::Module::isHeaderUnit(), clang::Module::isModulePartitionImplementation(), clang::Module::isNamedModule(), clang::SourceLocation::isValid(), clang::Module::Kind, makeTransitiveImportsVisible(), clang::Module::ModulePartitionImplementation, clang::Module::Name, clang::Module::Parent, Path, and clang::VisibleModuleSet::setVisible().
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 573 of file SemaModule.cpp.
References ActOnModuleImport(), clang::Module::AllVisible, currentModuleIsImplementation(), clang::SemaBase::Diag(), getCurrentModule(), clang::Preprocessor::getIdentifierInfo(), getLangOpts(), getModuleLoader(), clang::Module::getPrimaryModuleInterfaceName(), clang::Module::isInterfaceOrPartition(), clang::ModuleLoader::loadModule(), ObjC(), Path, PP, and stringFromPath().
Referenced by ActOnModuleImport(), and 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 930 of file SemaStmtAsm.cpp.
References Context, clang::SemaBase::Diag(), E, clang::Stmt::getBeginLoc(), clang::Decl::getLocation(), clang::Expr::getSourceBitField(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isBitIntType(), NS, clang::Expr::refersToBitField(), setFunctionHasBranchProtectedScope(), and clang::StmtError().
Referenced by clang::TreeTransform< Derived >::RebuildMSAsmStmt().
StmtResult Sema::ActOnMSDependentExistsStmt | ( | SourceLocation | KeywordLoc, |
bool | IsIfExists, | ||
CXXScopeSpec & | SS, | ||
UnqualifiedId & | Name, | ||
Stmt * | Nested | ||
) |
Definition at line 4491 of file SemaStmt.cpp.
References BuildMSDependentExistsStmt(), Context, GetNameFromUnqualifiedId(), and clang::CXXScopeSpec::getWithLocInContext().
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 594 of file SemaDecl.cpp.
References Context, clang::NestedNameSpecifier::Create(), CreateParsedType(), CurContext, clang::SemaBase::Diag(), findRecordWithDependentBasesOfEnclosingMethod(), getCurScope(), clang::ASTContext::getDependentNameType(), getLangOpts(), clang::NestedNameSpecifierLocBuilder::getWithLocInContext(), clang::NestedNameSpecifierLocBuilder::MakeTrivial(), clang::None, clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), synthesizeCurrentNestedNameSpecifier(), and clang::T.
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 1239 of file SemaDecl.cpp.
References ActOnDependentIdExpression().
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 1249 of file SemaDecl.cpp.
References BuildDeclarationNameExpr(), clang::SemaObjC::BuildIvarRefExpr(), clang::Found, getCurMethodDecl(), clang::Token::is(), clang::CXXScopeSpec::isEmpty(), LookupOrdinaryName, ObjC(), clang::Result, and UseArgumentDependentLookup().
ExprResult Sema::ActOnNameClassifiedAsOverloadSet | ( | Scope * | S, |
Expr * | OverloadSet | ||
) |
Act on the result of classifying a name as an overload set.
Definition at line 1266 of file SemaDecl.cpp.
References clang::CXXScopeSpec::Adopt(), BuildPossibleImplicitMemberExpr(), E, LookupOrdinaryName, and clang::Result.
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 1230 of file SemaDecl.cpp.
References BuildDeclarationNameExpr(), clang::CPlusPlus, getLangOpts(), LookupOrdinaryName, and clang::Result.
Decl * Sema::ActOnNamespaceAliasDef | ( | Scope * | CurScope, |
SourceLocation | NamespaceLoc, | ||
SourceLocation | AliasLoc, | ||
IdentifierInfo * | Alias, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | IdentLoc, | ||
IdentifierInfo * | Ident | ||
) |
Definition at line 13550 of file SemaDeclCXX.cpp.
References clang::AliasDecl, clang::LookupResult::clear(), Context, clang::NamespaceAliasDecl::Create(), CurContext, clang::SemaBase::Diag(), DiagnoseTemplateParameterShadow(), DiagnoseUseOfDecl(), clang::LookupResult::empty(), FilterLookupForScope(), clang::LookupResult::getFoundDecl(), clang::Decl::getLocation(), getNamespaceDecl(), clang::CXXScopeSpec::getRange(), clang::LookupResult::getRepresentativeDecl(), clang::NamedDecl::getUnderlyingDecl(), clang::CXXScopeSpec::getWithLocInContext(), clang::LookupResult::isAmbiguous(), clang::LookupResult::isSingleResult(), clang::Decl::isTemplateParameter(), isVisible(), LookupName(), LookupNamespaceName, LookupOrdinaryName, LookupParsedName(), PushOnScopeChains(), and TryNamespaceTypoCorrection().
concepts::Requirement * Sema::ActOnNestedRequirement | ( | Expr * | Constraint | ) |
Definition at line 9511 of file SemaExprCXX.cpp.
References BuildNestedRequirement().
ExprResult Sema::ActOnNoexceptExpr | ( | SourceLocation | KeyLoc, |
SourceLocation | LParen, | ||
Expr * | Operand, | ||
SourceLocation | RParen | ||
) |
Definition at line 8529 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 81 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(), clang::Expr::isValueDependent(), and clang::Result.
NamedDecl * Sema::ActOnNonTypeTemplateParameter | ( | Scope * | S, |
Declarator & | D, | ||
unsigned | Depth, | ||
unsigned | Position, | ||
SourceLocation | EqualLoc, | ||
Expr * | DefaultArg | ||
) |
Definition at line 1445 of file SemaTemplate.cpp.
References clang::IdentifierResolver::AddDecl(), clang::AS_public, AttachTypeConstraint(), CheckFunctionOrTemplateParamDeclarator(), CheckNonTypeTemplateParameterType(), clang::Type::containsUnexpandedParameterPack(), Context, clang::NonTypeTemplateParmDecl::Create(), clang::FixItHint::CreateRemoval(), D, Default, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::Decl::getBeginLoc(), clang::DeclSpec::getConstexprSpecLoc(), clang::Type::getContainedAutoType(), clang::TypeLoc::getContainedAutoTypeLoc(), clang::Type::getContainedDeducedType(), getEnclosingLambdaOrBlock(), clang::DeclSpec::getExplicitSpecLoc(), clang::DeclSpec::getInlineSpecLoc(), clang::DeclSpec::getNoreturnSpecLoc(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), clang::ASTContext::getTranslationUnitDecl(), getTrivialTemplateArgumentLoc(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getVirtualSpecLoc(), clang::DeclSpec::hasConstexprSpecifier(), clang::DeclSpec::hasExplicitSpecifier(), IdResolver, clang::ASTContext::IntTy, clang::Invalid, clang::DeclSpec::isInlineSpecified(), clang::DeclSpec::isNoreturnSpecified(), clang::NonTypeTemplateParmDecl::isParameterPack(), clang::DeclSpec::isVirtualSpecified(), Loc, maybeDiagnoseTemplateParameterShadow(), clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::NonTypeTemplateParmDecl::setDefaultArgument(), clang::Decl::setInvalidDecl(), clang::T, clang::TSCS_unspecified, UPPC_DefaultArgument, and UPPC_TypeConstraint.
StmtResult Sema::ActOnNullStmt | ( | SourceLocation | SemiLoc, |
bool | HasLeadingEmptyMacro = false |
||
) |
Definition at line 71 of file SemaStmt.cpp.
References Context.
ExprResult Sema::ActOnNumericConstant | ( | const Token & | Tok, |
Scope * | UDLScope = nullptr |
||
) |
Definition at line 3672 of file SemaExpr.cpp.
References clang::ASTContext::AccumTy, ActOnIntegerConstant(), clang::TemplateArgumentListInfo::addArgument(), clang::ASTContext::adjustStringLiteralBaseType(), BuildFloatingLiteral(), BuildLiteralOperatorCall(), clang::C23, clang::C99, clang::Type::castAs(), clang::ASTContext::CharTy, Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus23, clang::IntegerLiteral::Create(), clang::StringLiteral::Create(), clang::FixedPointLiteral::CreateFromRawInt(), clang::ASTContext::DeclarationNames, clang::Preprocessor::Diag(), clang::SemaBase::Diag(), clang::ASTContext::DoubleTy, clang::ExprError(), clang::ASTContext::Float128Ty, clang::ASTContext::Float16Ty, clang::ASTContext::FloatTy, clang::ASTContext::FractTy, clang::ActionResult< PtrTy, Compress >::get(), clang::IdentifierTable::get(), clang::ASTContext::getBitIntType(), clang::ASTContext::getComplexType(), clang::ASTContext::getConstantArrayType(), clang::ASTContext::getCorrespondingUnsignedType(), clang::DeclarationNameTable::getCXXLiteralOperatorName(), clang::Preprocessor::getDiagnostics(), clang::ASTContext::getFixedPointMax(), clang::ASTContext::getFixedPointScale(), clang::TargetInfo::getIntMaxTWidth(), clang::ASTContext::getIntTypeForBitwidth(), clang::TargetInfo::getIntWidth(), clang::ASTContext::getIntWidth(), clang::BuiltinType::getKind(), clang::Token::getKind(), clang::Preprocessor::getLangOpts(), getLangOpts(), clang::Token::getLength(), clang::Token::getLocation(), clang::TargetInfo::getLongLongWidth(), clang::TargetInfo::getLongWidth(), clang::TargetInfo::getMaxBitIntWidth(), clang::LangOptions::getOpenCLCompatibleVersion(), getOpenCLOptions(), clang::ASTContext::getSignedSizeType(), clang::ASTContext::getSizeType(), clang::TargetInfo::getSizeType(), clang::Preprocessor::getSourceManager(), clang::Preprocessor::getSpelling(), clang::Preprocessor::getSpellingOfSingleCharacterNumericConstant(), clang::ASTContext::getTargetInfo(), clang::Preprocessor::getTargetInfo(), clang::Expr::getType(), clang::ASTContext::getTypeInfo(), clang::ASTContext::getTypeSize(), clang::TargetInfo::getTypeWidth(), getUDSuffixLoc(), clang::ASTContext::HalfTy, HLSL(), clang::ASTContext::Idents, clang::if(), ImpCastExprToType(), clang::ASTContext::IntTy, clang::Invalid, clang::QualType::isNull(), LOLR_Cooked, LOLR_Error, LOLR_ErrorNoDiagnostic, LOLR_Raw, LOLR_StringTemplatePack, LOLR_Template, clang::ASTContext::LongAccumTy, clang::ASTContext::LongDoubleTy, clang::ASTContext::LongFractTy, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, LookupLiteralOperator(), LookupOrdinaryName, clang::Normal, OpenCL(), clang::Ordinary, PP, clang::DeclarationNameInfo::setCXXLiteralOperatorNameLoc(), clang::ASTContext::ShortAccumTy, clang::ASTContext::ShortFractTy, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::TypeInfo::Width, and clang::CanQual< T >::withConst().
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 631 of file SemaTemplateVariadic.cpp.
References ActOnPackExpansion(), 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::Result, clang::SourceRange::setBegin(), clang::ParsedTemplateArgument::Template, and clang::ParsedTemplateArgument::Type.
Referenced by ActOnPackExpansion(), and CheckTemplateArgument().
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 724 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 670 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 1182 of file SemaTemplateVariadic.cpp.
References BuildPackIndexingExpr(), clang::Expr::containsErrors(), CorrectDelayedTyposInExpr(), clang::CPlusPlus26, clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), getLangOpts(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and isParameterPack().
QualType Sema::ActOnPackIndexingType | ( | QualType | Pattern, |
Expr * | IndexExpr, | ||
SourceLocation | Loc, | ||
SourceLocation | EllipsisLoc | ||
) |
Definition at line 9718 of file SemaType.cpp.
References BuildPackIndexingType(), clang::Type::containsUnexpandedParameterPack(), clang::CPlusPlus26, clang::SemaBase::Diag(), getLangOpts(), and Loc.
Referenced by ActOnPseudoDestructorExpr().
Decl * Sema::ActOnParamDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
SourceLocation | ExplicitThisLoc = {} |
||
) |
ActOnParamDeclarator - Called from Parser::ParseFunctionDeclarator() to introduce parameters into function prototype scope.
Definition at line 15034 of file SemaDecl.cpp.
References clang::IdentifierResolver::AddDecl(), clang::LookupResult::begin(), CheckExplicitObjectParameter(), CheckFunctionOrTemplateParamDeclarator(), CheckParameter(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus17, clang::FixItHint::CreateRemoval(), D, deduceOpenCLAddressSpace(), clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), DiagnoseTemplateParameterShadow(), clang::LookupResult::empty(), clang::Decl::getBeginLoc(), clang::DeclSpec::getConstexprSpecLoc(), clang::DeclSpec::getInlineSpecLoc(), getLangOpts(), clang::Decl::getLocation(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), clang::ASTContext::getTranslationUnitDecl(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::DeclSpec::getTypeSpecType(), clang::Decl::hasAttr(), clang::DeclSpec::hasConstexprSpecifier(), IdResolver, clang::DeclSpec::isInlineSpecified(), clang::LookupResult::isSingleResult(), clang::Decl::isTemplateParameter(), LookupName(), LookupOrdinaryName, OpenCL(), ProcessDeclAttributes(), clang::SC_Auto, clang::SC_None, clang::SC_Register, clang::DeclSpec::SCS_auto, clang::DeclSpec::SCS_register, clang::DeclSpec::SCS_unspecified, clang::Decl::setInvalidDecl(), clang::ParmVarDecl::setScopeInfo(), and clang::DeclSpec::TST_void.
Referenced by ActOnFinishKNRParamDeclarations().
void Sema::ActOnParamDefaultArgument | ( | Decl * | param, |
SourceLocation | EqualLoc, | ||
Expr * | defarg | ||
) |
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 327 of file SemaDeclCXX.cpp.
References ActOnParamDefaultArgumentError(), ConvertParamDefaultArgument(), clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), getLangOpts(), clang::Stmt::getSourceRange(), clang::VarDecl::isParameterPack(), clang::Result, 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 382 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 371 of file SemaDeclCXX.cpp.
References clang::ParmVarDecl::setUnparsedDefaultArg(), and UnparsedDefaultArgLocs.
ExprResult Sema::ActOnParenExpr | ( | SourceLocation | L, |
SourceLocation | R, | ||
Expr * | E | ||
) |
Definition at line 4109 of file SemaExpr.cpp.
References BuildBuiltinCallExpr(), Context, CurFPFeatures, E, getLangOpts(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), and clang::Expr::isLValue().
Referenced by ActOnDecltypeExpression(), buildCounterUpdate(), MaybeConvertParenListExprToParenExpr(), clang::TreeTransform< Derived >::RebuildParenExpr(), and rebuildPotentialResultsAsNonOdrUsed().
ExprResult Sema::ActOnParenListExpr | ( | SourceLocation | L, |
SourceLocation | R, | ||
MultiExprArg | Val | ||
) |
Definition at line 7909 of file SemaExpr.cpp.
References Context, and clang::ParenListExpr::Create().
Referenced by clang::InitializationSequence::Perform(), and clang::TreeTransform< Derived >::RebuildParenListExpr().
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 2182 of file SemaDecl.cpp.
References CheckPoppedLabel(), clang::CPlusPlus, D, clang::Scope::DeclScope, clang::SemaBase::Diag(), DiagnoseUnusedButSetDecl(), DiagnoseUnusedDecl(), DiagnoseUnusedNestedTypedefs(), getLangOpts(), clang::Decl::getLocation(), IdResolver, clang::Preprocessor::isIncrementalProcessingEnabled(), Loc, ObjC(), clang::SemaBase::PDiag(), PP, RefsMinusAssignments, clang::IdentifierResolver::RemoveDecl(), and clang::Scope::TemplateParamScope.
Referenced by clang::Parser::ExitScope().
ExprResult Sema::ActOnPostfixUnaryOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
tok::TokenKind | Kind, | ||
Expr * | Input | ||
) |
Definition at line 4756 of file SemaExpr.cpp.
References BuildUnaryOp(), clang::ExprError(), MaybeConvertParenListExprToParenExpr(), and clang::Result.
void Sema::ActOnPragmaAttributeAttribute | ( | ParsedAttr & | Attribute, |
SourceLocation | PragmaLoc, | ||
attr::ParsedSubjectMatchRuleSet | Rules | ||
) |
Definition at line 1015 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 1148 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 1155 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 384 of file SemaAttr.cpp.
References clang::SemaBase::Diag(), E, isValidSectionSpecifier(), PCSA_Clear, PCSK_BSS, PCSK_Data, PCSK_Relro, PCSK_Rodata, PCSK_Text, 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, 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 1458 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 625 of file SemaAttr.cpp.
References clang::DeclContext::addDecl(), Consumer, Context, clang::PragmaDetectMismatchDecl::Create(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTConsumer::HandleTopLevelDecl(), and Loc.
void Sema::ActOnPragmaDump | ( | Expr * | E | ) |
Called on #pragma clang __debug dump E.
Definition at line 5759 of file SemaLookup.cpp.
References clang::Stmt::dump(), and E.
void Sema::ActOnPragmaDump | ( | Scope * | S, |
SourceLocation | Loc, | ||
IdentifierInfo * | II | ||
) |
Called on #pragma clang __debug dump II.
Definition at line 5749 of file SemaLookup.cpp.
References clang::LookupResult::dump(), LookupAnyName, LookupName(), clang::LookupResult::setHideTags(), and clang::LookupResult::suppressDiagnostics().
void Sema::ActOnPragmaFEnvAccess | ( | SourceLocation | Loc, |
bool | IsEnabled | ||
) |
ActOnPragmaFenvAccess - Called on well formed #pragma STDC FENV_ACCESS.
Definition at line 1442 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 1427 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 660 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 1372 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 633 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 1466 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 1391 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 896 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 617 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 1258 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 887 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 1249 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 714 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 882 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 844 of file SemaAttr.cpp.
References BSSSegStack, checkSectionName(), CodeSegStack, ConstSegStack, Context, DataSegStack, clang::SemaBase::Diag(), clang::StringLiteral::getBeginLoc(), clang::TargetInfo::getCXXABI(), clang::StringLiteral::getString(), clang::ASTContext::getTargetInfo(), clang::TargetCXXABI::isMicrosoft(), and PSK_Pop.
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 871 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 613 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 721 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 1242 of file SemaAttr.cpp.
References OptimizeOffPragmaLocation.
void Sema::ActOnPragmaOptionsAlign | ( | PragmaOptionsAlignKind | Kind, |
SourceLocation | PragmaLoc | ||
) |
ActOnPragmaOptionsAlign - Called on well formed #pragma options align.
Definition at line 329 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 433 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 20300 of file SemaDecl.cpp.
References clang::Decl::addAttr(), Context, clang::SemaBase::Diag(), ExtnameUndeclaredIdentifiers, clang::Decl::getLocation(), clang::IdentifierInfo::getName(), isDeclExternC(), LookupOrdinaryName, LookupSingleName(), clang::AttributeCommonInfo::Form::Pragma(), and TUScope.
void Sema::ActOnPragmaUnused | ( | const Token & | Identifier, |
Scope * | curScope, | ||
SourceLocation | PragmaLoc | ||
) |
ActOnPragmaUnused - Called on well-formed '#pragma unused'.
Definition at line 932 of file SemaAttr.cpp.
References clang::Decl::addAttr(), Context, clang::SemaBase::Diag(), clang::LookupResult::empty(), clang::LookupResult::getAsSingle(), clang::Token::getIdentifierInfo(), clang::Token::getLocation(), clang::Decl::isUsed(), LookupName(), and LookupOrdinaryName.
void Sema::ActOnPragmaVisibility | ( | const IdentifierInfo * | VisType, |
SourceLocation | PragmaLoc | ||
) |
ActOnPragmaVisibility - Called on well formed #pragma GCC visibility... .
Definition at line 1357 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 20339 of file SemaDecl.cpp.
References DeclApplyPragmaWeak(), clang::Decl::hasAttr(), LookupOrdinaryName, LookupSingleName(), TUScope, and WeakUndeclaredIdentifiers.
void Sema::ActOnPragmaWeakID | ( | IdentifierInfo * | WeakName, |
SourceLocation | PragmaLoc, | ||
SourceLocation | WeakNameLoc | ||
) |
ActOnPragmaWeakID - Called on well formed #pragma weak ident.
Definition at line 20327 of file SemaDecl.cpp.
References clang::Decl::addAttr(), Context, LookupOrdinaryName, LookupSingleName(), TUScope, and WeakUndeclaredIdentifiers.
ExprResult Sema::ActOnPredefinedExpr | ( | SourceLocation | Loc, |
tok::TokenKind | Kind | ||
) |
Definition at line 3534 of file SemaExpr.cpp.
References BuildPredefinedExpr(), 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 511 of file SemaModule.cpp.
References ActOnEndOfTranslationUnitFragment(), Context, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::Module::ExplicitGlobalModuleFragment, clang::Preprocessor::getHeaderSearchInfo(), clang::HeaderSearch::getModuleMap(), clang::ASTContext::getTranslationUnitDecl(), clang::Module::ImplicitGlobalModuleFragment, clang::Module::ModuleHeaderUnit, clang::Module::ModuleImplementationUnit, clang::Module::ModuleInterfaceUnit, clang::Module::ModuleMapModule, clang::Module::ModulePartitionImplementation, clang::Module::ModulePartitionInterface, clang::Decl::ModulePrivate, Normal, PP, clang::Module::PrivateModuleFragment, clang::Decl::setModuleOwnershipKind(), and clang::VisibleModuleSet::setVisible().
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 8312 of file SemaExprCXX.cpp.
References ActOnTemplateIdType(), BuildPseudoDestructorExpr(), CheckArrow(), computeDeclContext(), Context, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::ExprError(), clang::UnqualifiedId::getKind(), clang::TemplateIdAnnotation::getTemplateArgs(), clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), getTypeName(), clang::UnqualifiedId::Identifier, clang::IK_Identifier, clang::IK_TemplateId, clang::Type::isDependentType(), clang::QualType::isNull(), clang::Type::isRecordType(), clang::CXXScopeSpec::isSet(), isSFINAEContext(), clang::TemplateIdAnnotation::LAngleLoc, clang::OpaquePtr< QualType >::make(), clang::TemplateIdAnnotation::Name, clang::TemplateIdAnnotation::NumArgs, clang::TemplateIdAnnotation::RAngleLoc, clang::UnqualifiedId::StartLocation, clang::T, clang::TemplateIdAnnotation::Template, clang::UnqualifiedId::TemplateId, clang::TemplateIdAnnotation::TemplateKWLoc, and clang::TemplateIdAnnotation::TemplateNameLoc.
ExprResult Sema::ActOnPseudoDestructorExpr | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
SourceLocation | TildeLoc, | ||
const DeclSpec & | DS | ||
) |
Definition at line 8457 of file SemaExprCXX.cpp.
References ActOnPackIndexingType(), BuildDecltypeType(), BuildPseudoDestructorExpr(), CheckArrow(), Context, clang::SemaBase::Diag(), clang::ExprError(), clang::OpaquePtr< PtrTy >::get(), getASTContext(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getEllipsisLoc(), clang::SourceRange::getEnd(), clang::DeclSpec::getPackIndexingExpr(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::DeclSpec::getTypeofParensRange(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushTrivial(), clang::DecltypeTypeLoc::setDecltypeLoc(), clang::PackIndexingTypeLoc::setEllipsisLoc(), clang::DecltypeTypeLoc::setRParenLoc(), clang::T, clang::DeclSpec::TST_decltype, clang::DeclSpec::TST_decltype_auto, clang::DeclSpec::TST_error, and clang::DeclSpec::TST_typename_pack_indexing.
void Sema::ActOnPureSpecifier | ( | Decl * | D, |
SourceLocation | PureSpecLoc | ||
) |
Definition at line 18388 of file SemaDeclCXX.cpp.
References CheckPureMethod(), D, 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 10691 of file SemaDeclCXX.cpp.
References clang::IdentifierResolver::AddDecl(), clang::NamedDecl::getDeclName(), and IdResolver.
Push the parameters of D, which must be a function, into scope.
Definition at line 1433 of file SemaDecl.cpp.
References clang::IdentifierResolver::AddDecl(), CurContext, D, clang::Decl::getAsFunction(), clang::NamedDecl::getIdentifier(), clang::DeclContext::getLexicalParent(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), IdResolver, and P.
unsigned Sema::ActOnReenterTemplateScope | ( | Decl * | Template, |
llvm::function_ref< Scope *()> | EnterScope | ||
) |
Definition at line 10613 of file SemaDeclCXX.cpp.
References clang::Scope::AddDecl(), clang::IdentifierResolver::AddDecl(), AdjustDeclIfTemplate(), D, EnterTemplatedContext(), clang::Decl::getDeclContext(), clang::CXXRecordDecl::getDescribedClassTemplate(), clang::VarDecl::getDescribedVarTemplate(), and IdResolver.
Referenced by clang::Parser::ReenterTemplateScopes().
ExprResult Sema::ActOnRequiresClause | ( | ExprResult | ConstraintExpr | ) |
Definition at line 4045 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 9595 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 3828 of file SemaStmt.cpp.
References BuildReturnStmt(), CheckJumpOutOfSEHFinally(), CorrectDelayedTyposInExpr(), clang::SemaBase::Diag(), ExprEvalContexts, clang::sema::FunctionScopeInfo::FirstCoroutineStmtLoc, clang::sema::FunctionScopeInfo::FirstReturnLoc, clang::ActionResult< PtrTy, Compress >::get(), getCurFunction(), getCurScope(), clang::sema::FunctionScopeInfo::getFirstCoroutineStmtKeyword(), clang::Scope::getFnParent(), clang::sema::FunctionScopeInfo::isCoroutine(), clang::SourceLocation::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceLocation::isValid(), clang::StmtError(), and clang::Scope::updateNRVOCandidate().
StmtResult Sema::ActOnSEHExceptBlock | ( | SourceLocation | Loc, |
Expr * | FilterExpr, | ||
Stmt * | Block | ||
) |
Definition at line 4441 of file SemaStmt.cpp.
References clang::Block, Context, clang::SEHExceptStmt::Create(), clang::SemaBase::Diag(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Type::isDependentType(), clang::Type::isIntegerType(), Loc, and clang::StmtError().
Referenced by clang::TreeTransform< Derived >::RebuildSEHExceptStmt().
StmtResult Sema::ActOnSEHLeaveStmt | ( | SourceLocation | Loc, |
Scope * | CurScope | ||
) |
Definition at line 4468 of file SemaStmt.cpp.
References CheckJumpOutOfSEHFinally(), Context, clang::SemaBase::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 4403 of file SemaStmt.cpp.
References Context, clang::SEHTryStmt::Create(), CurContext, clang::SemaBase::Diag(), clang::sema::FunctionScopeInfo::FirstCXXOrObjCTryLoc, clang::sema::FunctionScopeInfo::FirstTryType, getCurFunction(), getLangOpts(), clang::DeclContext::getParent(), clang::ASTContext::getTargetInfo(), clang::DeclContext::isFunctionOrMethod(), clang::TargetInfo::isSEHTrySupported(), clang::SourceLocation::isValid(), clang::sema::FunctionScopeInfo::setHasSEHTry(), clang::FunctionDecl::setUsesSEHTry(), and clang::sema::FunctionScopeInfo::TryLocIsCXX.
Referenced by clang::TreeTransform< Derived >::RebuildSEHTryStmt().
concepts::Requirement * Sema::ActOnSimpleRequirement | ( | Expr * | E | ) |
Definition at line 9356 of file SemaExprCXX.cpp.
References BuildExprRequirement(), and E.
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 1125 of file SemaTemplateVariadic.cpp.
References clang::LookupResult::Ambiguous, Context, CorrectTypo(), clang::SizeOfPackExpr::Create(), CTK_ErrorRecovery, clang::SemaBase::Diag(), DiagnoseAmbiguousLookup(), diagnoseTypo(), clang::ExprError(), clang::LookupResult::Found, clang::LookupResult::FoundOverloaded, clang::LookupResult::FoundUnresolvedValue, clang::LookupResult::getFoundDecl(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::LookupResult::getResultKind(), clang::Decl::isParameterPack(), LookupName(), LookupOrdinaryName, MarkAnyDeclReferenced(), clang::LookupResult::NotFound, clang::LookupResult::NotFoundInCurrentInstantiation, and clang::SemaBase::PDiag().
Definition at line 15867 of file SemaDecl.cpp.
References clang::Decl::getAsFunction(), and clang::FunctionDecl::setHasSkippedBody().
Referenced by InstantiateFunctionDefinition().
ExprResult Sema::ActOnSourceLocExpr | ( | SourceLocIdentKind | Kind, |
SourceLocation | BuiltinLoc, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 16750 of file SemaExpr.cpp.
References BuildSourceLocExpr(), clang::ASTContext::CharTy, clang::Column, Context, CurContext, clang::ExprError(), clang::File, clang::FileName, clang::FuncSig, clang::Function, clang::Type::getAsArrayTypeUnsafe(), clang::ArrayType::getElementType(), clang::ASTContext::getPointerType(), clang::ASTContext::getRecordType(), clang::ASTContext::getStringLiteralArrayType(), clang::Line, LookupStdSourceLocationImpl(), clang::SourceLocStruct, StdSourceLocationImplDecl, clang::ASTContext::UnsignedIntTy, and clang::QualType::withConst().
ConceptDecl * Sema::ActOnStartConceptDefinition | ( | Scope * | S, |
MultiTemplateParamsArg | TemplateParameterLists, | ||
const IdentifierInfo * | Name, | ||
SourceLocation | NameLoc | ||
) |
Definition at line 8684 of file SemaTemplate.cpp.
References clang::TemplateParameterList::begin(), Context, clang::ConceptDecl::Create(), CurContext, clang::SemaBase::Diag(), clang::TemplateParameterList::end(), FilterLookupForScope(), forRedeclarationInCurContext(), clang::Decl::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), clang::TemplateDecl::hasAssociatedConstraints(), clang::DeclContext::isFileContext(), clang::Decl::isParameterPack(), LookupName(), LookupOrdinaryName, Previous, PushOnScopeChains(), clang::Decl::setInvalidDecl(), and clang::TemplateParameterList::size().
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 4021 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 18175 of file SemaDecl.cpp.
References AdjustDeclIfTemplate(), clang::AS_public, Context, clang::CXXRecordDecl::Create(), CurContext, FieldCollector, clang::ASTContext::getTypeDeclType(), clang::RecordDecl::isInjectedClassName(), clang::SourceLocation::isValid(), PushOnScopeChains(), clang::Decl::setAccess(), clang::CXXRecordDecl::setDescribedClassTemplate(), and clang::Decl::setImplicit().
ExprResult Sema::ActOnStartCXXMemberReference | ( | Scope * | S, |
Expr * | Base, | ||
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
ParsedType & | ObjectType, | ||
bool & | MayBePseudoDestructor | ||
) |
Definition at line 7986 of file SemaExprCXX.cpp.
References BuildOverloadedArrowExpr(), CheckPlaceholderExpr(), Context, CreateRecoveryExpr(), clang::FixItHint::CreateReplacement(), CurContext, clang::SemaBase::Diag(), clang::ExprError(), clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::DeclaratorDecl::getBeginLoc(), clang::CallExpr::getCalleeDecl(), clang::ASTContext::getCanonicalType(), getLangOpts(), clang::Type::getPointeeType(), clang::Type::isDependentType(), clang::FunctionDecl::isFunctionTemplateSpecialization(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Type::isRecordType(), isThisOutsideMemberFunctionBody(), clang::OpaquePtr< QualType >::make(), MaybeConvertParenListExprToParenExpr(), noteOperatorArrows(), RequireCompleteType(), and clang::Result.
Referenced by BuildMemberReferenceExpr().
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 10700 of file SemaDeclCXX.cpp.
Definition at line 10679 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), and PushDeclContext().
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 851 of file SemaModule.cpp.
References clang::DeclContext::addDecl(), Context, clang::ExportDecl::Create(), clang::FixItHint::CreateInsertion(), CurContext, currentModuleIsImplementation(), D, clang::SemaBase::Diag(), getEnclosingExportDecl(), getLangOpts(), clang::DeclContext::getLexicalParent(), HLSL(), clang::Module::PrivateModuleFragment, PushDeclContext(), clang::Decl::setInvalidDecl(), clang::Decl::setModuleOwnershipKind(), and clang::Decl::VisibleWhenImported.
void Sema::ActOnStartFunctionDeclarationDeclarator | ( | Declarator & | D, |
unsigned | TemplateParameterDepth | ||
) |
Called before parsing a function declarator belonging to a function declaration.
Definition at line 19097 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 16699 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::C, Context, clang::LinkageSpecDecl::Create(), CurContext, clang::CXX, D, clang::SemaBase::Diag(), clang::Expr::getExprLoc(), getLangOpts(), clang::Stmt::getSourceRange(), clang::StringLiteral::getString(), clang::StringLiteral::isUnevaluated(), clang::SourceLocation::isValid(), PushDeclContext(), and clang::Decl::setLocalOwningModule().
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 11554 of file SemaDeclCXX.cpp.
References ActOnDocumentableDecl(), clang::DeclContext::addDecl(), AddPragmaAttributes(), Context, clang::NamespaceDecl::Create(), clang::UsingDirectiveDecl::Create(), CurContext, clang::SemaBase::Diag(), DiagnoseNamespaceInlineMismatch(), 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 431 of file SemaStmt.cpp.
References PushCompoundScope().
Decl * Sema::ActOnStartOfFunctionDef | ( | Scope * | S, |
Decl * | D, | ||
SkipBodyInfo * | SkipBody = nullptr , |
||
FnBodyKind | BodyKind = FnBodyKind::Other |
||
) |
Definition at line 15571 of file SemaDecl.cpp.
References AbstractReturnType, ActOnDocumentableDecl(), applyFunctionAttributesBeforeParsingBody(), clang::ASTContext::BuiltinInfo, CheckForFunctionRedefinition(), CheckParmsForFunctionDef(), CheckShadow(), Context, currentModuleIsHeaderUnit(), D, clang::DeclContext::decls(), Default, Delete, clang::SemaBase::Diag(), clang::Decl::dropAttr(), ExprEvalContexts, clang::External, clang::Type::getAs(), clang::Decl::getAttr(), clang::FunctionDecl::getBuiltinID(), getCurLexicalContext(), clang::TargetInfo::getCXXABI(), clang::NamedDecl::getFormalLinkage(), getLangOpts(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::FunctionDecl::getReturnType(), clang::ASTContext::getTargetInfo(), clang::FunctionDecl::getTemplateSpecializationInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::TargetInfo::hasFeature(), ImmediateFunctionContext, InstantiateDefaultCtorDefaultArgs(), inTemplateInstantiation(), clang::FunctionDecl::isConsteval(), clang::Type::isDependentType(), clang::FunctionTemplateSpecializationInfo::isExplicitInstantiationOrSpecialization(), clang::isGenericLambdaCallOperatorSpecialization(), clang::FunctionDecl::isImmediateEscalating(), clang::FunctionDecl::isInlined(), clang::Decl::isInvalidDecl(), clang::isLambdaCallOperator(), clang::FunctionDecl::isLateTemplateParsed(), clang::TargetCXXABI::isMicrosoft(), clang::Builtin::Context::isPredefinedLibFunction(), clang::Builtin::Context::isPredefinedRuntimeFunction(), clang::Decl::isTemplated(), clang::FunctionDecl::isTemplateInstantiation(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isThisDeclarationInstantiatedFromAFriendDefinition(), clang::Type::isVoidType(), maybeAddDeclWithEffects(), clang::FunctionDecl::parameters(), PushDeclContext(), PushExpressionEvaluationContext(), PushFunctionScope(), PushOnScopeChains(), RebuildLambdaScopeInfo(), RequireCompleteType(), RequireNonAbstractType(), ResolveExceptionSpec(), clang::Decl::setInvalidDecl(), clang::FunctionDecl::setWillHaveBody(), clang::SkipBodyInfo::ShouldSkip, clang::TSK_ExplicitSpecialization, and clang::FunctionDecl::willHaveBody().
Decl * Sema::ActOnStartOfFunctionDef | ( | Scope * | S, |
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParamLists, | ||
SkipBodyInfo * | SkipBody = nullptr , |
||
FnBodyKind | BodyKind = FnBodyKind::Other |
||
) |
Definition at line 15343 of file SemaDecl.cpp.
References clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(), ActOnStartOfFunctionDef(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), D, clang::Definition, getCurFunctionDecl(), clang::Scope::getParent(), HandleDeclarator(), LangOpts, and OpenMP().
Referenced by ActOnStartOfFunctionDef(), and InstantiateFunctionDefinition().
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 1395 of file SemaLambda.cpp.
References clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(), clang::Decl::addAttr(), AddRangeBasedOptnone(), ARM(), clang::TemplateParameterList::asArray(), clang::C, clang::sema::LambdaScopeInfo::CallOperator, clang::LambdaIntroducer::Captures, clang::sema::CapturingScopeInfo::Captures, CheckCXXDefaultArguments(), CheckShadow(), clang::SemaARM::CheckSMEFunctionDefAttributes(), clang::Class, CompleteLambdaCallOperator(), Context, CUDA(), clang::SemaBase::Diag(), clang::sema::LambdaScopeInfo::ExplicitParams, ExprEvalContexts, clang::FTIHasSingleVoidParameter(), clang::SourceRange::getBegin(), clang::DeclSpec::getConstexprSpecifier(), getCurrentLambdaScopeUnsafe(), getCurScope(), clang::Declarator::getDeclSpec(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::SourceRange::getEnd(), clang::Declarator::getFunctionTypeInfo(), getGenericLambdaTemplateParameterList(), getImplicitCodeSegOrSectionAttrForFunction(), getLambdaType(), getLangOpts(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTargetInfo(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::Declarator::getTrailingRequiresClause(), clang::TargetInfo::getTriple(), clang::Declarator::getTypeObject(), handleLambdaNumbering(), ImmediateFunctionContext, clang::FunctionDecl::isConsteval(), clang::Declarator::isFunctionDeclarator(), clang::FunctionDecl::isImmediateEscalating(), clang::ValueDecl::isInitCapture(), clang::Decl::isTemplated(), clang::sema::LambdaScopeInfo::Lambda, LangOpts, NoteTemplateParameterLocation(), OpenMP(), P, PotentiallyEvaluated, ProcessDeclAttributes(), PushExpressionEvaluationContext(), PushOnScopeChains(), clang::LambdaIntroducer::Range, clang::SC_None, clang::SC_Static, clang::DeclSpec::SCS_static, clang::FunctionDecl::setConstexprKind(), and clang::SemaCUDA::SetLambdaAttrs().
StmtResult Sema::ActOnStartOfSwitchStmt | ( | SourceLocation | SwitchLoc, |
SourceLocation | LParenLoc, | ||
Stmt * | InitStmt, | ||
ConditionResult | Cond, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 1184 of file SemaStmt.cpp.
References Context, clang::SwitchStmt::Create(), clang::SemaBase::Diag(), clang::Sema::ConditionResult::get(), getCurFunction(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isIntegralOrEnumerationType(), clang::Sema::ConditionResult::isInvalid(), clang::Expr::isKnownToHaveBooleanValue(), clang::Expr::isTypeDependent(), setFunctionHasBranchIntoScope(), clang::StmtError(), and clang::sema::FunctionScopeInfo::SwitchStack.
Referenced by clang::TreeTransform< Derived >::RebuildSwitchStmtStart().
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 1100 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 9535 of file SemaExprCXX.cpp.
References CheckShadow(), Context, clang::RequiresExprBodyDecl::Create(), CurContext, clang::SemaBase::Diag(), clang::ASTContext::IntTy, PushDeclContext(), and PushOnScopeChains().
void Sema::ActOnStartSEHFinallyBlock | ( | ) |
Definition at line 4453 of file SemaStmt.cpp.
References CurrentSEHFinally.
void Sema::ActOnStartStmtExpr | ( | ) |
Definition at line 15840 of file SemaExpr.cpp.
References ExprEvalContexts, PushExpressionEvaluationContext(), and setFunctionHasBranchProtectedScope().
TopLevelStmtDecl * Sema::ActOnStartTopLevelStmtDecl | ( | Scope * | S | ) |
Definition at line 20284 of file SemaDecl.cpp.
References clang::DeclContext::addDecl(), Context, clang::TopLevelStmtDecl::Create(), CurContext, PushCompoundScope(), PushDeclContext(), and PushFunctionScope().
void Sema::ActOnStartTrailingRequiresClause | ( | Scope * | S, |
Declarator & | D | ||
) |
Definition at line 4027 of file SemaDeclCXX.cpp.
References D, and PushOnScopeChains().
Decl * Sema::ActOnStaticAssertDeclaration | ( | SourceLocation | StaticAssertLoc, |
Expr * | AssertExpr, | ||
Expr * | AssertMessageExpr, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 16959 of file SemaDeclCXX.cpp.
References BuildStaticAssertDeclaration(), DiagnoseUnexpandedParameterPack(), and UPPC_StaticAssertExpression.
ExprResult Sema::ActOnStmtExpr | ( | Scope * | S, |
SourceLocation | LPLoc, | ||
Stmt * | SubStmt, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 15854 of file SemaExpr.cpp.
References BuildStmtExpr(), and getTemplateDepth().
void Sema::ActOnStmtExprError | ( | ) |
Definition at line 15846 of file SemaExpr.cpp.
References DiscardCleanupsInEvaluationContext(), and PopExpressionEvaluationContext().
ExprResult Sema::ActOnStmtExprResult | ( | ExprResult | E | ) |
Definition at line 15898 of file SemaExpr.cpp.
References DefaultFunctionArrayConversion(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::InitializedEntity::InitializeStmtExprResult(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), and PerformCopyInitialization().
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"). 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 2048 of file SemaExpr.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::Lexer::AdvanceToTokenCharacter(), BuildLiteralOperatorCall(), clang::C23, clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::Char8Ty, clang::ASTContext::CharTy, Context, clang::CPlusPlus, clang::CPlusPlus20, clang::IntegerLiteral::Create(), clang::StringLiteral::Create(), clang::FixItHint::CreateRemoval(), clang::ASTContext::DeclarationNames, clang::SemaBase::Diag(), ExpandFunctionLocalPredefinedMacros(), clang::ExprError(), clang::IdentifierTable::get(), clang::ASTContext::getArrayDecayedType(), clang::CharSourceRange::getCharRange(), clang::StringLiteral::getCodeUnit(), clang::DeclarationNameTable::getCXXLiteralOperatorName(), clang::ASTContext::getIntWidth(), getLangOpts(), clang::StringLiteral::getLength(), clang::ASTContext::getSizeType(), getSourceManager(), clang::ASTContext::getStringLiteralArrayType(), clang::ASTContext::getTrivialTypeSourceInfo(), getUDSuffixLoc(), clang::ASTContext::getWideCharType(), clang::ASTContext::Idents, clang::SourceLocation::isInvalid(), clang::Type::isUnsignedIntegerType(), LOLR_Cooked, LOLR_Error, LOLR_ErrorNoDiagnostic, LOLR_Raw, LOLR_StringTemplatePack, LOLR_Template, LookupLiteralOperator(), LookupOrdinaryName, clang::Ordinary, clang::SemaBase::PDiag(), PP, clang::DeclarationNameInfo::setCXXLiteralOperatorNameLoc(), clang::ASTContext::UnsignedCharTy, clang::UTF16, clang::UTF32, clang::UTF8, and clang::Wide.
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 285 of file SemaCXXScopeSpec.cpp.
References Context, clang::SemaBase::Diag(), getCurLambda(), getCurScope(), clang::NamedDecl::getName(), clang::CXXRecordDecl::getNumBases(), clang::DeclContext::getParent(), and clang::CXXScopeSpec::MakeSuper().
DeclResult Sema::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 {'.
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 17145 of file SemaDecl.cpp.
References AddAlignmentAttributesForRecord(), clang::DeclContext::addDecl(), AddMsStructLayoutForRecord(), AddPragmaAttributes(), AddPushedVisibilityAttribute(), clang::AS_none, clang::C23, CheckClassTemplate(), CheckEnumRedeclaration(), CheckEnumUnderlyingType(), CheckMemberSpecialization(), CheckRedeclarationInModule(), clang::SkipBodyInfo::CheckSameAsPrevious, CheckTemplateDeclScope(), clang::RecordDecl::completeDefinition(), CompleteMemberSpecialization(), computeDeclContext(), Context, clang::CPlusPlus, clang::EnumDecl::Create(), clang::CXXRecordDecl::Create(), clang::RecordDecl::Create(), createFriendTagNNSFixIt(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), CurContext, clang::Declaration, clang::Definition, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), diagnoseQualifiedDeclaration(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), clang::LookupResult::Filter::done(), clang::ParsedAttributesView::empty(), clang::DeclContext::Encloses(), clang::Enum, clang::DeclContext::Equals(), clang::LookupResult::Filter::erase(), clang::Decl::FOK_Undeclared, forRedeclarationInCurContext(), clang::Friend, clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getAccess(), clang::Type::getAs(), clang::Type::getAsTagDecl(), clang::SourceRange::getBegin(), clang::TypeLoc::getBeginLoc(), clang::CXXScopeSpec::getBeginLoc(), getCurrentModule(), clang::Decl::getDeclContext(), clang::DeclContext::getDeclKind(), getDefinition(), clang::DeclContext::getEnclosingNamespaceContext(), clang::NamedDecl::getIdentifier(), clang::EnumDecl::getIntegerType(), getLangOpts(), clang::Decl::getLocation(), getNonFieldDeclScope(), getNonTagTypeDeclKind(), clang::Decl::getOwningModule(), clang::DeclContext::getParent(), clang::ASTContext::getPromotedIntegerType(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), getScopeForDeclContext(), clang::TagDecl::getSourceRange(), getStdAlignValT(), getStdBadAlloc(), getStdNamespace(), clang::ASTContext::getTagDeclType(), getTagInjectionContext(), getTagInjectionScope(), clang::TypeWithKeyword::getTagTypeKindForTypeSpec(), clang::TypeWithKeyword::getTagTypeKindName(), clang::ASTContext::getTargetInfo(), clang::TemplateParameterList::getTemplateLoc(), clang::TargetInfo::getTriple(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::CanQual< T >::getTypePtr(), clang::CXXScopeSpec::getWithLocInContext(), clang::LookupResult::Filter::hasNext(), hasVisibleDefinition(), inferGslOwnerPointerAttribute(), inferNullableClassAttribute(), clang::ASTContext::IntTy, clang::Invalid, isAcceptableTagRedeclaration(), isAcceptableTagRedeclContext(), clang::TagDecl::isBeingDefined(), clang::EnumDecl::isComplete(), clang::NamedDecl::isCXXClassMember(), isDeclInScope(), clang::CXXScopeSpec::isEmpty(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), clang::CXXScopeSpec::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::CXXRecordDecl::isLocalClass(), clang::CXXScopeSpec::isNotEmpty(), clang::ASTContext::isPromotableIntegerType(), clang::DeclContext::isRecord(), clang::CXXScopeSpec::isSet(), clang::DeclContext::isTranslationUnit(), clang::ActionResult< PtrTy, Compress >::isUnset(), clang::SourceLocation::isValid(), Loc, LookupName(), LookupQualifiedName(), LookupTagName, clang::DeclContext::makeDeclVisibleInContext(), makeMergedDefinitionVisible(), MatchTemplateParametersToScopeSpecifier(), mergeDeclAttributes(), clang::SkipBodyInfo::New, clang::LookupResult::Filter::next(), notePreviousDefinition(), OOK_Macro, OOK_Outside, clang::SkipBodyInfo::Previous, Previous, ProcessDeclAttributeList(), PushOnScopeChains(), clang::Reference, RequireCompleteDeclContext(), clang::Result, clang::Decl::setAccess(), clang::ASTContext::setFILEDecl(), clang::EnumDecl::setIntegerType(), clang::EnumDecl::setIntegerTypeSourceInfo(), clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), SetMemberAccessSpecifier(), clang::NamedDecl::setModulePrivate(), clang::Decl::setObjectOfFriendDecl(), clang::EnumDecl::setPromotionType(), clang::TagDecl::setQualifierInfo(), clang::TagDecl::setTemplateParameterListsInfo(), clang::SkipBodyInfo::ShouldSkip, clang::TemplateParameterList::size(), clang::TagDecl::startDefinition(), StdAlignValT, StdBadAlloc, StdNamespace, clang::T, clang::TSK_ExplicitSpecialization, and UPPC_FixedUnderlyingType.
Referenced by ActOnExplicitInstantiation(), and ActOnTemplatedFriendTag().
ActOnTagDefinitionError - Invoked when there was an unrecoverable error parsing the definition of a tag.
Definition at line 18285 of file SemaDecl.cpp.
References AdjustDeclIfTemplate(), clang::RecordDecl::completeDefinition(), and PopDeclContext().
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 18217 of file SemaDecl.cpp.
References AdjustDeclIfTemplate(), AlignPackStack, clang::RecordDecl::completeDefinition(), Consumer, Context, clang::SemaBase::Diag(), FieldCollector, clang::RecordDecl::fields(), clang::Sema::AlignPackInfo::getAlignMode(), clang::SourceRange::getBegin(), getCurLexicalContext(), getCurrentModule(), clang::RecordDecl::getDefinition(), clang::Decl::getLocation(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ASTConsumer::HandleTagDeclDefinition(), clang::Decl::hasAttr(), clang::Sema::AlignPackInfo::IsAlignAttr(), MarkVTableUsed(), clang::Sema::AlignPackInfo::Packed, and PopDeclContext().
void Sema::ActOnTagFinishSkippedDefinition | ( | SkippedDefinitionContext | Context | ) |
Definition at line 1338 of file SemaDecl.cpp.
References Context, and CurContext.
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 18152 of file SemaDecl.cpp.
References ActOnDocumentableDecl(), AddPushedVisibilityAttribute(), AdjustDeclIfTemplate(), and PushDeclContext().
Sema::SkippedDefinitionContext Sema::ActOnTagStartSkippedDefinition | ( | Scope * | S, |
Decl * | TD | ||
) |
Invoked when we enter a tag definition that we're skipping.
Definition at line 1324 of file SemaDecl.cpp.
References CurContext, D, clang::DeclContext::getLookupParent(), and clang::Result.
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 3853 of file SemaTemplate.cpp.
References clang::TemplateArgumentListInfo::arguments(), CheckTemplateIdType(), Context, CreateParsedType(), clang::FixItHint::CreateReplacement(), D, clang::Definition, clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateName::getAsTemplateDecl(), clang::ASTContext::getDependentTemplateSpecializationType(), clang::ASTContext::getElaboratedType(), clang::TypeWithKeyword::getKeywordForTagTypeKind(), clang::Decl::getLocation(), clang::TemplateSpecializationTypeLoc::getNumArgs(), clang::DependentTemplateSpecializationTypeLoc::getNumArgs(), clang::CXXScopeSpec::getScopeRep(), clang::TypeWithKeyword::getTagTypeKindForTypeSpec(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), Id, isAcceptableTagRedeclaration(), clang::CXXScopeSpec::isInvalid(), NTK_TypeAliasTemplate, clang::TypeLocBuilder::push(), clang::Result, clang::TemplateSpecializationTypeLoc::setArgLocInfo(), clang::DependentTemplateSpecializationTypeLoc::setArgLocInfo(), clang::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setElaboratedKeywordLoc(), clang::TemplateSpecializationTypeLoc::setLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setLAngleLoc(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::TemplateSpecializationTypeLoc::setRAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setRAngleLoc(), clang::TemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::TemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::T, and translateTemplateArguments().
Decl * Sema::ActOnTemplateDeclarator | ( | Scope * | S, |
MultiTemplateParamsArg | TemplateParameterLists, | ||
Declarator & | D | ||
) |
Definition at line 8676 of file SemaTemplate.cpp.
References ActOnDocumentableDecl(), D, and HandleDeclarator().
DeclResult Sema::ActOnTemplatedFriendTag | ( | Scope * | S, |
SourceLocation | FriendLoc, | ||
unsigned | TagSpec, | ||
SourceLocation | TagLoc, | ||
CXXScopeSpec & | SS, | ||
IdentifierInfo * | Name, | ||
SourceLocation | NameLoc, | ||
SourceLocation | EllipsisLoc, | ||
const ParsedAttributesView & | Attr, | ||
MultiTemplateParamsArg | TempParamLists | ||
) |
Handle a friend tag declaration where the scope specifier was templated.
Definition at line 17415 of file SemaDeclCXX.cpp.
References ActOnTag(), clang::DeclContext::addDecl(), clang::AS_public, clang::TypeLoc::castAs(), CheckClassTemplate(), CheckTypenameType(), collectUnexpandedParameterPacks(), Context, clang::FriendDecl::Create(), clang::ASTContext::CreateTypeSourceInfo(), CurContext, clang::SemaBase::Diag(), clang::Friend, clang::ActionResult< PtrTy, Compress >::get(), clang::CXXScopeSpec::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::ASTContext::getDependentNameType(), clang::getDepthAndIndex(), clang::TypeWithKeyword::getKeywordForTagTypeKind(), clang::ElaboratedTypeLoc::getNamedTypeLoc(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::TypeWithKeyword::getTagTypeKindForTypeSpec(), clang::TypeWithKeyword::getTagTypeKindName(), clang::TypeSourceInfo::getTypeLoc(), clang::CXXScopeSpec::getWithLocInContext(), clang::Invalid, clang::CXXScopeSpec::isEmpty(), clang::CXXScopeSpec::isNotEmpty(), MatchTemplateParametersToScopeSpecifier(), OOK_Outside, clang::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), and clang::T.
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 3743 of file SemaTemplate.cpp.
References ActOnTypenameType(), clang::TemplateArgumentListInfo::arguments(), CheckTemplateIdType(), computeDeclContext(), Context, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), CreateParsedType(), clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsAssumedTemplateName(), clang::TemplateName::getAsDependentTemplateName(), clang::CXXScopeSpec::getBeginLoc(), clang::ASTContext::getDependentTemplateSpecializationType(), getElaboratedType(), getLangOpts(), clang::IdentifierInfo::getName(), clang::TemplateSpecializationTypeLoc::getNumArgs(), clang::DependentTemplateSpecializationTypeLoc::getNumArgs(), clang::CXXScopeSpec::getScopeRep(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), isDependentScopeSpecifier(), clang::ElaboratedTypeLoc::isEmpty(), clang::SourceLocation::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::QualType::isNull(), clang::CXXScopeSpec::isSet(), clang::None, clang::TypeLocBuilder::push(), resolveAssumedTemplateNameAsType(), clang::TemplateSpecializationTypeLoc::setArgLocInfo(), clang::DependentTemplateSpecializationTypeLoc::setArgLocInfo(), clang::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setElaboratedKeywordLoc(), clang::TemplateSpecializationTypeLoc::setLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setLAngleLoc(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::TemplateSpecializationTypeLoc::setRAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setRAngleLoc(), clang::TemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::TemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::T, translateTemplateArguments(), and clang::Yes.
Referenced by ActOnPseudoDestructorExpr().
TemplateNameKind Sema::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).
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 4698 of file SemaTemplate.cpp.
References computeDeclContext(), Context, clang::CPlusPlus11, clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), clang::ASTContext::getDependentTemplateName(), getLangOpts(), clang::DeclarationNameInfo::getName(), GetNameFromUnqualifiedId(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), GetTypeFromParser(), clang::IK_Identifier, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::LookupResult::isAmbiguous(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isNotEmpty(), isTemplateName(), clang::SourceLocation::isValid(), LookupOrdinaryName, LookupTemplateName(), clang::OpaquePtr< TemplateName >::make(), clang::Result, TemplateNameIsRequired, clang::TNK_Dependent_template_name, clang::TNK_Function_template, and clang::TNK_Non_template.
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 1746 of file SemaTemplate.cpp.
References Context, clang::TemplateParameterList::Create(), clang::SemaBase::Diag(), clang::SourceLocation::isValid(), P, and warnOnReservedIdentifier().
NamedDecl * Sema::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.
T in template <template <typename> class T> class array) has been parsed. S is the current scope.
Definition at line 1585 of file SemaTemplate.cpp.
References clang::IdentifierResolver::AddDecl(), clang::AS_public, Context, clang::TemplateTemplateParmDecl::Create(), Default, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsTemplate(), getEnclosingLambdaOrBlock(), clang::TemplateParameterList::getLAngleLoc(), clang::Decl::getLocation(), clang::TemplateArgumentLoc::getLocation(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateArgumentLoc::getSourceRange(), clang::ASTContext::getTranslationUnitDecl(), IdResolver, clang::SourceLocation::isInvalid(), clang::TemplateName::isNull(), clang::TemplateTemplateParmDecl::isParameterPack(), clang::SourceLocation::isValid(), maybeDiagnoseTemplateParameterShadow(), clang::Decl::setAccess(), clang::TemplateTemplateParmDecl::setDefaultArgument(), clang::Decl::setInvalidDecl(), clang::TemplateParameterList::size(), translateTemplateArgument(), clang::Typename, and UPPC_DefaultArgument.
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 946 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::Adopt(), clang::CPlusPlus17, clang::OpaquePtr< PtrTy >::get(), clang::TypeLoc::getAs(), clang::QualType::getAsOpaquePtr(), clang::TypeLoc::getBeginLoc(), getLangOpts(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::SourceLocation::isValid(), clang::OpaquePtr< TemplateName >::make(), clang::Result, clang::T, and clang::ParsedTemplateArgument::Type.
void Sema::ActOnTranslationUnitScope | ( | Scope * | S | ) |
Scope actions.
Definition at line 149 of file Sema.cpp.
References Context, clang::ASTContext::getTranslationUnitDecl(), PushDeclContext(), and TUScope.
Referenced by clang::Parser::Initialize().
bool Sema::ActOnTypeConstraint | ( | const CXXScopeSpec & | SS, |
TemplateIdAnnotation * | TypeConstraint, | ||
TemplateTypeParmDecl * | ConstrainedParameter, | ||
SourceLocation | EllipsisLoc | ||
) |
Definition at line 1093 of file SemaTemplate.cpp.
References BuildTypeConstraint().
NamedDecl * Sema::ActOnTypedefDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
DeclContext * | DC, | ||
TypeSourceInfo * | TInfo, | ||
LookupResult & | Previous | ||
) |
Definition at line 6669 of file SemaDecl.cpp.
References ActOnTypedefNameDecl(), CheckTypedefForVariablyModifiedType(), CurContext, D, clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), clang::Decl::getKind(), getLangOpts(), clang::Decl::getSourceRange(), clang::TypeSourceInfo::getType(), clang::IK_DeductionGuideName, clang::IK_Identifier, ParseTypedefDecl(), Previous, and ProcessDeclAttributes().
Referenced by HandleDeclarator().
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 6753 of file SemaDecl.cpp.
References clang::Decl::addAttr(), CheckShadow(), Context, FilterLookupForScope(), filterNonConflictingPreviousTypedefDecls(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::DeclContext::getRedeclContext(), getShadowedDeclaration(), inferGslPointerAttribute(), clang::Decl::isInvalidDecl(), clang::DeclContext::isTranslationUnit(), MergeTypedefNameDecl(), Previous, clang::ASTContext::setFILEDecl(), clang::ASTContext::setjmp_bufDecl(), clang::ASTContext::setsigjmp_bufDecl(), and clang::ASTContext::setucontext_tDecl().
Referenced by ActOnAliasDeclaration(), and ActOnTypedefDeclarator().
TypeResult Sema::ActOnTypeName | ( | Declarator & | D | ) |
Definition at line 6414 of file SemaType.cpp.
References clang::AliasDecl, clang::AliasTemplate, CheckConstrainedAuto(), CheckExtraCXXDefaultArguments(), checkUnusedDeclAttributes(), clang::CPlusPlus, CreateParsedType(), D, clang::TypeLoc::getContainedAutoTypeLoc(), getLangOpts(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::TypeSourceInfo::getTypeLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::ObjCParameter, and clang::T.
Referenced by clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), and clang::Parser::ParseTypeName().
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 10624 of file SemaTemplate.cpp.
References CheckTypenameType(), Context, clang::CPlusPlus11, CreateParsedType(), clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), getLangOpts(), clang::CXXScopeSpec::getWithLocInContext(), clang::CXXScopeSpec::isInvalid(), clang::SourceLocation::isValid(), clang::None, clang::T, clang::Typename, and clang::Yes.
Referenced by ActOnTemplateIdType(), ActOnTypeRequirement(), DiagnoseUnknownTypeName(), getTypeName(), 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 10654 of file SemaTemplate.cpp.
References clang::TemplateArgumentListInfo::arguments(), CheckTemplateIdType(), computeDeclContext(), Context, clang::CPlusPlus11, CreateParsedType(), clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsDependentTemplateName(), clang::ASTContext::getDependentTemplateSpecializationType(), clang::ASTContext::getElaboratedType(), getLangOpts(), clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::getWithLocInContext(), clang::SourceLocation::isValid(), NoteAllFoundTemplates(), clang::TemplateSpecializationTypeLoc::setArgLocInfo(), clang::DependentTemplateSpecializationTypeLoc::setArgLocInfo(), clang::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setElaboratedKeywordLoc(), clang::TemplateSpecializationTypeLoc::setLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setLAngleLoc(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::TemplateSpecializationTypeLoc::setRAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setRAngleLoc(), clang::TemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::TemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::TemplateArgumentListInfo::size(), clang::T, translateTemplateArguments(), and clang::Typename.
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 988 of file SemaTemplate.cpp.
References clang::IdentifierResolver::AddDecl(), clang::AS_public, CheckTemplateArgument(), Context, clang::TemplateTypeParmDecl::Create(), clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), getEnclosingLambdaOrBlock(), clang::ASTContext::getTranslationUnitDecl(), clang::TypeSourceInfo::getType(), GetTypeFromParser(), IdResolver, clang::TemplateTypeParmDecl::isParameterPack(), clang::SourceLocation::isValid(), maybeDiagnoseTemplateParameterShadow(), clang::Decl::setAccess(), clang::TemplateTypeParmDecl::setDefaultArgument(), clang::Decl::setInvalidDecl(), clang::Typename, and UPPC_DefaultArgument.
concepts::Requirement * Sema::ActOnTypeRequirement | ( | SourceLocation | TypenameKWLoc, |
CXXScopeSpec & | SS, | ||
SourceLocation | NameLoc, | ||
const IdentifierInfo * | TypeName, | ||
TemplateIdAnnotation * | TemplateId | ||
) |
Definition at line 9362 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 6057 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 4686 of file SemaExpr.cpp.
References CreateUnaryExprOrTypeTraitExpr(), clang::ExprError(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), GetTypeFromParser(), and clang::Result.
Referenced by BuildCXXForRangeStmt().
ExprResult Sema::ActOnUnaryOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
tok::TokenKind | Op, | ||
Expr * | Input, | ||
bool | IsAfterAmp = false |
||
) |
Unary Operators. 'Tok' is the token for the operator.
Definition at line 15821 of file SemaExpr.cpp.
References BuildUnaryOp(), and ConvertTokenKindToUnaryOpcode().
Referenced by BuildCXXForRangeStmt().
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 3688 of file SemaTemplate.cpp.
References clang::OpaquePtr< PtrTy >::get(), clang::OpaquePtr< TemplateName >::make(), resolveAssumedTemplateNameAsType(), clang::TNK_Type_template, and clang::TNK_Undeclared_template.
ExprResult Sema::ActOnUnevaluatedStringLiteral | ( | ArrayRef< Token > | StringToks | ) |
Definition at line 1969 of file SemaExpr.cpp.
References Context, clang::StringLiteral::Create(), clang::SemaBase::Diag(), ExpandFunctionLocalPredefinedMacros(), clang::ExprError(), getLangOpts(), getUDSuffixLoc(), PP, and clang::Unevaluated.
void Sema::ActOnUninitializedDecl | ( | Decl * | dcl | ) |
Definition at line 13936 of file SemaDecl.cpp.
References AbstractVariableType, clang::TargetInfo::allowDebugInfoForExternalRef(), clang::VarDecl::CallInit, CheckCompleteVariableDeclaration(), checkNonTrivialCUnion(), Context, clang::CPlusPlus, clang::CPlusPlus17, clang::InitializationKind::CreateDefault(), CreateRecoveryExpr(), clang::VarDecl::DeclarationOnly, DeduceVariableDeclarationType(), clang::VarDecl::Definition, clang::SemaBase::Diag(), ExternalDeclarations, clang::Type::getAs(), clang::ASTContext::getAsIncompleteArrayType(), clang::ASTContext::getBaseElementType(), clang::TargetInfo::getCXXABI(), getLangOpts(), clang::ASTContext::getTargetInfo(), clang::Decl::hasAttr(), clang::Init, clang::InitializedEntity::InitializeVariable(), clang::Type::isDependentType(), clang::Type::isIncompleteArrayType(), clang::TargetCXXABI::isMicrosoft(), clang::Type::isReferenceType(), clang::Type::isUndeducedType(), MaybeCreateExprWithCleanups(), NTCUC_DefaultInitializedObject, NTCUK_Init, OpenCL(), clang::opencl_constant, clang::opencl_local, clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::push_back(), RequireCompleteSizedType(), RequireCompleteType(), RequireNonAbstractType(), clang::SC_Extern, clang::SC_PrivateExtern, clang::SC_Static, setFunctionHasBranchProtectedScope(), clang::VarDecl::TentativeDefinition, and TentativeDefinitions.
Referenced by actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), BuildAnonymousStructOrUnion(), buildCoroutinePromise(), 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 12224 of file SemaDeclCXX.cpp.
References BuildUsingDeclaration(), clang::DeclarationNameInfo::containsUnexpandedParameterPack(), clang::NestedNameSpecifier::containsUnexpandedParameterPack(), clang::CPlusPlus11, clang::FixItHint::CreateInsertion(), clang::Scope::DeclScope, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::SourceRange::getBegin(), clang::CXXScopeSpec::getBeginLoc(), clang::DeclarationNameInfo::getEndLoc(), getLangOpts(), clang::DeclarationNameInfo::getName(), GetNameFromUnqualifiedId(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::ParsedAttributesView::hasAttribute(), clang::IK_ConstructorName, clang::IK_ConstructorTemplateId, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::IK_DestructorName, clang::IK_Identifier, clang::IK_ImplicitSelfParam, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::IK_TemplateId, clang::CXXScopeSpec::isEmpty(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), PushOnScopeChains(), and UPPC_UsingDeclaration.
Decl * Sema::ActOnUsingDirective | ( | Scope * | CurScope, |
SourceLocation | UsingLoc, | ||
SourceLocation | NamespcLoc, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | IdentLoc, | ||
IdentifierInfo * | NamespcName, | ||
const ParsedAttributesView & | AttrList | ||
) |
Definition at line 12128 of file SemaDeclCXX.cpp.
References clang::LookupResult::addDecl(), clang::LookupResult::clear(), Context, clang::UsingDirectiveDecl::Create(), CurContext, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), clang::LookupResult::empty(), clang::DeclContext::Encloses(), clang::LookupResult::getAsSingle(), clang::SourceManager::getExpansionLoc(), getOrCreateStdNamespace(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::LookupResult::getRepresentativeDecl(), clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::getWithLocInContext(), clang::NestedNameSpecifier::Global, clang::LookupResult::isAmbiguous(), clang::SourceManager::isInMainFile(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isSet(), clang::IdentifierInfo::isStr(), IsUsingDirectiveInToplevelContext(), clang::SourceLocation::isValid(), LookupNamespaceName, LookupParsedName(), NS, ProcessAPINotes(), ProcessDeclAttributeList(), PushUsingDirective(), clang::LookupResult::resolveKind(), SourceMgr, and TryNamespaceTypoCorrection().
Decl * Sema::ActOnUsingEnumDeclaration | ( | Scope * | CurScope, |
AccessSpecifier | AS, | ||
SourceLocation | UsingLoc, | ||
SourceLocation | EnumLoc, | ||
SourceRange | TyLoc, | ||
const IdentifierInfo & | II, | ||
ParsedType | Ty, | ||
CXXScopeSpec * | SS = nullptr |
||
) |
Definition at line 12308 of file SemaDeclCXX.cpp.
References BuildUsingEnumDeclaration(), Context, clang::SemaBase::Diag(), clang::Enum, clang::Type::getAsTagDecl(), clang::SourceRange::getBegin(), clang::CXXScopeSpec::getBeginLoc(), clang::SourceRange::getEnd(), clang::IdentifierInfo::getName(), clang::ASTContext::getTrivialTypeSourceInfo(), GetTypeFromParser(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::CXXScopeSpec::isInvalid(), clang::QualType::isNull(), and PushOnScopeChains().
ExprResult Sema::ActOnVAArg | ( | SourceLocation | BuiltinLoc, |
Expr * | E, | ||
ParsedType | Ty, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 16495 of file SemaExpr.cpp.
References BuildVAArgExpr(), E, and GetTypeFromParser().
NamedDecl * Sema::ActOnVariableDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
DeclContext * | DC, | ||
TypeSourceInfo * | TInfo, | ||
LookupResult & | Previous, | ||
MultiTemplateParamsArg | TemplateParamLists, | ||
bool & | AddToScope, | ||
ArrayRef< BindingDecl * > | Bindings = {} |
||
) |
Definition at line 7470 of file SemaDecl.cpp.
References ActOnDocumentableDecl(), clang::SemaHLSL::ActOnVariableDeclarator(), ActOnVarTemplateSpecialization(), clang::Decl::addAttr(), adjustContextForLocalExternDecl(), CheckConstrainedAuto(), checkDLLAttributeRedeclaration(), CheckMemberSpecialization(), checkNonTrivialCUnion(), CheckShadow(), CheckTemplateDeclScope(), CheckTemplateParameterList(), CheckVariableDeclaration(), CompleteMemberSpecialization(), computeDeclContext(), clang::Consteval, clang::Constexpr, clang::Constinit, Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus14, clang::CPlusPlus17, clang::VarTemplateDecl::Create(), clang::VarDecl::Create(), clang::DecompositionDecl::Create(), clang::FixItHint::CreateRemoval(), CUDA(), CurContext, D, clang::DeclAttrsMatchCUDAMode(), deduceOpenCLAddressSpace(), clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), DiagPlaceholderVariableDefinition(), E, emitReadOnlyPlacementAttrWarning(), clang::DeclContext::Equals(), ExtnameUndeclaredIdentifiers, FilterLookupForScope(), clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getAddrSpaceQualType(), clang::Type::getAs(), clang::Decl::getAttr(), clang::TypeLoc::getBeginLoc(), clang::Decl::getBeginLoc(), clang::TypeLoc::getContainedAutoTypeLoc(), clang::Type::getContainedDeducedType(), getCurFunctionDecl(), getCurrentMangleNumberContext(), clang::TargetInfo::getCXXABI(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::VarDecl::getDescribedVarTemplate(), clang::Expr::getExprLoc(), clang::NamedDecl::getIdentifier(), clang::VarTemplateDecl::getInstantiatedFromMemberTemplate(), clang::Decl::getKind(), clang::ASTContext::getLangASForBuiltinAddressSpace(), getLangOpts(), clang::Decl::getLocation(), clang::MangleNumberingContext::getManglingNumber(), getMSManglingNumber(), clang::DeclarationNameInfo::getName(), GetNameForDeclarator(), clang::LangOptions::getOpenCLVersionString(), clang::DeclContext::getParent(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::TemplateParameterList::getRAngleLoc(), clang::DeclContext::getRedeclContext(), getShadowedDeclaration(), getSourceManager(), clang::TemplateParameterList::getSourceRange(), clang::TypeLoc::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::MangleNumberingContext::getStaticLocalNumber(), clang::VarDecl::getStorageClass(), clang::StringLiteral::getString(), clang::StringLiteral::getStrTokenLoc(), clang::TagDecl::getTagKind(), clang::ASTContext::getTargetInfo(), clang::TemplateParameterList::getTemplateLoc(), clang::TemplateDecl::getTemplateParameters(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::ASTContext::getTypeSize(), clang::Decl::hasAttr(), clang::NamedDecl::hasExternalFormalLinkage(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasGlobalStorage(), clang::VarDecl::hasLocalStorage(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), hasParsedAttr(), HLSL(), clang::IK_TemplateId, clang::Invalid, clang::DeclContext::isClosure(), clang::QualType::isConstQualified(), isDeclExternC(), isDeclInScope(), clang::DeclContext::isDependentContext(), clang::VarDecl::isExternC(), clang::Redeclarable< decl_type >::isFirstDecl(), isFunctionDefinitionDiscarded(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isFunctionPointerType(), isIncompleteDeclExternC(), clang::Type::isIntegralType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::VarDecl::isLocalVarDecl(), isMainVar(), clang::TargetCXXABI::isMicrosoft(), clang::IdentifierInfo::isPlaceholder(), clang::Type::isPointerType(), clang::DeclContext::isRecord(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::isStaticLocal(), clang::TargetInfo::isTLSSupported(), clang::TargetInfo::isValidGCCRegisterName(), clang::Type::isVariableArrayType(), clang::Type::isWebAssemblyTableType(), Label, LangOpts, MatchTemplateParametersToScopeSpecifier(), MaybeSuggestAddingStaticToDecl(), NTCUC_AutoVar, NTCUK_Destruct, ObjC(), OpenCL(), ParsingInitForAutoVars, Previous, ProcessDeclAttributes(), ProcessPragmaWeak(), RebuildTemplateParamsInCurrentInstantiation(), RegisterLocallyScopedExternCDecl(), clang::SC_Auto, clang::SC_Extern, clang::SC_None, clang::SC_PrivateExtern, clang::SC_Register, clang::SC_Static, clang::DeclSpec::SCS_mutable, clang::DeclSpec::SCS_register, clang::DeclSpec::SCS_unspecified, clang::VarDecl::setConstexpr(), clang::VarDecl::setDescribedVarTemplate(), clang::VarDecl::setImplicitlyInline(), clang::VarDecl::setInlineSpecified(), clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), clang::Decl::setLocalExternDecl(), clang::ASTContext::setManglingNumber(), clang::RedeclarableTemplateDecl::setMemberSpecialization(), clang::NamedDecl::setModulePrivate(), SetNestedNameSpecifier(), clang::VarDecl::setPreviousDeclInSameBlockScope(), clang::ASTContext::setStaticLocalNumber(), clang::VarDecl::setStorageClass(), clang::DeclaratorDecl::setTemplateParameterListsInfo(), clang::VarDecl::setTSCSpec(), clang::ValueDecl::setType(), shouldConsiderLinkage(), clang::TemplateParameterList::size(), StorageClassSpecToVarDeclStorageClass(), targetDiag(), TPC_ClassTemplateMember, TPC_VarTemplate, tryToFixVariablyModifiedVarType(), clang::DeclSpec::TSCS_thread_local, clang::TSCS_unspecified, and clang::Unspecified.
Referenced by ActOnDecompositionDeclarator(), and HandleDeclarator().
DeclResult Sema::ActOnVarTemplateSpecialization | ( | Scope * | S, |
Declarator & | D, | ||
TypeSourceInfo * | DI, | ||
LookupResult & | Previous, | ||
SourceLocation | TemplateKWLoc, | ||
TemplateParameterList * | TemplateParams, | ||
StorageClass | SC, | ||
bool | IsPartialSpecialization | ||
) |
Definition at line 4136 of file SemaTemplate.cpp.
References clang::DeclContext::addDecl(), clang::TemplateSpecializationType::anyDependentTemplateArguments(), CheckTemplateArgumentList(), CheckTemplatePartialSpecialization(), CheckTemplatePartialSpecializationArgs(), CheckTemplateSpecializationScope(), Context, clang::VarTemplatePartialSpecializationDecl::Create(), clang::VarTemplateSpecializationDecl::Create(), clang::FixItHint::CreateRemoval(), CurContext, D, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::OpaquePtr< PtrTy >::get(), clang::NamedDecl::getDeclName(), clang::VarTemplatePartialSpecializationDecl::getInstantiatedFromMember(), clang::Decl::getKind(), clang::ASTContext::getLangOpts(), clang::VarTemplateSpecializationDecl::getPointOfInstantiation(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::VarTemplateSpecializationDecl::getSpecializationKind(), clang::VarDecl::getTemplateSpecializationKind(), getTemplateSpecializationKind(), clang::TypeSourceInfo::getType(), clang::TemplateParameterList::hasAssociatedConstraints(), clang::IK_TemplateId, clang::DeclContext::isRecord(), isSameAsPrimaryTemplate(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, makeTemplateArgumentListInfo(), Previous, Range, clang::TemplateIdAnnotation::RAngleLoc, clang::SC_Extern, clang::VarTemplatePartialSpecializationDecl::setMemberSpecialization(), clang::VarTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::TemplateArgumentListInfo::size(), clang::Specialization, clang::TemplateIdAnnotation::Template, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, UPPC_ExplicitSpecialization, UPPC_PartialSpecialization, and VarTemplate.
Referenced by ActOnVariableDeclarator().
StmtResult Sema::ActOnWhileStmt | ( | SourceLocation | WhileLoc, |
SourceLocation | LParenLoc, | ||
ConditionResult | Cond, | ||
SourceLocation | RParenLoc, | ||
Stmt * | Body | ||
) |
Definition at line 1792 of file SemaStmt.cpp.
References Context, clang::WhileStmt::Create(), clang::SemaBase::Diag(), Diags, clang::Sema::ConditionResult::get(), clang::Stmt::getBeginLoc(), getCurCompoundScope(), clang::DiagnosticsEngine::isIgnored(), clang::Sema::ConditionResult::isInvalid(), clang::sema::CompoundScopeInfo::setHasEmptyLoopBodies(), and clang::StmtError().
Referenced by clang::TreeTransform< Derived >::RebuildWhileStmt().
void Sema::AddAlignedAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E, | ||
bool | IsPackExpansion | ||
) |
AddAlignedAttr - Adds an aligned attribute to a particular declaration.
Definition at line 4253 of file SemaDeclAttr.cpp.
References clang::Decl::addAttr(), Context, D, clang::SemaBase::Diag(), E, clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getCharWidth(), clang::AttributeCommonInfo::getLoc(), clang::TargetInfo::getMaxTLSAlign(), clang::CharUnits::getQuantity(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isValueDependent(), clang::Type::isVectorType(), MaximumAlignment, clang::VarDecl::TLS_None, clang::ASTContext::toCharUnitsFromBits(), validateAlignasAppliedType(), and VerifyIntegerConstantExpression().
Referenced by handleAlignedAttr(), and instantiateDependentAlignedAttr().
void Sema::AddAlignedAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
TypeSourceInfo * | T, | ||
bool | IsPackExpansion | ||
) |
Definition at line 4343 of file SemaDeclAttr.cpp.
References clang::Decl::addAttr(), Context, D, clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), clang::CharUnits::getQuantity(), clang::TypeLoc::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Type::isDependentType(), clang::Type::isVectorType(), clang::ASTContext::toCharUnitsFromBits(), and validateAlignasAppliedType().
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.
Referenced by ActOnClassTemplateSpecialization(), ActOnTag(), and CheckClassTemplate().
void Sema::AddAlignValueAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E | ||
) |
AddAlignValueAttr - Adds an align_value attribute to a particular declaration.
Definition at line 4121 of file SemaDeclAttr.cpp.
References clang::Decl::addAttr(), Context, D, clang::SemaBase::Diag(), E, clang::ActionResult< PtrTy, Compress >::get(), clang::AttributeCommonInfo::getLoc(), clang::Decl::getSourceRange(), clang::Stmt::getSourceRange(), clang::Type::isAnyPointerType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMemberPointerType(), clang::Type::isReferenceType(), clang::Expr::isValueDependent(), clang::T, and VerifyIntegerConstantExpression().
Referenced by handleAlignValueAttr(), and instantiateDependentAlignValueAttr().
void Sema::AddAllocAlignAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | ParamExpr | ||
) |
AddAllocAlignAttr - Adds an alloc_align attribute to a particular declaration.
Definition at line 1442 of file SemaDeclAttr.cpp.
References clang::Decl::addAttr(), checkFunctionOrMethodParameterIndex(), Context, D, clang::SemaBase::Diag(), clang::ParamIdx::getASTIndex(), clang::Stmt::getBeginLoc(), clang::getFunctionOrMethodParamType(), clang::getFunctionOrMethodResultSourceRange(), clang::getFunctionOrMethodResultType(), clang::AttributeCommonInfo::getLoc(), clang::AttributeCommonInfo::getRange(), clang::Type::isAlignValT(), clang::Type::isDependentType(), clang::Type::isIntegralType(), and isValidPointerAttrType().
Referenced by handleAllocAlignAttr(), and instantiateDependentAllocAlignAttr().
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 10096 of file SemaOverload.cpp.
References clang::AS_none, clang::ADLResult::begin(), clang::OverloadCandidateSet::begin(), E, clang::ADLResult::end(), clang::OverloadCandidateSet::end(), clang::ADLResult::erase(), clang::OverloadCandidateSet::getRewriteInfo(), Loc, clang::DeclAccessPair::make(), clang::Reversed, and clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed().
void Sema::AddAssumeAlignedAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | E, | ||
Expr * | OE | ||
) |
AddAssumeAlignedAttr - Adds an assume_aligned attribute to a particular declaration.
Definition at line 1393 of file SemaDeclAttr.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Decl::addAttr(), Context, D, clang::SemaBase::Diag(), E, clang::getFunctionOrMethodResultSourceRange(), clang::getFunctionOrMethodResultType(), clang::Expr::getIntegerConstantExpr(), clang::AttributeCommonInfo::getLoc(), clang::AttributeCommonInfo::getRange(), clang::Stmt::getSourceRange(), clang::Expr::isIntegerConstantExpr(), isValidPointerAttrType(), clang::Expr::isValueDependent(), and MaximumAlignment.
Referenced by handleAssumeAlignedAttr(), and instantiateDependentAssumeAlignedAttr().
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 8443 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), clang::AS_none, clang::ASTContext::BoolTy, clang::OverloadCandidate::BuiltinParamTypes, clang::OverloadCandidate::Conversions, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::DeclAccessPair::make(), clang::ovl_fail_bad_conversion, TryContextuallyConvertToBool(), TryCopyInitialization(), clang::Unevaluated, Unevaluated, and clang::OverloadCandidate::Viable.
Referenced by AddBuiltinAssignmentOperatorCandidates().
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 9898 of file SemaOverload.cpp.
References clang::QualifiersAndAtomic::addAtomic(), clang::QualifiersAndAtomic::addConst(), CollectVRQualifiers(), clang::NUM_OVERLOADED_OPERATORS, and clang::OO_None.
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 7977 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), clang::ImplicitConversionSequence::BadConversion, clang::Type::castAs(), clang::Expr::Classify(), clang::OverloadCandidate::Conversions, clang::CPlusPlus14, clang::CallExpr::CreateTemporary(), clang::DeductionFailureInfo::Data, clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FinalConversion, clang::StandardConversionSequence::First, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::GetConversionRank(), clang::CXXConversionDecl::getConversionType(), clang::RecordType::getDecl(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Expr::getExprLoc(), clang::ImplicitConversionSequence::getKind(), clang::OverloadCandidateSet::getLocation(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::FunctionDecl::getPrimaryTemplate(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::CanQual< T >::getUnqualifiedType(), clang::QualType::getUnqualifiedType(), clang::Expr::getValueKindForType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ICK_Lvalue_To_Rvalue, clang::ICR_Exact_Match, isAllowableExplicitConversion(), clang::CXXConversionDecl::isExplicit(), clang::OverloadCandidateSet::isNewCandidate(), isNonViableMultiVersionOverload(), clang::Type::isRValueReferenceType(), clang::ConstraintSatisfaction::IsSatisfied, clang::Type::isUndeducedType(), clang::ImplicitCastExpr::OnStack, clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_final_conversion, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_explicit, clang::ovl_fail_final_conversion_not_exact, clang::ovl_fail_trivial_conversion, clang::ovl_non_default_multiversion_function, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::setAllToTypes(), clang::StandardConversionSequence::setAsIdentityConversion(), clang::StandardConversionSequence::setFromType(), clang::ImplicitConversionSequence::Standard, clang::ImplicitConversionSequence::StandardConversion, TryCopyInitialization(), TryObjectArgumentInitialization(), clang::Unevaluated, Unevaluated, clang::OverloadCandidate::Viable, clang::VK_LValue, and clang::VK_PRValue.
Referenced by collectViableConversionCandidates(), FindConversionForRefInit(), IsUserDefinedConversion(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
void clang::Sema::addDeclWithEffects | ( | const Decl * | D, |
const FunctionEffectsRef & | FX | ||
) |
Unconditionally add a Decl to DeclsWithEfffectsToVerify.
Definition at line 1469 of file SemaFunctionEffects.cpp.
References AllEffectsToVerify, D, DeclsWithEffectsToVerify, clang::FunctionEffect::FE_InferrableOnCallees, and clang::FunctionEffectKindSet::insert().
Referenced by maybeAddDeclWithEffects().
void Sema::addExternalSource | ( | ExternalSemaSource * | E | ) |
Registers an external source.
If an external source already exists, creates a multiplex external source and appends to it.
[in] | E | - A non-null external sema source. |
Definition at line 594 of file Sema.cpp.
References E.
Referenced by clang::ASTReader::InitializeSema().
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 7430 of file SemaOverload.cpp.
References clang::UnresolvedSetImpl::begin(), clang::Expr::Classify(), D, E, clang::UnresolvedSetImpl::end(), clang::Decl::getDeclContext(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Expr::getType(), clang::QualType::isNull(), clang::Type::isPointerType(), and clang::Expr::Classification::makeSimpleLValue().
Referenced by clang::SemaCodeCompletion::ProduceCallSignatureHelp().
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 10515 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.
Referenced by ActOnFields().
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 1312 of file SemaAttr.cpp.
References clang::Decl::addAttr(), Context, clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), MSFunctionNoBuiltins, and V.
Referenced by ActOnFunctionDeclarator().
void Sema::addImplicitTypedef | ( | StringRef | Name, |
QualType | T | ||
) |
Definition at line 305 of file Sema.cpp.
References clang::IdentifierResolver::begin(), clang::ASTContext::buildImplicitTypedef(), Context, clang::IdentifierResolver::end(), clang::IdentifierTable::get(), clang::ASTContext::Idents, IdResolver, PushOnScopeChains(), clang::T, and TUScope.
Referenced by Initialize().
void Sema::addInitCapture | ( | sema::LambdaScopeInfo * | LSI, |
VarDecl * | Var, | ||
bool | ByRef | ||
) |
Add an init-capture to a lambda scope.
Definition at line 878 of file SemaLambda.cpp.
References clang::sema::CapturingScopeInfo::addCapture(), clang::Decl::getLocation(), clang::ValueDecl::getType(), and clang::VarDecl::isInitCapture().
Referenced by ActOnLambdaExpressionAfterIntroducer().
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 13377 of file SemaDecl.cpp.
References AbstractVariableType, ActOnFinishFullExpr(), clang::C99, clang::VarDecl::CallInit, CheckCompleteVariableDeclaration(), CheckForConstantInitializer(), checkNonTrivialCUnionInInitializer(), clang::SemaObjC::checkRetainCycles(), checkUnsafeAssigns(), checkVarDeclRedefinition(), clang::Expr::containsErrors(), Context, CorrectDelayedTyposInExpr(), clang::CPlusPlus, clang::CPlusPlus11, clang::InitializationKind::CreateForInit(), clang::FixItHint::CreateInsertion(), CreateRecoveryExpr(), currentModuleIsHeaderUnit(), DeduceVariableDeclarationType(), clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), Diags, clang::DirectInit, E, clang::ExprError(), clang::External, forceUnknownAnyToType(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::ASTContext::getAsIncompleteArrayType(), clang::ASTContext::getBaseElementType(), clang::DeclaratorDecl::getBeginLoc(), clang::VarDecl::getCanonicalDecl(), getCurFunction(), clang::TargetInfo::getCXXABI(), clang::NamedDecl::getDeclName(), clang::VarDecl::getDefinition(), clang::Expr::getExprLoc(), clang::ParenListExpr::getExprs(), clang::NamedDecl::getFormalLinkage(), clang::VarDecl::getInit(), clang::VarDecl::getInstantiatedFromStaticDataMember(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::ParenListExpr::getNumExprs(), clang::ASTContext::getObjCIdType(), clang::QualType::getObjCLifetime(), clang::VarDecl::getStorageClass(), clang::ASTContext::getTargetInfo(), clang::VarDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasInit(), clang::VarDecl::hasLocalStorage(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::Expr::IgnoreParens(), clang::Init, clang::InitializedEntity::InitializeVariable(), clang::Type::isAggregateType(), clang::VarDecl::isConstexpr(), clang::QualType::isConstQualified(), clang::Type::isDependentType(), clang::VarDecl::isExternC(), clang::VarDecl::isFileVarDecl(), clang::Type::isFloatingType(), clang::DiagnosticsEngine::isIgnored(), clang::VarDecl::isInline(), clang::Type::isIntegralOrEnumerationType(), clang::Decl::isInvalidDecl(), clang::Type::isLiteralType(), clang::VarDecl::isLocalVarDecl(), clang::TargetCXXABI::isMicrosoft(), clang::QualType::isNonWeakInMRRWithObjCWeak(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::VarDecl::isOutOfLine(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::VarDecl::isStaticDataMember(), clang::Decl::isTemplated(), clang::isTemplateInstantiation(), clang::VarDecl::isThisDeclarationADefinition(), clang::VarDecl::isThisDeclarationADemotedDefinition(), clang::Type::isUndeducedType(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::QualType::isVolatileQualified(), LangOpts, clang::VarDecl::ListInit, Loc, ObjC(), clang::Qualifiers::OCL_Strong, clang::LangOptions::OMPTargetTriples, clang::opencl_constant, clang::opencl_local, clang::VarDecl::ParenListInit, clang::InitializationSequence::Perform(), RequireCompleteType(), RequireNonAbstractType(), clang::Result, clang::SC_Extern, clang::SC_Static, clang::VarDecl::setConstexpr(), setFunctionHasBranchProtectedScope(), clang::VarDecl::setInit(), clang::VarDecl::setInitStyle(), clang::Decl::setInvalidDecl(), clang::VarDecl::setStorageClass(), clang::ValueDecl::setType(), clang::InitializationSequence::SK_ParenthesizedListInit, clang::InitializationSequence::step_begin(), clang::InitializationSequence::steps(), clang::ASTContext::UnknownAnyTy, and UPPC_Initializer.
Referenced by actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), buildCaptureDecl(), buildCoroutineParameterMoves(), BuildCXXForRangeStmt(), checkOpenMPLoop(), FinishForRangeVarDecl(), InstantiateVariableInitializer(), and precomputeExpr().
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 16626 of file SemaDecl.cpp.
References clang::Decl::addAttr(), AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), clang::ASTContext::BuiltinInfo, clang::C, Context, clang::CPlusPlus, CUDA(), clang::EST_None, clang::LangOptionsBase::FPE_Ignore, clang::IdentifierTable::get(), clang::Type::getAs(), clang::FunctionDecl::getBuiltinID(), clang::Decl::getDeclContext(), clang::LangOptions::getDefaultExceptionMode(), clang::NamedDecl::getIdentifier(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::ASTContext::Idents, inferLifetimeBoundAttribute(), inferLifetimeCaptureByAttribute(), clang::Builtin::Context::isAuxBuiltinID(), clang::Builtin::Context::isConst(), clang::Builtin::Context::isConstWithoutErrnoAndExceptions(), clang::Builtin::Context::isConstWithoutExceptions(), clang::FunctionDecl::isExternC(), clang::Decl::isInvalidDecl(), clang::Builtin::Context::isNoThrow(), clang::Type::isObjCObjectPointerType(), clang::Builtin::Context::isPrintfLike(), clang::Builtin::Context::isPure(), clang::Builtin::Context::isReturnsTwice(), clang::Builtin::Context::isScanfLike(), clang::DeclContext::isTranslationUnit(), clang::Builtin::Context::isTSBuiltin(), LazyProcessLifetimeCaptureByParams(), and clang::Builtin::Context::performsCallback().
Referenced by ActOnFunctionDeclarator(), CreateBuiltin(), and ImplicitlyDefineFunction().
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 16557 of file SemaDecl.cpp.
References clang::Decl::addAttr(), Context, clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::Decl::getLocation(), clang::Decl::hasAttr(), clang::Decl::isInvalidDecl(), and clang::FunctionDecl::isReplaceableGlobalAllocationFunction().
Referenced by AddKnownFunctionAttributes(), and DeclareGlobalAllocationFunction().
void Sema::AddLaunchBoundsAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
Expr * | MaxThreads, | ||
Expr * | MinBlocks, | ||
Expr * | MaxBlocks | ||
) |
AddLaunchBoundsAttr - Adds a launch_bounds attribute to a particular declaration.
Definition at line 5415 of file SemaDeclAttr.cpp.
References clang::Decl::addAttr(), CreateLaunchBoundsAttr(), and D.
Referenced by handleLaunchBoundsAttr(), and instantiateDependentCUDALaunchBoundsAttr().
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 8395 of file SemaOverload.cpp.
References clang::LookupResult::begin(), clang::ASTContext::DeclarationNames, clang::LookupResult::end(), clang::Type::getAs(), clang::DeclarationNameTable::getCXXOperatorName(), clang::OverloadCandidateSet::getRewriteInfo(), clang::Reversed, clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed(), and clang::LookupResult::suppressAccessDiagnostics().
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 = {} , |
||
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 7525 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), clang::OverloadCandidate::Conversions, clang::OverloadCandidateSet::CSK_AddressOfOverloadSet, clang::CUDA, clang::DeductionFailureInfo::Data, clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::Type::getAs(), clang::CXXMethodDecl::getFunctionObjectParameterReferenceType(), clang::OverloadCandidateSet::getKind(), clang::OverloadCandidateSet::getLocation(), clang::FunctionDecl::getMinRequiredArguments(), clang::FunctionDecl::getNumParams(), clang::FunctionProtoType::getParamType(), clang::OverloadCandidateSet::getRewriteInfo(), clang::OverloadCandidateSet::OperatorRewriteInfo::getRewriteKind(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ValueDecl::getType(), clang::OverloadCandidate::IgnoreObjectArgument, int, clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::CXXMethodDecl::isImplicitObjectMemberFunction(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::OverloadCandidateSet::isNewCandidate(), isNonViableMultiVersionOverload(), clang::QualType::isNull(), clang::ConstraintSatisfaction::IsSatisfied, clang::CXXMethodDecl::isStatic(), clang::FunctionProtoType::isVariadic(), clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_target, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_too_few_arguments, clang::ovl_fail_too_many_arguments, clang::ovl_non_default_multiversion_function, clang::Reversed, clang::OverloadCandidate::RewriteKind, clang::shouldEnforceArgLimit(), clang::OverloadCandidate::TookAddressOfOverload, clang::TooManyArguments, TryCopyInitialization(), TryObjectArgumentInitialization(), clang::Unevaluated, Unevaluated, and clang::OverloadCandidate::Viable.
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 7498 of file SemaOverload.cpp.
References clang::Decl::getDeclContext().
Referenced by LookupSpecialMember().
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 7710 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), DeduceTemplateArguments(), clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::OverloadCandidateSet::getLocation(), clang::OverloadCandidateSet::getRewriteInfo(), clang::OverloadCandidateSet::OperatorRewriteInfo::getRewriteKind(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::OverloadCandidate::IgnoreObjectArgument, clang::OverloadCandidateSet::isNewCandidate(), clang::QualType::isNull(), clang::OverloadCandidate::IsSurrogate, clang::MakeDeductionFailureInfo(), clang::NonDependentConversionFailure, clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_deduction, clang::Result, clang::OverloadCandidate::RewriteKind, clang::Specialization, clang::Success, and clang::OverloadCandidate::Viable.
Referenced by LookupSpecialMember().
void Sema::AddModeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
IdentifierInfo * | Name, | ||
bool | InInstantiation = false |
||
) |
AddModeAttr - Adds a mode attribute to a particular declaration.
Definition at line 4548 of file SemaDeclAttr.cpp.
References clang::Decl::addAttr(), Context, D, clang::SemaBase::Diag(), clang::Generic, clang::Type::getAs(), clang::ASTContext::getComplexType(), clang::ASTContext::getIntTypeForBitwidth(), getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::AttributeCommonInfo::getRange(), clang::ASTContext::getRealTypeForBitwidth(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::ASTContext::IntTy, clang::Type::isBitIntType(), clang::Type::isComplexType(), clang::Type::isDependentType(), clang::Type::isFloatingType(), clang::Type::isIntegralOrEnumerationType(), clang::QualType::isNull(), clang::Type::isSignedIntegerType(), clang::NoFloat, normalizeName(), and parseModeAttrArg().
Referenced by handleModeAttr(), and instantiateDependentModeAttr().
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.
Referenced by ActOnClassTemplateSpecialization(), ActOnTag(), and CheckClassTemplate().
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 8355 of file SemaOverload.cpp.
References clang::UnresolvedSetImpl::begin(), D, E, clang::UnresolvedSetImpl::end(), clang::OverloadCandidateSet::getRewriteInfo(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::OverloadCandidateSet::OperatorRewriteInfo::isAcceptableCandidate(), clang::Reversed, and clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed().
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 1298 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 | AllowExplicitConversion = false , |
||
ADLCallKind | IsADLCandidate = ADLCallKind::NotADL , |
||
ConversionSequenceList | EarlyConversions = {} , |
||
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.
Don't remove inline functions with internal linkage from the overload set if they are declared in a GMF, in violation of C++ [basic.link]p17. However:
Definition at line 6915 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), clang::C, clang::OverloadCandidate::Conversions, clang::OverloadCandidateSet::CSK_Operator, clang::CUDA, D, clang::DeductionFailureInfo::Data, clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::Function, clang::OverloadCandidate::Function, clang::FunctionType::ExtParameterInfo::getABI(), clang::OverloadCandidateSet::getDestAS(), clang::FunctionProtoType::getExtParameterInfo(), clang::NamedDecl::getFormalLinkage(), clang::ExplicitSpecifier::getFromDecl(), clang::OverloadCandidateSet::getKind(), clang::OverloadCandidateSet::getLocation(), clang::QualType::getNonReferenceType(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getRecordType(), clang::OverloadCandidateSet::getRewriteInfo(), clang::OverloadCandidateSet::OperatorRewriteInfo::getRewriteKind(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::hasSameUnqualifiedType(), clang::HLSLInOut, clang::HLSLOut, clang::Internal, IsAcceptableNonMemberOperatorCandidate(), clang::Qualifiers::isAddressSpaceSupersetOf(), clang::OverloadCandidate::IsADLCandidate, clang::Decl::isImplicit(), clang::OverloadCandidateSet::isNewCandidate(), isNonViableMultiVersionOverload(), clang::ConstraintSatisfaction::IsSatisfied, clang::FunctionProtoType::isVariadic(), Loc, clang::Expr::Classification::makeSimpleLValue(), clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_target, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_explicit, clang::ovl_fail_illegal_constructor, clang::ovl_fail_inhctor_slice, clang::ovl_fail_module_mismatched, clang::ovl_fail_object_addrspace_mismatch, clang::ovl_fail_too_few_arguments, clang::ovl_fail_too_many_arguments, clang::ovl_non_default_multiversion_function, P, clang::Reversed, clang::OverloadCandidate::RewriteKind, clang::shouldEnforceArgLimit(), clang::TooManyArguments, TryCopyInitialization(), clang::TSK_ImplicitInstantiation, clang::Unevaluated, Unevaluated, and clang::OverloadCandidate::Viable.
Referenced by AddOverloadedCallCandidate(), ComputeSelectedDestructor(), DeduceTemplateSpecializationFromInitializer(), DiagnoseEmptyLookup(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), LookupSpecialMember(), clang::SemaCodeCompletion::ProduceCallSignatureHelp(), clang::SemaCodeCompletion::ProduceConstructorSignatureHelp(), resolveAllocationOverload(), resolveBuiltinNewDeleteOverload(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), TryTypoCorrectionForCall(), and TryUserDefinedConversion().
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 13691 of file SemaOverload.cpp.
References AddOverloadedCallCandidate(), clang::LookupResult::begin(), E, 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 13637 of file SemaOverload.cpp.
References AddOverloadedCallCandidate(), clang::OverloadExpr::copyTemplateArgumentsInto(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), E, clang::Expr::getExprLoc(), clang::OverloadExpr::getName(), clang::OverloadExpr::hasExplicitTemplateArgs(), and clang::UnresolvedLookupExpr::requiresADL().
Referenced by DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), and clang::SemaCodeCompletion::ProduceCallSignatureHelp().
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 8974 of file SemaDecl.cpp.
References clang::CXXMethodDecl::addOverriddenMethod(), CheckExplicitObjectOverride(), CheckIfOverriddenFunctionIsMarkedFinal(), CheckOverridingFunctionAttributes(), CheckOverridingFunctionExceptionSpec(), CheckOverridingFunctionReturnType(), Context, clang::DeclarationName::CXXDestructorName, clang::ASTContext::DeclarationNames, clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXDestructorName(), clang::NamedDecl::getDeclName(), clang::ASTContext::getTypeDeclType(), IsOverride(), clang::CXXMethodDecl::isVirtual(), clang::DeclContext::lookup(), clang::CXXRecordDecl::lookupInBases(), Path, Specifier, and clang::T.
Referenced by CheckFunctionDeclaration().
Adds the attributes that have been specified using the '#pragma clang attribute push' directives to the given declaration.
Definition at line 1190 of file SemaAttr.cpp.
References clang::ParsedAttributesView::addAtEnd(), clang::ParsedAttr::appliesToDecl(), D, clang::ParsedAttr::isPragmaClangAttribute(), PragmaAttributeCurrentTargetDecl, PragmaAttributeStack, and ProcessDeclAttributeList().
Referenced by ActOnAliasDeclaration(), ActOnEnumConstant(), clang::SemaObjC::ActOnForwardProtocolDeclaration(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaObjC::ActOnMethodParmDeclaration(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartCategoryInterface(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), ActOnStartNamespaceDef(), clang::SemaObjC::ActOnStartProtocolInterface(), ActOnTag(), and ProcessDeclAttributes().
void Sema::AddPushedVisibilityAttribute | ( | Decl * | RD | ) |
AddPushedVisibilityAttribute - If '#pragma GCC visibility' was used, add an appropriate visibility attribute.
Definition at line 1324 of file SemaAttr.cpp.
References clang::Decl::addAttr(), Context, D, clang::NamedDecl::getExplicitVisibility(), NoVisibility, clang::ast_matchers::type, VisContext, and clang::NamedDecl::VisibilityForValue.
Referenced by ActOnFunctionDeclarator(), ActOnTag(), ActOnTagStartDefinition(), CheckClassTemplate(), and FinalizeDeclaration().
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 1268 of file SemaAttr.cpp.
References AddOptnoneAttributeIfNoConflicts(), clang::SourceLocation::isValid(), and OptimizeOffPragmaLocation.
Referenced by ActOnFunctionDeclarator(), and ActOnStartOfLambdaDefinition().
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 1275 of file SemaAttr.cpp.
References clang::Decl::addAttr(), Context, FunctionToSectionMap, clang::NamedDecl::getIdentifier(), clang::NamedDecl::getName(), clang::Decl::hasAttr(), and Loc.
Referenced by ActOnFunctionDeclarator().
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 8230 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), clang::OverloadCandidate::Conversions, clang::DeductionFailureInfo::Data, clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::OverloadCandidateSet::getLocation(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionProtoType::getParamType(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::ImplicitConversionSequence::isBad(), clang::OverloadCandidateSet::isNewCandidate(), clang::ConstraintSatisfaction::IsSatisfied, clang::OverloadCandidate::IsSurrogate, clang::FunctionProtoType::isVariadic(), clang::ovl_fail_bad_conversion, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_too_few_arguments, clang::ovl_fail_too_many_arguments, clang::ImplicitConversionSequence::Standard, clang::OverloadCandidate::Surrogate, TryCopyInitialization(), TryObjectArgumentInitialization(), clang::Unevaluated, Unevaluated, and clang::OverloadCandidate::Viable.
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 8179 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), clang::Expr::Classify(), DeduceTemplateArguments(), clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::OverloadCandidateSet::getLocation(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Expr::getType(), clang::OverloadCandidateSet::isNewCandidate(), isNonDependentlyExplicit(), clang::MakeDeductionFailureInfo(), clang::ovl_fail_bad_deduction, clang::ovl_fail_explicit, clang::Result, clang::Specialization, clang::Success, and clang::OverloadCandidate::Viable.
Referenced by collectViableConversionCandidates(), FindConversionForRefInit(), IsUserDefinedConversion(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
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 7782 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::addCandidate(), clang::sema::TemplateDeductionInfo::AggregateDeductionCandidateHasMismatchedArity, DeduceTemplateArguments(), clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::OverloadCandidateSet::getLocation(), clang::OverloadCandidateSet::getRewriteInfo(), clang::OverloadCandidateSet::OperatorRewriteInfo::getRewriteKind(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Decl::getTemplateDepth(), clang::OverloadCandidate::IgnoreObjectArgument, clang::OverloadCandidate::IsADLCandidate, clang::OverloadCandidateSet::isNewCandidate(), isNonDependentlyExplicit(), clang::OverloadCandidate::IsSurrogate, clang::MakeDeductionFailureInfo(), clang::NonDependentConversionFailure, clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_deduction, clang::ovl_fail_explicit, clang::Result, clang::OverloadCandidate::RewriteKind, clang::Specialization, clang::Success, and clang::OverloadCandidate::Viable.
Referenced by AddOverloadedCallCandidate(), DeduceTemplateSpecializationFromInitializer(), DiagnoseEmptyLookup(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), LookupSpecialMember(), clang::SemaCodeCompletion::ProduceConstructorSignatureHelp(), resolveAllocationOverload(), resolveBuiltinNewDeleteOverload(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
void Sema::AddTemplateParametersToLambdaCallOperator | ( | CXXMethodDecl * | CallOperator, |
CXXRecordDecl * | Class, | ||
TemplateParameterList * | TemplateParams | ||
) |
Definition at line 1000 of file SemaLambda.cpp.
References clang::AS_public, clang::Class, Context, clang::FunctionTemplateDecl::Create(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::Decl::setAccess(), and clang::FunctionDecl::setDescribedFunctionTemplate().
Referenced by ActOnLambdaClosureParameters().
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 4689 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 ActOnExplicitInstantiation(), CheckMemberSpecialization(), DeduceTemplateArguments(), and FindAllocationFunctions().
|
static |
Adjust the DeclContext
for a function or variable that might be a function-local external declaration.
Definition at line 7293 of file SemaDecl.cpp.
References clang::DeclContext::getParent(), clang::DeclContext::isDependentContext(), clang::DeclContext::isFileContext(), and clang::DeclContext::isFunctionOrMethod().
Referenced by ActOnFriendFunctionDecl(), ActOnFunctionDeclarator(), ActOnVariableDeclarator(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
TemplateDecl * Sema::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.
Otherwise, do nothing to D and return null.
Definition at line 876 of file SemaTemplate.cpp.
References D.
Referenced by ActOnBaseSpecifier(), ActOnBaseSpecifiers(), ActOnFinishCXXMemberSpecification(), ActOnFinishDelayedCXXMethodDeclaration(), ActOnMemInitializers(), ActOnReenterTemplateScope(), ActOnStartCXXMemberDeclarations(), ActOnStartDelayedMemberDeclarations(), ActOnTagDefinitionError(), ActOnTagFinishDefinition(), ActOnTagStartDefinition(), BuildMemInitializer(), 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 14316 of file SemaDeclCXX.cpp.
References Context, clang::CPlusPlus11, clang::Destructor, 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 CreateNewFunctionDecl(), and 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 8180 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 ActOnFunctionDeclarator(), BuildMemberPointerType(), and DeduceTemplateArgumentsByTypeMatch().
|
inline |
Definition at line 1046 of file Sema.h.
Referenced by instantiateDependentAMDGPUFlatWorkGroupSizeAttr(), instantiateDependentAMDGPUMaxNumWorkGroupsAttr(), instantiateDependentAMDGPUWavesPerEUAttr(), and ProcessDeclAttribute().
|
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 7563 of file SemaExpr.cpp.
References clang::AltiVecBool, clang::AltiVecPixel, clang::AltiVecVector, clang::Type::castAs(), clang::VectorType::getVectorKind(), and clang::Type::isVectorType().
Referenced by CheckAssignmentConstraints(), CheckVectorOperands(), and IsVectorConversion().
void Sema::applyFunctionAttributesBeforeParsingBody | ( | Decl * | FD | ) |
Definition at line 15800 of file SemaDecl.cpp.
References clang::FPOptions::applyChanges(), CurFPFeatures, FpPragmaStack, clang::FPOptions::getChangesFrom(), clang::Decl::hasAttr(), clang::Decl::isInvalidDecl(), LangOpts, and clang::FPOptionsOverride::setDisallowOptimizations().
Referenced by ActOnStartOfFunctionDef(), and clang::SemaObjC::ActOnStartOfObjCMethodDef().
bool Sema::AreConstraintExpressionsEqual | ( | const NamedDecl * | Old, |
const Expr * | OldConstr, | ||
const TemplateCompareNewDeclInfo & | New, | ||
const Expr * | NewConstr | ||
) |
Definition at line 1037 of file SemaConcept.cpp.
References clang::Sema::TemplateCompareNewDeclInfo::ContainsDecl(), Context, clang::Decl::getLexicalDeclContext(), clang::Sema::TemplateCompareNewDeclInfo::getLexicalDeclContext(), clang::Sema::TemplateCompareNewDeclInfo::isInvalid(), clang::Stmt::Profile(), and SubstituteConstraintExpressionWithoutSatisfaction().
Referenced by IsOverloadOrOverrideImpl(), MatchTemplateParameterKind(), and TemplateParameterListsAreEqual().
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 7586 of file SemaExpr.cpp.
References areVectorTypesSameSize(), clang::Type::isExtVectorType(), clang::Type::isScalarType(), and clang::Type::isVectorType().
Referenced by CheckExtVectorCast(), CheckVectorCast(), and isLaxVectorConversion().
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 7533 of file SemaExpr.cpp.
References clang::Type::getAs(), clang::ConstantMatrixType::getNumColumns(), clang::ConstantMatrixType::getNumRows(), and clang::Type::isMatrixType().
Referenced by CheckMatrixCast().
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 11234 of file SemaDecl.cpp.
References CheckEquivalentExceptionSpec(), Context, clang::SemaBase::Diag(), clang::FunctionProtoType::getAArch64SMEAttributes(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::FunctionType::ExtInfo::getCC(), clang::FunctionDecl::getConstexprKind(), clang::PartialDiagnostic::getDiagID(), clang::NamedDecl::getFormalLinkage(), clang::Decl::getLocation(), clang::FunctionDecl::getTemplatedKind(), clang::ValueDecl::getType(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isExternC(), clang::FunctionDecl::isInlineSpecified(), clang::Type::isUndeducedType(), clang::FunctionType::SME_PStateSMCompatibleMask, clang::FunctionType::SME_PStateSMEnabledMask, and clang::FunctionDecl::TK_FunctionTemplate.
Referenced by CheckMultiVersionAdditionalRules(), and clang::SemaOpenMP::checkOpenMPDeclareVariantFunction().
Definition at line 7544 of file SemaExpr.cpp.
References breakDownVectorType(), Context, clang::ASTContext::getTypeSize(), and clang::Type::isVectorType().
Referenced by areLaxCompatibleVectorTypes().
void Sema::ArgumentDependentLookup | ( | DeclarationName | Name, |
SourceLocation | Loc, | ||
ArrayRef< Expr * > | Args, | ||
ADLResult & | Functions | ||
) |
Definition at line 3785 of file SemaLookup.cpp.
References D, E, FindAssociatedClassesAndNamespaces(), clang::Decl::getFriendObjectKind(), clang::Decl::getIdentifierNamespace(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getMostRecentDecl(), clang::Decl::getOwningModule(), clang::Decl::getPreviousDecl(), clang::Decl::IDNS_Ordinary, clang::Module::isImplicitGlobalModule(), clang::Decl::isInAnotherModuleUnit(), clang::Decl::isInExportDeclContext(), clang::Module::isNamedModule(), clang::Module::isPrivateModule(), isReachable(), isVisible(), Loc, NS, clang::Result, and Visible.
|
inline |
Definition at line 1051 of file Sema.h.
Referenced by ActOnStartOfLambdaDefinition(), CheckFunctionDeclaration(), handleBuiltinAliasAttr(), handleInterruptAttr(), and ProcessDeclAttribute().
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 2824 of file SemaDeclCXX.cpp.
References clang::AS_public, clang::Class, Context, clang::ASTContext::Deallocate(), clang::SemaBase::Diag(), clang::CXXBaseSpecifier::getAccessSpecifier(), getAmbiguousPathsDisplayString(), 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::Invalid, 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 1227 of file SemaTemplate.cpp.
References clang::Auto, BuildDeclRefExpr(), BuildDecltypeType(), clang::SemaBase::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::QualType::getNonPackExpansionType(), 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, | ||
QualType | ConstrainedType, | ||
SourceLocation | EllipsisLoc | ||
) |
Attach a type-constraint to a template parameter.
Definition at line 1186 of file SemaTemplate.cpp.
References Context, clang::ASTTemplateArgumentListInfo::Create(), clang::ConceptReference::Create(), formImmediatelyDeclaredConstraint(), clang::ActionResult< PtrTy, Compress >::get(), clang::TemplateArgumentListInfo::getLAngleLoc(), clang::Decl::getLocation(), clang::TemplateArgumentListInfo::getRAngleLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), NS, and clang::TemplateTypeParmDecl::setTypeConstraint().
Referenced by ActOnNonTypeTemplateParameter(), BuildTypeConstraint(), InventTemplateParameter(), and SubstTypeConstraint().
|
inline |
Definition at line 1056 of file Sema.h.
Referenced by handleInterruptAttr(), and ProcessDeclAttribute().
|
inline |
Definition at line 1061 of file Sema.h.
Referenced by ProcessDeclAttribute(), and ProcessDeclAttributeDelayed().
QualType Sema::BuildAddressSpaceAttr | ( | QualType & | T, |
Expr * | AddrSpace, | ||
SourceLocation | AttrLoc | ||
) |
Same as above, but constructs the AddressSpace index if not provided.
Definition at line 6521 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 6498 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(), HandleAddressSpaceTypeAttribute(), 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 5503 of file SemaDecl.cpp.
References ActOnUninitializedDecl(), clang::DeclContext::addDecl(), clang::AS_none, clang::AS_protected, clang::AS_public, clang::C11, checkDuplicateDefaultInit(), CheckNontrivialField(), clang::DeclSpec::ClearTypeQualifiers(), Context, clang::CPlusPlus, clang::VarDecl::Create(), clang::FieldDecl::Create(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), FieldCollector, clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getConstSpecLoc(), getCurrentMangleNumberContext(), getLangOpts(), clang::MangleNumberingContext::getManglingNumber(), getMSManglingNumber(), clang::ASTContext::getPrintingPolicy(), clang::DeclContext::getRedeclContext(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclSpec::getSourceRange(), clang::MangleNumberingContext::getStaticLocalNumber(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::ASTContext::getTypeDeclType(), GetTypeForDeclarator(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getUnalignedSpecLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::ICIS_NoInit, InjectAnonymousStructOrUnionMembers(), clang::Invalid, clang::DeclContext::isNamespace(), clang::DeclContext::isRecord(), clang::DeclContext::isTranslationUnit(), clang::Member, clang::ParsedAttributesView::none(), ProcessDeclAttributes(), clang::SC_None, clang::DeclSpec::SCS_mutable, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::Decl::setImplicit(), clang::Decl::setInvalidDecl(), clang::ASTContext::setManglingNumber(), clang::ASTContext::setStaticLocalNumber(), clang::DeclSpec::SetStorageClassSpec(), StorageClassSpecToVarDeclStorageClass(), clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, clang::DeclSpec::TQ_unaligned, and clang::DeclSpec::TQ_volatile.
Referenced by ParsedFreeStandingDeclSpec().
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 840 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().
Referenced by BuildDeclarationNameExpr(), and BuildMemberReferenceExpr().
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 2048 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, OpenCL(), OpenMP(), RequireCompleteSizedType(), RequireNonAbstractType(), clang::Result, clang::Star, clang::T, targetDiag(), and toString().
Referenced by GetFullTypeForDeclarator(), and clang::TreeTransform< Derived >::RebuildArrayType().
ExprResult Sema::BuildArrayTypeTrait | ( | ArrayTypeTrait | ATT, |
SourceLocation | KWLoc, | ||
TypeSourceInfo * | TSInfo, | ||
Expr * | DimExpr, | ||
SourceLocation | RParen | ||
) |
Definition at line 6387 of file SemaExprCXX.cpp.
References Context, EvaluateArrayTypeTrait(), clang::ASTContext::getSizeType(), clang::TypeSourceInfo::getType(), clang::Type::isDependentType(), and clang::T.
Referenced by ActOnArrayTypeTrait(), and clang::TreeTransform< Derived >::RebuildArrayTypeTrait().
ExprResult Sema::BuildAsTypeExpr | ( | Expr * | E, |
QualType | DestTy, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RParenLoc | ||
) |
Create a new AsTypeExpr node (bitcast) from the arguments.
Definition at line 6710 of file SemaExpr.cpp.
References Context, clang::SemaBase::Diag(), E, clang::ExprError(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::Type::isDependentType(), clang::OK_Ordinary, and clang::VK_PRValue.
Referenced by ActOnAsTypeExpr().
ExprResult Sema::BuildAtomicExpr | ( | SourceRange | CallRange, |
SourceRange | ExprRange, | ||
SourceLocation | RParenLoc, | ||
MultiExprArg | Args, | ||
AtomicExpr::AtomicOp | Op, | ||
AtomicArgumentOrder | ArgOrder = AtomicArgumentOrder::API |
||
) |
Definition at line 3656 of file SemaChecking.cpp.
References AST, clang::ASTContext::AtomicUsesUnsupportedLibcall(), clang::ASTContext::BoolTy, clang::Type::castAs(), CheckNonNullArgument(), Context, clang::Copy, clang::Default, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::ASTContext::getAddrSpaceQualType(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::AtomicExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), clang::TargetInfo::getLongDoubleFormat(), clang::QualType::getObjCLifetime(), clang::Type::getPointeeType(), clang::ASTContext::getPointerDiffType(), clang::ASTContext::getPointerType(), clang::AtomicExpr::getScopeModel(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::Expr::getType(), clang::ASTContext::getTypeInfoInChars(), clang::QualType::getUnqualifiedType(), clang::Init, clang::InitializedEntity::InitializeParameter(), clang::ASTContext::IntTy, clang::Type::isAtomicType(), clang::Type::isBitIntType(), clang::QualType::isConstQualified(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), clang::Type::isScalarType(), clang::Type::isSpecificBuiltinType(), clang::QualType::isTriviallyCopyableType(), isValidOrderingForOp(), clang::CharUnits::isZero(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::opencl_constant, PerformCopyInitialization(), clang::ast_matchers::pointerType, clang::QualType::removeLocalConst(), clang::QualType::removeLocalVolatile(), RequireCompleteType(), clang::Result, clang::Success, clang::ASTContext::VoidTy, and clang::TypeInfoChars::Width.
Referenced by clang::TreeTransform< Derived >::RebuildAtomicExpr().
QualType Sema::BuildAtomicType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Definition at line 10019 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(), ConvertDeclSpecToType(), and clang::TreeTransform< Derived >::RebuildAtomicType().
StmtResult Sema::BuildAttributedStmt | ( | SourceLocation | AttrsLoc, |
ArrayRef< const Attr * > | Attrs, | ||
Stmt * | SubStmt | ||
) |
Definition at line 651 of file SemaStmt.cpp.
References checkAndRewriteMustTailAttr(), Context, clang::AttributedStmt::Create(), and setFunctionHasMustTail().
Referenced by ActOnAttributedStmt(), and clang::TreeTransform< Derived >::RebuildAttributedStmt().
MemInitResult Sema::BuildBaseInitializer | ( | QualType | BaseType, |
TypeSourceInfo * | BaseTInfo, | ||
Expr * | Init, | ||
CXXRecordDecl * | ClassDecl, | ||
SourceLocation | EllipsisLoc | ||
) |
Definition at line 4619 of file SemaDeclCXX.cpp.
References ActOnFinishFullExpr(), BuildDelegatingInitializer(), clang::Type::containsUnexpandedParameterPack(), Context, clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), CreateRecoveryExpr(), CurContext, clang::Dependent, 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::Init, 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 BuildMemInitializer(), and InstantiateMemInitializers().
void Sema::BuildBasePathArray | ( | const CXXBasePaths & | Paths, |
CXXCastPath & | BasePath | ||
) |
Definition at line 3001 of file SemaDeclCXX.cpp.
Referenced by buildDeclareReductionRef(), CheckDerivedToBaseConversion(), DiagnoseInvalidExplicitObjectParameterInLambda(), and findDecomposableBaseClass().
ExprResult Sema::BuildBinOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
BinaryOperatorKind | Opc, | ||
Expr * | LHSExpr, | ||
Expr * | RHSExpr | ||
) |
Definition at line 15345 of file SemaExpr.cpp.
References BuildOverloadedBinOp(), clang::SemaPseudoObject::checkAssignment(), CheckPlaceholderExpr(), clang::Expr::containsErrors(), Context, CorrectDelayedTyposInBinOp(), clang::CPlusPlus, clang::BinaryOperator::Create(), clang::CompoundAssignOperator::Create(), CreateBuiltinBinOp(), CurFPFeatureOverrides(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), getLangOpts(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), inTemplateInstantiation(), clang::ASTContext::IntTy, clang::BinaryOperator::isAssignmentOp(), clang::BinaryOperator::isCompoundAssignmentOp(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isOverloadableType(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OK_Ordinary, PseudoObject(), and clang::VK_PRValue.
Referenced by ActOnBinOp(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPCopyinClause(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::SemaObjC::ActOnPropertyImplDecl(), buildCounterInit(), buildCounterUpdate(), buildDistanceFunc(), buildLoopVarFunc(), checkOpenMPLoop(), FinishOpenMPLinearClause(), and clang::TreeTransform< Derived >::RebuildBinaryOperator().
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 1940 of file SemaType.cpp.
References AllowFold, Context, clang::SemaBase::Diag(), getASTContext(), clang::ASTContext::getBitIntType(), clang::ASTContext::getDependentBitIntType(), clang::TargetInfo::getMaxBitIntWidth(), clang::ASTContext::getTargetInfo(), clang::Expr::isInstantiationDependent(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, and VerifyIntegerConstantExpression().
Referenced by ConvertDeclSpecToType(), clang::TreeTransform< Derived >::RebuildBitIntType(), and clang::TreeTransform< Derived >::RebuildDependentBitIntType().
ExprResult Sema::BuildBlockForLambdaConversion | ( | SourceLocation | CurrentLocation, |
SourceLocation | ConvLocation, | ||
CXXConversionDecl * | Conv, | ||
Expr * | Src | ||
) |
Definition at line 2300 of file SemaLambda.cpp.
References ActOnFinishFullExpr(), clang::Block, Cleanup, Context, clang::BlockDecl::Create(), clang::VarDecl::Create(), clang::ParmVarDecl::Create(), CurContext, clang::ASTContext::DeclarationNames, ExprCleanupObjects, clang::ExprError(), clang::DeclContextLookupResult::front(), clang::DeclaratorDecl::getBeginLoc(), clang::CXXConversionDecl::getConversionType(), clang::DeclarationNameTable::getCXXOperatorName(), clang::NamedDecl::getIdentifier(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::VarDecl::getStorageClass(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Init, clang::InitializedEntity::InitializeLambdaToBlock(), clang::FunctionDecl::isVariadic(), clang::DeclContext::lookup(), clang::Decl::markUsed(), PerformCopyInitialization(), clang::SC_None, clang::CleanupInfo::setExprNeedsCleanups(), and clang::Decl::setReferenced().
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 2734 of file SemaType.cpp.
References checkQualifiedFunction(), Context, deduceOpenCLPointeeAddrSpace(), clang::SemaBase::Diag(), clang::ASTContext::getBlockPointerType(), getLangOpts(), clang::Type::isFunctionType(), Loc, OpenCL(), and clang::T.
Referenced by GetFullTypeForDeclarator(), and clang::TreeTransform< Derived >::RebuildBlockPointerType().
ExprResult Sema::BuildBuiltinBitCastExpr | ( | SourceLocation | KWLoc, |
TypeSourceInfo * | TSI, | ||
Expr * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 394 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(), and clang::TreeTransform< Derived >::RebuildBuiltinBitCastExpr().
Expr * Sema::BuildBuiltinCallExpr | ( | SourceLocation | Loc, |
Builtin::ID | Id, | ||
MultiExprArg | CallArgs | ||
) |
BuildBuiltinCallExpr - Create a call to a builtin function specified by Id.
Definition at line 6682 of file SemaExpr.cpp.
References BuildCallExpr(), BuildDeclRefExpr(), clang::ASTContext::BuiltinInfo, clang::Call, Context, clang::ActionResult< PtrTy, Compress >::get(), clang::IdentifierTable::get(), clang::LookupResult::getAsSingle(), clang::Builtin::Context::getName(), Id, clang::ASTContext::Idents, clang::ActionResult< PtrTy, Compress >::isUsable(), Loc, LookupName(), LookupOrdinaryName, TUScope, and clang::VK_LValue.
Referenced by ActOnParenExpr(), and buildCoroutineHandle().
ExprResult Sema::BuildBuiltinOffsetOf | ( | SourceLocation | BuiltinLoc, |
TypeSourceInfo * | TInfo, | ||
ArrayRef< OffsetOfComponent > | Components, | ||
SourceLocation | RParenLoc | ||
) |
__builtin_offsetof(type, a.b[123][456].c)
Definition at line 15929 of file SemaExpr.cpp.
References Context, clang::OffsetOfExpr::Create(), DefaultLvalueConversion(), clang::Dependent, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getAsArrayType(), clang::LookupResult::getAsSingle(), clang::Stmt::getBeginLoc(), clang::RecordType::getDecl(), clang::NamedDecl::getDeclName(), clang::ArrayType::getElementType(), clang::TypeLoc::getLocalSourceRange(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::FieldDecl::getParent(), clang::ASTContext::getSizeType(), clang::Stmt::getSourceRange(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::ASTContext::getTypeDeclType(), clang::TypeSourceInfo::getTypeLoc(), clang::LookupResult::isAmbiguous(), clang::FieldDecl::isBitField(), clang::Type::isDependentType(), IsDerivedFrom(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isRecordType(), clang::Expr::isTypeDependent(), isUnevaluatedContext(), clang::Expr::isValueDependent(), LangOpts, LookupMemberName, LookupQualifiedName(), Parent, Path, and RequireCompleteType().
Referenced by ActOnBuiltinOffsetOf(), and clang::TreeTransform< Derived >::RebuildOffsetOfExpr().
ExprResult Sema::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.
This provides the location of the left/right parens and a list of comma locations.
Definition at line 6475 of file SemaExpr.cpp.
References clang::ASTContext::BoundMemberTy, BuildCallToMemberFunction(), BuildCallToObjectOfClassType(), BuildOverloadedCallExpr(), BuildResolvedCallExpr(), checkAddressOfFunctionIsAvailable(), CheckArgsForPlaceholders(), checkDirectCallValidity(), CheckPlaceholderExpr(), Context, clang::CPlusPlus, clang::DeclRefExpr::Create(), clang::ImplicitCastExpr::Create(), clang::CallExpr::Create(), clang::CUDAKernelCallExpr::Create(), clang::FixItHint::CreateRemoval(), CurFPFeatureOverrides(), clang::Default, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), E, clang::ExprError(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), getASTContext(), clang::FunctionDecl::getBuiltinID(), getLangOpts(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::DeclaratorDecl::getQualifierLoc(), clang::QualType::getQualifiers(), clang::ASTContext::getTargetAddressSpace(), clang::ValueDecl::getType(), clang::Expr::hasAnyTypeDependentArguments(), clang::OverloadExpr::FindResult::HasFormOfMemberPointer, clang::HIP, clang::Expr::IgnoreParens(), ImpCastExprToType(), clang::OverloadExpr::FindResult::IsAddressOfOperand, clang::OverloadExpr::FindResult::IsAddressOfOperandWithParen, clang::ASTContext::isDependenceAllowed(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), MaybeConvertParenListExprToParenExpr(), clang::ASTContext::OverloadTy, clang::ASTContext::PseudoObjectTy, rebuildUnknownAnyFunction(), clang::Result, rewriteBuiltinFunctionDecl(), clang::Qualifiers::setAddressSpace(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), clang::ASTContext::UnknownAnyTy, clang::VK_PRValue, and clang::ASTContext::VoidTy.
Referenced by ActOnCallExpr(), clang::SemaCUDA::ActOnExecConfigExpr(), clang::SemaOpenMP::ActOnOpenMPCall(), BuildBuiltinCallExpr(), buildCoroutineHandle(), buildMemberCall(), buildMemcpyForAssignmentOp(), BuildRecoveryCallExpr(), checkTupleLikeDecomposition(), DefaultVariadicArgumentPromotion(), and EvaluateStaticAssertMessageAsString().
ExprResult Sema::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.
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 15366 of file SemaOverload.cpp.
References clang::AS_public, clang::OverloadCandidateSet::BestViableFunction(), clang::ASTContext::BoundMemberTy, clang::Type::castAs(), checkArgPlaceholdersForOverload(), chooseRecoveryType(), clang::Expr::Classify(), clang::OverloadExpr::copyTemplateArgumentsInto(), clang::CXXMemberCallExpr::Create(), clang::CallExpr::Create(), CreateFunctionRefExpr(), clang::OverloadCandidateSet::CSK_Normal, clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), Diag(), E, clang::ExprError(), clang::Func, clang::ActionResult< PtrTy, Compress >::get(), clang::Qualifiers::getAsString(), clang::UnresolvedMemberExpr::getBase(), clang::MemberExpr::getBase(), clang::UnresolvedMemberExpr::getBaseType(), clang::DeclaratorDecl::getBeginLoc(), clang::MemberExpr::getBeginLoc(), clang::UnresolvedMemberExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::FunctionType::getCallResultType(), clang::NamedDecl::getDeclName(), GetExplicitObjectType(), clang::MemberExpr::getExprLoc(), clang::MemberExpr::getFoundDecl(), clang::Decl::getLocation(), clang::MemberExpr::getMemberDecl(), clang::MemberExpr::getMemberLoc(), clang::UnresolvedMemberExpr::getMemberLoc(), clang::UnresolvedMemberExpr::getMemberName(), clang::FunctionProtoType::getMethodQuals(), clang::OverloadExpr::getNameLoc(), clang::QualType::getNonLValueExprType(), clang::FunctionProtoType::getNumParams(), clang::DeclContext::getParent(), getPointeeType(), clang::MemberExpr::getQualifier(), clang::OverloadExpr::getQualifier(), clang::QualType::getQualifiers(), clang::FunctionDecl::getReturnType(), clang::FunctionType::getReturnType(), clang::Stmt::getSourceRange(), clang::FunctionDecl::getSourceRange(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Expr::getValueKindForType(), clang::OverloadExpr::hasExplicitTemplateArgs(), clang::MemberExpr::hasQualifier(), clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParens(), clang::UnresolvedMemberExpr::isArrow(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXMethodDecl::isStatic(), clang::DeclAccessPair::make(), clang::Expr::Classification::makeSimpleLValue(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::ASTContext::OverloadTy, clang::MemberExpr::performsVirtualDispatch(), PrepareExplicitObjectArgument(), clang::Qualifiers::removeAddressSpace(), clang::Qualifiers::removeObjCGCAttr(), clang::MemberExpr::setBase(), clang::OverloadCandidateSet::size(), clang::VK_PRValue, and clang::ASTContext::VoidTy.
Referenced by BuildCallExpr(), and buildSingleCopyAssignRecursively().
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 15690 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::Call, clang::Type::castAs(), checkArgPlaceholdersForOverload(), checkPlaceholderForOverload(), clang::ImplicitCastExpr::Create(), clang::CXXOperatorCallExpr::Create(), CreateFunctionRefExpr(), clang::OverloadCandidateSet::CSK_Operator, D, clang::ASTContext::DeclarationNames, E, clang::OverloadCandidateSet::empty(), clang::OverloadCandidateSet::end(), clang::ExprError(), clang::OverloadCandidate::FailureKind, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::CXXConversionDecl::getConversionType(), clang::DeclarationNameTable::getCXXOperatorName(), clang::Decl::getDeclContext(), clang::DeclarationNameInfo::getInfo(), clang::DeclarationNameInfo::getLoc(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::FunctionProtoType::getNumParams(), clang::Type::getPointeeType(), clang::FunctionDecl::getReturnType(), clang::StringLiteral::getString(), clang::ValueDecl::getType(), clang::Expr::getValueKindForType(), clang::CXXConversionDecl::isExplicit(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::ovl_fail_constraints_not_satisfied, PrepareArgumentsForCallToObjectOfClassType(), PrepareExplicitObjectArgument(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::OverloadCandidateSet::size(), clang::OverloadCandidate::Viable, and clang::VK_PRValue.
Referenced by BuildCallExpr().
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 2032 of file SemaLambda.cpp.
References clang::DeclContext::addDecl(), clang::AS_private, Context, clang::FieldDecl::Create(), clang::sema::Capture::getCapturedVLAType(), clang::sema::Capture::getCaptureType(), clang::sema::Capture::getLocation(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::sema::Capture::getVariable(), clang::ICIS_NoInit, clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Decl::isInvalidDecl(), clang::sema::Capture::isVariableCapture(), clang::sema::Capture::isVLATypeCapture(), Loc, RequireCompleteSizedType(), and clang::Decl::setInvalidDecl().
Referenced by buildCapturedStmtCaptureList(), and BuildLambdaExpr().
ExprResult Sema::BuildCaptureInit | ( | const sema::Capture & | Capture, |
SourceLocation | ImplicitCaptureLoc, | ||
bool | IsOpenMPMapping = false |
||
) |
Initialize the given capture with a suitable expression.
Definition at line 1890 of file SemaLambda.cpp.
References BuildCXXThisExpr(), BuildDeclarationNameExpr(), CreateBuiltinUnaryOp(), clang::InitializationKind::CreateDirect(), clang::ExprError(), clang::sema::Capture::getCaptureType(), getCurrentThisType(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), clang::sema::Capture::getLocation(), clang::sema::Capture::getVariable(), clang::Init, clang::InitializedEntity::InitializeLambdaCapture(), clang::sema::Capture::isCopyCapture(), clang::sema::Capture::isInitCapture(), clang::sema::Capture::isThisCapture(), clang::SourceLocation::isValid(), clang::sema::Capture::isVariableCapture(), clang::sema::Capture::isVLATypeCapture(), Loc, and clang::InitializationSequence::Perform().
Referenced by buildCapturedStmtCaptureList(), and BuildLambdaExpr().
CodeAlignAttr * Sema::BuildCodeAlignAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | E | ||
) |
Definition at line 357 of file SemaStmtAttr.cpp.
References Context, clang::SemaBase::Diag(), E, clang::ActionResult< PtrTy, Compress >::get(), clang::AttributeCommonInfo::getLoc(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isValueDependent(), and VerifyIntegerConstantExpression().
Referenced by handleCodeAlignAttr().
ExprResult Sema::BuildCompoundLiteralExpr | ( | SourceLocation | LParenLoc, |
TypeSourceInfo * | TInfo, | ||
SourceLocation | RParenLoc, | ||
Expr * | LiteralExpr | ||
) |
Definition at line 7054 of file SemaExpr.cpp.
References CheckForConstantInitializer(), checkNonTrivialCUnion(), checkNonTrivialCUnionInInitializer(), Cleanup, Context, clang::CPlusPlus, clang::ConstantExpr::Create(), clang::InitializationKind::CreateCStyleCast(), CurContext, clang::Default, clang::SemaBase::Diag(), E, ExprCleanupObjects, clang::ExprError(), clang::QualType::getAddressSpace(), clang::ASTContext::getBaseElementType(), getCurFunction(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), clang::Init, clang::InitializedEntity::InitializeCompoundLiteralInit(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::DeclContext::isFunctionOrMethod(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Type::isVariableArrayType(), LangOpts, MaybeBindToTemporary(), NTCUC_CompoundLiteral, NTCUK_Destruct, clang::opencl_private, clang::InitializationSequence::Perform(), RequireCompleteSizedType(), RequireCompleteType(), clang::Result, clang::CleanupInfo::setExprNeedsCleanups(), clang::sema::FunctionScopeInfo::setHasBranchProtectedScope(), tryToFixVariablyModifiedVarType(), clang::VK_LValue, and clang::VK_PRValue.
Referenced by ActOnCompoundLiteral(), BuildVectorLiteral(), and clang::TreeTransform< Derived >::RebuildCompoundLiteralExpr().
ExprResult Sema::BuildConvertedConstantExpression | ( | Expr * | From, |
QualType | T, | ||
CCEKind | CCE, | ||
NamedDecl * | Dest = nullptr |
||
) |
Definition at line 6307 of file SemaOverload.cpp.
References clang::T.
Referenced by CheckTemplateArgument(), and EvaluateStaticAssertMessageAsString().
StmtResult Sema::BuildCoreturnStmt | ( | SourceLocation | KwLoc, |
Expr * | E, | ||
bool | IsImplicit = false |
||
) |
Definition at line 1030 of file SemaCoroutine.cpp.
References ActOnFinishFullExpr(), buildPromiseCall(), checkCoroutineContext(), CheckPlaceholderExpr(), Context, E, ForceOn, clang::ActionResult< PtrTy, Compress >::get(), clang::Sema::FullExprArg::get(), getNamedReturnInfo(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isVoidType(), Loc, MakeFullDiscardedValueExpr(), and clang::StmtError().
Referenced by ActOnCoreturnStmt(), and clang::TreeTransform< Derived >::RebuildCoreturnStmt().
StmtResult Sema::BuildCoroutineBodyStmt | ( | CoroutineBodyStmt::CtorArgs | Args | ) |
Definition at line 1959 of file SemaCoroutine.cpp.
References Context, clang::CoroutineBodyStmt::Create(), and clang::StmtError().
Referenced by clang::TreeTransform< Derived >::RebuildCoroutineBodyStmt().
bool Sema::buildCoroutineParameterMoves | ( | SourceLocation | Loc | ) |
Definition at line 1907 of file SemaCoroutine.cpp.
References ActOnDeclStmt(), AddInitializerToDecl(), BuildDeclRefExpr(), buildVarDecl(), castForMoving(), ConvertDeclToDeclGroup(), CurContext, D, clang::ActionResult< PtrTy, Compress >::get(), getCurFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, and clang::VK_LValue.
Referenced by checkCoroutineContext().
VarDecl * Sema::buildCoroutinePromise | ( | SourceLocation | Loc | ) |
Definition at line 476 of file SemaCoroutine.cpp.
References ActOnCXXThis(), ActOnUninitializedDecl(), BuildDeclRefExpr(), clang::VarDecl::CallInit, CheckCompleteVariableDeclaration(), CheckVariableDeclarationType(), Context, clang::VarDecl::Create(), clang::ParenListExpr::Create(), CreateBuiltinUnaryOp(), clang::InitializationKind::CreateForInit(), CurContext, clang::ASTContext::DependentTy, clang::ExprEmpty(), clang::ActionResult< PtrTy, Compress >::get(), clang::IdentifierTable::get(), getCurFunction(), clang::Preprocessor::getIdentifierTable(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::InitializedEntity::InitializeVariable(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::isLambdaCallOperator(), Loc, lookupPromiseType(), MaybeCreateExprWithCleanups(), clang::InitializationSequence::Perform(), PP, clang::Result, clang::SC_None, clang::T, and clang::VK_LValue.
Referenced by checkCoroutineContext().
QualType Sema::BuildCountAttributedArrayOrPointerType | ( | QualType | WrappedTy, |
Expr * | CountExpr, | ||
bool | CountInBytes, | ||
bool | OrNull | ||
) |
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 9614 of file SemaType.cpp.
References BuildTypeCoupledDecls(), Context, clang::ASTContext::getCountAttributedType(), clang::Type::isIncompleteArrayType(), and clang::Type::isPointerType().
Referenced by handleCountedByAttrField().
ExprResult Sema::BuildCoyieldExpr | ( | SourceLocation | KwLoc, |
Expr * | E | ||
) |
Definition at line 986 of file SemaCoroutine.cpp.
References buildCoawaitCalls(), checkCoroutineContext(), CheckPlaceholderExpr(), Context, CreateMaterializeTemporaryExpr(), clang::ASTContext::DependentTy, E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), ReadySuspendResumeResult::IsInvalid, clang::Expr::isPRValue(), Loc, ReadySuspendResumeResult::OpaqueValue, and ReadySuspendResumeResult::Results.
Referenced by ActOnCoyieldExpr(), and clang::TreeTransform< Derived >::RebuildCoyieldExpr().
ExprResult Sema::BuildCStyleCastExpr | ( | SourceLocation | LParenLoc, |
TypeSourceInfo * | Ty, | ||
SourceLocation | RParenLoc, | ||
Expr * | Op | ||
) |
Definition at line 3351 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 ActOnCastExpr(), actOnOMPReductionKindClause(), buildDistanceFunc(), buildPostUpdate(), BuildVectorLiteral(), checkOpenMPLoop(), clang::CStyleCastPtrExpr(), and clang::TreeTransform< Derived >::RebuildCStyleCastExpr().
ExprResult Sema::BuildCXXAssumeExpr | ( | Expr * | Assumption, |
const IdentifierInfo * | AttrName, | ||
SourceRange | Range | ||
) |
Definition at line 746 of file SemaStmtAttr.cpp.
References CheckPlaceholderExpr(), Context, CorrectDelayedTyposInExpr(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::Expr::HasSideEffects(), clang::ActionResult< PtrTy, Compress >::isInvalid(), PerformContextuallyConvertToBool(), and Range.
Referenced by ActOnCXXAssumeAttr().
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 16010 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 15987 of file SemaDeclCXX.cpp.
References BuildCXXConstructExpr(), DiagnoseUseOfOverloadedDecl(), clang::ExprError(), and findInheritingConstructor().
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 15945 of file SemaDeclCXX.cpp.
References BuildCXXConstructExpr(), clang::Complete, Context, clang::Decl::getDeclContext(), hasOneRealArgument(), and clang::Expr::isTemporaryObject().
Referenced by BuildCXXCastArgument(), BuildCXXConstructExpr(), CopyObject(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), PerformImplicitConversion(), and clang::TreeTransform< Derived >::RebuildCXXConstructExpr().
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 5487 of file SemaExpr.cpp.
References CheckCXXDefaultArgExpr(), Context, ConvertParamDefaultArgument(), clang::CXXDefaultArgExpr::Create(), CurContext, currentEvaluationContext(), clang::ExprError(), ExprEvalContexts, clang::ActionResult< PtrTy, Compress >::get(), getASTContext(), clang::Stmt::getBeginLoc(), clang::VarDecl::getInit(), clang::ParmVarDecl::hasDefaultArg(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), clang::ParmVarDecl::hasUnparsedDefaultArg(), ImmediateFunctionContext, clang::Init, clang::Sema::ExpressionEvaluationContextRecord::InLifetimeExtendingContext, InstantiateDefaultArgument(), isCheckingDefaultArgumentOrInitializer(), clang::FunctionDecl::isImmediateFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), needsRebuildOfDefaultArgOrInit(), OutermostDeclarationWithDelayedImmediateInvocations(), parentEvaluationContext(), PotentiallyEvaluated, runWithSufficientStackSpace(), and V.
Referenced by convertArgsForAvailabilityChecks(), CopyObject(), GatherArgumentsForCall(), and PrepareArgumentsForCallToObjectOfClassType().
ExprResult Sema::BuildCXXDefaultInitExpr | ( | SourceLocation | Loc, |
FieldDecl * | Field | ||
) |
Definition at line 5581 of file SemaExpr.cpp.
References ActOnFinishFullExpr(), Context, ConvertMemberDefaultInitExpression(), clang::CXXDefaultInitExpr::Create(), CurContext, currentEvaluationContext(), clang::SemaBase::Diag(), DiscardCleanupsInEvaluationContext(), E, clang::ExprError(), ExprEvalContexts, FindFieldDeclInstantiationPattern(), clang::ActionResult< PtrTy, Compress >::get(), getASTContext(), clang::DeclContext::getOuterLexicalRecordContext(), getTemplateInstantiationArgs(), clang::FieldDecl::hasInClassInitializer(), clang::Init, clang::Sema::ExpressionEvaluationContextRecord::InLifetimeExtendingContext, InstantiateInClassInitializer(), isCheckingDefaultArgumentOrInitializer(), isInLifetimeExtendingContext(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isSFINAEContext(), clang::isTemplateInstantiation(), Loc, MarkDeclarationsReferencedInExpr(), needsRebuildOfDefaultArgOrInit(), OutermostDeclarationWithDelayedImmediateInvocations(), parentEvaluationContext(), PotentiallyEvaluated, runWithSufficientStackSpace(), and V.
Referenced by CollectFieldInitializer(), clang::TreeTransform< Derived >::RebuildCXXDefaultInitExpr(), and TryOrBuildParenListInitialization().
ExprResult Sema::BuildCXXFoldExpr | ( | UnresolvedLookupExpr * | Callee, |
SourceLocation | LParenLoc, | ||
Expr * | LHS, | ||
BinaryOperatorKind | Operator, | ||
SourceLocation | EllipsisLoc, | ||
Expr * | RHS, | ||
SourceLocation | RParenLoc, | ||
std::optional< unsigned > | NumExpansions | ||
) |
Definition at line 1446 of file SemaTemplateVariadic.cpp.
References Context, and clang::ASTContext::DependentTy.
Referenced by ActOnCXXFoldExpr(), formImmediatelyDeclaredConstraint(), and clang::TreeTransform< Derived >::RebuildCXXFoldExpr().
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 2683 of file SemaStmt.cpp.
References ActOnBinOp(), ActOnCoawaitExpr(), ActOnDeclStmt(), ActOnFinishFullExpr(), clang::SemaOpenMP::ActOnOpenMPLoopInitialization(), ActOnUnaryExprOrTypeTraitExpr(), ActOnUnaryOp(), AddInitializerToDecl(), clang::InitializedEntity::allocateManglingNumber(), Begin, BFRK_Build, BFRK_Check, BuildDeclRefExpr(), BuildNonArrayForRange(), CheckBooleanCondition(), clang::Expr::containsErrors(), Context, ConvertDeclToDeclGroup(), clang::CPlusPlus17, clang::CPlusPlus23, clang::IntegerLiteral::Create(), CreateParsedType(), clang::OverloadCandidateSet::CSK_Normal, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), FinishForRangeVarDecl(), FRS_NoViableFunction, FRS_Success, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsArrayTypeUnsafe(), clang::OpaquePtr< PtrTy >::getAsOpaquePtr(), clang::ASTContext::getAutoDeductType(), getCurScope(), clang::DeclRefExpr::getDecl(), clang::VarDecl::getInit(), getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::ASTContext::getPointerDiffType(), clang::DeclStmt::getSingleDecl(), clang::VarDecl::getSourceRange(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::hasSameType(), clang::InitializedEntity::InitializeVariable(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::SourceLocation::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::Type::isPointerType(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), clang::Decl::markUsed(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, OpenMP(), clang::SemaBase::PDiag(), Range, RebuildForRangeWithDereference(), RequireCompleteType(), clang::ValueDecl::setType(), clang::StmtError(), SubstAutoTypeDependent(), and clang::VK_LValue.
Referenced by ActOnCXXForRangeStmt(), and clang::TreeTransform< Derived >::RebuildCXXForRangeStmt().
ExprResult Sema::BuildCXXFunctionalCastExpr | ( | TypeSourceInfo * | TInfo, |
QualType | Type, | ||
SourceLocation | LParenLoc, | ||
Expr * | CastExpr, | ||
SourceLocation | RParenLoc | ||
) |
Definition at line 3377 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 14239 of file SemaOverload.cpp.
References clang::ASTContext::BoundMemberTy, clang::Type::castAs(), clang::CXXMemberCallExpr::Create(), clang::CallExpr::Create(), CreateFunctionRefExpr(), Diag(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getAccess(), clang::Stmt::getBeginLoc(), clang::CXXConversionDecl::getConversionType(), clang::CallExpr::getDirectCallee(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), clang::QualType::getNonLValueExprType(), clang::CXXMethodDecl::getParent(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), clang::Expr::getValueKindForType(), clang::Expr::IgnoreParens(), clang::Type::isBlockPointerType(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXRecordDecl::isLambda(), clang::DeclAccessPair::make(), clang::OK_Ordinary, and clang::VK_PRValue.
Referenced by BuildCXXCastArgument(), diagnoseNoViableConversion(), clang::InitializationSequence::Perform(), and recordConversion().
ExprResult Sema::BuildCXXNamedCast | ( | SourceLocation | OpLoc, |
tok::TokenKind | Kind, | ||
TypeSourceInfo * | Ty, | ||
Expr * | E, | ||
SourceRange | AngleBrackets, | ||
SourceRange | Parens | ||
) |
Definition at line 296 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(), E, 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(), castForMoving(), CastForMoving(), clang::TreeTransform< Derived >::RebuildCXXAddrspaceCastExpr(), clang::TreeTransform< Derived >::RebuildCXXConstCastExpr(), clang::TreeTransform< Derived >::RebuildCXXDynamicCastExpr(), clang::TreeTransform< Derived >::RebuildCXXReinterpretCastExpr(), and clang::TreeTransform< Derived >::RebuildCXXStaticCastExpr().
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 407 of file SemaCXXScopeSpec.cpp.
References clang::Sema::NestedNameSpecInfo::CCLoc, clang::CXXScopeSpec::clear(), computeDeclContext(), Context, CorrectTypo(), clang::CPlusPlus11, clang::FixItHint::CreateReplacement(), CTK_ErrorRecovery, CurContext, clang::SemaBase::Diag(), diagnoseTypo(), DiagnoseUnknownTypeName(), DiagnoseUseOfDecl(), clang::LookupResult::empty(), clang::CXXScopeSpec::Extend(), clang::Found, clang::LookupResult::getAsSingle(), clang::Decl::getCanonicalDecl(), getLangOpts(), clang::Decl::getLocation(), clang::LookupResult::getNameLoc(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::ASTContext::getTypeDeclType(), GetTypeFromParser(), clang::TypeLocBuilder::getTypeLocInContext(), clang::NamedDecl::getUnderlyingDecl(), clang::ASTContext::getUsingType(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::ASTContext::hasSameType(), clang::Sema::NestedNameSpecInfo::Identifier, clang::Sema::NestedNameSpecInfo::IdentifierLoc, isAcceptableNestedNameSpecifier(), clang::DeclContext::isDependentContext(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::IdentifierInfo::isEditorPlaceholder(), clang::Type::isEnumeralType(), clang::DeclContext::isFunctionOrMethod(), clang::QualType::isNull(), clang::DeclContext::isRecord(), clang::CXXScopeSpec::isSet(), LookupName(), LookupNamespaceName, LookupNestedNameSpecifierName, LookupOrdinaryName, LookupQualifiedName(), clang::CXXScopeSpec::MakeTrivial(), MarkAnyDeclReferenced(), clang::Sema::NestedNameSpecInfo::ObjectType, clang::SemaBase::PDiag(), clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushTrivial(), clang::TypeLocBuilder::pushTypeSpec(), RequireCompleteDeclContext(), clang::TypeSpecTypeLoc::setNameLoc(), clang::LookupResult::suppressDiagnostics(), and clang::T.
Referenced by ActOnCXXNestedNameSpecifier(), IsInvalidUnlessNestedName(), and 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 2045 of file SemaExprCXX.cpp.
References AFS_Both, AFS_Global, clang::AlreadyDiagnosed, clang::Braces, CheckAllocatedType(), CheckArgsForPlaceholders(), checkArrayElementAlignment(), checkCall(), CheckPlaceholderExpr(), Context, clang::Converting, clang::CPlusPlus14, clang::CPlusPlus17, clang::CPlusPlus20, clang::IntegerLiteral::Create(), clang::CXXNewExpr::Create(), clang::InitializationKind::CreateDefault(), clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), clang::FixItHint::CreateRemoval(), DeduceAutoType(), DeduceTemplateSpecializationFromInitializer(), clang::SemaBase::Diag(), DiagnoseSentinelCalls(), DiagnoseUseOfDecl(), doesUsualArrayDeleteWantSize(), clang::ExprError(), FindAllocationFunctions(), GatherArgumentsForCall(), clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getAsConstantArrayType(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::ASTContext::getCharWidth(), clang::ASTContext::getConstantArrayType(), clang::Type::getContainedDeducedType(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), clang::ASTContext::getIncompleteArrayType(), clang::TargetInfo::getIntWidth(), getLangOpts(), clang::ASTContext::getLifetimeQualifiedType(), clang::Decl::getLocation(), clang::ConstantArrayType::getMaxSizeBits(), clang::TargetInfo::getNewAlign(), clang::ConstantArrayType::getNumAddressingBits(), clang::Type::getObjCARCImplicitLifetime(), clang::QualType::getObjCLifetime(), clang::ASTContext::getPointerType(), clang::CharUnits::getQuantity(), clang::ASTContext::getSizeType(), getSourceManager(), clang::Stmt::getSourceRange(), clang::TypeLoc::getSourceRange(), getStdAlignValT(), clang::ASTContext::getTargetInfo(), clang::Expr::getType(), clang::ASTContext::getTypeAlign(), clang::ASTContext::getTypeDeclType(), clang::TypeSourceInfo::getTypeLoc(), clang::ASTContext::getTypeSize(), clang::ASTContext::getTypeSizeInChars(), clang::Expr::hasAnyTypeDependentArguments(), clang::InitializedEntity::InitializeNew(), clang::Initializer, clang::Type::isDependentType(), clang::Type::isEnumeralType(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isLegalArrayNewInitializer(), clang::QualType::isNull(), clang::Type::isObjCLifetimeType(), clang::SourceRange::isValid(), clang::FunctionProtoType::isVariadic(), Loc, MarkFunctionReferenced(), clang::None, clang::Normal, clang::Qualifiers::OCL_None, clang::OK_Ordinary, clang::ImplicitCastExpr::OnStack, clang::Parens, clang::InitializationSequence::Perform(), PerformContextualImplicitConversion(), PerformImplicitConversion(), Range, clang::Result, StdAlignValT, clang::Success, clang::T, toString(), VariadicDoesNotApply, VariadicFunction, and clang::VK_PRValue.
Referenced by ActOnCXXNew(), and clang::TreeTransform< Derived >::RebuildCXXNewExpr().
ExprResult Sema::BuildCXXNoexceptExpr | ( | SourceLocation | KeyLoc, |
Expr * | Operand, | ||
SourceLocation | RParen | ||
) |
Definition at line 8502 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 1454 of file SemaExprCXX.cpp.
References Context, clang::CXXThisExpr::Create(), Loc, and MarkThisReferenced().
Referenced by ActOnCXXThis(), BuildCaptureInit(), BuildImplicitMemberExpr(), BuildMemberReferenceExpr(), clang::SemaOpenMP::isOpenMPCapturedDecl(), and clang::TreeTransform< Derived >::RebuildCXXThisExpr().
ExprResult Sema::BuildCXXThrow | ( | SourceLocation | OpLoc, |
Expr * | Ex, | ||
bool | IsThrownVarInScope | ||
) |
Definition at line 867 of file SemaExprCXX.cpp.
References CheckCXXThrowOperand(), clang::SemaPPC::CheckPPCMMAType(), Context, CUDA(), clang::SemaBase::Diag(), clang::SemaCUDA::DiagIfDeviceCode(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), getCurScope(), clang::ASTContext::getExceptionObjectType(), getLangOpts(), getNamedReturnInfo(), getSourceManager(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Expr::getType(), clang::InitializedEntity::InitializeException(), clang::SourceManager::isInSystemHeader(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), OpenACC(), PerformMoveOrCopyInitialization(), PPC(), clang::T, targetDiag(), clang::Scope::TryScope, and clang::ASTContext::VoidTy.
Referenced by ActOnCXXThrow(), and clang::TreeTransform< Derived >::RebuildCXXThrowExpr().
ExprResult Sema::BuildCXXTypeConstructExpr | ( | TypeSourceInfo * | Type, |
SourceLocation | LParenLoc, | ||
MultiExprArg | Exprs, | ||
SourceLocation | RParenLoc, | ||
bool | ListInitialization | ||
) |
Definition at line 1542 of file SemaExprCXX.cpp.
References clang::AlreadyDiagnosed, BuildCXXFunctionalCastExpr(), Context, clang::CPlusPlus23, clang::CXXFunctionalCastExpr::Create(), clang::CXXUnresolvedConstructExpr::Create(), clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), clang::InitializationKind::CreateValue(), CurFPFeatureOverrides(), DeduceAutoType(), DeduceTemplateSpecializationFromInitializer(), clang::SemaBase::Diag(), clang::ExprError(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::SourceRange::getBegin(), clang::TypeLoc::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::Type::getContainedDeducedType(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::QualType::getUnqualifiedType(), clang::Expr::getValueKindForType(), 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(), clang::Result, clang::Success, and clang::VK_PRValue.
Referenced by ActOnCXXTypeConstructExpr(), clang::TreeTransform< Derived >::RebuildCXXFunctionalCastExpr(), clang::TreeTransform< Derived >::RebuildCXXScalarValueInitExpr(), clang::TreeTransform< Derived >::RebuildCXXTemporaryObjectExpr(), and clang::TreeTransform< Derived >::RebuildCXXUnresolvedConstructExpr().
ExprResult Sema::BuildCXXTypeId | ( | QualType | TypeInfoType, |
SourceLocation | TypeidLoc, | ||
Expr * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Build a C++ typeid expression with an expression operand.
Definition at line 577 of file SemaExprCXX.cpp.
References CheckPlaceholderExpr(), CheckUnevaluatedOperand(), Context, clang::SemaBase::Diag(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::ASTContext::getUnqualifiedArrayType(), clang::Expr::getValueKind(), clang::Expr::hasPlaceholderType(), clang::ASTContext::hasSameType(), clang::Expr::HasSideEffects(), ImpCastExprToType(), inTemplateInstantiation(), clang::Expr::isGLValue(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXRecordDecl::isPolymorphic(), clang::Expr::isTypeDependent(), isUnevaluatedContext(), clang::Type::isVariablyModifiedType(), MarkVTableUsed(), RequireCompleteType(), clang::Result, clang::T, TransformToPotentiallyEvaluated(), and clang::QualType::withConst().
ExprResult Sema::BuildCXXTypeId | ( | QualType | TypeInfoType, |
SourceLocation | TypeidLoc, | ||
TypeSourceInfo * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Build a C++ typeid expression with a type operand.
Definition at line 550 of file SemaExprCXX.cpp.
References CheckQualifiedFunctionForTypeId(), Context, clang::SemaBase::Diag(), clang::ExprError(), clang::Type::getAs(), clang::ASTContext::getUnqualifiedArrayType(), clang::Type::isVariablyModifiedType(), RequireCompleteType(), clang::T, and clang::QualType::withConst().
Referenced by ActOnCXXTypeid(), and clang::TreeTransform< Derived >::RebuildCXXTypeidExpr().
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 Context, clang::SemaBase::Diag(), E, clang::ExprError(), clang::ASTContext::getMSGuidDecl(), clang::Expr::getType(), getUuidAttrOfType(), clang::Type::isDependentType(), clang::Expr::isNullPointerConstant(), and clang::Expr::NPC_ValueDependentIsNull.
ExprResult Sema::BuildCXXUuidof | ( | QualType | TypeInfoType, |
SourceLocation | TypeidLoc, | ||
TypeSourceInfo * | Operand, | ||
SourceLocation | RParenLoc | ||
) |
Build a Microsoft __uuidof expression with a type operand.
Definition at line 751 of file SemaExprCXX.cpp.
References Context, clang::SemaBase::Diag(), clang::ExprError(), and getUuidAttrOfType().
Referenced by ActOnCXXUuidof(), and clang::TreeTransform< Derived >::RebuildCXXUuidofExpr().
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 3226 of file SemaExpr.cpp.
References BuildAnonymousStructUnionMemberReference(), BuildDeclRefExpr(), clang::ASTContext::BuiltinFnTy, clang::ASTContext::BuiltinInfo, CheckDeclInExpr(), Context, clang::CPlusPlus, CreateRecoveryExpr(), D, clang::SemaBase::Diag(), diagnoseMissingTemplateArguments(), DiagnoseUseOfDecl(), E, clang::ExprError(), clang::DeclarationNameInfo::getBeginLoc(), clang::Stmt::getBeginLoc(), getCapturedDeclRefType(), clang::DeclarationNameInfo::getEndLoc(), clang::Stmt::getEndLoc(), clang::FunctionType::getExtInfo(), clang::ASTContext::getFunctionNoProtoType(), clang::Decl::getKind(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::CXXScopeSpec::getRange(), clang::FunctionType::getReturnType(), isAttrContext(), clang::Builtin::Context::isDirectlyAddressable(), clang::QualType::isNull(), isUnevaluatedContext(), Loc, clang::ast_matchers::type, clang::ASTContext::UnknownAnyTy, clang::VK_LValue, and clang::VK_PRValue.
ExprResult Sema::BuildDeclarationNameExpr | ( | const CXXScopeSpec & | SS, |
LookupResult & | R, | ||
bool | NeedsADL, | ||
bool | AcceptInvalidDecl = false |
||
) |
Definition at line 3189 of file SemaExpr.cpp.
References clang::LookupResult::begin(), BuildDeclarationNameExpr(), CheckDeclInExpr(), Context, clang::UnresolvedLookupExpr::Create(), clang::LookupResult::end(), clang::ExprError(), clang::LookupResult::getAsSingle(), clang::LookupResult::getFoundDecl(), clang::LookupResult::getLookupNameInfo(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), clang::LookupResult::getRepresentativeDecl(), clang::CXXScopeSpec::getWithLocInContext(), clang::LookupResult::isSingleResult(), ShouldLookupResultBeMultiVersionOverload(), and clang::LookupResult::suppressDiagnostics().
Referenced by ActOnBlockStmtExpr(), ActOnIdExpression(), ActOnNameClassifiedAsNonType(), ActOnNameClassifiedAsUndeclaredNonType(), attemptRecovery(), BuildAnonymousStructUnionMemberReference(), BuildCaptureInit(), buildCoroutineHandle(), BuildDeclarationNameExpr(), BuildExpressionFromDeclTemplateArgument(), BuildMemberReferenceExpr(), BuildPossibleImplicitMemberExpr(), BuildQualifiedDeclarationNameExpr(), BuildRecoveryCallExpr(), checkTupleLikeDecomposition(), CheckVarTemplateId(), isTupleLike(), clang::TreeTransform< Derived >::RebuildDeclarationNameExpr(), and clang::TreeTransform< Derived >::RebuildDeclRefExpr().
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 14900 of file SemaDecl.cpp.
References ActOnDocumentableDecls(), Context, clang::DeclGroupRef::Create(), D, clang::SemaBase::Diag(), clang::Decl::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::DeducedType::getDeducedType(), clang::VarDecl::getInit(), clang::Decl::getSourceRange(), clang::Stmt::getSourceRange(), clang::VarDecl::hasInit(), clang::ASTContext::hasSameType(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), clang::OpaquePtr< PtrTy >::make(), and clang::Decl::setInvalidDecl().
Referenced by ActOnCXXForRangeStmt(), clang::SemaObjC::ActOnFinishObjCImplementation(), clang::SemaObjC::ActOnForwardClassDeclaration(), clang::SemaObjC::ActOnForwardProtocolDeclaration(), clang::CreateDGPtrFrom(), FinalizeDeclaratorGroup(), and clang::TreeTransform< Derived >::RebuildDeclStmt().
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 2212 of file SemaExpr.cpp.
References BuildDeclRefExpr(), Context, D, and 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 2281 of file SemaExpr.cpp.
References Context, clang::DeclRefExpr::Create(), D, Diags, E, clang::Type::getAs(), clang::Stmt::getBeginLoc(), getCurFunction(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), getNonOdrUseReasonInCurrentContext(), clang::QualType::getObjCLifetime(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::DiagnosticsEngine::isIgnored(), isUnevaluatedContext(), clang::isUnresolvedExceptionSpec(), MarkDeclRefReferenced(), NeedToCaptureVariable(), clang::Qualifiers::OCL_Weak, clang::OK_BitField, clang::sema::FunctionScopeInfo::recordUseOfWeak(), ResolveExceptionSpec(), clang::Expr::setObjectKind(), clang::Expr::setType(), and UnusedPrivateFields.
DeclRefExpr * Sema::BuildDeclRefExpr | ( | ValueDecl * | D, |
QualType | Ty, | ||
ExprValueKind | VK, | ||
SourceLocation | Loc, | ||
const CXXScopeSpec * | SS = nullptr |
||
) |
Definition at line 2204 of file SemaExpr.cpp.
References BuildDeclRefExpr(), D, and Loc.
Referenced by ActOnIdExpression(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPCanonicalLoop(), AttachTypeConstraint(), BuildBuiltinCallExpr(), buildCoroutineParameterMoves(), buildCoroutinePromise(), BuildCXXForRangeStmt(), BuildDeclarationNameExpr(), buildDeclareReductionRef(), BuildDeclRefExpr(), buildDistanceFunc(), buildLoopVarFunc(), buildMemcpyForAssignmentOp(), buildPromiseCall(), buildStdNoThrowDeclRef(), buildUserDefinedMapperRef(), CheckConditionVariable(), checkMemberDecomposition(), CheckPlaceholderExpr(), checkSimpleDecomposition(), checkTupleLikeDecomposition(), collectPlacementArgs(), DefineImplicitLambdaToFunctionPointerConversion(), findOMPAllocatorHandleT(), clang::SemaOpenMP::getOpenMPCapturedExpr(), and clang::TreeTransform< Derived >::RebuildMemberExpr().
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 9704 of file SemaType.cpp.
References CodeSynthesisContexts, Context, clang::SemaBase::Diag(), E, getDecltypeForExpr(), clang::ASTContext::getDecltypeType(), clang::Expr::getExprLoc(), clang::Expr::hasPlaceholderType(), clang::Expr::HasSideEffects(), and clang::Expr::isInstantiationDependent().
Referenced by ActOnCXXNestedNameSpecifierDecltype(), ActOnPseudoDestructorExpr(), AttachTypeConstraint(), BuildMemInitializer(), ConvertDeclSpecToType(), getDestructorTypeForDecltype(), and clang::TreeTransform< Derived >::RebuildDecltypeType().
MemInitResult Sema::BuildDelegatingInitializer | ( | TypeSourceInfo * | TInfo, |
Expr * | Init, | ||
CXXRecordDecl * | ClassDecl | ||
) |
Definition at line 4556 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::Init, 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 746 of file SemaTemplate.cpp.
References Context, clang::DependentScopeDeclRefExpr::Create(), CreateRecoveryExpr(), clang::CXXScopeSpec::getBeginLoc(), clang::DeclarationNameInfo::getEndLoc(), clang::TemplateArgumentListInfo::getRAngleLoc(), clang::CXXScopeSpec::getWithLocInContext(), and clang::CXXScopeSpec::isValid().
Referenced by ActOnDependentIdExpression(), BuildQualifiedDeclarationNameExpr(), and BuildQualifiedTemplateIdExpr().
ExprResult Sema::BuildEmptyCXXFoldExpr | ( | SourceLocation | EllipsisLoc, |
BinaryOperatorKind | Operator | ||
) |
Definition at line 1457 of file SemaTemplateVariadic.cpp.
References ActOnCXXBoolLiteral(), Context, clang::SemaBase::Diag(), clang::BinaryOperator::getOpcodeStr(), clang::ASTContext::getTrivialTypeSourceInfo(), and clang::ASTContext::VoidTy.
Referenced by calculateConstraintSatisfaction(), and clang::TreeTransform< Derived >::RebuildEmptyCXXFoldExpr().
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 16774 of file SemaDeclCXX.cpp.
References AbstractVariableType, Context, clang::VarDecl::Create(), clang::InitializationKind::CreateCopy(), CurContext, clang::SemaBase::Diag(), FinalizeVarWithDestructor(), clang::ASTContext::getArrayDecayedType(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Type::getAs(), clang::CXXConstructExpr::getConstructor(), clang::ASTContext::getExceptionObjectType(), getLangOpts(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::TypeSourceInfo::getType(), clang::InitializedEntity::InitializeVariable(), clang::Invalid, clang::Type::isArrayType(), clang::Type::isDependentType(), clang::ObjCRuntime::isFragile(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjCObjectType(), clang::Type::isRValueReferenceType(), clang::Type::isSizelessType(), clang::FunctionDecl::isTrivial(), clang::Type::isVariablyModifiedType(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), Loc, MaybeCreateExprWithCleanups(), ObjC(), clang::OK_Ordinary, clang::InitializationSequence::Perform(), PotentiallyEvaluated, clang::ast_matchers::recordType, RequireCompleteType(), RequireNonAbstractType(), clang::SC_None, clang::VarDecl::setExceptionVariable(), clang::VarDecl::setInit(), clang::Decl::setInvalidDecl(), clang::T, and clang::VK_LValue.
Referenced by ActOnExceptionDeclarator(), and clang::TreeTransform< Derived >::RebuildExceptionDecl().
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 7453 of file SemaTemplate.cpp.
References BuildDeclarationNameExpr(), Context, clang::NestedNameSpecifier::Create(), CreateBuiltinUnaryOp(), clang::TemplateArgument::Declaration, DefaultFunctionArrayConversion(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getArrayDecayedType(), clang::Type::getArrayElementTypeNoTypeQual(), clang::Type::getAs(), clang::TemplateArgument::getAsDecl(), getASTContext(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Expr::getExprLoc(), clang::TemplateArgument::getKind(), clang::QualType::getNonLValueExprType(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::Expr::getValueKind(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSimilarType(), ImpCastExprToType(), clang::Type::isArrayType(), clang::AutoType::isDecltypeAuto(), IsFunctionConversion(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isLValue(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isVoidPointerType(), Loc, clang::CXXScopeSpec::MakeTrivial(), clang::TemplateArgument::NullPtr, clang::ASTContext::NullPtrTy, and clang::TemplateParam.
Referenced by BuildExpressionFromNonTypeTemplateArgument(), and getTrivialTemplateArgumentLoc().
ExprResult Sema::BuildExpressionFromNonTypeTemplateArgument | ( | const TemplateArgument & | Arg, |
SourceLocation | Loc | ||
) |
Definition at line 7699 of file SemaTemplate.cpp.
References BuildExpressionFromDeclTemplateArgument(), 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.
Referenced by getTrivialTemplateArgumentLoc().
ExprResult Sema::BuildExpressionTrait | ( | ExpressionTrait | OET, |
SourceLocation | KWLoc, | ||
Expr * | Queried, | ||
SourceLocation | RParen | ||
) |
Definition at line 6431 of file SemaExprCXX.cpp.
References clang::ASTContext::BoolTy, BuildExpressionTrait(), 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(), BuildExpressionTrait(), and clang::TreeTransform< Derived >::RebuildExpressionTrait().
concepts::ExprRequirement * Sema::BuildExprRequirement | ( | concepts::Requirement::SubstitutionDiagnostic * | ExprSubstDiag, |
bool | IsSatisfied, | ||
SourceLocation | NoexceptLoc, | ||
concepts::ExprRequirement::ReturnTypeRequirement | ReturnTypeRequirement | ||
) |
Definition at line 9491 of file SemaExprCXX.cpp.
References Context.
concepts::ExprRequirement * Sema::BuildExprRequirement | ( | Expr * | E, |
bool | IsSatisfied, | ||
SourceLocation | NoexceptLoc, | ||
concepts::ExprRequirement::ReturnTypeRequirement | ReturnTypeRequirement | ||
) |
Definition at line 9439 of file SemaExprCXX.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterRetainedLevels(), canThrow(), Context, createSubstDiagAt(), clang::CT_Can, E, clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getCanonicalType(), clang::TemplateParameterList::getDepth(), clang::TypeConstraint::getImmediatelyDeclaredConstraint(), clang::TemplateParameterList::getParam(), clang::ASTContext::getReferenceQualifiedType(), clang::Expr::getType(), clang::concepts::ExprRequirement::ReturnTypeRequirement::getTypeConstraintTemplateParameterList(), clang::concepts::ExprRequirement::ReturnTypeRequirement::isDependent(), clang::Expr::isInstantiationDependent(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPlaceholderType(), clang::ConceptSpecializationExpr::isSatisfied(), clang::concepts::ExprRequirement::ReturnTypeRequirement::isSubstitutionFailure(), clang::concepts::ExprRequirement::ReturnTypeRequirement::isTypeConstraint(), clang::SourceLocation::isValid(), OS, clang::concepts::ExprRequirement::SS_ConstraintsNotSatisfied, clang::concepts::ExprRequirement::SS_Dependent, clang::concepts::ExprRequirement::SS_NoexceptNotMet, clang::concepts::ExprRequirement::SS_Satisfied, clang::concepts::ExprRequirement::SS_TypeRequirementSubstitutionFailure, and SubstExpr().
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 2393 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, CheckBitIntElementType(), Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::ASTContext::getDependentSizedExtVectorType(), clang::ASTContext::getExtVectorType(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Type::isBooleanType(), clang::Type::isDependentType(), clang::Type::isIntegerType(), clang::Type::isRealFloatingType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::T.
Referenced by HandleExtVectorTypeAttr(), 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 1868 of file SemaExprMember.cpp.
References BuildMemberExpr(), clang::Type::castAs(), Context, CurContext, clang::ExprError(), clang::Type::getAs(), clang::ASTContext::getAttributedType(), clang::ASTContext::getCanonicalType(), getDefaultedFunctionKind(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Expr::getObjectKind(), clang::SemaOpenMP::getOpenMPCapturedExpr(), clang::Type::getPointeeType(), getPointeeType(), clang::ASTContext::getQualifiedType(), clang::CanQual< T >::getQualifiers(), clang::QualType::getQualifiers(), clang::CXXScopeSpec::getScopeRep(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::CXXScopeSpec::getWithLocInContext(), clang::Qualifiers::hasAddressSpace(), clang::Type::hasAttr(), clang::DeclContext::isDependentContext(), clang::Sema::DefaultedFunctionKind::isSpecialMember(), clang::OK_BitField, clang::OK_Ordinary, OpenMP(), PerformObjectMemberConversion(), clang::Qualifiers::removeConst(), clang::Qualifiers::removeObjCGCAttr(), UnusedPrivateFields, clang::VK_LValue, and clang::VK_PRValue.
Referenced by BuildAnonymousStructUnionMemberReference(), BuildMemberReferenceExpr(), checkMemberDecomposition(), and clang::TreeTransform< Derived >::RebuildMemberExpr().
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 16167 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::BestViableFunction(), clang::OverloadCandidateSet::clear(), clang::OverloadCandidateSet::CSK_Normal, clang::LookupResult::empty(), clang::OverloadCandidateSet::empty(), clang::ExprError(), FinishOverloadedCallExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, clang::OR_No_Viable_Function, clang::OR_Success, and Range.
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 2633 of file SemaType.cpp.
References clang::TargetInfo::allowHalfArgsAndReturns(), checkExtParameterInfos(), CheckFunctionReturnType(), clang::SemaObjC::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::Invalid, clang::Type::isHalfType(), clang::Type::isVoidType(), clang::QualType::isVolatileQualified(), clang::Type::isWebAssemblyTableType(), Loc, ObjC(), and clang::T.
Referenced by clang::TreeTransform< Derived >::RebuildFunctionProtoType(), and SubstituteExplicitTemplateArguments().
StmtResult Sema::BuildIfStmt | ( | SourceLocation | IfLoc, |
IfStatementKind | StatementKind, | ||
SourceLocation | LParenLoc, | ||
Stmt * | InitStmt, | ||
ConditionResult | Cond, | ||
SourceLocation | RParenLoc, | ||
Stmt * | ThenVal, | ||
SourceLocation | ElseLoc, | ||
Stmt * | ElseVal | ||
) |
Definition at line 1044 of file SemaStmt.cpp.
References Context, clang::IfStmt::Create(), clang::Sema::ConditionResult::get(), clang::Sema::ConditionResult::isInvalid(), clang::Ordinary, setFunctionHasBranchProtectedScope(), and clang::StmtError().
Referenced by ActOnIfStmt().
ExprResult Sema::BuildImplicitMemberExpr | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
LookupResult & | R, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
bool | IsDefiniteInstance, | ||
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 1958 of file SemaExprMember.cpp.
References BuildCXXThisExpr(), BuildMemberReferenceExpr(), clang::LookupResult::empty(), clang::SourceRange::getBegin(), getCurrentThisType(), getLangOpts(), clang::LookupResult::getNameLoc(), clang::CXXScopeSpec::getRange(), HLSL(), clang::LookupResult::isAmbiguous(), clang::QualType::isNull(), clang::SourceRange::isValid(), and Loc.
Referenced by BuildPossibleImplicitMemberExpr().
ExprResult Sema::BuildInitList | ( | SourceLocation | LBraceLoc, |
MultiExprArg | InitArgList, | ||
SourceLocation | RBraceLoc | ||
) |
Definition at line 7254 of file SemaExpr.cpp.
References CheckPlaceholderExpr(), Context, E, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::setType(), and clang::ASTContext::VoidTy.
Referenced by ActOnInitList(), and 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 2080 of file SemaLambda.cpp.
References ActOnFields(), addBlockPointerConversion(), addFunctionPointerConversions(), BuildCaptureField(), BuildCaptureInit(), clang::sema::LambdaScopeInfo::CallOperator, clang::sema::LambdaScopeInfo::CaptureDefaultLoc, clang::sema::CapturingScopeInfo::Captures, CheckCompletedCXXClass(), CheckConstexprFunctionDefinition(), clang::SemaCUDA::CheckLambdaCapture(), CheckValid, clang::Class, clang::sema::LambdaScopeInfo::Cleanup, Cleanup, ConstantEvaluated, clang::Constexpr, clang::sema::CapturingScopeInfo::ContainsUnexpandedParameterPack, Context, clang::CPlusPlus17, clang::CPlusPlus20, clang::LambdaExpr::Create(), clang::FixItHint::CreateInsertion(), CUDA(), CurContext, clang::SemaBase::Diag(), DiagnoseShadowingLambdaDecls(), DiagnoseUnusedLambdaCapture(), DiscardedStatement, clang::sema::LambdaScopeInfo::ExplicitCaptureRanges, clang::sema::LambdaScopeInfo::ExplicitParams, clang::ExprError(), ExprEvalContexts, clang::SourceRange::getBegin(), clang::FunctionDecl::getBody(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::sema::Capture::getEllipsisLoc(), clang::SourceRange::getEnd(), getLangOpts(), clang::sema::Capture::getLocation(), getLocForEndOfToken(), clang::sema::Capture::getVariable(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::if(), ImmediateFunctionContext, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::Init, clang::sema::LambdaScopeInfo::IntroducerRange, clang::sema::Capture::isBlockCapture(), clang::FunctionDecl::isConstexpr(), clang::sema::Capture::isCopyCapture(), clang::DeclContext::isDependentContext(), clang::sema::Capture::isInitCapture(), clang::sema::Capture::isInvalid(), clang::Decl::isInvalidDecl(), 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, LangOpts, clang::LCD_ByCopy, clang::LCD_None, clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_StarThis, clang::LCK_This, clang::LCK_VLAType, mapImplicitCaptureStyle(), maybeAddDeclWithEffects(), MaybeBindToTemporary(), clang::CleanupInfo::mergeFrom(), clang::sema::LambdaScopeInfo::NumExplicitCaptures, ObjC(), PopExpressionEvaluationContext(), PotentiallyEvaluated, PotentiallyEvaluatedIfUsed, clang::FunctionDecl::setConstexprKind(), clang::Decl::setLexicalDeclContext(), Unevaluated, UnevaluatedAbstract, UnevaluatedList, and clang::Unspecified.
Referenced by ActOnLambdaExpr(), and clang::TreeTransform< Derived >::RebuildLambdaExpr().
QualType Sema::buildLambdaInitCaptureInitialization | ( | SourceLocation | Loc, |
bool | ByRef, | ||
SourceLocation | EllipsisLoc, | ||
std::optional< unsigned > | NumExpansions, | ||
IdentifierInfo * | Id, | ||
bool | DirectInit, | ||
Expr *& | Init | ||
) |
Definition at line 786 of file SemaLambda.cpp.
References BuildReferenceType(), Context, clang::CPlusPlus20, clang::InitializationKind::CreateCopy(), clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), deduceVarTypeFromInitializer(), clang::SemaBase::Diag(), clang::ASTContext::getAutoDeductType(), clang::ParenListExpr::getExprs(), getLangOpts(), clang::ParenListExpr::getNumExprs(), clang::ASTContext::getPackExpansionType(), clang::TypeLocBuilder::getTypeSourceInfo(), Id, clang::Init, clang::InitializedEntity::InitializeLambdaCapture(), clang::QualType::isNull(), clang::SourceLocation::isValid(), Loc, clang::InitializationSequence::Perform(), clang::TypeLocBuilder::push(), clang::Result, and clang::TypeSpecTypeLoc::setNameLoc().
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 525 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::CallOperator, clang::sema::LambdaScopeInfo::CaptureDefaultLoc, clang::sema::LambdaScopeInfo::ExplicitParams, clang::CXXMethodDecl::getParent(), 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 16091 of file SemaOverload.cpp.
References clang::LookupResult::asUnresolvedSet(), clang::OverloadCandidateSet::BestViableFunction(), clang::UserDefinedLiteral::Create(), CreateFunctionRefExpr(), clang::OverloadCandidateSet::CSK_Normal, 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(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, and clang::OverloadCandidateSet::size().
Referenced by ActOnNumericConstant(), ActOnStringLiteral(), and BuildCookedLiteralOperatorCall().
QualType Sema::BuildMatrixType | ( | QualType | T, |
Expr * | NumRows, | ||
Expr * | NumColumns, | ||
SourceLocation | AttrLoc | ||
) |
Definition at line 2447 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, CheckBitIntElementType(), Context, clang::SemaBase::Diag(), clang::Type::getAs(), 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 HandleMatrixTypeAttr(), and 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 933 of file SemaExprMember.cpp.
References Context, clang::MemberExpr::Create(), E, clang::Type::getAs(), clang::DeclarationNameInfo::getLoc(), getNonOdrUseReasonInCurrentContext(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::isUnresolvedExceptionSpec(), MarkMemberReferenced(), clang::Member, ResolveExceptionSpec(), and clang::Expr::setType().
Referenced by BuildFieldReferenceExpr(), buildImplicitMap(), BuildMemberReferenceExpr(), clang::SemaOpenMP::isOpenMPCapturedDecl(), and processImplicitMapsWithDefaultMappers().
MemInitResult Sema::BuildMemberInitializer | ( | ValueDecl * | Member, |
Expr * | Init, | ||
SourceLocation | IdLoc | ||
) |
Definition at line 4473 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::Init, clang::InitializedEntity::InitializeMember(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Member, clang::InitializationSequence::Perform(), and UPPC_Initializer.
Referenced by BuildMemInitializer(), and 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 2682 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, OpenCL(), and clang::T.
Referenced by GetFullTypeForDeclarator(), and 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 975 of file SemaExprMember.cpp.
References ActOnDependentMemberExpr(), ActOnMemberAccessExpr(), ActOnStartCXXMemberReference(), clang::LookupResult::begin(), clang::ASTContext::BoundMemberTy, BuildAnonymousStructUnionMemberReference(), BuildCXXThisExpr(), BuildDeclarationNameExpr(), BuildFieldReferenceExpr(), BuildMemberExpr(), BuildMSPropertyRefExpr(), BuildTemplateIdExpr(), clang::Type::castAs(), CheckQualifiedMemberReference(), CheckVarTemplateId(), computeDeclContext(), Context, clang::CPlusPlus, clang::UnresolvedMemberExpr::Create(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), DiagnoseDiscardedExprMarkedNodiscard(), diagnoseMissingTemplateArguments(), DiagnoseUseOfDecl(), clang::LookupResult::empty(), clang::LookupResult::end(), clang::Enum, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), getCurFunctionDecl(), getCurScope(), clang::DeclarationName::getCXXOverloadedOperator(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::LookupResult::getLookupName(), clang::LookupResult::getLookupNameInfo(), clang::DeclarationNameInfo::getName(), clang::LookupResult::getNameLoc(), clang::QualType::getNonReferenceType(), clang::UnresolvedSetIterator::getPair(), getPointeeType(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::Stmt::getSourceRange(), clang::VarDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::CXXScopeSpec::getWithLocInContext(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::Sema::ActOnMemberAccessExtraArgs::Id, IgnoredValueConversions(), clang::Expr::IgnoreImpCasts(), int, clang::LookupResult::isAmbiguous(), clang::NamedDecl::isCXXInstanceMember(), clang::NestedNameSpecifier::isDependent(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::CXXScopeSpec::isEmpty(), IsInFnTryBlockHandler(), clang::CXXScopeSpec::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::LookupResult::isOverloadedResult(), clang::Type::isPointerType(), clang::Expr::isPRValue(), clang::CXXScopeSpec::isSet(), clang::LookupResult::isSingleResult(), clang::Expr::isTypeDependent(), clang::LookupResult::isUnresolvableResult(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), clang::SourceRange::isValid(), Loc, clang::Sema::ActOnMemberAccessExtraArgs::ObjCImpDecl, clang::OK_Ordinary, clang::Sema::ActOnMemberAccessExtraArgs::S, clang::LookupResult::setBaseObjectType(), clang::VarDecl::setTemplateSpecializationKind(), clang::LookupResult::suppressDiagnostics(), TemporaryMaterializationConversion(), clang::TSK_ImplicitInstantiation, clang::ast_matchers::type, clang::VK_LValue, clang::VK_PRValue, and clang::LookupResult::wasNotFoundInCurrentInstantiation().
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 |
||
) |
Definition at line 786 of file SemaExprMember.cpp.
References BuildMemberReferenceExpr(), clang::Type::castAs(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getPointeeType(), clang::CXXScopeSpec::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), LookupMemberExpr(), LookupMemberExprInRecord(), LookupMemberName, clang::Sema::ActOnMemberAccessExtraArgs::ObjCImpDecl, and clang::Result.
Referenced by ActOnMemberAccessExpr(), BuildImplicitMemberExpr(), BuildImplicitMemberInitializer(), buildMemberCall(), BuildMemberReferenceExpr(), buildSingleCopyAssignRecursively(), checkTupleLikeDecomposition(), EvaluateStaticAssertMessageAsString(), LookupInlineAsmVarDeclField(), clang::TreeTransform< Derived >::RebuildCXXDependentScopeMemberExpr(), clang::TreeTransform< Derived >::RebuildExtVectorElementExpr(), clang::TreeTransform< Derived >::RebuildMemberExpr(), clang::TreeTransform< Derived >::RebuildObjCIsaExpr(), clang::TreeTransform< Derived >::RebuildObjCIvarRefExpr(), clang::TreeTransform< Derived >::RebuildObjCPropertyRefExpr(), and clang::TreeTransform< Derived >::RebuildUnresolvedMemberExpr().
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 4279 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), clang::CXXRecordDecl::bases(), BuildBaseInitializer(), BuildDecltypeType(), BuildMemberInitializer(), BuildPackIndexingType(), clang::TypeLoc::castAs(), CheckTypenameType(), clang::LookupResult::clear(), computeDeclContext(), Context, CorrectDelayedTyposInExpr(), CorrectTypo(), clang::ASTContext::CreateTypeSourceInfo(), CTK_ErrorRecovery, clang::SemaBase::Diag(), diagnoseTypo(), clang::LookupResult::empty(), FindBaseInitializer(), clang::OpaquePtr< PtrTy >::get(), clang::ActionResult< PtrTy, Compress >::get(), clang::LookupResult::getAsSingle(), clang::CXXBaseSpecifier::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::TypoCorrection::getCorrectionDeclAs(), getElaboratedType(), clang::DeclSpec::getEllipsisLoc(), getLangOpts(), clang::Decl::getLocation(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::ElaboratedTypeLoc::getNamedTypeLoc(), clang::DeclSpec::getPackIndexingExpr(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::CXXBaseSpecifier::getSourceRange(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::CXXBaseSpecifier::getType(), clang::ASTContext::getTypeDeclType(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::CXXScopeSpec::getWithLocInContext(), clang::ASTContext::hasSameTemplateName(), clang::Init, clang::LookupResult::isAmbiguous(), isDependentScopeSpecifier(), clang::QualType::isNull(), clang::TypeLoc::isNull(), clang::CXXScopeSpec::isSet(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), LookupOrdinaryName, LookupParsedName(), MarkAnyDeclReferenced(), clang::Member, clang::None, clang::SemaBase::PDiag(), clang::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::LookupResult::setLookupName(), clang::DependentNameTypeLoc::setNameLoc(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::LookupResult::suppressDiagnostics(), tryLookupCtorInitMemberDecl(), clang::TST_decltype, clang::TST_decltype_auto, and clang::TST_typename_pack_indexing.
Referenced by ActOnMemInitializer().
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 5779 of file SemaDecl.cpp.
References clang::DeclContext::addDecl(), clang::AS_none, Context, clang::FieldDecl::Create(), CurContext, clang::DeclSpec::getBeginLoc(), clang::RecordDecl::getDefinition(), clang::Decl::getLocation(), clang::ASTContext::getTypeDeclType(), GetTypeForDeclarator(), clang::ICIS_NoInit, InjectAnonymousStructOrUnionMembers(), clang::ParsedAttributesView::none(), RequireCompleteSizedType(), clang::Decl::setImplicit(), clang::Decl::setInvalidDecl(), StorageClassSpecToVarDeclStorageClass(), and clang::TypeName.
Referenced by ParsedFreeStandingDeclSpec().
void Sema::BuildModuleInclude | ( | SourceLocation | DirectiveLoc, |
Module * | Mod | ||
) |
Definition at line 734 of file SemaModule.cpp.
References clang::DeclContext::addDecl(), clang::ASTContext::addModuleInitializer(), clang::Module::AllVisible, Consumer, Context, clang::ImportDecl::CreateImplicit(), getASTContext(), clang::Preprocessor::getHeaderSearchInfo(), getLangOpts(), getModuleLoader(), getSourceManager(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTConsumer::HandleImplicitImportDecl(), clang::SourceManager::isWrittenInMainFile(), clang::HeaderSearch::lookupModule(), clang::ModuleLoader::makeModuleVisible(), PP, clang::VisibleModuleSet::setVisible(), clang::TU_ClangModule, and TUKind.
Referenced by ActOnAnnotModuleEnd(), and ActOnAnnotModuleInclude().
StmtResult Sema::BuildMSDependentExistsStmt | ( | SourceLocation | KeywordLoc, |
bool | IsIfExists, | ||
NestedNameSpecifierLoc | QualifierLoc, | ||
DeclarationNameInfo | NameInfo, | ||
Stmt * | Nested | ||
) |
Definition at line 4479 of file SemaStmt.cpp.
References Context.
Referenced by ActOnMSDependentExistsStmt(), and clang::TreeTransform< Derived >::RebuildMSDependentExistsStmt().
concepts::NestedRequirement * Sema::BuildNestedRequirement | ( | Expr * | E | ) |
Definition at line 9516 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 9527 of file SemaExprCXX.cpp.
References Context, and clang::ASTConstraintSatisfaction::Rebuild().
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 250 of file SemaCoroutine.cpp.
References clang::UnresolvedSetImpl::append(), CreateOverloadedUnaryOp(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), E, and Loc.
Referenced by buildOperatorCoawaitCall(), BuildUnresolvedCoawaitExpr(), and clang::TreeTransform< Derived >::RebuildCoawaitExpr().
ExprResult Sema::BuildOperatorCoawaitLookupExpr | ( | Scope * | S, |
SourceLocation | Loc | ||
) |
Definition at line 827 of file SemaCoroutine.cpp.
References clang::LookupResult::asUnresolvedSet(), Context, clang::UnresolvedLookupExpr::Create(), clang::ASTContext::DeclarationNames, clang::DeclarationNameTable::getCXXOperatorName(), clang::LookupResult::isAmbiguous(), Loc, LookupName(), and LookupOperatorName.
Referenced by ActOnCoawaitExpr(), and buildOperatorCoawaitCall().
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 15962 of file SemaOverload.cpp.
References clang::LookupResult::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::Type::castAs(), checkPlaceholderForOverload(), clang::OverloadCandidateSet::CompleteCandidates(), clang::CXXOperatorCallExpr::Create(), CreateFunctionRefExpr(), clang::FixItHint::CreateReplacement(), clang::OverloadCandidateSet::CSK_Operator, clang::ASTContext::DeclarationNames, Diag(), clang::OverloadCandidateSet::empty(), clang::LookupResult::end(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::DeclarationNameTable::getCXXOperatorName(), clang::RecordType::getDecl(), clang::QualType::getNonLValueExprType(), clang::FunctionDecl::getReturnType(), clang::StringLiteral::getString(), clang::ValueDecl::getType(), clang::Expr::getValueKindForType(), clang::LookupResult::isAmbiguous(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), clang::Type::isRecordType(), Loc, clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::OverloadCandidateSet::size(), and clang::LookupResult::suppressAccessDiagnostics().
Referenced by ActOnStartCXXMemberReference(), and 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 14181 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::BestViableFunction(), clang::CallExpr::Create(), clang::OverloadCandidateSet::CSK_AddressOfOverloadSet, clang::OverloadCandidateSet::CSK_Normal, clang::ASTContext::DependentTy, FinishOverloadedCallExpr(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::FunctionDecl::isTemplateInstantiation(), clang::Type::isUndeducedType(), markUnaddressableCandidatesUnviable(), clang::OR_Success, clang::VK_PRValue, and clang::FunctionDecl::willHaveBody().
Referenced by BuildCallExpr().
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 13954 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::BestViableFunction(), checkArgPlaceholdersForOverload(), clang::CPlusPlus, clang::CallExpr::Create(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), clang::ASTContext::DependentTy, clang::OverloadCandidateSet::empty(), clang::ExprError(), clang::FunctionDecl::getBuiltinID(), clang::OverloadExpr::getQualifier(), clang::Decl::isImplicit(), clang::CallExpr::markDependentForPostponedNameLookup(), clang::OR_No_Viable_Function, clang::UnresolvedLookupExpr::requiresADL(), clang::Result, and clang::VK_PRValue.
ExprResult Sema::BuildPackIndexingExpr | ( | Expr * | PackExpression, |
SourceLocation | EllipsisLoc, | ||
Expr * | IndexExpr, | ||
SourceLocation | RSquareLoc, | ||
ArrayRef< Expr * > | ExpandedExprs = {} , |
||
bool | FullySubstituted = false |
||
) |
Definition at line 1205 of file SemaTemplateVariadic.cpp.
References CCEK_ArrayBound, CheckConvertedConstantExpression(), Context, clang::PackIndexingExpr::Create(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getASTContext(), clang::Stmt::getBeginLoc(), clang::ASTContext::getIntWidth(), clang::ASTContext::getSizeType(), clang::Expr::isInstantiationDependent(), and clang::ActionResult< PtrTy, Compress >::isUsable().
Referenced by ActOnPackIndexingExpr(), and clang::TreeTransform< Derived >::RebuildPackIndexingExpr().
QualType Sema::BuildPackIndexingType | ( | QualType | Pattern, |
Expr * | IndexExpr, | ||
SourceLocation | Loc, | ||
SourceLocation | EllipsisLoc, | ||
bool | FullySubstituted = false , |
||
ArrayRef< QualType > | Expansions = {} |
||
) |
Definition at line 9736 of file SemaType.cpp.
References CCEK_ArrayBound, CheckConvertedConstantExpression(), Context, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::ASTContext::getIntWidth(), clang::ASTContext::getPackIndexingType(), clang::ASTContext::getSizeType(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), and clang::Expr::isValueDependent().
Referenced by ActOnPackIndexingType(), BuildMemInitializer(), ConvertDeclSpecToType(), and clang::TreeTransform< Derived >::RebuildPackIndexingType().
Build a paren type including T
.
Definition at line 1675 of file SemaType.cpp.
References Context, clang::ASTContext::getParenType(), and clang::T.
Referenced by GetFullTypeForDeclarator(), and 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 15155 of file SemaDecl.cpp.
References Context, clang::ParmVarDecl::Create(), clang::ASTContext::getTrivialTypeSourceInfo(), Loc, clang::SC_None, clang::Decl::setImplicit(), and clang::T.
Referenced by ActOnBlockArguments(), ActOnFunctionDeclarator(), DeclClonePragmaWeak(), and 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 1805 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, OpenCL(), and clang::T.
Referenced by BuiltinAddPointer(), GetFullTypeForDeclarator(), 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 303 of file SemaExprMember.cpp.
References clang::LookupResult::begin(), BuildDeclarationNameExpr(), BuildImplicitMemberExpr(), BuildTemplateIdExpr(), ClassifyImplicitMemberAccess(), Context, clang::UnresolvedLookupExpr::Create(), clang::SemaBase::Diag(), diagnoseInstanceReference(), clang::LookupResult::end(), clang::ExprError(), clang::LookupResult::getLookupNameInfo(), clang::DeclarationNameInfo::getName(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), clang::LookupResult::getRepresentativeDecl(), clang::CXXScopeSpec::getWithLocInContext(), IMA_Abstract, IMA_Dependent, IMA_Error_StaticOrExplicitContext, IMA_Error_Unrelated, IMA_Field_Uneval_Context, IMA_Instance, IMA_Mixed, IMA_Mixed_StaticOrExplicitContext, IMA_Mixed_Unrelated, IMA_Static, IMA_Unresolved, IMA_Unresolved_StaticOrExplicitContext, clang::SourceLocation::isValid(), and clang::LookupResult::suppressDiagnostics().
Referenced by ActOnIdExpression(), ActOnNameClassifiedAsOverloadSet(), attemptRecovery(), BuildQualifiedDeclarationNameExpr(), BuildQualifiedTemplateIdExpr(), and BuildRecoveryCallExpr().
ExprResult Sema::BuildPredefinedExpr | ( | SourceLocation | Loc, |
PredefinedIdentKind | IK | ||
) |
Definition at line 3486 of file SemaExpr.cpp.
References clang::ASTContext::adjustStringLiteralBaseType(), clang::ASTContext::CharTy, clang::PredefinedExpr::ComputeName(), Context, ConvertUTF8ToWideString(), clang::PredefinedExpr::Create(), clang::StringLiteral::Create(), CurContext, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::Function, clang::ASTContext::getConstantArrayType(), getLangOpts(), getPredefinedExprDecl(), clang::CharUnits::getQuantity(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getTypeSizeInChars(), LangOpts, clang::LFuncSig, clang::LFunction, Loc, clang::Normal, clang::Ordinary, clang::Wide, clang::ASTContext::WideCharTy, and clang::CanQual< T >::withConst().
Referenced by ActOnPredefinedExpr(), and clang::TreeTransform< Derived >::RebuildPredefinedExpr().
ExprResult Sema::BuildPseudoDestructorExpr | ( | Expr * | Base, |
SourceLocation | OpLoc, | ||
tok::TokenKind | OpKind, | ||
const CXXScopeSpec & | SS, | ||
TypeSourceInfo * | ScopeType, | ||
SourceLocation | CCLoc, | ||
SourceLocation | TildeLoc, | ||
PseudoDestructorTypeStorage | DestroyedType | ||
) |
Definition at line 8193 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::isMatrixType(), clang::Type::isPointerType(), clang::Type::isScalarType(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::Qualifiers::OCL_None, and clang::Result.
Referenced by ActOnPseudoDestructorExpr(), and 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 2896 of file SemaExpr.cpp.
References BuildDeclarationNameExpr(), BuildDependentDeclRefExpr(), BuildPossibleImplicitMemberExpr(), computeDeclContext(), Context, clang::FixItHint::CreateInsertion(), D, clang::SemaBase::Diag(), clang::LookupResult::empty(), clang::ExprEmpty(), clang::ExprError(), clang::LookupResult::getAsSingle(), clang::DeclarationName::getAsString(), clang::CXXScopeSpec::getBeginLoc(), getElaboratedType(), clang::DeclarationNameInfo::getEndLoc(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::ASTContext::getTypeDeclType(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), clang::LookupResult::isAmbiguous(), clang::CXXScopeSpec::isInvalid(), isPotentialImplicitMemberAccess(), Loc, LookupOrdinaryName, LookupParsedName(), clang::None, clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushTypeSpec(), clang::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::TypeSpecTypeLoc::setNameLoc(), clang::ElaboratedTypeLoc::setQualifierLoc(), and clang::LookupResult::wasNotFoundInCurrentInstantiation().
Referenced by clang::TreeTransform< Derived >::RebuildDependentScopeDeclRefExpr().
ExprResult Sema::BuildQualifiedTemplateIdExpr | ( | CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
const DeclarationNameInfo & | NameInfo, | ||
const TemplateArgumentListInfo * | TemplateArgs, | ||
bool | IsAddressOfOperand | ||
) |
Definition at line 4666 of file SemaTemplate.cpp.
References BuildDependentDeclRefExpr(), BuildPossibleImplicitMemberExpr(), BuildTemplateIdExpr(), computeDeclContext(), clang::SemaBase::Diag(), clang::LookupResult::empty(), clang::ExprError(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getRange(), clang::LookupResult::isAmbiguous(), clang::CXXScopeSpec::isInvalid(), isPotentialImplicitMemberAccess(), clang::SourceLocation::isValid(), LookupOrdinaryName, LookupTemplateName(), and clang::LookupResult::wasNotFoundInCurrentInstantiation().
Referenced by clang::TreeTransform< Derived >::RebuildDependentScopeDeclRefExpr().
QualType Sema::BuildQualifiedType | ( | QualType | T, |
SourceLocation | Loc, | ||
Qualifiers | Qs, | ||
const DeclSpec * | DS = nullptr |
||
) |
Definition at line 1581 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(), checkMemberDecomposition(), ConvertDeclSpecToType(), GetFullTypeForDeclarator(), and clang::TreeTransform< Derived >::RebuildQualifiedType().
QualType Sema::BuildQualifiedType | ( | QualType | T, |
SourceLocation | Loc, | ||
unsigned | CVRA, | ||
const DeclSpec * | DS = nullptr |
||
) |
Definition at line 1631 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 1932 of file SemaType.cpp.
References Context, clang::ASTContext::getReadPipeType(), and clang::T.
Referenced by GetFullTypeForDeclarator(), and clang::TreeTransform< Derived >::RebuildPipeType().
QualType Sema::BuildReferenceType | ( | QualType | T, |
bool | LValueRef, | ||
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 1857 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, OpenCL(), clang::ASTContext::OverloadTy, and clang::T.
Referenced by buildLambdaInitCaptureInitialization(), BuiltinAddReference(), castForMoving(), CastForMoving(), checkTupleLikeDecomposition(), GetFullTypeForDeclarator(), and clang::TreeTransform< Derived >::RebuildReferenceType().
ExprResult Sema::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.
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 6732 of file SemaExpr.cpp.
References clang::ASTContext::BoolTy, clang::ASTContext::BuiltinInfo, CallExprUnaryConversions(), clang::Type::castAs(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), clang::CallExpr::computeDependence(), Context, ConvertArgumentsForCall(), CorrectDelayedTyposInExpr(), clang::CallExpr::Create(), clang::CUDAKernelCallExpr::Create(), CUDA(), CurFPFeatureOverrides(), DefaultArgumentPromotion(), clang::SemaBase::Diag(), DiagnoseSentinelCalls(), Diags, E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArgs(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::FunctionDecl::getBuiltinID(), clang::FunctionDecl::getCallResultType(), clang::FunctionType::getCallResultType(), clang::FunctionType::getCmseNSCallAttr(), getCurFunctionDecl(), getLangOpts(), clang::Decl::getLocation(), clang::CallExpr::getNumArgs(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::FunctionType::getReturnType(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::Expr::getValueKindForType(), clang::Decl::hasAttr(), clang::FunctionDecl::hasBody(), clang::Builtin::Context::hasCustomTypechecking(), clang::TargetInfo::hasFeature(), clang::FunctionDecl::hasPrototype(), ImpCastExprToType(), clang::InitializedEntity::InitializeParameter(), clang::ASTContext::isDependenceAllowed(), clang::DiagnosticsEngine::isIgnored(), clang::Builtin::Context::isImmediate(), clang::Decl::isImplicit(), clang::Type::isInstantiationDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isVoidType(), MaybeBindToTemporary(), clang::FunctionDecl::param_size(), PerformCopyInitialization(), rebuildUnknownAnyFunction(), RequireCompleteType(), clang::Result, clang::CallExpr::setArg(), clang::CallExpr::setNumArgsUnsafe(), clang::Expr::setType(), clang::Expr::setValueKind(), clang::CallExpr::shrinkNumArgs(), clang::ASTContext::UnknownAnyTy, and clang::VK_PRValue.
Referenced by BuildCallExpr(), and FinishOverloadedCallExpr().
ExprResult Sema::BuildResolvedCoawaitExpr | ( | SourceLocation | KwLoc, |
Expr * | Operand, | ||
Expr * | Awaiter, | ||
bool | IsImplicit = false |
||
) |
Definition at line 923 of file SemaCoroutine.cpp.
References buildCoawaitCalls(), checkCoroutineContext(), CheckPlaceholderExpr(), Context, CreateMaterializeTemporaryExpr(), clang::ASTContext::DependentTy, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), ReadySuspendResumeResult::IsInvalid, clang::Expr::isPRValue(), Loc, ReadySuspendResumeResult::OpaqueValue, and ReadySuspendResumeResult::Results.
Referenced by ActOnCoroutineBodyStart(), BuildUnresolvedCoawaitExpr(), and clang::TreeTransform< Derived >::RebuildCoawaitExpr().
StmtResult Sema::BuildReturnStmt | ( | SourceLocation | ReturnLoc, |
Expr * | RetValExp, | ||
bool | AllowRecovery = false |
||
) |
Definition at line 3883 of file SemaStmt.cpp.
References ActOnCapScopeReturnStmt(), ActOnFinishFullExpr(), CheckSimplerImplicitMovesMSVCWorkaround(), clang::Type::containsErrors(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus14, clang::ReturnStmt::Create(), CreateRecoveryExpr(), CurContext, D, DeduceFunctionTypeFromReturnExpr(), clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), ExprEvalContexts, ForceOff, FunctionScopes, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Decl::getAttrs(), clang::Stmt::getBeginLoc(), clang::QualType::getCanonicalType(), clang::ObjCMethodDecl::getClassInterface(), clang::Type::getContainedAutoType(), getCopyElisionCandidate(), getCurFunction(), getCurFunctionDecl(), getCurFunctionOrMethodDecl(), getCurMethodDecl(), clang::RecordType::getDecl(), clang::Stmt::getEndLoc(), getLangOpts(), getNamedReturnInfo(), clang::ASTContext::getObjCInterfaceType(), clang::ASTContext::getObjCObjectPointerType(), clang::FunctionDecl::getReturnType(), clang::ObjCMethodDecl::getReturnType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), clang::ObjCMethodDecl::hasRelatedResultType(), IgnoredValueConversions(), ImpCastExprToType(), clang::InitializedEntity::InitializeRelatedResult(), clang::InitializedEntity::InitializeResult(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::FunctionDecl::isMain(), clang::FunctionDecl::isNoReturn(), clang::QualType::isNull(), clang::RecordDecl::isOrContainsUnion(), clang::Expr::isTypeDependent(), clang::Type::isVoidType(), Normal, PerformCopyInitialization(), PerformMoveOrCopyInitialization(), clang::Result, clang::Decl::setInvalidDecl(), clang::StmtError(), and clang::ASTContext::VoidTy.
Referenced by ActOnReturnStmt(), DefineImplicitCopyAssignment(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), and clang::TreeTransform< Derived >::RebuildReturnStmt().
ExprResult Sema::BuildSourceLocExpr | ( | SourceLocIdentKind | Kind, |
QualType | ResultTy, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RPLoc, | ||
DeclContext * | ParentContext | ||
) |
Definition at line 16783 of file SemaExpr.cpp.
References Context.
Referenced by ActOnSourceLocExpr(), and clang::TreeTransform< Derived >::RebuildSourceLocExpr().
Decl * Sema::BuildStaticAssertDeclaration | ( | SourceLocation | StaticAssertLoc, |
Expr * | AssertExpr, | ||
Expr * | AssertMessageExpr, | ||
SourceLocation | RParenLoc, | ||
bool | Failed | ||
) |
Definition at line 17304 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 12009 of file SemaDeclCXX.cpp.
References clang::TemplateArgumentListInfo::addArgument(), CheckTemplateIdType(), Context, clang::NestedNameSpecifier::Create(), clang::ASTContext::getElaboratedType(), getStdNamespace(), clang::ASTContext::getTrivialTypeSourceInfo(), Loc, LookupStdInitializerList(), clang::None, and StdInitializerList.
Referenced by DeduceAutoType().
ExprResult Sema::BuildStmtExpr | ( | SourceLocation | LPLoc, |
Stmt * | SubStmt, | ||
SourceLocation | RPLoc, | ||
unsigned | TemplateDepth | ||
) |
Definition at line 15859 of file SemaExpr.cpp.
References clang::CompoundStmt::body_empty(), Cleanup, Context, DiscardCleanupsInEvaluationContext(), clang::CleanupInfo::exprNeedsCleanups(), clang::CompoundStmt::getStmtExprResult(), clang::Value::getType(), hasAnyUnrecoverableErrorsInThisFunction(), MaybeBindToTemporary(), PopExpressionEvaluationContext(), and clang::ASTContext::VoidTy.
Referenced by ActOnStmtExpr(), and clang::TreeTransform< Derived >::RebuildStmtExpr().
ExprResult Sema::BuildSynthesizedThreeWayComparison | ( | SourceLocation | OpLoc, |
const UnresolvedSetImpl & | Fns, | ||
Expr * | LHS, | ||
Expr * | RHS, | ||
FunctionDecl * | DefaultedFn | ||
) |
Definition at line 15042 of file SemaOverload.cpp.
References clang::ASTContext::CompCategories, clang::BinaryOperator::Create(), clang::PseudoObjectExpr::Create(), clang::ast_matchers::Eq, clang::Equal, clang::Equivalent, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Expr::getObjectKind(), clang::FunctionDecl::getReturnType(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::Greater, clang::Expr::isGLValue(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ComparisonCategoryInfo::isPartial(), clang::ComparisonCategoryInfo::isStrong(), clang::Less, clang::ComparisonCategories::lookupInfoForType(), clang::Result, and clang::Unordered.
ExprResult Sema::BuildTemplateIdExpr | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
LookupResult & | R, | ||
bool | RequiresADL, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) |
Definition at line 4603 of file SemaTemplate.cpp.
References clang::LookupResult::begin(), CheckConceptTemplateId(), CheckVarTemplateId(), Context, clang::UnresolvedLookupExpr::Create(), diagnoseMissingTemplateArguments(), clang::LookupResult::end(), clang::ExprError(), clang::Decl::getAsFunction(), clang::LookupResult::getAsSingle(), clang::LookupResult::getFoundDecl(), clang::LookupResult::getLookupNameInfo(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), clang::LookupResult::getRepresentativeDecl(), clang::Expr::getType(), clang::CXXScopeSpec::getWithLocInContext(), clang::LookupResult::isAmbiguous(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::LookupResult::isSingleResult(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), clang::ASTContext::OverloadTy, clang::Expr::setType(), clang::LookupResult::suppressDiagnostics(), and clang::ASTContext::UnresolvedTemplateTy.
Referenced by ActOnIdExpression(), BuildMemberReferenceExpr(), BuildPossibleImplicitMemberExpr(), BuildQualifiedTemplateIdExpr(), BuildRecoveryCallExpr(), and clang::TreeTransform< Derived >::RebuildTemplateIdExpr().
bool Sema::BuildTypeConstraint | ( | const CXXScopeSpec & | SS, |
TemplateIdAnnotation * | TypeConstraint, | ||
TemplateTypeParmDecl * | ConstrainedParameter, | ||
SourceLocation | EllipsisLoc, | ||
bool | AllowUnexpandedPack | ||
) |
Definition at line 1101 of file SemaTemplate.cpp.
References clang::TemplateArgumentListInfo::arguments(), AttachTypeConstraint(), CheckTypeConstraint(), Context, DiagnoseUnexpandedParameterPack(), clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateName::getAsUsingShadowDecl(), clang::ASTContext::getTypeDeclType(), clang::CXXScopeSpec::getWithLocInContext(), clang::SourceLocation::isInvalid(), clang::CXXScopeSpec::isSet(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, makeTemplateArgumentListInfo(), clang::TemplateIdAnnotation::Name, clang::TemplateIdAnnotation::Template, clang::TemplateIdAnnotation::TemplateNameLoc, and UPPC_TypeConstraint.
Referenced by ActOnCompoundRequirement(), and ActOnTypeConstraint().
QualType Sema::BuildTypeofExprType | ( | Expr * | E, |
TypeOfKind | Kind | ||
) |
Definition at line 9591 of file SemaType.cpp.
References Context, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), E, 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 ConvertDeclSpecToType(), and clang::TreeTransform< Derived >::RebuildTypeOfExprType().
concepts::TypeRequirement * Sema::BuildTypeRequirement | ( | concepts::Requirement::SubstitutionDiagnostic * | SubstDiag | ) |
Definition at line 9506 of file SemaExprCXX.cpp.
References Context.
concepts::TypeRequirement * Sema::BuildTypeRequirement | ( | TypeSourceInfo * | Type | ) |
Definition at line 9501 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 6026 of file SemaExprCXX.cpp.
References CheckTypeTraitArity(), CheckUnaryTypeTraitTypeCompleteness(), Context, clang::TypeTraitExpr::Create(), clang::Dependent, EvaluateBooleanTypeTrait(), clang::ExprError(), clang::ASTContext::getLogicalOperationType(), GetReturnType(), clang::getTypeTraitArity(), clang::Result, and clang::UTT_Last.
Referenced by ActOnTypeTrait(), and clang::TreeTransform< Derived >::RebuildTypeTrait().
ExprResult Sema::BuildUnaryOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
UnaryOperatorKind | Opc, | ||
Expr * | Input, | ||
bool | IsAfterAmp = false |
||
) |
Definition at line 15777 of file SemaExpr.cpp.
References clang::SemaPseudoObject::checkIncDec(), CheckPlaceholderExpr(), clang::CPlusPlus, CreateBuiltinUnaryOp(), CreateOverloadedUnaryOp(), clang::ExprError(), clang::Type::getAsPlaceholderType(), getLangOpts(), clang::UnaryOperator::getOverloadedOperator(), clang::Expr::getType(), clang::UnaryOperator::isIncrementDecrementOp(), clang::Type::isOverloadableType(), isQualifiedMemberAccess(), LookupOverloadedOperatorName(), clang::OO_None, PseudoObject(), and clang::Result.
Referenced by clang::SemaOpenMP::ActOnOpenMPCanonicalLoop(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), ActOnPostfixUnaryOp(), ActOnUnaryOp(), buildDistanceFunc(), buildLoopVarFunc(), RebuildForRangeWithDereference(), rebuildPotentialResultsAsNonOdrUsed(), and clang::TreeTransform< Derived >::RebuildUnaryOperator().
QualType Sema::BuildUnaryTransformType | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9963 of file SemaType.cpp.
References BuiltinAddPointer(), BuiltinAddReference(), BuiltinChangeCVRQualifiers(), BuiltinChangeSignedness(), BuiltinDecay(), BuiltinEnumUnderlyingType(), BuiltinRemoveExtent(), BuiltinRemovePointer(), BuiltinRemoveReference(), Context, clang::ASTContext::getUnaryTransformType(), clang::Type::isDependentType(), Loc, and clang::Result.
Referenced by ConvertDeclSpecToType(), and clang::TreeTransform< Derived >::RebuildUnaryTransformType().
ExprResult Sema::BuildUnresolvedCoawaitExpr | ( | SourceLocation | KwLoc, |
Expr * | Operand, | ||
UnresolvedLookupExpr * | Lookup | ||
) |
Definition at line 876 of file SemaCoroutine.cpp.
References applySafeElideContext(), BuildOperatorCoawaitCall(), buildPromiseCall(), BuildResolvedCoawaitExpr(), checkCoroutineContext(), CheckPlaceholderExpr(), Context, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsCXXRecordDecl(), getCurFunctionDecl(), clang::Expr::getType(), isAttributedCoroAwaitElidable(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, and lookupMember().
Referenced by ActOnCoawaitExpr(), clang::TreeTransform< Derived >::RebuildCoawaitExpr(), and clang::TreeTransform< Derived >::RebuildDependentCoawaitExpr().
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 12737 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::LookupResult::addDecl(), clang::AS_public, clang::LookupResult::begin(), BuildUsingShadowDecl(), CheckInheritingConstructorUsingDecl(), CheckUsingDeclQualifier(), CheckUsingDeclRedeclaration(), CheckUsingShadowDecl(), computeDeclContext(), Context, CorrectTypo(), clang::CPlusPlus14, clang::UsingDecl::Create(), clang::UnresolvedUsingValueDecl::Create(), clang::UnresolvedUsingTypenameDecl::Create(), clang::UnresolvedUsingIfExistsDecl::Create(), clang::FixItHint::CreateInsertion(), CTK_ErrorRecovery, CurContext, clang::DeclarationName::CXXConstructorName, D, clang::ASTContext::DeclarationNames, clang::SemaBase::Diag(), diagnoseTypo(), E, clang::LookupResult::empty(), clang::LookupResult::end(), FilterUsingLookup(), clang::DeclarationName::getAsIdentifierInfo(), clang::LookupResult::getAsSingle(), clang::CXXScopeSpec::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXConstructorName(), clang::NamedDecl::getDeclName(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::DeclarationNameInfo::getName(), clang::DeclarationName::getNameKind(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::ASTContext::getRecordType(), clang::CXXScopeSpec::getScopeRep(), getSourceManager(), clang::NestedNameSpecifierLoc::getSourceRange(), clang::ASTContext::getTypeDeclType(), clang::CXXScopeSpec::getWithLocInContext(), clang::Invalid, clang::LookupResult::isAmbiguous(), clang::RecordDecl::isInjectedClassName(), clang::CXXScopeSpec::isInvalid(), clang::DeclContext::isRecord(), clang::DeclContext::isStdNamespace(), clang::SourceLocation::isValid(), LookupConstructors(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), LookupUsingDeclName, clang::SemaBase::PDiag(), Previous, ProcessDeclAttributeList(), RequireCompleteDeclContext(), clang::LookupResult::resolveKind(), clang::Decl::setAccess(), clang::LookupResult::setBaseObjectType(), clang::LookupResult::setHideTags(), clang::Decl::setInvalidDecl(), clang::DeclarationNameInfo::setName(), clang::DeclarationNameInfo::setNamedTypeInfo(), and clang::LookupResult::suppressDiagnostics().
Referenced by ActOnUsingDeclaration().
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 12994 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), BuildUsingShadowDecl(), CheckUsingShadowDecl(), Context, clang::UsingEnumDecl::Create(), CurContext, D, clang::SemaBase::Diag(), clang::EnumDecl::enumerators(), FilterUsingLookup(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), clang::Invalid, clang::DeclContext::isRecord(), LookupName(), LookupOrdinaryName, LookupUsingDeclName, Previous, RequireCompleteEnumDecl(), clang::Decl::setAccess(), and clang::Decl::setInvalidDecl().
Referenced by ActOnUsingEnumDeclaration().
NamedDecl * Sema::BuildUsingPackDecl | ( | NamedDecl * | InstantiatedFrom, |
ArrayRef< NamedDecl * > | Expansions | ||
) |
Definition at line 13050 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 12555 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::BaseUsingDecl::addShadowDecl(), Context, clang::UsingShadowDecl::Create(), clang::ConstructorUsingShadowDecl::Create(), CurContext, clang::Decl::getAccess(), clang::Decl::getLocation(), clang::Decl::isInvalidDecl(), isVirtualDirectBase(), PushOnScopeChains(), clang::Decl::setAccess(), clang::Decl::setInvalidDecl(), clang::Redeclarable< decl_type >::setPreviousDecl(), and clang::Target.
Referenced by BuildUsingDeclaration(), BuildUsingEnumDeclaration(), and clang::TemplateDeclInstantiator::VisitBaseUsingDecls().
ExprResult Sema::BuildVAArgExpr | ( | SourceLocation | BuiltinLoc, |
Expr * | E, | ||
TypeSourceInfo * | TInfo, | ||
SourceLocation | RPLoc | ||
) |
Definition at line 16502 of file SemaExpr.cpp.
References clang::TargetInfo::CharPtrBuiltinVaList, CheckForModifiableLvalue(), Context, clang::CPlusPlus, CUDA(), CurContext, clang::Device, clang::SemaBase::Diag(), DiagRuntimeBehavior(), clang::ASTContext::DoubleTy, E, clang::ExprError(), clang::ASTContext::getArrayDecayedType(), clang::Type::getAs(), clang::TypeLoc::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::ASTContext::getBuiltinMSVaListType(), clang::TargetInfo::getBuiltinVaListKind(), clang::ASTContext::getBuiltinVaListType(), clang::ASTContext::getCorrespondingSignedType(), clang::ASTContext::getCorrespondingUnsignedType(), getLangOpts(), clang::ASTContext::getLValueReferenceType(), clang::QualType::getNonLValueExprType(), clang::ASTContext::getPromotedIntegerType(), clang::Stmt::getSourceRange(), clang::TypeLoc::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Global, clang::TargetInfo::hasBuiltinMSVaList(), clang::ASTContext::hasSameType(), clang::HostDevice, clang::SemaCUDA::IdentifyTarget(), clang::Init, clang::InitializedEntity::InitializeParameter(), clang::Type::isArrayType(), clang::Type::isBooleanType(), clang::Type::isDependentType(), clang::QualType::isNull(), clang::Type::isObjCLifetimeType(), clang::QualType::isPODType(), clang::ASTContext::isPromotableIntegerType(), clang::Type::isRecordType(), clang::Type::isSpecificBuiltinType(), clang::Expr::isTypeDependent(), clang::Type::isUnsignedIntegerType(), OpenMP(), clang::SemaBase::PDiag(), PerformCopyInitialization(), RequireCompleteType(), RequireNonAbstractType(), clang::Result, clang::T, targetDiag(), clang::ASTContext::typesAreCompatible(), and UsualUnaryConversions().
Referenced by ActOnVAArg(), and clang::TreeTransform< Derived >::RebuildVAArgExpr().
void Sema::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.
Sets basic variable data and decides whether to postpone the variable instantiation.
Definition at line 5388 of file SemaTemplateInstantiateDecl.cpp.
References clang::DeclContext::addHiddenDecl(), CheckVariableDeclaration(), Context, CurrentInstantiationScope, DiagnoseUnusedDecl(), FindInstantiatedDecl(), 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 5310 of file SemaTemplateInstantiateDecl.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::TemplateArgumentList::asArray(), clang::Decl::getDeclContext(), clang::VarDecl::getDescribedVarTemplate(), clang::Redeclarable< decl_type >::getFirstDecl(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), VarTemplate, and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
Referenced by CheckVarTemplateId().
ExprResult Sema::BuildVectorLiteral | ( | SourceLocation | LParenLoc, |
SourceLocation | RParenLoc, | ||
Expr * | E, | ||
TypeSourceInfo * | TInfo | ||
) |
Build an altivec or OpenCL literal.
Definition at line 7810 of file SemaExpr.cpp.
References BuildCompoundLiteralExpr(), BuildCStyleCastExpr(), clang::Type::castAs(), CheckAltivecInitFromScalar(), Context, DefaultLvalueConversion(), clang::SemaBase::Diag(), E, clang::ExprError(), clang::Generic, clang::VectorType::getElementType(), clang::Expr::getExprLoc(), getLangOpts(), clang::VectorType::getNumElements(), clang::Stmt::getSourceRange(), clang::TypeSourceInfo::getType(), clang::VectorType::getVectorKind(), ImpCastExprToType(), clang::Type::isVectorType(), OpenCL(), PrepareScalarCast(), clang::Expr::setType(), and ShouldSplatAltivecScalarInCast().
Referenced by ActOnCastExpr().
QualType Sema::BuildVectorType | ( | QualType | T, |
Expr * | VecSize, | ||
SourceLocation | AttrLoc | ||
) |
Definition at line 2327 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, CheckBitIntElementType(), 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(), and clang::Expr::isValueDependent().
Referenced by HandleVectorSizeAttr(), and 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 1936 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 9799 of file SemaType.cpp.
References BuildPointerType(), clang::QualType::getNonReferenceType(), clang::QualType::isReferenceable(), clang::Type::isVoidType(), Loc, and Pointer.
Referenced by BuildUnaryTransformType(), and BuiltinDecay().
QualType Sema::BuiltinAddReference | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9832 of file SemaType.cpp.
References BuildReferenceType(), clang::QualType::isReferenceable(), LangOpts, Loc, and clang::Reference.
Referenced by BuildUnaryTransformType().
QualType Sema::BuiltinChangeCVRQualifiers | ( | QualType | BaseType, |
UTTKind | UKind, | ||
SourceLocation | Loc | ||
) |
Definition at line 9870 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 9937 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().
BuiltinConstantArg - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression.
Definition at line 5442 of file SemaChecking.cpp.
References Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::CallExpr::getCallee(), clang::DeclRefExpr::getDecl(), clang::NamedDecl::getDeclName(), clang::Expr::getIntegerConstantExpr(), clang::Stmt::getSourceRange(), clang::Expr::IgnoreParenCasts(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.
Referenced by BuiltinConstantArgMultiple(), BuiltinConstantArgPower2(), BuiltinConstantArgRange(), BuiltinConstantArgShiftedByte(), BuiltinConstantArgShiftedByteOrXXFF(), clang::SemaX86::CheckBuiltinGatherScatterScale(), clang::SemaX86::CheckBuiltinRoundingOrSAE(), clang::SemaX86::CheckBuiltinTileDuplicate(), clang::SemaARM::CheckImmediateArg(), clang::SemaRISCV::CheckLMUL(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), and ValueIsRunOfOnes().
BuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression is a multiple of Num.
Definition at line 5489 of file SemaChecking.cpp.
References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Num, and clang::Result.
Referenced by clang::SemaHexagon::CheckHexagonBuiltinArgument(), clang::SemaARM::CheckImmediateArg(), and clang::SemaMIPS::CheckMipsBuiltinArgument().
BuiltinConstantArgPower2 - Check if argument ArgNum of TheCall is a constant expression representing a power of 2.
Definition at line 5509 of file SemaChecking.cpp.
References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.
Referenced by clang::SemaPPC::CheckPPCBuiltinFunctionCall().
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 5458 of file SemaChecking.cpp.
References BuiltinConstantArg(), clang::SemaBase::Diag(), DiagRuntimeBehavior(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), isConstantEvaluatedContext(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::SemaBase::PDiag(), clang::Result, and toString().
Referenced by clang::SemaARM::BuiltinARMMemoryTaggingCall(), clang::SemaARM::BuiltinARMSpecialReg(), clang::SemaPPC::BuiltinPPCMMACall(), clang::SemaARM::CheckAArch64BuiltinFunctionCall(), clang::SemaARM::CheckARMBuiltinFunctionCall(), clang::SemaRISCV::CheckBuiltinFunctionCall(), clang::SemaX86::CheckBuiltinFunctionCall(), clang::SemaX86::CheckBuiltinTileArgumentsRange(), clang::SemaHexagon::CheckHexagonBuiltinArgument(), clang::SemaARM::CheckImmediateArg(), clang::SemaLoongArch::CheckLoongArchBuiltinFunctionCall(), clang::SemaMIPS::CheckMipsBuiltinArgument(), clang::SemaPPC::CheckPPCBuiltinFunctionCall(), and clang::SemaSystemZ::CheckSystemZBuiltinFunctionCall().
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 5552 of file SemaChecking.cpp.
References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), IsShiftedByte(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.
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 5576 of file SemaChecking.cpp.
References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), IsShiftedByte(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.
QualType Sema::BuiltinDecay | ( | QualType | BaseType, |
SourceLocation | Loc | ||
) |
Definition at line 9816 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(), and builtinCommonTypeImpl().
Definition at line 14672 of file SemaChecking.cpp.
References checkArgCount(), checkFPMathBuiltinElementType(), checkMathBuiltinElementType(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CallExpr::setArg(), clang::Expr::setType(), and UsualUnaryConversions().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
QualType Sema::BuiltinEnumUnderlyingType | ( | QualType | BaseType, |
SourceLocation | Loc | ||
) |
Definition at line 9780 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 9844 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 9808 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 9855 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 5115 of file SemaChecking.cpp.
References clang::Type::castAs(), Context, clang::SemaBase::Diag(), clang::ExprError(), clang::Generic, clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::CallExpr::getCallee(), clang::CallExpr::getDirectCallee(), clang::CallExpr::getEndLoc(), clang::Stmt::getEndLoc(), clang::Expr::getIntegerConstantExpr(), clang::CallExpr::getNumArgs(), clang::VectorType::getNumElements(), clang::CallExpr::getRParenLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getVectorType(), clang::Type::hasIntegerRepresentation(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Type::isVectorType(), clang::Result, and clang::CallExpr::setArg().
Referenced by clang::TreeTransform< Derived >::RebuildShuffleVectorExpr().
FPOnly | restricts the arguments to floating-point types. |
Definition at line 14639 of file SemaChecking.cpp.
References ACK_Comparison, checkArgCount(), checkFPMathBuiltinElementType(), checkMathBuiltinElementType(), clang::SemaBase::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(), clang::CallExpr::setArg(), and UsualArithmeticConversions().
Referenced by BuiltinVectorToScalarMath().
Definition at line 14626 of file SemaChecking.cpp.
References BuiltinVectorMath(), clang::Type::getAs(), and clang::Expr::setType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
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 762 of file SemaExpr.cpp.
References Context, DefaultLvalueConversion(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getPointerType(), clang::Expr::getType(), ImpCastExprToType(), clang::Type::isFunctionType(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
Referenced by BuildResolvedCallExpr().
|
static |
Definition at line 15930 of file SemaDecl.cpp.
References methodHasName().
Referenced by CheckCoroutineWrapper(), and clang::sema::visitFunctionCallArguments().
|
static |
Definition at line 15934 of file SemaDecl.cpp.
References clang::FunctionDecl::isStatic(), and methodHasName().
Referenced by CheckCoroutineWrapper().
|
static |
Determine whether the callee of a particular function call can throw.
E, D and Loc are all optional.
Definition at line 995 of file SemaExceptionSpec.cpp.
References clang::FunctionProtoType::canThrow(), clang::Type::castAs(), clang::CT_Can, clang::CT_Cannot, D, E, clang::Type::getAs(), clang::Type::getPointeeType(), getPointeeType(), clang::Type::isSpecificPlaceholderType(), Loc, and clang::T.
Referenced by canThrow(), clang::canVarDeclThrow(), and checkNoThrow().
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 15825 of file SemaDecl.cpp.
References D, clang::DeclaratorChunk::Function, GetTypeFromParser(), 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 11058 of file SemaDecl.cpp.
References clang::Decl::getFriendObjectKind(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), and clang::Decl::isLocalExternDecl().
Referenced by MergeFunctionDecl(), and shouldLinkDependentDeclWithPrevious().
bool Sema::CanPerformAggregateInitializationForOverloadResolution | ( | const InitializedEntity & | Entity, |
InitListExpr * | From | ||
) |
Determine whether we can perform aggregate initialization for the purposes of overload resolution.
Definition at line 3469 of file SemaInit.cpp.
References clang::InitializedEntity::getType().
Referenced by TryListConversion().
bool Sema::CanPerformCopyInitialization | ( | const InitializedEntity & | Entity, |
ExprResult | Init | ||
) |
Definition at line 9756 of file SemaInit.cpp.
References clang::InitializationKind::CreateCopy(), clang::Stmt::getBeginLoc(), clang::Init, and clang::Seq.
Referenced by TryListConversion().
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 15849 of file SemaDecl.cpp.
References Consumer, D, clang::Decl::getAsFunction(), and clang::ASTConsumer::shouldSkipFunctionBody().
CanThrowResult clang::Sema::canThrow | ( | const Stmt * | E | ) |
Definition at line 1110 of file SemaExceptionSpec.cpp.
References canCalleeThrow(), clang::canDynamicCastThrow(), clang::canSubStmtsThrow(), canThrow(), clang::canTypeidThrow(), clang::canVarDeclThrow(), clang::LambdaExpr::capture_init_begin(), clang::LambdaExpr::capture_init_end(), Context, clang::CT_Can, clang::CT_Cannot, clang::CT_Dependent, D, E, clang::Type::getAsCXXRecordDecl(), clang::CallExpr::getCallee(), clang::CallExpr::getCalleeDecl(), clang::CXXCatchStmt::getExceptionDecl(), clang::CXXCatchStmt::getHandlerBlock(), clang::ObjCAtCatchStmt::hasEllipsis(), clang::Expr::IgnoreParens(), clang::Init, clang::CXXDestructorDecl::isCalledByDelete(), clang::Type::isDependentType(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::mergeCanThrow(), and clang::Stmt::NoStmtClass.
Referenced by BuildCXXNoexceptExpr(), BuildExprRequirement(), canThrow(), clang::canTypeidThrow(), checkEscapingByref(), and EvaluateBooleanTypeTrait().
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, CurContext, D, DeduceReturnType(), clang::Decl::getAvailability(), getLangOpts(), isUnavailableAlignedAllocationFunction(), and ParsingInitForAutoVars.
Referenced by canRecoverDotPseudoDestructorCallsOnPointerObjects().
bool Sema::CaptureHasSideEffects | ( | const sema::Capture & | From | ) |
Does copying/destroying the captured variable have side effects?
Definition at line 1981 of file SemaLambda.cpp.
References Context, clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), clang::sema::Capture::getCaptureType(), getCurrentThisType(), clang::Type::getPointeeType(), clang::sema::Capture::getVariable(), clang::Init, clang::sema::Capture::isCopyCapture(), clang::sema::Capture::isInitCapture(), clang::sema::Capture::isThisCapture(), and clang::T.
Referenced by DiagnoseUnusedLambdaCapture().
QualType Sema::CheckAdditionOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc, | ||
QualType * | CompLHSTy = nullptr |
||
) |
Definition at line 10939 of file SemaExpr.cpp.
References ACK_Arithmetic, ACK_CompAssign, checkArithmeticNull(), checkArithmeticOnObjCPointer(), checkArithmeticOpPointerOperand(), CheckMatrixElementwiseOperands(), CheckSizelessVectorOperands(), CheckVectorOperands(), Context, clang::CPlusPlus, clang::SemaBase::Diag(), diagnoseArithmeticOnNullPointer(), diagnoseStringPlusChar(), diagnoseStringPlusInt(), clang::ActionResult< PtrTy, Compress >::get(), clang::APValue::getInt(), getLangOpts(), clang::ASTContext::getPromotedIntegerType(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), InvalidOperands(), clang::Type::isAnyPointerType(), clang::Type::isArithmeticType(), clang::Type::isConstantMatrixType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::BinaryOperator::isNullPointerArithmeticExtension(), clang::Expr::isNullPointerConstant(), clang::Type::isObjCObjectPointerType(), isObjCPointer(), clang::Type::isPointerType(), clang::ASTContext::isPromotableBitField(), clang::ASTContext::isPromotableIntegerType(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), Loc, clang::Expr::NPC_ValueDependentIsNotNull, UsualArithmeticConversions(), and clang::Expr::EvalResult::Val.
Referenced by CreateBuiltinBinOp().
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 11109 of file SemaOverload.cpp.
References clang::Function, and Loc.
Referenced by BuildCallExpr(), BuiltinFunctionStart(), CheckAddressOfOperand(), DefaultFunctionArrayConversion(), clang::InitializationSequence::Diagnose(), FinishOverloadedCallExpr(), isExprAnUnaddressableFunction(), IsStandardConversion(), markUnaddressableCandidatesUnviable(), maybeDiagnoseAssignmentToFunction(), and clang::InitializationSequence::Perform().
Sema::AccessResult Sema::CheckAddressOfMemberAccess | ( | Expr * | OvlExpr, |
DeclAccessPair | FoundDecl | ||
) |
Definition at line 1858 of file SemaAccess.cpp.
References AR_accessible, clang::AS_none, clang::AS_public, CheckAccess(), Context, clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::Found, getLangOpts(), clang::OverloadExpr::getNameLoc(), clang::OverloadExpr::getNamingClass(), and clang::Stmt::getSourceRange().
Referenced by clang::InitializationSequence::Perform().
QualType Sema::CheckAddressOfOperand | ( | ExprResult & | Operand, |
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 14159 of file SemaExpr.cpp.
References bool, clang::C99, checkAddressOfFunctionIsAvailable(), CheckPlaceholderExpr(), CheckUseOfCXXMethodAsAddressOfOperand(), clang::Expr::ClassifyLValue(), Context, clang::CPlusPlus, CreateMaterializeTemporaryExpr(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), diagnoseAddressOfInvalidType(), E, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::TargetInfo::getCXXABI(), clang::DeclRefExpr::getDecl(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Expr::getExprLoc(), getLangOpts(), clang::ASTContext::getMemberPointerType(), clang::ASTContext::getObjCObjectPointerType(), clang::Expr::getObjectKind(), clang::DeclContext::getParent(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getPointerType(), getPrimaryDecl(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParens(), clang::isa(), isCompleteType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::TargetCXXABI::isMicrosoft(), clang::Type::isObjCObjectType(), clang::DeclContext::isRecord(), clang::Type::isReferenceType(), isSFINAEContext(), clang::Expr::isTypeDependent(), isUnevaluatedContext(), clang::CXXMethodDecl::isVirtual(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), clang::Type::isWebAssemblyTableType(), LangOpts, clang::Expr::LV_ArrayTemporary, clang::Expr::LV_ClassTemporary, clang::Expr::LV_IncompleteVoidType, clang::Expr::LV_MemberFunction, clang::Expr::LV_Valid, clang::OK_BitField, clang::OK_MatrixComponent, clang::OK_VectorComponent, clang::ASTContext::OverloadTy, clang::FunctionDecl::parameters(), RequireCompleteType(), ResolveSingleFunctionTemplateSpecialization(), clang::SC_Register, clang::T, and clang::ASTContext::UnknownAnyTy.
Referenced by BuiltinAddressof(), and CreateBuiltinUnaryOp().
bool Sema::CheckAlignasTypeArgument | ( | StringRef | KWName, |
TypeSourceInfo * | TInfo, | ||
SourceLocation | OpLoc, | ||
SourceRange | R | ||
) |
Definition at line 4703 of file SemaExpr.cpp.
References CheckUnaryExprOrTypeTraitOperand(), and clang::TypeSourceInfo::getType().
Referenced by ActOnAlignasTypeArgument(), and instantiateDependentAlignedAttr().
void Sema::CheckAlignasUnderalignment | ( | Decl * | D | ) |
Definition at line 4391 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::CharUnits::getQuantity(), clang::ASTContext::getTagDeclType(), clang::ASTContext::getTypeAlignInChars(), clang::Decl::hasAttrs(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isSizelessType(), clang::Decl::specific_attrs(), and clang::ASTContext::toCharUnitsFromBits().
Referenced by ActOnEnumBody(), ActOnFields(), CheckFieldDecl(), and CheckVariableDeclarationType().
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 2532 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().
Referenced by BuildCXXNew().
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 1740 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, CheckAccess(), Context, Diagnose, clang::Found, and getLangOpts().
Referenced by FindAllocationFunctions(), FindDeallocationFunction(), and resolveAllocationOverload().
bool Sema::CheckAltivecInitFromScalar | ( | SourceRange | R, |
QualType | VecTy, | ||
QualType | SrcTy | ||
) |
Definition at line 2713 of file SemaCast.cpp.
References clang::SemaBase::Diag(), clang::LangOptionsBase::GCC, clang::SourceRange::getBegin(), and getLangOpts().
Referenced by BuildVectorLiteral().
bool Sema::CheckAlwaysInlineAttr | ( | const Stmt * | OrigSt, |
const Stmt * | CurSt, | ||
const AttributeCommonInfo & | A | ||
) |
Definition at line 289 of file SemaStmtAttr.cpp.
Referenced by handleAlwaysInlineAttr().
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 680 of file SemaStmt.cpp.
References CurContext, E, clang::ReturnStmt::getRetValue(), clang::IgnoreElidableImplicitConstructorSingleStep(), clang::IgnoreExprNodes(), clang::IgnoreImplicitAsWrittenSingleStep(), clang::DeclContext::isDependentContext(), clang::Expr::isInstantiationDependent(), and clang::ReturnStmt::setRetValue().
Referenced by BuildAttributedStmt().
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 154 of file SemaChecking.cpp.
References clang::Call, checkArgCountAtLeast(), clang::SemaBase::Diag(), clang::SourceRange::getBegin(), and Range.
Referenced by BuiltinAddressof(), BuiltinAlignment(), BuiltinAnnotation(), clang::SemaARM::BuiltinARMMemoryTaggingCall(), BuiltinCallWithStaticChain(), BuiltinElementwiseTernaryMath(), BuiltinFunctionStart(), BuiltinIsWithinLifetime(), BuiltinLaunder(), BuiltinOverflow(), BuiltinPopcountg(), clang::SemaPPC::BuiltinPPCMMACall(), BuiltinPreserveAI(), BuiltinVectorMath(), clang::SemaPPC::BuiltinVSX(), clang::SemaWasm::BuiltinWasmTableCopy(), clang::SemaWasm::BuiltinWasmTableFill(), clang::SemaWasm::BuiltinWasmTableGet(), clang::SemaWasm::BuiltinWasmTableGrow(), clang::SemaWasm::BuiltinWasmTableSet(), clang::SemaWasm::BuiltinWasmTableSize(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), clang::SemaBPF::CheckBPFBuiltinFunctionCall(), clang::SemaOpenCL::checkBuiltinCommitRWPipe(), clang::SemaHLSL::CheckBuiltinFunctionCall(), clang::SemaOpenCL::checkBuiltinKernelWorkGroupSize(), clang::SemaOpenCL::checkBuiltinNDRangeAndBlock(), clang::SemaOpenCL::checkBuiltinPipePackets(), clang::SemaOpenCL::checkBuiltinReserveRWPipe(), clang::SemaOpenCL::checkBuiltinToAddr(), clang::SemaSPIRV::CheckSPIRVBuiltinFunctionCall(), PointerAuthAuthAndResign(), PointerAuthBlendDiscriminator(), PointerAuthSignGenericData(), PointerAuthSignOrAuth(), PointerAuthStrip(), and PrepareBuiltinElementwiseMathOneArgCall().
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 clang::Call, and clang::SemaBase::Diag().
Referenced by BuiltinDumpStruct(), checkArgCount(), checkArgCountRange(), and clang::SemaRISCV::CheckBuiltinFunctionCall().
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 139 of file SemaChecking.cpp.
References clang::Call, and clang::SemaBase::Diag().
Referenced by checkArgCountRange(), clang::SemaRISCV::CheckBuiltinFunctionCall(), and clang::SemaNVPTX::CheckNVPTXBuiltinFunctionCall().
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 148 of file SemaChecking.cpp.
References clang::Call, checkArgCountAtLeast(), and checkArgCountAtMost().
Referenced by BuiltinCountZeroBitsGeneric(), and clang::SemaAMDGPU::checkMovDPPFunctionCall().
bool Sema::CheckArgsForPlaceholders | ( | MultiExprArg | args | ) |
Check an argument list for placeholders that we won't try to handle later.
Definition at line 6199 of file SemaExpr.cpp.
References CheckPlaceholderExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and isPlaceholderToRemoveAsArg().
Referenced by ActOnArraySubscriptExpr(), BuildCallExpr(), and BuildCXXNew().
bool Sema::checkArrayElementAlignment | ( | QualType | EltTy, |
SourceLocation | Loc | ||
) |
Definition at line 2031 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(), and BuildCXXNew().
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 9193 of file SemaExpr.cpp.
References clang::AltiVecBool, clang::AltiVecPixel, clang::AltiVecVector, anyAltivecTypes(), clang::ASTContext::areCompatibleRVVTypes(), clang::ASTContext::areCompatibleSveTypes(), clang::ASTContext::areCompatibleVectorTypes(), clang::ASTContext::areLaxCompatibleRVVTypes(), clang::ASTContext::areLaxCompatibleSveTypes(), clang::ASTContext::BoolTy, clang::C23, CheckAssignmentConstraints(), checkBlockPointerTypesForAssignment(), checkObjCPointerTypesForAssignment(), checkPointerTypesForAssignment(), Compatible, Context, clang::CPlusPlus, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::Expr::getExprLoc(), getLangOpts(), clang::VectorType::getNumElements(), clang::ASTContext::getObjCClassRedefinitionType(), clang::Type::getPointeeType(), getPointeeType(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Expr::getType(), clang::CanQual< T >::getUnqualifiedType(), clang::VectorType::getVectorKind(), clang::ASTContext::hasCvrSimilarType(), clang::ASTContext::hasSameType(), ImpCastExprToType(), Incompatible, IncompatibleObjCWeakRef, IncompatiblePointer, IncompatibleVectors, IntToBlockPointer, IntToPointer, clang::Type::isArithmeticType(), clang::Type::isBlockCompatibleObjCPointerType(), clang::Type::isBlockPointerType(), clang::Type::isEnumeralType(), clang::Type::isExtVectorType(), clang::Type::isIntegerType(), isLaxVectorConversion(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), clang::Type::isObjCClassType(), clang::Type::isObjCIdType(), clang::Type::isObjCObjectPointerType(), clang::Type::isRVVSizelessBuiltinType(), clang::Type::isSamplerT(), clang::Type::isScalarType(), clang::Type::isSVESizelessBuiltinType(), clang::Type::isVectorType(), clang::Type::isVoidPointerType(), maybeExtendBlockObject(), clang::Expr::NPC_ValueDependentIsNull, ObjC(), PointerToInt, PrepareScalarCast(), prepareVectorSplat(), clang::ASTContext::typesAreCompatible(), and unsupportedTypeConversion().
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 9154 of file SemaExpr.cpp.
References CheckAssignmentConstraints(), Loc, and clang::VK_PRValue.
Referenced by clang::SemaObjC::ActOnPropertyImplDecl(), CheckAssignmentConstraints(), CheckAssignmentOperands(), CheckSingleAssignmentConstraints(), CheckTransparentUnionArgumentConstraints(), clang::SemaObjC::DiagnosePropertyAccessorMismatch(), handleCleanupAttr(), and PerformImplicitConversion().
QualType Sema::CheckAssignmentOperands | ( | Expr * | LHSExpr, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
QualType | CompoundType, | ||
BinaryOperatorKind | Opc | ||
) |
Definition at line 13718 of file SemaExpr.cpp.
References clang::Assigning, CheckAssignmentConstraints(), clang::sema::checkAssignmentLifetime(), CheckForModifiableLvalue(), CheckForNullPointerDereference(), CheckIdentityFieldAssignment(), clang::SemaObjC::checkRetainCycles(), CheckSingleAssignmentConstraints(), checkUnsafeExprAssigns(), Compatible, Context, clang::CPlusPlus20, clang::SemaBase::Diag(), DiagnoseAssignmentResult(), Diags, ExprEvalContexts, clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAtomicUnqualifiedType(), clang::Stmt::getBeginLoc(), getCurFunction(), clang::DeclRefExpr::getDecl(), getLangOpts(), clang::SourceLocation::getLocWithOffset(), clang::QualType::getObjCLifetime(), getOpenCLOptions(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Decl::hasAttr(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenCasts(), IncompatiblePointer, clang::SourceLocation::isFileID(), clang::Type::isHalfType(), clang::DiagnosticsEngine::isIgnored(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNonWeakInMRRWithObjCWeak(), clang::QualType::isNull(), clang::ASTContext::isObjCNSObjectType(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjCObjectType(), clang::QualType::isVolatileQualified(), clang::Type::isWebAssemblyTableType(), Loc, clang::sema::FunctionScopeInfo::markSafeWeakUse(), ObjC(), clang::Qualifiers::OCL_Strong, and OpenCL().
Referenced by CreateBuiltinBinOp().
bool Sema::CheckAttrNoArgs | ( | const ParsedAttr & | CurrAttr | ) |
Definition at line 1915 of file SemaDeclAttr.cpp.
References clang::ParsedAttr::checkExactlyNumArgs(), and clang::ParsedAttr::setInvalid().
Referenced by handleFunctionTypeAttr(), and handleNonBlockingNonAllocatingTypeAttr().
bool Sema::CheckAttrTarget | ( | const ParsedAttr & | CurrAttr | ) |
Definition at line 1924 of file SemaDeclAttr.cpp.
References Context, clang::SemaBase::Diag(), clang::ParsedAttr::existsInTarget(), clang::AttributeCommonInfo::getLoc(), clang::AttributeCommonInfo::getRange(), clang::ASTContext::getTargetInfo(), clang::AttributeCommonInfo::isRegularKeywordAttribute(), and clang::ParsedAttr::setInvalid().
Referenced by checkCommonAttributeFeatures(), and handleFunctionTypeAttr().
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 1876 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::AS_public, clang::Type::castAs(), CheckAccess(), CheckEffectiveAccess(), Context, clang::RecordType::getDecl(), getLangOpts(), and Path.
Referenced by buildDeclareReductionRef(), buildUserDefinedMapperRef(), CheckDerivedToBaseConversion(), DiagnoseInvalidExplicitObjectParameterInLambda(), findDecomposableBaseClass(), handlerCanCatch(), and hasUserDefinedMapper().
CXXBaseSpecifier * Sema::CheckBaseSpecifier | ( | CXXRecordDecl * | Class, |
SourceRange | SpecifierRange, | ||
bool | Virtual, | ||
AccessSpecifier | Access, | ||
TypeSourceInfo * | TInfo, | ||
SourceLocation | EllipsisLoc | ||
) |
Check the validity of a C++ base class specifier.
Definition at line 2626 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 13094 of file SemaExpr.cpp.
References ACK_BitwiseOp, ACK_CompAssign, checkArithmeticNull(), CheckSizelessVectorOperands(), CheckVectorOperands(), diagnoseLogicalNotOnLHSofCheck(), diagnoseXorMisusedAsPow(), clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), clang::Type::hasIntegerRepresentation(), InvalidOperands(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isLegalBoolVectorBinaryOp(), clang::QualType::isNull(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), Loc, and UsualArithmeticConversions().
Referenced by CreateBuiltinBinOp().
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 20387 of file SemaExpr.cpp.
References CheckCXXBooleanCondition(), CheckPlaceholderExpr(), clang::CPlusPlus, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), DiagnoseAssignmentAsCondition(), DiagnoseEqualityWithExtraParens(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isScalarType(), clang::Expr::isTypeDependent(), Loc, and clang::T.
Referenced by ActOnCondition(), ActOnDoStmt(), clang::SemaOpenMP::ActOnOpenMPFinalClause(), clang::SemaOpenMP::ActOnOpenMPIfClause(), clang::SemaOpenMP::ActOnOpenMPNocontextClause(), clang::SemaOpenMP::ActOnOpenMPNovariantsClause(), BuildCXXForRangeStmt(), 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 3276 of file SemaChecking.cpp.
References clang::FunctionProtoType::ExtProtoInfo::AArch64SMEAttributes, clang::FunctionType::ARM_None, clang::SemaARM::ArmStreaming, clang::SemaARM::ArmStreamingCompatible, clang::SemaPPC::checkAIXMemberAlignment(), checkLifetimeCaptureBy(), CheckNonNullArguments(), checkVariadicArgument(), clang::Expr::containsErrors(), Context, CurContext, clang::SemaBase::Diag(), diagnoseArgDependentDiagnoseIfAttrs(), clang::getArmStreamingFnType(), clang::FunctionType::getArmZAState(), clang::FunctionType::getArmZT0State(), clang::Decl::getAttr(), clang::FunctionDecl::getBuiltinID(), clang::Expr::getExprLoc(), clang::FunctionProtoType::getExtProtoInfo(), clang::NamedDecl::getFormalLinkage(), clang::ASTContext::getFunctionFeatureMap(), clang::Decl::getFunctionType(), clang::APValue::getInt(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::FunctionType::getReturnType(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::TargetInfo::hasFeature(), clang::NamedDecl::hasLinkage(), clang::Internal, clang::DeclContext::isDependentContext(), clang::Type::isSizelessVectorType(), Loc, MaximumAlignment, PPC(), Range, clang::FunctionType::SME_PStateSMCompatibleMask, clang::FunctionType::SME_PStateSMEnabledMask, clang::Decl::specific_attrs(), clang::Expr::EvalResult::Val, and VariadicDoesNotApply.
Referenced by BuildCXXNew(), CheckFunctionCall(), and clang::SemaObjC::CheckObjCMethodCall().
bool 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
.
Definition at line 5124 of file SemaDeclAttr.cpp.
References clang::CC_AAPCS, clang::CC_AAPCS_VFP, clang::CC_AArch64SVEPCS, clang::CC_AArch64VectorCall, clang::CC_AMDGPUKernelCall, clang::CC_C, clang::CC_IntelOclBicc, clang::CC_M68kRTD, clang::CC_PreserveAll, clang::CC_PreserveMost, clang::CC_PreserveNone, clang::CC_RISCVVectorCall, clang::CC_Swift, clang::CC_SwiftAsync, clang::CC_Win64, clang::CC_X86_64SysV, clang::CC_X86FastCall, clang::CC_X86Pascal, clang::CC_X86RegCall, clang::CC_X86StdCall, clang::CC_X86ThisCall, clang::CC_X86VectorCall, clang::TargetInfo::CCCR_Error, clang::TargetInfo::CCCR_Ignore, clang::TargetInfo::CCCR_OK, clang::TargetInfo::CCCR_Warning, clang::TargetInfo::checkCallingConvention(), clang::ParsedAttr::checkExactlyNumArgs(), checkStringLiteralArgumentAttr(), Context, CUDA(), clang::Device, clang::SemaBase::Diag(), ForThisTarget, clang::ASTContext::getAuxTargetInfo(), clang::ASTContext::getDefaultCallingConvention(), clang::ParsedAttr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getProcessingCache(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Global, clang::ParsedAttr::hasProcessingCache(), clang::Host, clang::HostDevice, clang::SemaCUDA::IdentifyTarget(), int, clang::InvalidTarget, clang::NamedDecl::isCXXInstanceMember(), clang::ParsedAttr::isInvalid(), clang::FunctionDecl::isVariadic(), LangOpts, clang::ParsedAttr::setInvalid(), and clang::ParsedAttr::setProcessingCache().
Referenced by getCCForDeclaratorChunk(), handleCallConvAttr(), and handleFunctionTypeAttr().
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 20259 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), clang::Sema::ExpressionEvaluationContextRecord::EK_Decltype, ExprEvalContexts, clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), clang::Type::isIncompleteType(), clang::Type::isVoidType(), Loc, RequireCompleteType(), and clang::T.
Referenced by ActOnDecltypeExpression(), and BuildResolvedCallExpr().
Definition at line 21160 of file SemaExpr.cpp.
References Context, E, clang::Expr::getType(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegralOrEnumerationType(), 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 13371 of file SemaChecking.cpp.
References Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::SourceRange::getBegin(), getDiagnostics(), clang::PointerType::getPointeeType(), getPresumedAlignmentOfPointer(), clang::CharUnits::getQuantity(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::CharUnits::isOne(), and clang::T.
void Sema::checkClassLevelCodeSegAttribute | ( | CXXRecordDecl * | Class | ) |
Definition at line 6367 of file SemaDeclCXX.cpp.
References clang::Class, and getImplicitCodeSegOrSectionAttrForFunction().
Referenced by CheckCompletedCXXClass().
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 6377 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 CheckCompletedCXXClass(), dllExportImportClassTemplateSpecialization(), and 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 1799 of file SemaTemplate.cpp.
References ActOnDocumentableDecl(), AddAlignmentAttributesForRecord(), clang::DeclContext::addDecl(), AddMsStructLayoutForRecord(), AddPushedVisibilityAttribute(), clang::AS_none, clang::AS_public, CheckRedeclarationInModule(), CheckTemplateDeclScope(), CheckTemplateParameterList(), computeDeclContext(), Context, clang::ClassTemplateDecl::Create(), clang::FriendDecl::Create(), clang::CXXRecordDecl::Create(), clang::FixItHint::CreateReplacement(), CurContext, clang::Definition, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), diagnoseQualifiedDeclaration(), DiagnoseTemplateParameterShadow(), clang::DeclContext::Encloses(), EnterTemplatedContext(), clang::Enum, clang::DeclContext::Equals(), forRedeclarationInCurContext(), clang::Friend, clang::Decl::getAccess(), clang::Decl::getDeclContext(), clang::RecordDecl::getDefinition(), clang::Scope::getFlags(), clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::ASTContext::getInjectedClassNameType(), clang::ClassTemplateDecl::getInstantiatedFromMemberTemplate(), clang::TagDecl::getKindName(), clang::Decl::getLocation(), clang::DeclContext::getLookupParent(), clang::Scope::getParent(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), getScopeForDeclContext(), clang::CXXScopeSpec::getScopeRep(), clang::TagDecl::getTagKind(), clang::TypeWithKeyword::getTagTypeKindForTypeSpec(), clang::ClassTemplateDecl::getTemplatedDecl(), GetTemplateParameterList(), clang::TemplateDecl::getTemplateParameters(), hasVisibleDefinition(), inferGslOwnerPointerAttribute(), inferNullableClassAttribute(), clang::Invalid, isAcceptableTagRedeclaration(), isDeclInScope(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::CXXScopeSpec::isEmpty(), clang::DeclContext::isFileContext(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isNotEmpty(), clang::DeclContext::isRecord(), clang::CXXScopeSpec::isSet(), clang::Decl::isTemplateParameter(), clang::DeclContext::isTransparentContext(), clang::SourceLocation::isValid(), clang::CXXScopeSpec::isValid(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), LookupTagName, clang::DeclContext::makeDeclVisibleInContext(), makeMergedDefinitionVisible(), mergeDeclAttributes(), clang::SkipBodyInfo::Previous, Previous, ProcessDeclAttributeList(), PushOnScopeChains(), RebuildTemplateParamsInCurrentInstantiation(), clang::Reference, RequireCompleteDeclContext(), clang::Decl::setAccess(), clang::CXXRecordDecl::setDescribedClassTemplate(), clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), SetMemberAccessSpecifier(), clang::RedeclarableTemplateDecl::setMemberSpecialization(), clang::NamedDecl::setModulePrivate(), SetNestedNameSpecifier(), clang::Decl::setObjectOfFriendDecl(), clang::Redeclarable< decl_type >::setPreviousDecl(), clang::TagDecl::setTemplateParameterListsInfo(), clang::SkipBodyInfo::ShouldSkip, clang::TemplateParameterList::size(), clang::TagDecl::startDefinition(), clang::T, TemplateParameterListsAreEqual(), clang::Scope::TemplateParamScope, TPC_ClassTemplate, TPC_ClassTemplateMember, TPC_FriendClassTemplate, and TPL_TemplateMatch.
Referenced by ActOnClassTemplateSpecialization(), ActOnTag(), and ActOnTemplatedFriendTag().
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 1561 of file SemaAttr.cpp.
References D.
Referenced by ProcessDeclAttribute(), and ProcessStmtAttribute().
bool Sema::checkCommonAttributeFeatures | ( | const Stmt * | S, |
const ParsedAttr & | A, | ||
bool | SkipArgCountCheck = false |
||
) |
Definition at line 1565 of file SemaAttr.cpp.
QualType Sema::CheckCompareOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc | ||
) |
Definition at line 12194 of file SemaExpr.cpp.
References clang::ASTContext::areComparableObjCPointerTypes(), clang::Type::castAs(), checkArithmeticNull(), checkArithmeticOrEnumeralCompare(), CheckComparisonCategoryType(), clang::SemaObjC::CheckObjCConversion(), CheckPtrComparisonWithNullChar(), CheckSizelessVectorCompareOperands(), CheckVectorCompareOperands(), Context, convertPointersToCompositeType(), clang::CPlusPlus, CurContext, DefaultFunctionArrayLvalueConversion(), DefaultLvalueConversion(), clang::SemaBase::Diag(), DiagnoseAlwaysNonNullPointer(), diagnoseDistinctPointerComparison(), diagnoseFunctionPointerToVoidComparison(), diagnoseLogicalNotOnLHSofCheck(), diagnoseObjCLiteralComparison(), diagnoseTautologicalComparison(), E, clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), getASTContext(), clang::QualType::getCanonicalType(), clang::getComparisonCategoryForBuiltinCmp(), getLangOpts(), clang::ASTContext::getLogicalOperationType(), clang::DeclContext::getParent(), clang::Type::getPointeeType(), clang::PointerType::getPointeeType(), getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), ImpCastExprToType(), clang::Implicit, InvalidOperands(), clang::QualType::isAddressSpaceOverlapping(), clang::Type::isAnyPointerType(), clang::Type::isArithmeticType(), clang::Type::isBlockCompatibleObjCPointerType(), clang::Type::isBlockPointerType(), clang::Type::isClkEventT(), clang::Type::isEnumeralType(), clang::BinaryOperator::isEqualityOp(), clang::Type::isFunctionPointerType(), clang::Type::isFunctionType(), clang::Type::isIncompleteType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMemberPointerType(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), isObjCObjectLiteral(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Type::isQueueT(), clang::Type::isReferenceType(), clang::BinaryOperator::isRelationalOp(), isSFINAEContext(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), clang::Type::isVoidPointerType(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), LangOpts, Loc, clang::Expr::NPC_ValueDependentIsNull, clang::Expr::NPCK_NotNull, ObjC(), OpenCL(), OperatorInExpression, and clang::ASTContext::typesAreCompatible().
Referenced by CreateBuiltinBinOp().
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 11786 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::ASTContext::CompCategories, Context, clang::CPlusPlus, clang::NestedNameSpecifier::Create(), clang::SemaBase::Diag(), 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.
Referenced by checkArithmeticOrEnumeralThreeWayCompare(), CheckCompareOperands(), and CheckExplicitlyDefaultedComparison().
void Sema::CheckCompatibleReinterpretCast | ( | QualType | SrcType, |
QualType | DestType, | ||
bool | IsDereference, | ||
SourceRange | Range | ||
) |
Definition at line 2050 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.
Referenced by CheckIndirectionOperand().
void Sema::CheckCompletedCoroutineBody | ( | FunctionDecl * | FD, |
Stmt *& | Body | ||
) |
Definition at line 1143 of file SemaCoroutine.cpp.
References Context, clang::CoroutineBodyStmt::Create(), clang::SemaBase::Diag(), clang::AddrLabelExpr::getBeginLoc(), getCurFunction(), clang::Decl::getLocation(), clang::Decl::hasAttr(), clang::Decl::isInvalidDecl(), and clang::Decl::setInvalidDecl().
Referenced by ActOnFinishFunctionBody().
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 6829 of file SemaDeclCXX.cpp.
References clang::TargetCXXABI::areArgsDestroyedLeftToRightInCallee(), clang::AS_public, clang::Sema::DefaultedFunctionKind::asComparison(), clang::CXXRecordDecl::bases(), clang::DeclContextLookupResult::begin(), clang::CanNeverPassInRegs, clang::CannotPassInRegs, canPassInRegisters(), clang::CanPassInRegs, CheckAbstractClassUsage(), checkClassLevelCodeSegAttribute(), checkClassLevelDLLAttribute(), checkCUDADeviceBuiltinSurfaceClassTemplate(), checkCUDADeviceBuiltinTextureClassTemplate(), CheckExplicitlyDefaultedFunction(), checkIllFormedTrivialABIStruct(), checkIncorrectVTablePointerAuthenticationAttribute(), Context, clang::CopyConstructor, clang::FixItHint::CreateInsertion(), CUDA(), D, clang::DefaultConstructor, DefineDefaultedFunction(), DelayedDllExportMemberFunctions, clang::Destructor, clang::SemaBase::Diag(), DiagnoseAbsenceOfOverrideControl(), DiagnoseAbstractType(), DiagnoseDeletedDefaultedFunction(), DiagnoseHiddenVirtualMethods(), E, clang::DeclContextLookupResult::end(), clang::RecordDecl::fields(), clang::Decl::getAccess(), clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), clang::TargetInfo::getCallingConvKind(), clang::QualType::getCanonicalType(), clang::TargetInfo::getCXXABI(), getDefaultedFunctionKind(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::ASTContext::getRecordType(), getSpecialMember(), clang::FunctionDecl::getStorageClass(), clang::ASTContext::getTargetInfo(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::CXXRecordDecl::hasConstexprDestructor(), clang::Incomplete, clang::Invalid, clang::TagDecl::isCompleteDefinition(), clang::FunctionDecl::isDeleted(), clang::Decl::isInvalidDecl(), clang::CXXMethodDecl::isVirtual(), MarkVTableUsed(), clang::MoveConstructor, clang::LangOptionsBase::MSVC2015, NotEqual, Relational, ReportOverrides(), clang::SC_Static, SpecialMemberIsTrivial(), clang::T, TAH_ConsiderTrivialABI, V, and clang::LangOptionsBase::Ver4.
Referenced by ActOnFinishCXXMemberSpecification(), ActOnLambdaError(), BuildLambdaExpr(), and InstantiateClass().
void Sema::CheckCompleteDecompositionDeclaration | ( | DecompositionDecl * | DD | ) |
Definition at line 1520 of file SemaDeclCXX.cpp.
References clang::DecompositionDecl::bindings(), checkArrayDecomposition(), checkComplexDecomposition(), checkMemberDecomposition(), checkTupleLikeDecomposition(), checkVectorDecomposition(), Context, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), 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().
Referenced by CheckCompleteVariableDeclaration().
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 14255 of file SemaDeclCXX.cpp.
References Context, clang::Destructor, clang::TargetInfo::getCXXABI(), clang::CXXRecordDecl::getNumVBases(), clang::ASTContext::getTargetInfo(), clang::TargetCXXABI::isMicrosoft(), and MarkVirtualBaseDestructorsReferenced().
Referenced by MarkFunctionReferenced().
void Sema::CheckCompleteVariableDeclaration | ( | VarDecl * | VD | ) |
Definition at line 14304 of file SemaDecl.cpp.
References clang::sema::FunctionScopeInfo::addByrefBlockVar(), clang::ASTContext::addModuleInitializer(), clang::AttributeCommonInfo::AS_Declspec, BSSSegStack, clang::C23, CheckCompleteDecompositionDeclaration(), ConstSegStack, Context, clang::CPlusPlus, clang::CPlusPlus11, clang::FixItHint::CreateInsertion(), CUDA(), CurInitSeg, CurInitSegLoc, DataSegStack, clang::ASTContext::DeclMustBeEmitted(), clang::SemaBase::Diag(), clang::QualType::DK_nontrivial_c_struct, FinalizeVarWithDestructor(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), getCurFunction(), getDiagnostics(), clang::Expr::getExprLoc(), getLangOpts(), clang::Attr::getLocation(), clang::Preprocessor::getLocForEndOfToken(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::AttributeCommonInfo::getRange(), clang::Stmt::getSourceRange(), clang::StringLiteral::getString(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::Init, int, inTemplateInstantiation(), clang::isTemplateInstantiation(), clang::VarDecl::isThisDeclarationADefinition(), clang::SemaCUDA::MaybeAddConstantAttr(), clang::QualType::NonTrivialCtor, ObjC(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, OpenCL(), clang::SemaBase::PDiag(), PP, clang::ASTContext::PSF_Implicit, clang::ASTContext::PSF_Read, clang::ASTContext::PSF_Write, clang::ast_matchers::recordType, clang::SC_Register, setFunctionHasBranchProtectedScope(), clang::VarDecl::TLS_Static, clang::ast_matchers::type, and UnifySection().
Referenced by ActOnEndOfTranslationUnit(), ActOnUninitializedDecl(), AddInitializerToDecl(), buildCoroutinePromise(), and checkTupleLikeDecomposition().
void Sema::CheckConceptRedefinition | ( | ConceptDecl * | NewDecl, |
LookupResult & | Previous, | ||
bool & | AddToScope | ||
) |
Definition at line 8791 of file SemaTemplate.cpp.
References Context, clang::SemaBase::Diag(), clang::ConceptDecl::getCanonicalDecl(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), hasReachableDefinition(), IsRedefinitionInModule(), clang::ASTContext::isSameEntity(), notePreviousDefinition(), Previous, and clang::ASTContext::setPrimaryMergedDecl().
Referenced by ActOnFinishConceptDefinition().
ExprResult Sema::CheckConceptTemplateId | ( | const CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
const DeclarationNameInfo & | ConceptNameInfo, | ||
NamedDecl * | FoundDecl, | ||
ConceptDecl * | NamedConcept, | ||
const TemplateArgumentListInfo * | TemplateArgs | ||
) |
Definition at line 4551 of file SemaTemplate.cpp.
References clang::TemplateSpecializationType::anyDependentTemplateArguments(), CheckConstraintSatisfaction(), CheckTemplateArgumentList(), Context, clang::ConceptSpecializationExpr::Create(), clang::ASTTemplateArgumentListInfo::Create(), clang::ImplicitConceptSpecializationDecl::Create(), clang::ConceptReference::Create(), DiagnoseUseOfDecl(), clang::ExprError(), clang::CXXScopeSpec::getBeginLoc(), clang::ConceptDecl::getConstraintExpr(), clang::Decl::getDeclContext(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::TemplateArgumentListInfo::getRAngleLoc(), clang::CXXScopeSpec::getWithLocInContext(), clang::Decl::isInvalidDecl(), clang::CXXScopeSpec::isSet(), and Unevaluated.
Referenced by BuildTemplateIdExpr(), formImmediatelyDeclaredConstraint(), and clang::TreeTransform< Derived >::RebuildConceptSpecializationExpr().
bool Sema::CheckConceptUseInDefinition | ( | ConceptDecl * | Concept, |
SourceLocation | Loc | ||
) |
Definition at line 8833 of file SemaTemplate.cpp.
References Concept, clang::SemaBase::Diag(), and Loc.
Referenced by CheckTypeConstraint(), and DiagnoseUseOfDecl().
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 8403 of file SemaExpr.cpp.
References ACK_Conditional, checkBlockType(), checkCondition(), checkConditionalBlockPointerCompatibility(), checkConditionalNullPointer(), checkConditionalObjectPointersCompatibility(), CheckPlaceholderExpr(), checkPointerIntegerMismatch(), CheckVectorOperands(), clang::Expr::containsErrors(), Context, clang::CPlusPlus, CXXCheckConditionalOperands(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), DiagnoseConditionalForNull(), clang::SemaObjC::FindCompositeObjCPointerType(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::ASTContext::getCommonSugaredType(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), ImpCastExprToType(), clang::Type::isArithmeticType(), clang::Type::isBitIntType(), clang::Type::isBlockPointerType(), clang::ASTContext::isDependenceAllowed(), clang::Type::isExtVectorType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isNullPtrType(), clang::Type::isPointerType(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::Type::isWebAssemblyTableType(), ObjC(), clang::OK_Ordinary, OpenCL(), OpenCLCheckVectorConditional(), PrepareScalarCast(), unsupportedTypeConversion(), UsualArithmeticConversions(), UsualUnaryConversions(), and clang::VK_PRValue.
Referenced by ActOnConditionalOp(), and builtinCommonTypeImpl().
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 4058 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 1524 of file SemaChecking.cpp.
References Context, clang::SemaBase::Diag(), clang::Expr::getExprLoc(), clang::Expr::getIntegerConstantExpr(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::Result, and clang::TargetInfo::validatePointerAuthKey().
Referenced by checkPointerAuthKey().
bool Sema::CheckConstexprFunctionDefinition | ( | const FunctionDecl * | FD, |
CheckConstexprKind | Kind | ||
) |
Definition at line 1783 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().
Referenced by ActOnFinishFunctionBody(), and BuildLambdaExpr().
void Sema::CheckConstrainedAuto | ( | const AutoType * | AutoT, |
SourceLocation | Loc | ||
) |
Definition at line 3462 of file SemaChecking.cpp.
References DiagnoseUseOfDecl(), clang::AutoType::getTypeConstraintConcept(), and Loc.
Referenced by ActOnTypeName(), and ActOnVariableDeclarator().
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 90 of file SemaConcept.cpp.
References clang::ASTContext::BoolTy, clang::C, CheckConstraintExpression(), Context, clang::CPlusPlus11, clang::SemaBase::Diag(), clang::getBinOpPrecedence(), getCurFunction(), clang::Expr::getExprLoc(), clang::Token::getKind(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::IgnoreParenImpCasts(), clang::Token::is(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isSpecificBuiltinType(), clang::Expr::isTypeDependent(), and clang::prec::LogicalAnd.
Referenced by calculateConstraintSatisfaction(), CheckConstraintExpression(), 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 685 of file SemaConcept.cpp.
References calculateConstraintSatisfaction(), isInvalid(), and PerformContextuallyConvertToBool().
|
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 14375 of file Sema.h.
References CheckConstraintSatisfaction().
Referenced by BuildNestedRequirement(), BuildStaticAssertDeclaration(), CheckConceptTemplateId(), CheckConstraintSatisfaction(), CheckDeducedArgumentConstraints(), CheckDeducedPlaceholderConstraints(), CheckFunctionConstraints(), CheckInstantiatedFunctionTemplateConstraints(), and EnsureTemplateArgumentListConstraints().
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 616 of file SemaConcept.cpp.
References CheckConstraintSatisfaction(), Context, clang::Decl::isInvalidDecl(), clang::ConstraintSatisfaction::IsSatisfied, and clang::ConstraintSatisfaction::Profile().
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 10837 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.
Referenced by ActOnFinishDelayedCXXMethodDeclaration(), and CheckFunctionDeclaration().
Sema::AccessResult Sema::CheckConstructorAccess | ( | SourceLocation | Loc, |
CXXConstructorDecl * | D, | ||
DeclAccessPair | FoundDecl, | ||
const InitializedEntity & | Entity, | ||
bool | IsCopyBindingRefToTemp = false |
||
) |
Checks access to a constructor.
Definition at line 1653 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, CheckConstructorAccess(), clang::InitializedEntity::EK_Base, clang::InitializedEntity::EK_LambdaCapture, clang::InitializedEntity::EK_Member, clang::InitializedEntity::EK_ParenAggInitMember, clang::Found, clang::InitializedEntity::getBaseSpecifier(), clang::InitializedEntity::getCapturedVarName(), clang::InitializedEntity::getDecl(), clang::InitializedEntity::getKind(), getLangOpts(), getSpecialMember(), clang::CXXBaseSpecifier::getType(), clang::InitializedEntity::getType(), clang::InitializedEntity::isInheritedVirtualBase(), and clang::SemaBase::PDiag().
Referenced by BuildCXXCastArgument(), CheckConstructorAccess(), CheckCXX98CompatAccessibleCopy(), CopyObject(), clang::InitializationSequence::Perform(), and PerformConstructorInitialization().
Sema::AccessResult Sema::CheckConstructorAccess | ( | SourceLocation | Loc, |
CXXConstructorDecl * | D, | ||
DeclAccessPair | FoundDecl, | ||
const InitializedEntity & | Entity, | ||
const PartialDiagnostic & | PDiag | ||
) |
Checks access to a constructor.
Definition at line 1699 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, CheckAccess(), Context, CurContext, clang::InitializedEntity::EK_Base, clang::InitializedEntity::EK_Delegating, clang::Found, clang::InitializedEntity::getKind(), getLangOpts(), clang::DeclContext::getParent(), clang::InitializedEntity::getParent(), clang::ASTContext::getTypeDeclType(), and clang::DeclAccessPair::make().
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 10776 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), checkMethodTypeQualifiers(), Context, clang::FixItHint::CreateRemoval(), D, clang::SemaBase::Diag(), diagnoseIgnoredQualifiers(), diagnoseInvalidDeclaratorChunks(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::FunctionProtoType::getParamTypes(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::FunctionType::getReturnType(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::RQ_None, clang::SC_None, clang::SC_Static, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, and clang::ASTContext::VoidTy.
Referenced by CreateNewFunctionDecl().
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 11036 of file SemaDeclCXX.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::Type::castAs(), Context, clang::CPlusPlus11, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateInsertionFromRange(), clang::FixItHint::CreateRemoval(), D, clang::SemaBase::Diag(), extendLeft(), extendRight(), clang::First, clang::DeclaratorChunk::Function, clang::SourceRange::getBegin(), clang::TypeLoc::getEndLoc(), clang::DeclSpec::getExplicitSpecLoc(), clang::DeclSpec::getExplicitSpecRange(), clang::ASTContext::getFunctionType(), getLangOpts(), getLocForEndOfToken(), clang::ASTContext::getPointerType(), clang::Decl::getSourceRange(), clang::TypeLoc::getSourceRange(), 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::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, and clang::SC_Static.
Referenced by CreateNewFunctionDecl().
ExprResult Sema::CheckConvertedConstantExpression | ( | Expr * | From, |
QualType | T, | ||
APValue & | Value, | ||
CCEKind | CCE, | ||
NamedDecl * | Dest = nullptr |
||
) |
Definition at line 6315 of file SemaOverload.cpp.
References clang::T.
ExprResult Sema::CheckConvertedConstantExpression | ( | Expr * | From, |
QualType | T, | ||
llvm::APSInt & | Value, | ||
CCEKind | CCE | ||
) |
Definition at line 6322 of file SemaOverload.cpp.
References CheckConvertedConstantExpression(), clang::Type::isIntegralOrEnumerationType(), clang::T, and V.
Referenced by ActOnCaseExpr(), ActOnCXXNew(), ActOnNoexceptSpec(), BuildPackIndexingExpr(), BuildPackIndexingType(), checkArraySize(), CheckEnumConstant(), CheckTemplateArgument(), and tryResolveExplicitSpecifier().
void Sema::CheckCoroutineWrapper | ( | FunctionDecl * | FD | ) |
Definition at line 15939 of file SemaDecl.cpp.
References CanBeGetReturnObject(), CanBeGetReturnTypeOnAllocFailure(), clang::SemaBase::Diag(), clang::Type::getAsRecordDecl(), clang::Decl::getLocation(), clang::FunctionDecl::getReturnType(), clang::NamedDecl::getUnderlyingDecl(), and clang::Decl::hasAttr().
Referenced by ActOnFinishFunctionBody().
bool clang::Sema::CheckCountedByAttrOnField | ( | FieldDecl * | FD, |
Expr * | E, | ||
bool | CountInBytes, | ||
bool | OrNull | ||
) |
Check if applying the specified attribute variant from the "counted by" family of attributes to FieldDecl FD
is semantically valid.
If semantically invalid diagnostics will be emitted explaining the problems.
FD | The FieldDecl to apply the attribute to |
E | The count expression on the attribute |
CountInBytes | If true the attribute is from the "sized_by" family of attributes. If the false the attribute is from "counted_by" family of attributes. |
OrNull | If true the attribute is from the "_or_null" suffixed family of attributes. If false the attribute does not have the suffix. |
Together CountInBytes
and OrNull
decide the attribute variant. E.g. CountInBytes
and OrNull
both being true indicates the counted_by_or_null
attribute.
Definition at line 51 of file SemaBoundsSafety.cpp.
References clang::SemaBase::Diag(), E, clang::FLEXIBLE_ARRAY_MEMBER, clang::FUNCTION, clang::ASTContext::getAsArrayType(), getASTContext(), clang::DeclaratorDecl::getBeginLoc(), clang::getCountAttrKind(), clang::ArrayType::getElementType(), clang::GetEnclosingNamedOrTopAnonRecord(), getLangOpts(), clang::Decl::getLocation(), clang::FieldDecl::getParent(), clang::Type::getPointeeType(), clang::FieldDecl::getSourceRange(), clang::ValueDecl::getType(), clang::INCOMPLETE, clang::LangOptionsBase::IncompleteOnly, int, clang::Decl::isFlexibleArrayMemberLike(), clang::Type::isFunctionType(), clang::Type::isIncompleteType(), clang::Type::isSizelessType(), clang::Type::isStructureTypeWithFlexibleArrayMember(), clang::TagDecl::isUnion(), Kind, clang::SIZELESS, and clang::VALID.
Referenced by handleCountedByAttrField().
ExprResult Sema::CheckCXXBooleanCondition | ( | Expr * | CondExpr, |
bool | IsConstexpr = false |
||
) |
CheckCXXBooleanCondition - Returns true if conversion to bool is invalid.
Definition at line 4095 of file SemaExprCXX.cpp.
References E, clang::Expr::isValueDependent(), PerformContextuallyConvertToBool(), and VerifyIntegerConstantExpression().
Referenced by CheckBooleanCondition(), and 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 5332 of file SemaExpr.cpp.
References Cleanup, clang::SemaBase::Diag(), ExprEvalContexts, clang::DeclaratorDecl::getBeginLoc(), clang::Decl::getDeclContext(), clang::VarDecl::getInit(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), clang::ParmVarDecl::hasUnparsedDefaultArg(), ImmediateFunctionContext, clang::Init, InstantiateDefaultArgument(), clang::FunctionDecl::isImmediateFunction(), MarkDeclarationsReferencedInExpr(), PotentiallyEvaluated, runWithSufficientStackSpace(), clang::CleanupInfo::setExprNeedsCleanups(), clang::Decl::setInvalidDecl(), and UnparsedDefaultArgLocs.
Referenced by BuildCXXDefaultArgExpr(), CheckCXXThrowOperand(), checkForMultipleExportedDefaultConstructors(), and 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 1629 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.
Referenced by ActOnFinishDelayedCXXMethodDeclaration(), ActOnStartOfLambdaDefinition(), and CheckFunctionDeclaration().
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 1303 of file SemaExprCXX.cpp.
References clang::sema::CapturingScopeInfo::addThisCapture(), buildLambdaThisCaptureFixit(), clang::sema::LambdaScopeInfo::CallOperator, clang::SemaBase::Diag(), clang::Explicit, 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 ActOnLambdaClosureQualifiers(), ActOnLambdaExpressionAfterIntroducer(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), DiagnoseDependentMemberLookup(), clang::getStackIndexOfNearestEnclosingCaptureCapableLambda(), MarkThisReferenced(), clang::SemaOpenMP::tryCaptureOpenMPLambdas(), and tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs().
bool Sema::CheckCXXThisType | ( | SourceLocation | Loc, |
QualType | Type | ||
) |
Check whether the type of 'this' is valid in the current context.
Definition at line 1428 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 986 of file SemaExprCXX.cpp.
References clang::ASTContext::addCopyConstructorForExceptionObject(), CheckCXXDefaultArgExpr(), CheckDestructorAccess(), Context, clang::Destructor, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), E, clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::TargetInfo::getCXXABI(), clang::CXXRecordDecl::getDestructor(), clang::ASTContext::getExnObjectAlignment(), clang::Expr::getExprLoc(), getLangOpts(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::CharUnits::getQuantity(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeAlignInChars(), clang::QualType::getTypePtr(), getUnambiguousPublicSubobjects(), clang::CXXRecordDecl::hasIrrelevantDestructor(), clang::FunctionDecl::isDeleted(), clang::TargetCXXABI::isItaniumFamily(), clang::TargetCXXABI::isMicrosoft(), clang::Type::isSizelessType(), clang::FunctionDecl::isTrivial(), clang::isUnresolvedExceptionSpec(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), LookupCopyingConstructor(), LookupDestructor(), MarkFunctionReferenced(), MarkVTableUsed(), clang::SemaBase::PDiag(), RequireCompleteType(), and RequireNonAbstractType().
Referenced by BuildCXXThrow().
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 11405 of file SemaDeclCXX.cpp.
References Context, CurContext, D, clang::SemaBase::Diag(), clang::DeclContext::Equals(), clang::DeclaratorChunk::Function, clang::TypeLoc::getAsAdjusted(), clang::TemplateName::getAsQualifiedTemplateName(), clang::TemplateName::getAsTemplateDecl(), clang::TypeLoc::getBeginLoc(), clang::Decl::getBeginLoc(), clang::Decl::getDeclContext(), clang::DeclContext::getRedeclContext(), clang::Decl::getSourceRange(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::QualType::hasQualifiers(), clang::ASTContext::hasSameTemplateName(), clang::Type::isDependentType(), NoteTemplateLocation(), clang::DeclaratorChunk::Paren, and clang::SC_None.
Referenced by CreateNewFunctionDecl().
void Sema::CheckDeductionGuideTemplate | ( | FunctionTemplateDecl * | TD | ) |
Definition at line 4113 of file SemaTemplate.cpp.
References clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::TemplateDecl::getTemplateParameters(), hasVisibleDefaultArgument(), MarkDeducedTemplateParameters(), and noteNonDeducibleParameters().
Referenced by CheckFunctionDeclaration().
void Sema::CheckDelayedMemberExceptionSpecs | ( | ) |
Definition at line 9137 of file SemaDeclCXX.cpp.
References CheckEquivalentExceptionSpec(), CheckOverridingFunctionExceptionSpec(), DelayedEquivalentExceptionSpecChecks, DelayedOverridingExceptionSpecChecks, and clang::Equivalent.
Referenced by ActOnEndOfTranslationUnit(), and ActOnFinishDelayedMemberInitializers().
void Sema::CheckDelegatingCtorCycles | ( | ) |
Definition at line 18762 of file SemaDeclCXX.cpp.
References clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::begin(), DelegatingCtorDecls, DelegatingCycleHelper(), E, clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::end(), and clang::Invalid.
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 9037 of file SemaTemplate.cpp.
References Context, D, clang::SemaBase::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().
Referenced by ActOnFunctionDeclarator().
bool Sema::CheckDerivedToBaseConversion | ( | QualType | Derived, |
QualType | Base, | ||
SourceLocation | Loc, | ||
SourceRange | Range, | ||
CXXCastPath * | BasePath = nullptr , |
||
bool | IgnoreAccess = false |
||
) |
Definition at line 3091 of file SemaDeclCXX.cpp.
References CheckDerivedToBaseConversion(), Loc, and Range.
Referenced by CheckDerivedToBaseConversion(), CheckOverridingFunctionReturnType(), CheckPointerToMemberOperands(), MarkVirtualBaseDestructorsReferenced(), clang::InitializationSequence::Perform(), PerformImplicitConversion(), and PerformObjectMemberConversion().
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 3009 of file SemaDeclCXX.cpp.
References AR_accessible, AR_delayed, AR_dependent, AR_inaccessible, BuildBasePathArray(), CheckBaseClassAccess(), Context, clang::SemaBase::Diag(), getAmbiguousPathsDisplayString(), clang::ASTContext::getCanonicalType(), getLangOpts(), clang::CanQual< T >::getUnqualifiedType(), IsDerivedFrom(), Loc, Path, and Range.
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 10869 of file SemaDeclCXX.cpp.
References ActOnCXXThis(), clang::declaresSameEntity(), clang::Destructor, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), FindDeallocationFunctionForDestructor(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getLocation(), Loc, MarkFunctionReferenced(), clang::Passing, and PerformImplicitConversion().
Referenced by ActOnFinishFunctionBody(), DefineImplicitDestructor(), and MarkVTableUsed().
Sema::AccessResult Sema::CheckDestructorAccess | ( | SourceLocation | Loc, |
CXXDestructorDecl * | Dtor, | ||
const PartialDiagnostic & | PDiag, | ||
QualType | objectType = QualType() |
||
) |
Definition at line 1630 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, CheckAccess(), Context, clang::Decl::getAccess(), getLangOpts(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getTypeDeclType(), clang::QualType::isNull(), Loc, clang::DeclAccessPair::make(), and clang::SemaBase::PDiag().
Referenced by ActOnCXXDelete(), ActOnDecltypeExpression(), CheckCXXThrowOperand(), checkDestructorReference(), FinalizeVarWithDestructor(), MarkBaseAndMemberDestructorsReferenced(), MarkVirtualBaseDestructorsReferenced(), MaybeBindToTemporary(), clang::InitializationSequence::Perform(), and clang::SemaObjC::SetIvarInitializers().
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 10919 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), checkMethodTypeQualifiers(), Context, clang::FixItHint::CreateRemoval(), D, clang::SemaBase::Diag(), diagnoseIgnoredQualifiers(), diagnoseInvalidDeclaratorChunks(), clang::DeclaratorChunk::FunctionTypeInfo::freeParams(), clang::FTIHasNonVoidParameters(), clang::Type::getAs(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), GetTypeFromParser(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::RQ_None, clang::SC_None, clang::SC_Static, clang::FunctionProtoType::ExtProtoInfo::Variadic, and clang::ASTContext::VoidTy.
Referenced by CreateNewFunctionDecl().
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 185 of file SemaExceptionSpec.cpp.
References clang::CPlusPlus17, clang::Type::getAs(), getLangOpts(), clang::Type::getPointeeType(), clang::FunctionProtoType::hasExceptionSpec(), and clang::T.
Referenced by BuildMemberPointerType(), and GetFullTypeForDeclarator().
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 7329 of file SemaOverload.cpp.
References convertArgsForAvailabilityChecks(), clang::Function, and clang::Result.
Referenced by checkDirectCallValidity().
EnumConstantDecl * Sema::CheckEnumConstant | ( | EnumDecl * | Enum, |
EnumConstantDecl * | LastEnumConst, | ||
SourceLocation | IdLoc, | ||
IdentifierInfo * | Id, | ||
Expr * | val | ||
) |
Definition at line 19555 of file SemaDecl.cpp.
References AllowFold, clang::C23, CCEK_Enumerator, CheckConvertedConstantExpression(), clang::Expr::containsErrors(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::EnumConstantDecl::Create(), DefaultLvalueConversion(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::Enum, clang::ActionResult< PtrTy, Compress >::get(), clang::EnumConstantDecl::getInitVal(), clang::TargetInfo::getIntWidth(), clang::ASTContext::getIntWidth(), getLangOpts(), getNextLargerIntegralType(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::hasSameType(), Id, ImpCastExprToType(), clang::ASTContext::IntTy, clang::Type::isBooleanType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isRepresentableIntegerValue(), clang::Type::isSignedIntegerOrEnumerationType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::T, toString(), UPPC_EnumeratorValue, and VerifyIntegerConstantExpression().
Referenced by ActOnEnumConstant(), and 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 16877 of file SemaDecl.cpp.
References Context, clang::SemaBase::Diag(), clang::EnumDecl::getIntegerType(), clang::EnumDecl::getIntegerTypeRange(), clang::Decl::getLocation(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isDependentType(), clang::EnumDecl::isFixed(), and clang::EnumDecl::isScoped().
Referenced by ActOnTag().
bool Sema::CheckEnumUnderlyingType | ( | TypeSourceInfo * | TI | ) |
Check that this is a valid underlying type for an enum declaration.
Definition at line 16860 of file SemaDecl.cpp.
References clang::SemaBase::Diag(), clang::Type::getAs(), clang::TypeLoc::getBeginLoc(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Type::isBitIntType(), clang::Type::isDependentType(), and clang::T.
Referenced by ActOnTag().
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 484 of file SemaExceptionSpec.cpp.
References clang::CheckEquivalentExceptionSpecImpl(), getLangOpts(), clang::SemaBase::PDiag(), and clang::Result.
bool clang::Sema::CheckEquivalentExceptionSpec | ( | const PartialDiagnostic & | DiagID, |
const PartialDiagnostic & | NoteID, | ||
const FunctionProtoType * | Old, | ||
SourceLocation | OldLoc, | ||
const FunctionProtoType * | New, | ||
SourceLocation | NewLoc | ||
) |
Definition at line 660 of file SemaExceptionSpec.cpp.
References clang::CheckEquivalentExceptionSpecImpl(), and getLangOpts().
bool clang::Sema::CheckEquivalentExceptionSpec | ( | FunctionDecl * | Old, |
FunctionDecl * | New | ||
) |
Definition at line 289 of file SemaExceptionSpec.cpp.
References clang::Type::castAs(), clang::CheckEquivalentExceptionSpecImpl(), Context, clang::CPlusPlus11, clang::CPlusPlus17, clang::FixItHint::CreateInsertion(), DelayedEquivalentExceptionSpecChecks, clang::SemaBase::Diag(), E, 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(), OS, clang::SemaBase::PDiag(), clang::Decl::setInvalidDecl(), and clang::ValueDecl::setType().
Referenced by ActOnExplicitInstantiation(), areMultiversionVariantFunctionsCompatible(), CheckDelayedMemberExceptionSpecs(), clang::CheckSpecForTypesEquivalent(), MergeFunctionDecl(), and MergeVarDeclExceptionSpecs().
Definition at line 907 of file SemaExceptionSpec.cpp.
References CheckExceptionSpecSubset(), clang::CPlusPlus17, clang::SourceRange::getBegin(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::GetUnderlyingFunction(), clang::FunctionProtoType::hasDependentExceptionSpec(), and clang::SemaBase::PDiag().
Referenced by clang::InitializationSequence::Perform(), and 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 18917 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(), and GetFullTypeForDeclarator().
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 756 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 8706 of file SemaDeclCXX.cpp.
References clang::Qualifiers::addConst(), clang::QualType::addConst(), clang::ASTContext::adjustDeducedFunctionResultType(), clang::ASTContext::AutoDeductTy, clang::ASTContext::BoolTy, clang::Type::castAs(), CheckComparisonCategoryType(), CheckConstexprParameterTypes(), CheckConstexprReturnType(), clang::Constexpr, Context, clang::CPlusPlus23, clang::FunctionDecl::DefaultedOrDeletedFunctionInfo::Create(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), DefaultedOperator, clang::SemaBase::Diag(), Diagnose, clang::EST_None, clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::First, clang::CXXRecordDecl::friends(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::ASTContext::getAutoDeductType(), clang::SourceRange::getBegin(), clang::DeclaratorDecl::getBeginLoc(), clang::FunctionDecl::getCanonicalDecl(), clang::CXXRecordDecl::getCanonicalDecl(), clang::FunctionDecl::getDeclaredReturnType(), clang::FunctionDecl::getDefaultLoc(), clang::FunctionDecl::getExceptionSpecType(), clang::ParmVarDecl::getExplicitObjectParamThisLoc(), clang::Decl::getFriendObjectKind(), clang::CXXMethodDecl::getFunctionObjectParameterReferenceType(), clang::ASTContext::getFunctionType(), clang::FunctionDecl::getFunctionTypeLoc(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::ASTContext::getLValueReferenceType(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getRecordType(), clang::CXXMethodDecl::getRefQualifier(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::ParmVarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::ASTContext::hasSameType(), int, inTemplateInstantiation(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::TagDecl::isDependentType(), clang::Type::isDependentType(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Decl::isImplicit(), clang::CXXMethodDecl::isImplicitObjectMemberFunction(), clang::SourceLocation::isInvalid(), clang::Type::isLValueReferenceType(), clang::QualType::isNull(), clang::CXXMethodDecl::isStatic(), clang::Type::isUndeducedAutoType(), clang::SourceLocation::isValid(), clang::CXXMethodDecl::isVolatile(), Loc, lookupOperatorsForDefaultedComparison(), None, Ok, clang::UnresolvedSetImpl::pairs(), clang::FunctionDecl::parameters(), clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::Qualifiers::removeVolatile(), RequireCompleteType(), clang::RQ_None, clang::RQ_RValue, clang::FunctionDecl::setConstexprKind(), SetDeclDeleted(), clang::FunctionDecl::setDefaultedOrDeletedInfo(), clang::ValueDecl::setType(), SubstAutoType(), clang::T, ThreeWay, clang::FunctionProtoType::ExceptionSpecInfo::Type, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, and clang::QualType::withConst().
Referenced by CheckExplicitlyDefaultedFunction(), and SetDeclDefaulted().
void Sema::CheckExplicitlyDefaultedFunction | ( | Scope * | S, |
FunctionDecl * | MD | ||
) |
Definition at line 7533 of file SemaDeclCXX.cpp.
References clang::Sema::DefaultedFunctionKind::asComparison(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), CheckExplicitlyDefaultedComparison(), CheckExplicitlyDefaultedSpecialMember(), clang::RecordDecl::fields(), clang::Decl::getDeclContext(), getDefaultedFunctionKind(), clang::FunctionDecl::getDefaultLoc(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::Sema::DefaultedFunctionKind::isComparison(), clang::DeclContext::isDependentContext(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::Sema::DefaultedFunctionKind::isSpecialMember(), clang::Decl::setInvalidDecl(), and UnusedPrivateFields.
Referenced by CheckCompletedCXXClass().
bool Sema::CheckExplicitlyDefaultedSpecialMember | ( | CXXMethodDecl * | MD, |
CXXSpecialMemberKind | CSM, | ||
SourceLocation | DefaultLoc | ||
) |
Definition at line 7560 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::FunctionDecl::getParamDecl(), 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::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::QualType::isNull(), 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 CheckExplicitlyDefaultedFunction(), and SetDeclDefaulted().
void Sema::CheckExplicitObjectLambda | ( | Declarator & | D | ) |
Definition at line 11266 of file SemaDeclCXX.cpp.
References CheckExplicitObjectMemberFunction(), and D.
Referenced by getLambdaType().
void Sema::CheckExplicitObjectMemberFunction | ( | Declarator & | D, |
DeclarationName | Name, | ||
QualType | R, | ||
bool | IsLambda, | ||
DeclContext * | DC = nullptr |
||
) |
Definition at line 11270 of file SemaDeclCXX.cpp.
References computeDeclContext(), clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXDestructorName, D, clang::SemaBase::Diag(), clang::DeclaratorDecl::getBeginLoc(), clang::Decl::getLocation(), clang::Decl::getSourceRange(), clang::ParmVarDecl::getSourceRange(), clang::ParmVarDecl::hasDefaultArg(), clang::DeclaratorChunk::FunctionTypeInfo::hasMutableQualifier(), clang::ParmVarDecl::isExplicitObjectParameter(), clang::DeclContext::isRecord(), clang::Member, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::FunctionTypeInfo::Params, and clang::DeclSpec::SCS_static.
Referenced by CheckExplicitObjectLambda(), CheckExplicitObjectMemberFunction(), and CreateNewFunctionDecl().
void Sema::CheckExplicitObjectMemberFunction | ( | DeclContext * | DC, |
Declarator & | D, | ||
DeclarationName | Name, | ||
QualType | R | ||
) |
Definition at line 11261 of file SemaDeclCXX.cpp.
References CheckExplicitObjectMemberFunction(), and D.
bool Sema::CheckExplicitObjectOverride | ( | CXXMethodDecl * | New, |
const CXXMethodDecl * | Old | ||
) |
Definition at line 18252 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().
Referenced by AddOverriddenMethods().
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 401 of file SemaDeclCXX.cpp.
References D, clang::DeclaratorChunk::ParamInfo::DefaultArgTokens, clang::SemaBase::Diag(), clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::ParmVarDecl::getDefaultArg(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), clang::ParmVarDecl::hasUnparsedDefaultArg(), 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 ActOnCastExpr(), ActOnCXXNamedCast(), clang::SemaObjC::ActOnObjCExceptionDecl(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperVarDecl(), ActOnTypeName(), CheckFunctionOrTemplateParamDeclarator(), HandleDeclarator(), HandleField(), and HandleMSProperty().
ExprResult Sema::CheckExtVectorCast | ( | SourceRange | R, |
QualType | DestTy, | ||
Expr * | CastExpr, | ||
CastKind & | Kind | ||
) |
Definition at line 7702 of file SemaExpr.cpp.
References areLaxCompatibleVectorTypes(), Context, clang::SemaBase::Diag(), clang::ExprError(), clang::SourceRange::getBegin(), getLangOpts(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isExtVectorType(), clang::Type::isPointerType(), clang::Type::isVectorType(), OpenCL(), and prepareVectorSplat().
FieldDecl * Sema::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.
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 18497 of file SemaDecl.cpp.
References AbstractFieldType, CheckAlignasUnderalignment(), checkDuplicateDefaultInit(), CheckNontrivialField(), clang::Type::containsErrors(), Context, clang::CPlusPlus, clang::FieldDecl::Create(), D, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::Type::getBaseElementTypeUnsafe(), getCurScope(), clang::NamedDecl::getDeclName(), clang::CXXRecordDecl::getDefinition(), getLangOpts(), clang::Decl::getLocation(), getOpenCLOptions(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Decl::hasAttrs(), clang::ICIS_NoInit, clang::ASTContext::IntTy, clang::Type::isBlockPointerType(), clang::LangOptions::isCompatibleWithMSVC(), clang::Type::isDependentAddressSpaceType(), clang::Type::isDependentType(), clang::Type::isEventT(), clang::Type::isImageType(), clang::Type::isIncompleteType(), clang::Decl::isInvalidDecl(), clang::NamedDecl::isPlaceholderVar(), clang::Type::isReferenceType(), clang::Type::isSamplerT(), clang::Type::isVariablyModifiedType(), LangOpts, Loc, clang::LangOptionsBase::MSVC2015, ObjC(), PPC(), ProcessDeclAttributes(), RequireCompleteSizedType(), RequireCompleteType(), RequireNonAbstractType(), clang::Decl::setAccess(), clang::Decl::setInvalidDecl(), clang::T, tryToFixVariablyModifiedVarType(), and VerifyBitField().
Referenced by HandleField().
Check that the expression co_await promise.final_suspend() shall not be potentially-throwing.
Definition at line 667 of file SemaCoroutine.cpp.
References checkNoThrow(), D, clang::SemaBase::Diag(), and clang::Decl::getEndLoc().
Referenced by ActOnCoroutineBodyStart().
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 9457 of file SemaChecking.cpp.
References Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::ASTContext::getFloatTypeSemantics(), clang::Stmt::getSourceRange(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::FloatingLiteral::getValue(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParens(), clang::BinaryOperator::isEqualityOp(), clang::BuiltinType::isFloatingPoint(), and Loc.
Referenced by checkArithmeticOrEnumeralCompare(), CheckSizelessVectorCompareOperands(), and CheckVectorCompareOperands().
bool Sema::CheckForConstantInitializer | ( | Expr * | Init, |
unsigned | DiagID = diag::err_init_element_not_constant |
||
) |
type checking declaration initializers (C99 6.7.8)
Definition at line 12558 of file SemaDecl.cpp.
References Context, clang::SemaBase::Diag(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), and clang::Init.
Referenced by AddInitializerToDecl(), and BuildCompoundLiteralExpr().
void Sema::CheckForFunctionRedefinition | ( | FunctionDecl * | FD, |
const FunctionDecl * | EffectiveDefinition = nullptr , |
||
SkipBodyInfo * | SkipBody = nullptr |
||
) |
Definition at line 15449 of file SemaDecl.cpp.
References canRedefineFunction(), clang::declaresSameEntity(), Definition, clang::SemaBase::Diag(), clang::Decl::FOK_None, clang::FunctionDecl::getInstantiatedFromMemberFunction(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::GNUMode, hasVisibleDefinition(), clang::Internal, clang::FunctionDecl::isDefined(), makeMergedDefinitionVisible(), clang::SkipBodyInfo::Previous, clang::SC_Extern, clang::Decl::setInvalidDecl(), clang::SkipBodyInfo::ShouldSkip, and TypoCorrectedFunctionDefinitions.
Referenced by ActOnStartOfFunctionDef(), checkNewAttributesAfterDef(), and MergeCXXFunctionDecl().
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 17511 of file SemaExpr.cpp.
References clang::Call, Cleanup, clang::CleanupInfo::cleanupsHaveSideEffects(), clang::ExprWithCleanups::Create(), clang::ConstantExpr::Create(), clang::Expr::EvalStatus::Diag, E, clang::Expr::EvaluateAsConstantExpr(), ExprEvalContexts, clang::CleanupInfo::exprNeedsCleanups(), getASTContext(), clang::ConstantExpr::getStorageKind(), clang::APValue::hasValue(), clang::Expr::IgnoreImplicit(), isAlwaysConstantEvaluatedContext(), isCheckingDefaultArgumentOrInitializer(), isImmediateFunctionContext(), isUnevaluatedContext(), clang::Expr::isValueDependent(), MarkExpressionAsImmediateEscalating(), clang::ConstantExpr::MoveIntoResult(), RebuildingImmediateInvocation, and clang::Expr::EvalResult::Val.
Referenced by BuildCXXConstructExpr(), BuildResolvedCallExpr(), and PerformConstructorInitialization().
Sema::AccessResult Sema::CheckFriendAccess | ( | NamedDecl * | D | ) |
Checks access to the target of a friend declaration.
Definition at line 1827 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::AS_public, CheckEffectiveAccess(), Context, CurContext, clang::Decl::getAccess(), clang::Decl::getAsFunction(), clang::Decl::getDeclContext(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNameInfo(), clang::DeclaratorDecl::getQualifier(), clang::DeclaratorDecl::getQualifierLoc(), clang::DeclarationNameInfo::getSourceRange(), clang::NestedNameSpecifierLoc::getSourceRange(), and clang::DeclAccessPair::make().
Referenced by ActOnFriendFunctionDecl(), and 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 3484 of file SemaChecking.cpp.
References checkCall(), CheckTCBEnforcement(), Context, clang::SemaObjC::DiagnoseCStringFormatDirectiveInCFAPI(), clang::CallExpr::getArgs(), clang::FunctionDecl::getBuiltinID(), clang::CallExpr::getCallee(), clang::Expr::getExprLoc(), clang::NamedDecl::getIdentifier(), getLangOpts(), clang::FunctionDecl::getMemoryFunctionKind(), clang::CallExpr::getNumArgs(), clang::ASTContext::getPointerType(), clang::CallExpr::getRParenLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), getVariadicCallType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::FunctionDecl::isStatic(), and ObjC().
Referenced by BuildResolvedCallExpr(), and handleCleanupAttr().
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 843 of file SemaConcept.cpp.
References CheckConstraintSatisfaction(), CheckFunctionConstraints(), 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 ActOnExplicitInstantiation(), checkAddressOfFunctionIsAvailable(), CheckFunctionConstraints(), CheckMemberSpecialization(), DiagnoseUseOfDecl(), InstantiateClassMembers(), NoteFunctionCandidate(), NoteSurrogateCandidate(), and SetEligibleMethods().
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 11953 of file SemaDecl.cpp.
References ActOnConversionDeclarator(), clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(), clang::Decl::addAttr(), clang::Qualifiers::addConst(), AddOverriddenMethods(), AllowOverloadingOfFunction(), ARM(), clang::Type::castAs(), CheckConstPureAttributesUsage(), CheckConstructor(), CheckCXXDefaultArguments(), CheckDeductionGuideTemplate(), checkForConflictWithNonVisibleExternC(), CheckLiteralOperatorDeclaration(), CheckMultiVersionFunction(), CheckOverload(), CheckOverloadedOperatorDeclaration(), clang::SemaARM::CheckSMEFunctionDefAttributes(), clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), clang::SemaCUDA::checkTargetOverload(), checkThisInStaticMemberFunctionType(), Context, clang::CPlusPlus, clang::CPlusPlus14, clang::CPlusPlus17, clang::FixItHint::CreateInsertion(), CUDA(), CurContext, clang::ASTContext::DeclarationNames, clang::Destructor, clang::SemaBase::Diag(), clang::Decl::FOK_None, clang::Type::getAs(), clang::TypeLoc::getAs(), clang::Decl::getAsFunction(), clang::Decl::getAttr(), clang::Stmt::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXDestructorName(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionProtoType::getExtProtoInfo(), clang::Decl::getFriendObjectKind(), clang::ASTContext::getFunctionType(), clang::FunctionTemplateDecl::getInstantiatedFromMemberTemplate(), getLangOpts(), clang::FunctionDecl::getLiteralIdentifier(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::CXXMethodDecl::getMethodQualifiers(), clang::FunctionProtoType::getParamTypes(), clang::Type::getPointeeType(), clang::FunctionDecl::getPrimaryTemplate(), clang::FunctionDecl::getReturnType(), clang::FunctionType::getReturnType(), clang::ASTContext::getTargetInfo(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Decl::hasAttr(), clang::Qualifiers::hasConst(), clang::TypeLoc::IgnoreParens(), inferLifetimeCaptureByAttribute(), inTemplateInstantiation(), clang::Type::isAnyPointerType(), clang::FunctionDecl::isConstexpr(), clang::NamedDecl::isCXXClassMember(), clang::DeclContext::isDependentContext(), clang::FunctionDecl::isExternC(), clang::Type::isIncompleteType(), clang::Type::isObjCObjectPointerType(), IsOverload(), clang::FunctionDecl::isOverloadedOperator(), clang::QualType::isPODType(), clang::DeclContext::isRecord(), clang::CXXMethodDecl::isStatic(), clang::Type::isUndeducedType(), clang::Type::isVariablyModifiedType(), clang::Type::isVoidType(), LangOpts, MergeFunctionDecl(), clang::FunctionTemplateDecl::mergePrevDecl(), OpenMP(), Ovl_Match, Ovl_NonFunction, Ovl_Overload, clang::FunctionProtoType::param_types(), clang::FunctionDecl::parameters(), PPC(), Previous, clang::Decl::setAccess(), clang::Decl::setInvalidDecl(), clang::RedeclarableTemplateDecl::setMemberSpecialization(), clang::FunctionDecl::setPreviousDeclaration(), clang::ValueDecl::setType(), shouldLinkDependentDeclWithPrevious(), SubstAutoTypeDependent(), SYCL(), clang::T, clang::TSK_ExplicitSpecialization, and clang::FunctionProtoType::ExtProtoInfo::TypeQuals.
Referenced by ActOnFunctionDeclarator(), CheckImplicitSpecialMemberDeclaration(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
|
inline |
Check if IdxExpr is a valid parameter index for a function or instance method D.
May output an error.
Definition at line 4703 of file Sema.h.
References clang::AANT_ArgumentIntegerConstant, Context, D, clang::SemaBase::Diag(), getAttrLoc(), clang::getFunctionOrMethodNumParams(), clang::Expr::getIntegerConstantExpr(), clang::Stmt::getSourceRange(), clang::hasFunctionProto(), clang::isFunctionOrMethodOrBlockForAttrSubject(), clang::isFunctionOrMethodVariadic(), clang::isInstanceMethod(), clang::Expr::isTypeDependent(), and UINT_MAX.
Referenced by AddAllocAlignAttr(), checkParamIsIntegerType(), handleArgumentWithTypeTagAttr(), clang::SemaSwift::handleAsyncAttr(), handleFormatArgAttr(), handleNonNullAttr(), handleOwnershipAttr(), and handleXRayLogArgsAttr().
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 14975 of file SemaDecl.cpp.
References CheckExtraCXXDefaultArguments(), clang::CPlusPlus, D, clang::SemaBase::Diag(), clang::Decl::getKind(), getLangOpts(), clang::DeclarationNameInfo::getName(), GetNameForDeclarator(), clang::IK_ConstructorName, clang::IK_ConstructorTemplateId, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::IK_DestructorName, clang::IK_Identifier, clang::IK_ImplicitSelfParam, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, and clang::IK_TemplateId.
Referenced by ActOnNonTypeTemplateParameter(), and ActOnParamDeclarator().
bool Sema::CheckFunctionReturnType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Definition at line 2528 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 clang::SemaObjC::ActOnMethodDeclaration(), and 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 9079 of file SemaTemplate.cpp.
References clang::TemplateSpecCandidateSet::addCandidate(), clang::Qualifiers::addConst(), clang::UnresolvedSetImpl::addDecl(), clang::UnresolvedSetImpl::begin(), clang::Type::castAs(), CheckSpecializationInstantiationRedecl(), CheckTemplateSpecializationScope(), Context, clang::TemplateArgumentList::CreateCopy(), clang::CRK_None, CUDA(), clang::CUDATargetMismatch, DeduceTemplateArguments(), clang::SemaBase::Diag(), E, clang::UnresolvedSetImpl::empty(), clang::UnresolvedSetImpl::end(), clang::Decl::FOK_None, clang::FunctionDecl::getConstexprKind(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::FunctionProtoType::getExtProtoInfo(), clang::Decl::getFriendObjectKind(), clang::ASTContext::getFunctionType(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::TemplateSpecCandidateSet::getLocation(), getMostSpecialized(), clang::FunctionProtoType::getParamTypes(), clang::FunctionTemplateSpecializationInfo::getPointOfInstantiation(), clang::DeclContext::getRedeclContext(), clang::FunctionType::getReturnType(), clang::FunctionTemplateSpecializationInfo::getTemplateSpecializationKind(), clang::ValueDecl::getType(), clang::NamedDecl::getUnderlyingDecl(), clang::SemaCUDA::IdentifyTarget(), clang::DeclContext::InEnclosingNamespaceSetOf(), clang::SemaCUDA::inheritTargetAttrs(), clang::FunctionTemplateSpecializationInfo::isExplicitSpecialization(), clang::isUnresolvedExceptionSpec(), LangOpts, clang::MakeDeductionFailureInfo(), MarkUnusedFileScopedDecl(), clang::TemplateSpecCandidateSet::NoteCandidates(), NoteOverloadCandidate(), clang::SemaBase::PDiag(), Previous, ResolveExceptionSpec(), clang::Result, clang::TemplateSpecCandidate::set(), clang::FunctionTemplateSpecializationInfo::setTemplateSpecializationKind(), clang::Specialization, clang::Success, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, and clang::FunctionProtoType::ExtProtoInfo::TypeQuals.
Referenced by ActOnFunctionDeclarator(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool Sema::CheckIfFunctionSpecializationIsImmediate | ( | FunctionDecl * | FD, |
SourceLocation | Loc | ||
) |
Definition at line 5454 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 | ||
) |
CheckIfOverriddenFunctionIsMarkedFinal - Checks whether a virtual member function overrides a virtual member function marked 'final', according to C++11 [class.virtual]p4.
Definition at line 3237 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::NamedDecl::getDeclName(), and clang::Decl::getLocation().
Referenced by AddOverriddenMethods().
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 10345 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.
Referenced by CheckCompletedCXXClass().
bool Sema::CheckImmediateEscalatingFunctionDefinition | ( | FunctionDecl * | FD, |
const sema::FunctionScopeInfo * | FSI | ||
) |
Definition at line 2475 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.
Referenced by ActOnFinishFunctionBody().
void Sema::CheckImplicitConversion | ( | Expr * | E, |
QualType | T, | ||
SourceLocation | CC, | ||
bool * | ICContext = nullptr , |
||
bool | IsListInit = false |
||
) |
Definition at line 11058 of file SemaChecking.cpp.
References clang::SemaObjC::adornBoolConversionDiagWithTernaryFixit(), clang::ASTContext::areCompatibleRVVTypes(), clang::ASTContext::areCompatibleSveTypes(), clang::ASTContext::areLaxCompatibleRVVTypes(), clang::ASTContext::areLaxCompatibleSveTypes(), clang::Type::canDecayToPointerType(), clang::Type::castAs(), clang::SemaObjC::checkArrayLiteral(), clang::SemaObjC::checkDictionaryLiteral(), Context, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseAlwaysNonNullPointer(), DiagnoseFloatingImpCast(), DiagnoseImpCast(), DiagnoseIntInBoolContext(), DiagnoseNullConversion(), DiagRuntimeBehavior(), DiscardMisalignedMemberAddress(), E, clang::Expr::EvaluateAsFixedPoint(), clang::Expr::EvaluateAsInt(), clang::Expr::EvaluateAsRValue(), clang::CallExpr::getArg(), clang::Type::getAs(), getASTContext(), clang::ASTContext::getCanonicalType(), clang::Expr::getEnumCoercedType(), clang::Expr::getExprLoc(), clang::ASTContext::getFixedPointMax(), clang::ASTContext::getFixedPointMin(), clang::ASTContext::getFixedPointSemantics(), clang::ASTContext::getFloatingTypeSemanticOrder(), clang::ASTContext::getFloatTypeSemantics(), clang::Expr::getIntegerConstantExpr(), clang::ASTContext::getIntWidth(), getLangOpts(), clang::CallExpr::getNumArgs(), clang::VectorType::getNumElements(), clang::Stmt::getSourceRange(), clang::Type::getSveEltType(), clang::Expr::getType(), clang::CanQual< T >::getTypePtr(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSize(), HLSL(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isAtomicType(), clang::Type::isBooleanType(), clang::Type::isCharType(), isConstantEvaluatedContext(), clang::Type::isFixedPointType(), clang::BuiltinType::isFloatingPoint(), clang::Type::isFloatingType(), clang::SourceManager::isInSystemMacro(), clang::BuiltinType::isInteger(), clang::Type::isIntegerType(), clang::Type::isIntegralType(), clang::SourceLocation::isInvalid(), clang::Expr::isKnownToHaveBooleanValue(), clang::Type::isPointerType(), IsSameFloatAfterCast(), isSameWidthConstantConversion(), clang::BuiltinType::isSignedInteger(), clang::Type::isSignedIntegerType(), clang::Type::isSveVLSBuiltinType(), clang::Expr::isTypeDependent(), clang::Type::isUnsignedIntegerType(), clang::Expr::isValueDependent(), clang::Expr::NPCK_NotNull, ObjC(), clang::SemaBase::PDiag(), PrettyPrintInRange(), clang::Result, clang::Expr::SE_AllowSideEffects, SourceMgr, clang::T, toString(), TryGetExprRange(), and clang::Expr::EvalResult::Val.
Referenced by AnalyzeImplicitConversions(), CheckBoolLikeConversion(), CheckConditionalOperand(), CheckConditionalOperator(), and clang::checkOpenCLEnqueueIntType().
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 7408 of file SemaType.cpp.
References CheckNullabilityTypeSpecifier().
Referenced by applyNullability().
void Sema::CheckImplicitSpecialMemberDeclaration | ( | Scope * | S, |
FunctionDecl * | FD | ||
) |
Check a completed declaration of an implicit special member.
Definition at line 13815 of file SemaDeclCXX.cpp.
References clang::LookupResult::addDecl(), CheckFunctionDeclaration(), D, clang::LookupResult::getAcceptableDecl(), clang::NamedDecl::getDeclName(), clang::DeclContext::getParent(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::DeclContext::lookup(), LookupOrdinaryName, clang::LookupResult::resolveKind(), and clang::LookupResult::suppressDiagnostics().
Referenced by DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), and DeclareImplicitMoveConstructor().
void Sema::checkIncorrectVTablePointerAuthenticationAttribute | ( | CXXRecordDecl & | RD | ) |
Check that VTable Pointer authentication is only being set on the first first instantiation of the vtable.
Definition at line 10419 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), Context, clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::Decl::getLocation(), clang::ASTContext::getRecordType(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::CXXRecordDecl::isPolymorphic(), and RequireCompleteType().
Referenced by CheckCompletedCXXClass().
Additional checks for a using declaration referring to a constructor name.
Definition at line 13063 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().
Referenced by BuildUsingDeclaration().
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 7456 of file SemaInit.cpp.
References clang::sema::checkInitLifetime(), and clang::Init.
Referenced by CollectFieldInitializer(), clang::InitializationSequence::Perform(), and TryOrBuildParenListInitialization().
bool Sema::CheckInstantiatedFunctionTemplateConstraints | ( | SourceLocation | PointOfInstantiation, |
FunctionDecl * | Decl, | ||
ArrayRef< TemplateArgument > | TemplateArgs, | ||
ConstraintSatisfaction & | Satisfaction | ||
) |
Definition at line 1114 of file SemaConcept.cpp.
References CheckConstraintSatisfaction(), clang::TemplateDecl::getAssociatedConstraints(), and clang::ConstraintSatisfaction::IsSatisfied.
Referenced by FinishTemplateArgumentDeduction().
void Sema::checkLifetimeCaptureBy | ( | FunctionDecl * | FDecl, |
bool | IsMemberFunction, | ||
const Expr * | ThisArg, | ||
ArrayRef< const Expr * > | Args | ||
) |
Definition at line 3229 of file SemaChecking.cpp.
References clang::sema::checkCaptureByLifetime(), clang::TypeLoc::getAsAdjusted(), clang::Decl::getAttr(), clang::AttributedTypeLoc::getAttrAs(), clang::AttributedTypeLoc::getModifiedLoc(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::TypeSourceInfo::getTypeLoc(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by checkCall().
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 16529 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(), getLangOpts(), clang::Decl::getLocation(), clang::IdentifierInfo::getName(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::PointerType::getPointeeType(), clang::FunctionDecl::getPrimaryTemplate(), clang::ASTContext::getSizeType(), getSourceManager(), 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::IdentifierInfo::isReservedLiteralSuffixId(), clang::Type::isSpecificBuiltinType(), clang::StringLiteralParser::isValidUDSuffix(), clang::QualType::isVolatileQualified(), clang::ASTContext::LongDoubleTy, clang::NotReserved, clang::FunctionDecl::param_begin(), clang::FunctionDecl::param_size(), clang::FunctionDecl::parameters(), clang::ASTContext::UnsignedLongLongTy, and clang::ASTContext::WideCharTy.
Referenced by CheckFunctionDeclaration().
bool Sema::checkLiteralOperatorId | ( | const CXXScopeSpec & | SS, |
const UnqualifiedId & | Id, | ||
bool | IsUDSuffix | ||
) |
Definition at line 495 of file SemaExprCXX.cpp.
References clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::NestedNameSpecifier::getKind(), clang::Preprocessor::getLangOpts(), clang::IdentifierInfo::getName(), clang::CXXScopeSpec::getScopeRep(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::IK_LiteralOperatorId, clang::IdentifierInfo::isReserved(), clang::isReservedInAllContexts(), clang::IdentifierInfo::isReservedLiteralSuffixId(), clang::CXXScopeSpec::isValid(), Loc, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NotStartsWithUnderscore, PP, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
|
inline |
Definition at line 13158 of file SemaExpr.cpp.
References clang::ASTContext::BoolTy, CheckVectorLogicalOperands(), Context, clang::CPlusPlus, clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::Expr::EvaluateAsInt(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), clang::APValue::getInt(), clang::ASTContext::getLangOpts(), getLangOpts(), getLocForEndOfToken(), clang::Stmt::getSourceRange(), clang::Expr::getType(), inTemplateInstantiation(), clang::ASTContext::IntTy, InvalidOperands(), clang::Type::isBooleanType(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceLocation::isMacroID(), clang::Type::isScalarType(), clang::Expr::isValueDependent(), clang::Type::isVectorType(), Loc, PerformContextuallyConvertToBool(), clang::Result, UsualUnaryConversions(), and clang::Expr::EvalResult::Val.
Referenced by CreateBuiltinBinOp().
void Sema::CheckLookupAccess | ( | const LookupResult & | R | ) |
Checks access to all the declarations in the given result set.
Definition at line 1910 of file SemaAccess.cpp.
References clang::AS_public, clang::LookupResult::begin(), CheckAccess(), Context, E, clang::LookupResult::end(), clang::LookupResult::getBaseObjectType(), getLangOpts(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), and clang::sema::AccessedEntity::Member.
bool Sema::CheckLoopHintExpr | ( | Expr * | E, |
SourceLocation | Loc, | ||
bool | AllowZero | ||
) |
Definition at line 3638 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), E, clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Type::isBooleanType(), clang::Type::isCharType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isValueDependent(), toString(), and VerifyIntegerConstantExpression().
Referenced by handleHLSLLoopHintAttr(), and handleLoopHintAttr().
ExprResult Sema::CheckLValueToRValueConversionOperand | ( | Expr * | E | ) |
Definition at line 19631 of file SemaExpr.cpp.
References checkNonTrivialCUnion(), E, 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, NTCUK_Copy, NTCUK_Destruct, rebuildPotentialResultsAsNonOdrUsed(), and clang::Result.
Referenced by ActOnConstantExpression(), and DefaultLvalueConversion().
void Sema::CheckMain | ( | FunctionDecl * | FD, |
const DeclSpec & | D | ||
) |
Definition at line 12336 of file SemaDecl.cpp.
References clang::ASTContext::adjustFunctionType(), clang::Type::castAs(), clang::CC_C, clang::ASTContext::CharTy, Context, clang::CPlusPlus, clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::Qualifiers::empty(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::FunctionType::getCallConv(), clang::ASTContext::getCanonicalType(), clang::DeclSpec::getConstexprSpecLoc(), clang::Decl::getDeclContext(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionType::getExtInfo(), clang::DeclSpec::getInlineSpecLoc(), getLangOpts(), clang::FunctionDecl::getLanguageLinkage(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::DeclSpec::getNoreturnSpecLoc(), clang::FunctionDecl::getNumParams(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::PointerType::getPointeeType(), clang::ASTContext::getPointerType(), clang::DeclContext::getRedeclContext(), clang::FunctionType::getReturnType(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::FunctionDecl::getStorageClass(), clang::DeclSpec::getStorageClassSpecLoc(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::Decl::hasAttr(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ASTContext::IntTy, clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::DeclContext::isExternCContext(), clang::DeclContext::isExternCXXContext(), clang::Type::isFunctionType(), clang::FunctionDecl::isInlineSpecified(), clang::Decl::isInvalidDecl(), clang::DeclSpec::isNoreturnSpecified(), clang::DeclContext::isTranslationUnit(), clang::SourceRange::isValid(), clang::FunctionProtoType::isVariadic(), OpenCL(), clang::Qualifiers::removeConst(), clang::SC_Static, clang::FunctionDecl::setConstexprKind(), clang::FunctionDecl::setHasImplicitReturnZero(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), clang::QualifierCollector::strip(), clang::T, clang::Unspecified, and clang::FunctionType::ExtInfo::withCallingConv().
Referenced by ActOnFunctionDeclarator().
bool Sema::CheckMatrixCast | ( | SourceRange | R, |
QualType | DestTy, | ||
QualType | SrcTy, | ||
CastKind & | Kind | ||
) |
Definition at line 7628 of file SemaExpr.cpp.
References areMatrixTypesOfTheSameDimension(), clang::SemaBase::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 12997 of file SemaExpr.cpp.
References Context, DefaultFunctionArrayLvalueConversion(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getCommonSugaredType(), clang::MatrixType::getElementType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), InvalidOperands(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, and tryConvertExprToType().
Referenced by CheckAdditionOperands(), CheckMatrixMultiplyOperands(), CheckMultiplyDivideOperands(), and CheckSubtractionOperands().
QualType Sema::CheckMatrixMultiplyOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign | ||
) |
Definition at line 13043 of file SemaExpr.cpp.
References CheckMatrixElementwiseOperands(), Context, DefaultFunctionArrayLvalueConversion(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getCommonSugaredType(), clang::ASTContext::getConstantMatrixType(), clang::MatrixType::getElementType(), clang::ConstantMatrixType::getNumColumns(), clang::ConstantMatrixType::getNumRows(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), InvalidOperands(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and Loc.
Referenced by CheckMultiplyDivideOperands().
Sema::AccessResult Sema::CheckMemberAccess | ( | SourceLocation | UseLoc, |
CXXRecordDecl * | NamingClass, | ||
DeclAccessPair | Found | ||
) |
Checks access to a member.
Definition at line 1759 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, CheckAccess(), Context, clang::Found, and getLangOpts().
Sema::AccessResult Sema::CheckMemberOperatorAccess | ( | SourceLocation | Loc, |
Expr * | ObjectExpr, | ||
ArrayRef< Expr * > | ArgExprs, | ||
DeclAccessPair | FoundDecl | ||
) |
Definition at line 1814 of file SemaAccess.cpp.
References CheckMemberOperatorAccess().
Sema::AccessResult Sema::CheckMemberOperatorAccess | ( | SourceLocation | Loc, |
Expr * | ObjectExpr, | ||
const SourceRange & | Range, | ||
DeclAccessPair | FoundDecl | ||
) |
Definition at line 1788 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, clang::Type::castAs(), CheckAccess(), Context, clang::Found, clang::RecordType::getDecl(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and Range.
Referenced by BuildCXXCastArgument(), CheckMemberOperatorAccess(), diagnoseNoViableConversion(), clang::InitializationSequence::Perform(), 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 1805 of file SemaAccess.cpp.
References CheckMemberOperatorAccess(), clang::Found, and 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 3549 of file SemaOverload.cpp.
References BuildBasePathArray(), Diag(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::MemberPointerType::getClass(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::isNullPointerConstant(), clang::Type::isRecordType(), and clang::Expr::NPC_ValueDependentIsNull.
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 9348 of file SemaTemplate.cpp.
References clang::UnresolvedSetImpl::addDecl(), adjustCCAndNoReturn(), clang::UnresolvedSetImpl::begin(), CheckFunctionConstraints(), CheckSpecializationInstantiationRedecl(), CheckTemplateSpecializationScope(), Context, clang::SemaBase::Diag(), E, clang::UnresolvedSetImpl::empty(), clang::UnresolvedSetImpl::end(), clang::Decl::FOK_None, clang::Function, clang::FunctionDecl::getCanonicalDecl(), clang::CXXRecordDecl::getInstantiatedFromMemberClass(), clang::EnumDecl::getInstantiatedFromMemberEnum(), clang::FunctionDecl::getInstantiatedFromMemberFunction(), clang::VarDecl::getInstantiatedFromStaticDataMember(), clang::Decl::getLocation(), clang::VarDecl::getMemberSpecializationInfo(), clang::FunctionDecl::getMemberSpecializationInfo(), clang::EnumDecl::getMemberSpecializationInfo(), clang::CXXRecordDecl::getMemberSpecializationInfo(), getMoreConstrainedFunction(), clang::MemberSpecializationInfo::getPointOfInstantiation(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::MemberSpecializationInfo::getTemplateSpecializationKind(), getTemplateSpecializationKind(), hasExplicitCallingConv(), clang::ASTContext::hasSameType(), clang::FunctionDecl::isDeleted(), clang::VarDecl::isStaticDataMember(), clang::Member, Previous, clang::FunctionDecl::setDeletedAsWritten(), clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.
Referenced by ActOnFunctionDeclarator(), ActOnTag(), and ActOnVariableDeclarator().
Sema::IfExistsResult Sema::CheckMicrosoftIfExistsSymbol | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
const DeclarationNameInfo & | TargetNameInfo | ||
) |
Definition at line 9307 of file SemaExprCXX.cpp.
References clang::LookupResult::Ambiguous, clang::LookupResult::Found, clang::LookupResult::FoundOverloaded, clang::LookupResult::FoundUnresolvedValue, clang::DeclarationNameInfo::getName(), clang::LookupResult::getResultKind(), IER_Dependent, IER_DoesNotExist, IER_Exists, clang::DeclarationName::isDependentName(), LookupAnyName, LookupParsedName(), clang::LookupResult::NotFound, clang::LookupResult::NotFoundInCurrentInstantiation, and clang::LookupResult::suppressDiagnostics().
Referenced by CheckMicrosoftIfExistsSymbol().
Sema::IfExistsResult Sema::CheckMicrosoftIfExistsSymbol | ( | Scope * | S, |
SourceLocation | KeywordLoc, | ||
bool | IsIfExists, | ||
CXXScopeSpec & | SS, | ||
UnqualifiedId & | Name | ||
) |
Definition at line 9342 of file SemaExprCXX.cpp.
References CheckMicrosoftIfExistsSymbol(), DiagnoseUnexpandedParameterPack(), GetNameFromUnqualifiedId(), IER_Error, UPPC_IfExists, and UPPC_IfNotExists.
bool Sema::checkMSInheritanceAttrOnDefinition | ( | CXXRecordDecl * | RD, |
SourceRange | Range, | ||
bool | BestCase, | ||
MSInheritanceModel | SemanticSpelling | ||
) |
Definition at line 4433 of file SemaDeclAttr.cpp.
References clang::CXXRecordDecl::calculateInheritanceModel(), clang::SemaBase::Diag(), clang::SourceRange::getBegin(), clang::CXXRecordDecl::getDefinition(), clang::Decl::getLocation(), clang::CXXRecordDecl::hasDefinition(), clang::TagDecl::isCompleteDefinition(), Range, and clang::Unspecified.
Referenced by ActOnFields(), and mergeMSInheritanceAttr().
void Sema::CheckMSVCRTEntryPoint | ( | FunctionDecl * | FD | ) |
Definition at line 12523 of file SemaDecl.cpp.
References clang::ASTContext::adjustFunctionType(), clang::Type::castAs(), clang::CC_C, clang::CC_X86StdCall, Context, clang::SemaBase::Diag(), clang::FunctionType::getCallConv(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionType::getExtInfo(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::FunctionType::getReturnType(), clang::ValueDecl::getType(), hasExplicitCallingConv(), clang::Type::isAnyPointerType(), isDefaultStdCall(), clang::Type::isFunctionType(), clang::Type::isIntegralOrEnumerationType(), clang::Decl::isInvalidDecl(), clang::Type::isNullPtrType(), clang::FunctionDecl::setHasImplicitReturnZero(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), clang::T, and clang::FunctionType::ExtInfo::withCallingConv().
Referenced by ActOnFunctionDeclarator().
QualType Sema::CheckMultiplyDivideOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign, | ||
bool | IsDivide | ||
) |
Definition at line 10581 of file SemaExpr.cpp.
References ACK_Arithmetic, ACK_CompAssign, checkArithmeticNull(), CheckMatrixElementwiseOperands(), CheckMatrixMultiplyOperands(), CheckSizelessVectorOperands(), CheckVectorOperands(), DiagnoseBadDivideOrRemainderValues(), DiagnoseDivisionSizeofPointerOrArray(), clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::Expr::getType(), InvalidOperands(), clang::Type::isArithmeticType(), clang::Type::isConstantMatrixType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), Loc, and UsualArithmeticConversions().
Referenced by CreateBuiltinBinOp().
bool Sema::CheckNoInlineAttr | ( | const Stmt * | OrigSt, |
const Stmt * | CurSt, | ||
const AttributeCommonInfo & | A | ||
) |
Definition at line 284 of file SemaStmtAttr.cpp.
Referenced by handleNoInlineAttr().
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 7862 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::allocateConversionSequences(), clang::OverloadCandidateSet::getLocation(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::Type::isDependentType(), clang::QualType::isNull(), 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 13356 of file SemaDecl.cpp.
References clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), Loc, NTCUK_Copy, NTCUK_Destruct, NTCUK_Init, and clang::DefaultInitializedTypeVisitor< Derived, RetTy >::visit().
Referenced by ActOnBlockStmtExpr(), ActOnFunctionDeclarator(), ActOnUninitializedDecl(), ActOnVariableDeclarator(), BuildCompoundLiteralExpr(), CheckFunctionReturnType(), CheckLValueToRValueConversionOperand(), checkNonTrivialCUnionInInitializer(), CheckParameter(), CreateBuiltinBinOp(), and markEscapingByrefs().
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 13104 of file SemaDecl.cpp.
References checkNonTrivialCUnion(), checkNonTrivialCUnionInInitializer(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::Init, clang::SourceLocation::isValid(), Loc, NTCUC_CopyInit, NTCUC_DefaultInitializedObject, NTCUK_Copy, and NTCUK_Init.
Referenced by AddInitializerToDecl(), BuildCompoundLiteralExpr(), and checkNonTrivialCUnionInInitializer().
Definition at line 18695 of file SemaDecl.cpp.
References clang::Decl::addAttr(), Context, clang::CopyAssignment, clang::CopyConstructor, clang::CPlusPlus, clang::CPlusPlus11, clang::DefaultConstructor, clang::Destructor, clang::SemaBase::Diag(), DiagnoseNontrivial(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::NamedDecl::getDeclName(), clang::CXXRecordDecl::getDefinition(), getLangOpts(), clang::Decl::getLocation(), clang::FieldDecl::getParent(), getSourceManager(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::CXXRecordDecl::hasNonTrivialCopyAssignment(), clang::CXXRecordDecl::hasNonTrivialCopyConstructor(), clang::CXXRecordDecl::hasNonTrivialDestructor(), clang::RecordDecl::hasObjectMember(), clang::CXXRecordDecl::hasTrivialDefaultConstructor(), clang::Invalid, clang::Type::isDependentType(), clang::Decl::isInvalidDecl(), clang::TagDecl::isUnion(), and Loc.
Referenced by BuildAnonymousStructOrUnion(), and CheckFieldDecl().
QualType Sema::CheckNonTypeTemplateParameterType | ( | QualType | T, |
SourceLocation | Loc | ||
) |
Definition at line 1379 of file SemaTemplate.cpp.
References Context, clang::CPlusPlus20, clang::SemaBase::Diag(), clang::ASTContext::getDecayedType(), getLangOpts(), clang::Type::isArrayType(), clang::Type::isDependentType(), 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, RequireStructuralType(), 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 1266 of file SemaTemplate.cpp.
References CheckNonTypeTemplateParameterType(), clang::TypeSourceInfo::getType(), clang::Type::isUndeducedType(), Loc, and SubstAutoTypeSourceInfoDependent().
Referenced by ActOnNonTypeTemplateParameter(), CheckNonTypeTemplateParameterType(), and CheckTemplateArgument().
Sema::OverloadKind Sema::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.
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 1200 of file SemaOverload.cpp.
References clang::LookupResult::addAllDecls(), clang::LookupResult::begin(), E, clang::LookupResult::end(), clang::Decl::getAsFunction(), clang::LookupResult::getAsSingle(), clang::FunctionDecl::getDependentSpecializationInfo(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Decl::getFriendObjectKind(), clang::LookupResult::getLookupKind(), clang::DeclaratorDecl::getQualifier(), clang::ValueDecl::getType(), clang::Type::isDependentType(), clang::Decl::setInvalidDecl(), and clang::LookupResult::Temporary.
Referenced by CheckFunctionDeclaration(), and 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 16305 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().
Referenced by CheckFunctionDeclaration().
void Sema::CheckOverrideControl | ( | NamedDecl * | D | ) |
CheckOverrideControl - Check C++11 override control semantics.
Definition at line 3134 of file SemaDeclCXX.cpp.
References clang::FixItHint::CreateRemoval(), D, 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 ActOnCXXMemberDeclarator(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
bool Sema::CheckOverridingFunctionAttributes | ( | CXXMethodDecl * | New, |
const CXXMethodDecl * | Old | ||
) |
Definition at line 18159 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), Context, clang::SemaBase::Diag(), diagnoseFunctionEffectMergeConflicts(), E, clang::FunctionProtoType::ExtProtoInfo::FunctionEffects, clang::Decl::getAttr(), clang::FunctionType::getCallConv(), clang::NamedDecl::getDeclName(), clang::FunctionProtoType::getExtParameterInfo(), clang::FunctionDecl::getFunctionEffects(), clang::ASTContext::getFunctionType(), clang::Decl::getLocation(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::FunctionDecl::getStorageClass(), clang::ValueDecl::getType(), clang::ASTContext::hasAnyFunctionEffects(), clang::FunctionProtoType::hasExtParameterInfos(), clang::FunctionEffectSet::insert(), IsInvalidSMECallConversion(), clang::FunctionType::ExtParameterInfo::isNoEscape(), clang::Sema::FunctionEffectDiff::Merge, clang::Sema::FunctionEffectDiff::NoAction, clang::SC_Static, clang::ValueDecl::setType(), and clang::Sema::FunctionEffectDiff::Warn.
Referenced by AddOverriddenMethods().
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 948 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 clang::SemaBase::PDiag().
Referenced by actOnDelayedExceptionSpecification(), AddOverriddenMethods(), 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 18266 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), CheckDerivedToBaseConversion(), Context, clang::SemaBase::Diag(), clang::Type::getAs(), getASTContext(), 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::QualType::isAtLeastAsQualifiedAs(), clang::Type::isDependentType(), IsDerivedFrom(), clang::QualType::isNull(), clang::Type::isStructureOrClassType(), and RequireCompleteType().
Referenced by AddOverriddenMethods().
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 728 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 703 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 686 of file SemaTemplateVariadic.cpp.
References CheckPackExpansion(), Context, clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushFullCopy(), clang::Result, and clang::PackExpansionTypeLoc::setEllipsisLoc().
Referenced by ActOnPackExpansion(), CheckPackExpansion(), clang::TreeTransform< Derived >::RebuildPackExpansion(), clang::TreeTransform< Derived >::RebuildPackExpansionType(), and SubstParmVarDecl().
ParmVarDecl * Sema::CheckParameter | ( | DeclContext * | DC, |
SourceLocation | StartLoc, | ||
SourceLocation | NameLoc, | ||
const IdentifierInfo * | Name, | ||
QualType | T, | ||
TypeSourceInfo * | TSInfo, | ||
StorageClass | SC | ||
) |
Definition at line 15210 of file SemaDecl.cpp.
References clang::Sema::DelayedDiagnostics::add(), checkNonTrivialCUnion(), Context, clang::ParmVarDecl::Create(), clang::FixItHint::CreateInsertion(), clang::Default, clang::SemaBase::Diag(), clang::ASTContext::getAdjustedParameterType(), getEnclosingLambdaOrBlock(), clang::TypeLoc::getEndLoc(), getLangOpts(), clang::ASTContext::getLifetimeQualifiedType(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::Type::getObjCARCImplicitLifetime(), clang::ASTContext::getObjCObjectPointerType(), clang::ParmVarDecl::getOriginalType(), clang::TypeLoc::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), clang::Type::isArrayType(), clang::Type::isFunctionPointerType(), clang::Type::isObjCLifetimeType(), clang::Type::isObjCObjectType(), clang::VarDecl::isParameterPack(), clang::sema::DelayedDiagnostic::makeForbiddenType(), NTCUC_FunctionParam, NTCUK_Copy, NTCUK_Destruct, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, OpenCL(), clang::opencl_private, PPC(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), clang::Sema::DelayedDiagnostics::shouldDelayDiagnostics(), clang::T, and clang::wasm_funcref.
Referenced by clang::SemaObjC::ActOnMethodParmDeclaration(), ActOnParamDeclarator(), and 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 749 of file SemaTemplateVariadic.cpp.
References CurrentInstantiationScope, clang::SemaBase::Diag(), clang::TemplateArgument::Expression, clang::LocalInstantiationScope::findInstantiationOf(), clang::Type::getAs(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsType(), clang::getDepthAndIndex(), clang::NamedDecl::getIdentifier(), clang::TemplateArgument::getKind(), clang::PackExpansionType::getNumExpansions(), clang::MultiLevelTemplateArgumentList::getNumLevels(), clang::TemplateArgument::getNumTemplateExpansions(), clang::LocalInstantiationScope::getPartiallySubstitutedPack(), clang::MultiLevelTemplateArgumentList::hasTemplateArgument(), clang::if(), clang::TemplateArgument::isPackExpansion(), and clang::TemplateArgument::Type.
Referenced by calculateConstraintSatisfaction(), instantiateDependentAlignedAttr(), InstantiateMemInitializers(), and SubstBaseSpecifiers().
bool clang::Sema::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.
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 876 of file SemaExceptionSpec.cpp.
References clang::CheckSpecForTypesEquivalent(), E, clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::FunctionType::getReturnType(), and clang::SemaBase::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 13040 of file SemaChecking.cpp.
References AbstractParamType, clang::C23, clang::CPlusPlus, clang::Destructor, clang::SemaBase::Diag(), diagnoseArrayStarInParamType(), DiagnoseUseOfDecl(), clang::Type::getAsCXXRecordDecl(), getLangOpts(), clang::DeclContext::getParent(), clang::Attr::getSpelling(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isWebAssemblyTableType(), LangOpts, LookupDestructor(), MarkFunctionReferenced(), RequireCompleteType(), and RequireNonAbstractType().
Referenced by ActOnBlockArguments(), ActOnStartOfFunctionDef(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), and CompleteLambdaCallOperator().
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 20971 of file SemaExpr.cpp.
References clang::CXXScopeSpec::Adopt(), BuildDeclRefExpr(), clang::ASTContext::BuiltinInfo, clang::SemaPseudoObject::checkRValue(), Context, clang::DeclRefExpr::copyTemplateArgumentsInto(), CorrectDelayedTyposInExpr(), clang::CPlusPlus20, clang::CallExpr::Create(), CreateRecoveryExpr(), clang::DeclarationName::CXXDestructorName, clang::SemaBase::Diag(), clang::SemaObjC::diagnoseARCUnbridgedCast(), diagnoseUnknownAnyExpr(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), clang::DeclarationName::getAsString(), clang::DeclarationNameInfo::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::DeclRefExpr::getDecl(), clang::DeclarationNameInfo::getEndLoc(), clang::DeclRefExpr::getFoundDecl(), clang::BuiltinType::getKind(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), clang::DeclRefExpr::getNameInfo(), clang::ASTContext::getPointerType(), clang::DeclRefExpr::getQualifierLoc(), clang::DeclRefExpr::getTemplateKeywordLoc(), clang::Expr::getType(), clang::DeclRefExpr::hasExplicitTemplateArgs(), clang::DeclRefExpr::hasQualifier(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParens(), ImpCastExprToType(), InstantiateFunctionDefinition(), clang::ASTContext::IntTy, clang::ASTContext::isDependenceAllowed(), clang::Builtin::Context::isInStdNamespace(), Loc, ObjC(), clang::SemaBase::PDiag(), PseudoObject(), resolveAndFixAddressOfSingleOverloadCandidate(), ResolveAndFixSingleFunctionTemplateSpecialization(), clang::Result, clang::SemaObjC::stripARCUnbridgedCast(), tryToRecoverWithCall(), clang::VK_LValue, and clang::VK_PRValue.
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), ActOnArraySubscriptExpr(), ActOnCoawaitExpr(), ActOnConditionalOp(), ActOnDecltypeExpression(), ActOnFinishFullExpr(), ActOnForEachLValueExpr(), ActOnGCCAsmStmt(), clang::SemaOpenMP::ActOnOMPArraySectionExpr(), clang::SemaOpenMP::ActOnOMPArrayShapingExpr(), ActOnStartCXXMemberReference(), BuildArrayType(), BuildBinOp(), BuildCallExpr(), BuildCoreturnStmt(), BuildCoyieldExpr(), BuildCXXAssumeExpr(), BuildCXXNew(), BuildCXXNoexceptExpr(), BuildCXXTypeId(), BuildExpressionTrait(), BuildInitList(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildObjCSubscriptExpression(), BuildResolvedCoawaitExpr(), BuildUnaryOp(), BuildUnresolvedCoawaitExpr(), CheckAddressOfOperand(), CheckArgsForPlaceholders(), CheckArrow(), clang::SemaPseudoObject::checkAssignment(), CheckBooleanCondition(), CheckCommaOperands(), CheckConditionalOperands(), CheckIncrementDecrementOperand(), CheckIndirectionOperand(), CheckObjCCollectionLiteralElement(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), checkPlaceholderForOverload(), checkPointerAuthValue(), CheckRealImagOperand(), CreateBuiltinMatrixSubscriptExpr(), CreateUnaryExprOrTypeTraitExpr(), DeduceAutoType(), DefaultFunctionArrayConversion(), DefaultLvalueConversion(), DefaultVariadicArgumentPromotion(), HandleExprEvaluationContextForTypeof(), IgnoredValueConversions(), clang::InitializationSequence::InitializeFrom(), LookupInlineAsmIdentifier(), clang::InitializationSequence::Perform(), PerformImplicitConversion(), PerformMemberExprBaseConversion(), clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr(), and clang::TreeTransform< Derived >::TransformExprRequirement().
bool Sema::checkPointerAuthEnabled | ( | SourceLocation | Loc, |
SourceRange | Range | ||
) |
Definition at line 1499 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), getLangOpts(), Loc, and Range.
Referenced by checkPointerAuthEnabled(), and checkPtrAuthTypeDiscriminatorOperandType().
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 3432 of file SemaOverload.cpp.
References clang::ASTContext::BoolTy, Diag(), clang::Type::getAs(), clang::Expr::getExprLoc(), clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), clang::Type::isFunctionType(), clang::Expr::isNullPointerConstant(), clang::Type::isRecordType(), clang::Expr::NPC_ValueDependentIsNotNull, clang::Expr::NPC_ValueDependentIsNull, and clang::Expr::NPCK_ZeroExpression.
Referenced by CheckSingleAssignmentConstraints(), and PerformImplicitConversion().
QualType Sema::CheckPointerToMemberOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
ExprValueKind & | VK, | ||
SourceLocation | OpLoc, | ||
bool | isIndirect | ||
) |
Definition at line 6449 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::Result, clang::RQ_LValue, clang::RQ_None, clang::RQ_RValue, TemporaryMaterializationConversion(), clang::VK_LValue, and clang::VK_PRValue.
Referenced by CreateBuiltinBinOp().
void Sema::CheckPtrComparisonWithNullChar | ( | ExprResult & | E, |
ExprResult & | NullE | ||
) |
Definition at line 12167 of file SemaExpr.cpp.
References clang::ASTContext::CharTy, Context, clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), E, clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getCanonicalType(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::CanQual< T >::getUnqualifiedType(), clang::Type::isAnyPointerType(), clang::Preprocessor::isMacroDefined(), clang::Expr::isNullPointerConstant(), clang::Expr::NPC_ValueDependentIsNotNull, clang::Expr::NPCK_ZeroExpression, PP, and clang::T.
Referenced by CheckCompareOperands().
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 18372 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 1784 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.
Referenced by BuildCXXTypeId().
bool Sema::CheckQualifiedMemberReference | ( | Expr * | BaseExpr, |
QualType | BaseType, | ||
const CXXScopeSpec & | SS, | ||
const LookupResult & | R | ||
) |
Definition at line 617 of file SemaExprMember.cpp.
References clang::LookupResult::begin(), computeDeclContext(), DiagnoseQualifiedMemberReference(), E, 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().
Referenced by BuildMemberReferenceExpr().
Definition at line 713 of file SemaStmtAttr.cpp.
Referenced by clang::TreeTransform< Derived >::RebuildAttributedStmt().
[module.interface]p6: A redeclaration of an entity X is implicitly exported if X was introduced by an exported declaration; otherwise it shall not be exported.
Definition at line 1659 of file SemaDecl.cpp.
References clang::SemaBase::Diag(), clang::NamedDecl::getFormalLinkage(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::DeclContext::getNonTransparentContext(), clang::Decl::getOwningModule(), clang::Internal, clang::DeclContext::isFileContext(), clang::Module::isImplicitGlobalModule(), clang::Decl::isInExportDeclContext(), clang::Decl::isInNamedModule(), and clang::Module.
Referenced by CheckRedeclarationInModule().
A wrapper function for checking the semantic restrictions of a redeclaration within a module.
Definition at line 1705 of file SemaDecl.cpp.
References CheckRedeclarationExported(), and CheckRedeclarationModuleOwnership().
Referenced by ActOnAliasDeclaration(), ActOnTag(), CheckClassTemplate(), MergeFunctionDecl(), and MergeVarDecl().
We've determined that New
is a redeclaration of Old
.
Check that they have compatible owning modules.
Definition at line 1600 of file SemaDecl.cpp.
References clang::SemaBase::Diag(), getASTContext(), clang::Decl::getFriendObjectKind(), clang::Module::getFullModuleName(), clang::Decl::getLocation(), clang::Decl::getOwningModule(), clang::Decl::getOwningModuleForLinkage(), clang::Module::isModuleImplementation(), clang::Module::isModulePartition(), clang::Module::isNamedModule(), clang::Module::isPrivateModule(), makeMergedDefinitionVisible(), clang::Module::Parent, clang::Decl::setInvalidDecl(), and clang::Decl::setLocalOwningModule().
Referenced by CheckRedeclarationInModule().
bool Sema::CheckRegparmAttr | ( | const ParsedAttr & | attr, |
unsigned & | value | ||
) |
Checks a regparm attribute, returning true if it is ill-formed and otherwise setting numParams to the appropriate value.
Definition at line 5299 of file SemaDeclAttr.cpp.
References clang::ParsedAttr::checkExactlyNumArgs(), checkUInt32Argument(), Context, clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::AttributeCommonInfo::getLoc(), clang::TargetInfo::getRegParmMax(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::ParsedAttr::isInvalid(), and clang::ParsedAttr::setInvalid().
Referenced by handleFunctionTypeAttr().
QualType Sema::CheckRemainderOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
bool | IsCompAssign = false |
||
) |
Definition at line 10620 of file SemaExpr.cpp.
References ACK_Arithmetic, ACK_CompAssign, checkArithmeticNull(), CheckSizelessVectorOperands(), CheckVectorOperands(), DiagnoseBadDivideOrRemainderValues(), clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::Expr::getType(), clang::Type::hasIntegerRepresentation(), InvalidOperands(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), Loc, and UsualArithmeticConversions().
Referenced by CreateBuiltinBinOp().
bool Sema::checkSectionName | ( | SourceLocation | LiteralLoc, |
StringRef | Str | ||
) |
Definition at line 2905 of file SemaDeclAttr.cpp.
References clang::SemaBase::Diag(), E, isValidSectionSpecifier(), and toString().
Referenced by ActOnPragmaMSSeg(), and handleSectionAttr().
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 8302 of file SemaDecl.cpp.
References computeShadowedDeclKind(), D, clang::SemaBase::Diag(), clang::DeclContext::Encloses(), clang::DeclContext::Equals(), getCaptureLocation(), getCurFunction(), clang::Decl::getDeclContext(), clang::getLambdaAwareParentOfDeclContext(), getLangOpts(), clang::DeclContext::getLexicalParent(), clang::Decl::getLocation(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::DeclContext::getParent(), clang::DeclContext::getRedeclContext(), clang::SourceLocation::isInvalid(), clang::isLambdaCallOperator(), clang::NamedDecl::isPlaceholderVar(), clang::DeclContext::isRecord(), and clang::LCD_None.
Referenced by ActOnBlockArguments(), ActOnDecompositionDeclarator(), ActOnEnumConstant(), ActOnLambdaExpressionAfterIntroducer(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), ActOnStartRequiresExpr(), ActOnTypedefNameDecl(), ActOnVariableDeclarator(), and CheckShadow().
Check -Wshadow without the advantage of a previous lookup.
Definition at line 8453 of file SemaDecl.cpp.
References CheckShadow(), D, Diags, clang::Decl::getLocation(), getShadowedDeclaration(), clang::DiagnosticsEngine::isIgnored(), LookupName(), and LookupOrdinaryName.
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 8467 of file SemaDecl.cpp.
References clang::CPlusPlus, D, clang::SemaBase::Diag(), E, clang::Decl::getDeclContext(), getLangOpts(), clang::Decl::getLocation(), clang::Expr::IgnoreParenImpCasts(), and Loc.
Referenced by CheckForModifiableLvalue().
QualType Sema::CheckShiftOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc, | ||
bool | IsCompAssign = false |
||
) |
Definition at line 11504 of file SemaExpr.cpp.
References clang::AltiVecBool, checkArithmeticNull(), checkSizelessVectorShift(), checkVectorShift(), DiagnoseBadShiftValues(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getType(), clang::Type::hasIntegerRepresentation(), InvalidOperands(), clang::Type::isFixedPointOrIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isScopedEnumerationType(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), LangOpts, Loc, and UsualUnaryConversions().
Referenced by CreateBuiltinBinOp().
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 9628 of file SemaExpr.cpp.
References clang::SemaObjC::ACR_okay, clang::Assigning, clang::C23, CheckAssignmentConstraints(), CheckPointerConversion(), Compatible, Context, clang::CPlusPlus, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), Diagnose, E, FixOverloadedFunctionReference(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::QualType::getAtomicUnqualifiedType(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getNonLValueExprType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), ImpCastExprToType(), clang::Implicit, Incompatible, IncompatibleObjCWeakRef, clang::Type::isAtomicType(), clang::Type::isBlockPointerType(), clang::Type::isBooleanType(), clang::ImplicitConversionSequence::isFailure(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Type::isQueueT(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Expr::NPC_ValueDependentIsNull, ObjC(), clang::ASTContext::OverloadTy, Path, PerformImplicitConversion(), ResolveAddressOfOverloadedFunction(), TryImplicitConversion(), clang::VK_PRValue, and clang::ASTContext::VoidPtrTy.
Referenced by ActOnIndirectGotoStmt(), CheckAssignmentOperands(), clang::checkCollectionLiteralElement(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), IsStandardConversion(), and clang::InitializationSequence::Perform().
QualType Sema::CheckSizelessVectorCompareOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
BinaryOperatorKind | Opc | ||
) |
Definition at line 12799 of file SemaExpr.cpp.
References ACK_Comparison, CheckFloatComparison(), CheckSizelessVectorOperands(), clang::SemaBase::Diag(), diagnoseTautologicalComparison(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), GetSignedSizelessVectorType(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), clang::QualType::isNull(), clang::BuiltinType::isSVEBool(), and Loc.
Referenced by CheckCompareOperands().
QualType Sema::CheckSizelessVectorConditionalTypes | ( | ExprResult & | Cond, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | QuestionLoc | ||
) |
Definition at line 6884 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 10406 of file SemaExpr.cpp.
References ACK_Arithmetic, Context, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::ASTContext::BuiltinVectorTypeInfo::EC, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getBuiltinVectorTypeInfo(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isLValue(), clang::Type::isRealType(), clang::BuiltinType::isSVEBool(), clang::Type::isSveVLSBuiltinType(), Loc, tryGCCVectorConvertAndSplat(), and clang::Vector.
Referenced by CheckAdditionOperands(), CheckBitwiseOperands(), CheckMultiplyDivideOperands(), CheckRemainderOperands(), CheckSizelessVectorCompareOperands(), CheckSizelessVectorConditionalTypes(), and CheckSubtractionOperands().
bool Sema::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.
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 8872 of file SemaTemplate.cpp.
References Context, clang::SemaBase::Diag(), DiagLocForExplicitInstantiation(), getLangOpts(), clang::Decl::getLocation(), clang::Decl::getPreviousDecl(), clang::ASTContext::getTargetInfo(), getTemplateSpecializationKind(), clang::TargetInfo::getTriple(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), StripImplicitInstantiation(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by ActOnExplicitInstantiation(), CheckFunctionTemplateSpecialization(), CheckMemberSpecialization(), InstantiateClassMembers(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
void Sema::checkSpecializationReachability | ( | SourceLocation | Loc, |
NamedDecl * | Spec | ||
) |
Definition at line 11363 of file SemaTemplate.cpp.
References checkSpecializationVisibility(), getLangOpts(), Loc, and Reachable.
Referenced by CheckVarTemplateId(), and MarkFunctionReferenced().
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 11354 of file SemaTemplate.cpp.
References getLangOpts(), Loc, and Visible.
Referenced by checkSpecializationReachability(), and 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 114 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(), Kind, 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 6074 of file SemaExpr.cpp.
References Context, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseCalleeStaticArrayParam(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getAsConstantArrayType(), getASTContext(), clang::ArrayType::getElementType(), getLangOpts(), clang::ParmVarDecl::getOriginalType(), clang::ConstantArrayType::getSize(), clang::ArrayType::getSizeModifier(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInCharsIfKnown(), clang::ConstantArrayType::getZExtSize(), clang::Expr::IgnoreParenCasts(), clang::Expr::isNullPointerConstant(), clang::Expr::NPC_NeverValueDependent, and clang::Static.
Referenced by GatherArgumentsForCall().
void Sema::CheckStaticLocalForDllExport | ( | VarDecl * | VD | ) |
Check if VD needs to be dllexport/dllimport due to being in a dllexport/import function.
Definition at line 14611 of file SemaDecl.cpp.
References clang::Decl::addAttr(), getASTContext(), clang::Decl::getAttr(), clang::getDLLAttr(), clang::Decl::getParentFunctionOrMethod(), clang::Decl::hasAttr(), and clang::VarDecl::isStaticLocal().
Referenced by FinalizeDeclaration().
bool Sema::checkStringLiteralArgumentAttr | ( | const AttributeCommonInfo & | CI, |
const Expr * | E, | ||
StringRef & | Str, | ||
SourceLocation * | ArgLocation = nullptr |
||
) |
Check if the argument E
is a ASCII string literal.
If not emit an error and return false, otherwise set Str
to the value of the string literal and return true.
Definition at line 112 of file SemaDeclAttr.cpp.
References clang::AANT_ArgumentString, clang::SemaBase::Diag(), E, clang::Stmt::getBeginLoc(), and clang::Expr::IgnoreParenCasts().
Referenced by CheckCallingConvAttr(), checkFunctionConditionAttr(), checkStringLiteralArgumentAttr(), CreateAnnotationAttr(), handleAbiTagAttr(), handleAcquireHandleAttr(), handleAliasAttr(), HandleAnnotateTypeAttr(), handleArmAgnosticAttribute(), handleArmStateAttribute(), clang::SemaSwift::handleAsyncName(), clang::SemaSwift::handleAttrAttr(), handleAttrWithMessage(), clang::SemaSwift::handleBridge(), handleBTFDeclTagAttr(), handleCallableWhenAttr(), handleCapabilityAttr(), handleCodeModelAttr(), handleCodeSegAttr(), handleDeprecatedAttr(), handleDiagnoseIfAttr(), handleEnforceTCBAttr(), handleErrorAttr(), handleFunctionReturnThunksAttr(), handleHandleAttr(), handleIFuncAttr(), clang::SemaARM::handleInterruptAttr(), clang::SemaMIPS::handleInterruptAttr(), clang::SemaRISCV::handleInterruptAttr(), clang::SemaSwift::handleName(), clang::SemaARM::handleNewAttr(), handleNoBuiltinAttr(), handleNoSanitizeAttr(), handleNoSpecializations(), clang::SemaOpenMP::handleOMPAssumeAttr(), clang::SemaObjC::handleRuntimeName(), handleSectionAttr(), clang::SemaHLSL::handleShaderAttr(), handleSuppressAttr(), HandleSwiftAttr(), handleTargetAttr(), handleTargetClonesAttr(), handleTargetVersionAttr(), handleTLSModelAttr(), handleUuidAttr(), handleVisibilityAttr(), handleWarnUnusedResult(), handleWeakRefAttr(), clang::SemaWasm::handleWebAssemblyExportNameAttr(), clang::SemaWasm::handleWebAssemblyImportModuleAttr(), clang::SemaWasm::handleWebAssemblyImportNameAttr(), handleZeroCallUsedRegsAttr(), and instantiateDependentAnnotationAttr().
bool Sema::checkStringLiteralArgumentAttr | ( | const ParsedAttr & | Attr, |
unsigned | ArgNum, | ||
StringRef & | Str, | ||
SourceLocation * | ArgLocation = nullptr |
||
) |
Check if the argument ArgNum
of Attr
is a ASCII string literal.
If not emit an error and return false. If the argument is an identifier it will emit an error with a fixit hint and treat it as if it was a string literal.
Definition at line 129 of file SemaDeclAttr.cpp.
References clang::AANT_ArgumentString, checkStringLiteralArgumentAttr(), clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::ParsedAttr::getArgAsIdent(), clang::Stmt::getBeginLoc(), getLocForEndOfToken(), clang::Expr::IgnoreParenCasts(), clang::ParsedAttr::isArgIdent(), and Loc.
Sema::AccessResult Sema::CheckStructuredBindingMemberAccess | ( | SourceLocation | UseLoc, |
CXXRecordDecl * | DecomposedClass, | ||
DeclAccessPair | Field | ||
) |
Checks implicit access to a member in a structured binding.
Definition at line 1774 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, CheckAccess(), Context, getLangOpts(), and clang::ASTContext::getRecordType().
Referenced by checkMemberDecomposition().
QualType Sema::CheckSubtractionOperands | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
SourceLocation | Loc, | ||
QualType * | CompLHSTy = nullptr |
||
) |
Definition at line 11062 of file SemaExpr.cpp.
References ACK_Arithmetic, ACK_CompAssign, checkArithmeticBinOpPointerOperands(), checkArithmeticNull(), checkArithmeticOnObjCPointer(), checkArithmeticOpPointerOperand(), CheckMatrixElementwiseOperands(), CheckSizelessVectorOperands(), CheckVectorOperands(), Context, clang::CPlusPlus, clang::SemaBase::Diag(), diagnoseArithmeticOnNullPointer(), diagnosePointerIncompatibility(), diagnoseSubtractionOnNullPointer(), clang::Expr::EvaluateAsInt(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::APValue::getInt(), getLangOpts(), clang::Type::getPointeeType(), clang::ASTContext::getPointerDiffType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), clang::CanQual< T >::getUnqualifiedType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::IgnoreParenCasts(), InvalidOperands(), clang::Type::isAnyPointerType(), clang::Type::isArithmeticType(), clang::Type::isConstantMatrixType(), clang::Type::isFunctionType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isNullPointerConstant(), clang::Type::isObjCObjectPointerType(), clang::Type::isSveVLSBuiltinType(), clang::Expr::isValueDependent(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::CharUnits::isZero(), Loc, clang::Expr::NPC_ValueDependentIsNotNull, clang::ASTContext::typesAreCompatible(), UsualArithmeticConversions(), and clang::Expr::EvalResult::Val.
Referenced by CreateBuiltinBinOp().
ExprResult Sema::CheckSwitchCondition | ( | SourceLocation | SwitchLoc, |
Expr * | Cond | ||
) |
Definition at line 1120 of file SemaStmt.cpp.
References clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isEnumeralType(), clang::Type::isIntegralOrEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), Loc, PerformContextualImplicitConversion(), clang::T, and UsualUnaryConversions().
Referenced by ActOnCondition(), and CheckConditionVariable().
bool Sema::checkTargetAttr | ( | SourceLocation | LiteralLoc, |
StringRef | Str | ||
) |
Definition at line 3005 of file SemaDeclAttr.cpp.
References clang::ParsedTargetAttr::BranchProtection, Context, clang::ParsedTargetAttr::CPU, clang::SemaBase::Diag(), clang::ParsedTargetAttr::Duplicate, clang::ParsedTargetAttr::Features, clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::TargetInfo::isValidCPUName(), clang::TargetInfo::isValidFeatureName(), None, clang::TargetInfo::parseTargetAttr(), clang::TargetInfo::supportsTargetAttributeTune(), clang::Target, clang::TargetClones, clang::ParsedTargetAttr::Tune, Unknown, and clang::TargetInfo::validateBranchProtection().
Referenced by handleTargetAttr().
bool Sema::checkTargetClonesAttrString | ( | SourceLocation | LiteralLoc, |
StringRef | Str, | ||
const StringLiteral * | Literal, | ||
Decl * | D, | ||
bool & | HasDefault, | ||
bool & | HasCommas, | ||
bool & | HasNotDefault, | ||
SmallVectorImpl< SmallString< 64 > > & | StringsBuffer | ||
) |
Definition at line 3161 of file SemaDeclAttr.cpp.
References Context, clang::SemaBase::Diag(), clang::TargetInfo::doesFeatureAffectCodeGen(), clang::ParsedTargetAttr::Features, clang::TargetInfo::getFMVPriority(), getLangOpts(), getSourceManager(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::TargetInfo::isValidCPUName(), clang::TargetInfo::isValidFeatureName(), None, clang::TargetInfo::parseTargetAttr(), clang::Target, clang::TargetClones, Unknown, and clang::TargetInfo::validateCpuSupports().
Referenced by handleTargetClonesAttr().
bool Sema::checkTargetVersionAttr | ( | SourceLocation | Loc, |
Decl * | D, | ||
StringRef | Str | ||
) |
Check Target Version attrs.
Definition at line 3073 of file SemaDeclAttr.cpp.
References Context, clang::SemaBase::Diag(), clang::ParsedTargetAttr::Features, clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), None, clang::TargetInfo::parseTargetAttr(), clang::Target, clang::TargetClones, clang::TargetVersion, and clang::TargetInfo::validateCpuSupports().
Referenced by handleTargetVersionAttr().
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 15007 of file SemaChecking.cpp.
References clang::SemaBase::Diag(), getCurFunctionOrMethodDecl(), clang::Decl::hasAttr(), isUnevaluatedContext(), and clang::Decl::specific_attrs().
Referenced by CheckFunctionCall(), and 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 5201 of file SemaTemplate.cpp.
References ActOnPackExpansion(), clang::CXXScopeSpec::Adopt(), CheckNonTypeTemplateParameterType(), CheckTemplateArgument(), CheckTemplateTemplateArgument(), CheckTemplateTypeArgument(), Context, convertTypeTemplateArgumentToTemplate(), clang::DependentScopeDeclRefExpr::Create(), CTAK_Specified, CurContext, clang::TemplateArgument::Declaration, clang::SemaBase::Diag(), E, clang::TemplateArgument::Expression, clang::ActionResult< PtrTy, Compress >::get(), clang::TemplateArgumentLoc::getArgument(), clang::Type::getAs(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::SourceRange::getBegin(), clang::ASTContext::getCanonicalTemplateArgument(), clang::Decl::getDeclContext(), clang::TemplateTemplateParmDecl::getExpansionTemplateParameters(), clang::TemplateArgument::getKind(), getLangOpts(), clang::TemplateArgumentLoc::getLocation(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateArgumentLoc::getTemplateEllipsisLoc(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateDecl::getTemplateParameters(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), clang::TypeSourceInfo::getTypeLoc(), clang::TemplateArgumentLoc::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), clang::TemplateArgument::Integral, clang::DeclContext::isDependentContext(), clang::TemplateTemplateParmDecl::isExpandedParameterPack(), clang::Type::isFunctionType(), clang::Type::isInstantiationDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::TemplateArgument::isNull(), clang::QualType::isNull(), NoteTemplateParameterLocation(), clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, NumSFINAEErrors, clang::TemplateArgument::Pack, clang::TemplateArgument::StructuralValue, SubstTemplateParams(), SubstType(), clang::T, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
Referenced by ActOnTypeParameter(), CheckTemplateArgument(), CheckTemplateArgumentList(), CheckTemplateTypeArgument(), ConvertDeducedTemplateArgument(), ConvertDeducedTemplateArguments(), and LookupLiteralOperator().
ExprResult Sema::CheckTemplateArgument | ( | NonTypeTemplateParmDecl * | Param, |
QualType | InstantiatedParamType, | ||
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 6717 of file SemaTemplate.cpp.
References ActOnConstantExpression(), ActOnFinishFullExpr(), clang::AlreadyDiagnosed, BuildConvertedConstantExpression(), clang::Type::castAs(), CCEK_TemplateArg, CheckConvertedConstantExpression(), CheckNonTypeTemplateParameterType(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), ConstantEvaluated, Context, clang::CPlusPlus11, clang::CPlusPlus17, clang::CPlusPlus20, clang::InitializationKind::CreateForInit(), CTAK_Deduced, DeduceAutoType(), DeduceTemplateSpecializationFromInitializer(), DefaultLvalueConversion(), clang::SemaBase::Diag(), DiagnoseUseOfDecl(), E, clang::Enum, EvaluateConvertedConstantExpression(), clang::ExprError(), FixOverloadedFunctionReference(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::Decl::getCanonicalDecl(), clang::ASTContext::getCanonicalTemplateArgument(), clang::ASTContext::getCanonicalType(), clang::Type::getContainedDeducedType(), clang::NamedDecl::getDeclName(), clang::NonTypeTemplateParmDecl::getDepth(), clang::Expr::getExprLoc(), clang::ASTContext::getIntWidth(), getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::PointerType::getPointeeType(), clang::ReferenceType::getPointeeType(), clang::MemberPointerType::getPointeeType(), clang::Stmt::getSourceRange(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::ASTContext::getTypeSize(), clang::QualType::getUnqualifiedType(), clang::QualType::hasQualifiers(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::IgnoreParenImpCasts(), ImpCastExprToType(), clang::InitializedEntity::InitializeTemplateParameter(), clang::Type::isArrayType(), clang::Type::isBitIntType(), clang::Type::isBooleanType(), clang::DeducedType::isDeduced(), clang::Type::isDependentType(), clang::Type::isEnumeralType(), clang::Type::isFunctionType(), clang::Type::isIncompleteOrObjectType(), clang::Type::isIntegralOrEnumerationType(), IsIntegralPromotion(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isLValueReferenceType(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), isNullPointerValueTemplateArgument(), clang::Type::isNullPtrType(), clang::Type::isPointerOrReferenceType(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isRValueReferenceType(), clang::Type::isSignedIntegerOrEnumerationType(), clang::Expr::isTypeDependent(), clang::Type::isUnsignedIntegerOrEnumerationType(), clang::Expr::isValueDependent(), Loc, NoteTemplateParameterLocation(), NPV_Error, NPV_NotNullPointer, NPV_NullPointer, clang::ASTContext::OverloadTy, clang::InitializationSequence::Perform(), ResolveAddressOfOverloadedFunction(), clang::Result, clang::Success, clang::T, toString(), VerifyIntegerConstantExpression(), clang::VK_LValue, clang::VK_PRValue, and clang::VK_XValue.
bool Sema::CheckTemplateArgument | ( | TypeSourceInfo * | Arg | ) |
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 6115 of file SemaTemplate.cpp.
References Context, clang::SemaBase::Diag(), clang::SourceRange::getBegin(), clang::ASTContext::getCanonicalType(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::hasUnnamedOrLocalType(), clang::Type::isVariablyModifiedType(), LangOpts, and clang::ASTContext::OverloadTy.
bool Sema::CheckTemplateArgumentList | ( | TemplateDecl * | Template, |
SourceLocation | TemplateLoc, | ||
TemplateArgumentListInfo & | TemplateArgs, | ||
const DefaultArguments & | DefaultArgs, | ||
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. |
DefaultArgs | any default arguments from template specialization deduction. |
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 5490 of file SemaTemplate.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::DefaultArguments::Args, clang::TemplateParameterList::begin(), clang::Decl::castToDeclContext(), CheckTemplateArgument(), clang::ConstraintsNotSatisfied, Context, clang::TemplateArgument::CreatePackCopy(), CTAK_Specified, CurrentInstantiationScope, clang::SemaBase::Diag(), diagnoseMissingArgument(), clang::TemplateParameterList::end(), EnsureTemplateArgumentListConstraints(), clang::TemplateArgumentLoc::getArgument(), getArgument(), clang::ASTContext::getCanonicalTemplateArgument(), clang::Decl::getDeclContext(), clang::TemplateParameterList::getDepth(), clang::getExpandedPackSize(), clang::Decl::getKind(), clang::NamedDecl::getMostRecentDecl(), clang::LocalInstantiationScope::getPartiallySubstitutedPack(), clang::TemplateArgumentListInfo::getRAngleLoc(), clang::TemplateParameterList::getSourceRange(), clang::TemplateDecl::getTemplatedDecl(), getTemplateInstantiationArgs(), getTemplateNameKindForDiagnostics(), GetTemplateParameterList(), int, clang::Sema::InstantiatingTemplate::isInvalid(), clang::TemplateArgument::isNull(), clang::isSubstitutedDefaultArgument(), NoteTemplateLocation(), NoteTemplateParameterLocation(), clang::TemplateArgumentListInfo::size(), clang::DefaultArguments::StartPos, and SubstDefaultTemplateArgumentIfAvailable().
Referenced by ActOnClassTemplateSpecialization(), ActOnExplicitInstantiation(), ActOnVarTemplateSpecialization(), CheckConceptTemplateId(), CheckDeducedPlaceholderConstraints(), CheckTemplateIdType(), CheckVarTemplateId(), FinishTemplateArgumentDeduction(), clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), SubstituteExplicitTemplateArguments(), 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 7998 of file SemaTemplate.cpp.
References clang::SemaBase::Diag(), clang::DeclContext::getExternCContext(), clang::DeclContext::getRedeclContext(), clang::TemplateParameterList::getSourceRange(), clang::TemplateParameterList::getTemplateLoc(), clang::DeclContext::isExternCContext(), and clang::DeclContext::isFileContext().
Referenced by ActOnAliasDeclaration(), ActOnClassTemplateSpecialization(), ActOnFunctionDeclarator(), ActOnTag(), ActOnVariableDeclarator(), and CheckClassTemplate().
QualType Sema::CheckTemplateIdType | ( | TemplateName | Template, |
SourceLocation | TemplateLoc, | ||
TemplateArgumentListInfo & | TemplateArgs | ||
) |
Definition at line 3464 of file SemaTemplate.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterRetainedLevels(), clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), AliasTemplate, clang::TemplateSpecializationType::anyDependentTemplateArguments(), clang::TemplateArgumentListInfo::arguments(), checkBuiltinTemplateIdType(), CheckTemplateArgumentList(), ClassTemplate, Context, clang::ClassTemplateSpecializationDecl::Create(), CurContext, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), clang::TemplateArgument::Expression, findFailedBooleanCondition(), clang::ASTContext::getCanonicalTemplateSpecializationType(), clang::Type::getCanonicalTypeInternal(), clang::ASTContext::getDependentTemplateSpecializationType(), clang::DependentTemplateName::getIdentifier(), clang::MultiLevelTemplateArgumentList::getInnermost(), getLangOpts(), clang::DeclContext::getLookupParent(), clang::DependentTemplateName::getQualifier(), clang::Stmt::getSourceRange(), clang::ASTContext::getTemplateSpecializationType(), clang::ASTContext::getTypeDeclType(), clang::TypedefNameDecl::getUnderlyingType(), InstantiateAttrsForDecl(), clang::QualType::isCanonical(), isEnableIfAliasTemplate(), clang::DependentTemplateName::isIdentifier(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), isSFINAEContext(), clang::None, NoteAllFoundTemplates(), clang::SemaBase::PDiag(), resolveAssumedTemplateNameAsType(), clang::Decl::setLexicalDeclContext(), SubstType(), and clang::TSK_Undeclared.
Referenced by ActOnCXXNestedNameSpecifier(), ActOnTagTemplateIdType(), ActOnTemplateIdType(), ActOnTypenameType(), BuildStdInitializerList(), builtinCommonTypeImpl(), checkBuiltinTemplateIdType(), FindInstantiatedDecl(), lookupCoroutineHandleType(), lookupPromiseType(), lookupStdTypeTraitMember(), 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 2299 of file SemaTemplate.cpp.
References clang::TemplateParameterList::begin(), Context, clang::SemaBase::Diag(), DiagnoseDefaultTemplateArgument(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::TemplateParameterList::end(), getASTContext(), clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::TemplateTypeParmDecl::getDefaultArgumentLoc(), clang::NonTypeTemplateParmDecl::getDefaultArgumentLoc(), clang::Module::getFullModuleName(), clang::Decl::getImportedOwningModule(), clang::Decl::getLocation(), clang::TemplateArgumentLoc::getLocation(), clang::Decl::getOwningModule(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateTypeParmDecl::hasDefaultArgument(), clang::NonTypeTemplateParmDecl::hasDefaultArgument(), clang::TemplateTemplateParmDecl::hasDefaultArgument(), hasVisibleDefaultArgument(), clang::Invalid, clang::TemplateTemplateParmDecl::isPackExpansion(), clang::TemplateTemplateParmDecl::isParameterPack(), clang::TemplateTemplateParmDecl::removeDefaultArgument(), clang::TemplateTemplateParmDecl::setInheritedDefaultArgument(), clang::SkipBodyInfo::ShouldSkip, TPC_ClassTemplate, TPC_FriendClassTemplate, TPC_TypeAliasTemplate, TPC_VarTemplate, and UPPC_NonTypeTemplateParameterType.
Referenced by ActOnAliasDeclaration(), ActOnFunctionDeclarator(), ActOnVariableDeclarator(), CheckClassTemplate(), MatchTemplateParametersToScopeSpecifier(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
void Sema::CheckTemplatePartialSpecialization | ( | ClassTemplatePartialSpecializationDecl * | Partial | ) |
Definition at line 4103 of file SemaTemplate.cpp.
References checkTemplatePartialSpecialization().
Referenced by ActOnClassTemplateSpecialization(), ActOnVarTemplateSpecialization(), clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), and clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization().
void Sema::CheckTemplatePartialSpecialization | ( | VarTemplatePartialSpecializationDecl * | Partial | ) |
Definition at line 4108 of file SemaTemplate.cpp.
References checkTemplatePartialSpecialization().
bool Sema::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.
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 8265 of file SemaTemplate.cpp.
References CheckNonTypeTemplatePartialSpecializationArgs(), clang::Decl::getDeclContext(), clang::TemplateParameterList::getParam(), clang::TemplateDecl::getTemplateParameters(), clang::DeclContext::isDependentContext(), and clang::TemplateParameterList::size().
Referenced by ActOnClassTemplateSpecialization(), ActOnVarTemplateSpecialization(), 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 7324 of file SemaTemplate.cpp.
References clang::SemaBase::Diag(), clang::TemplateArgumentLoc::getArgument(), clang::TemplateParameterList::getAssociatedConstraints(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), getLangOpts(), clang::Decl::getLocation(), clang::TemplateArgumentLoc::getLocation(), clang::TemplateArgumentLoc::getSourceRange(), IsAtLeastAsConstrained(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), TemplateParameterListsAreEqual(), and TPL_TemplateTemplateArgumentMatch.
Referenced by CheckTemplateArgument().
bool Sema::CheckTemplateTypeArgument | ( | TemplateTypeParmDecl * | Param, |
TemplateArgumentLoc & | Arg, | ||
SmallVectorImpl< TemplateArgument > & | SugaredConverted, | ||
SmallVectorImpl< TemplateArgument > & | CanonicalConverted | ||
) |
Definition at line 4824 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::Adopt(), clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, CheckTemplateArgument(), CodeSynthesisContexts, Context, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), diagnoseMissingTemplateArguments(), clang::TemplateArgument::Expression, clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsExpr(), clang::DeclarationName::getAsIdentifierInfo(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::SourceRange::getBegin(), clang::ASTContext::getCanonicalType(), clang::ASTContext::getDependentNameType(), clang::SourceRange::getEnd(), clang::TemplateArgument::getKind(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::QualType::getObjCLifetime(), clang::ASTContext::getQualifiedType(), clang::CXXScopeSpec::getScopeRep(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateArgumentLoc::getTypeSourceInfo(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), clang::Type::isObjCLifetimeType(), Loc, LookupOrdinaryName, LookupParsedName(), NoteTemplateParameterLocation(), clang::Qualifiers::OCL_Strong, clang::TemplateArgument::Pack, clang::TypeLocBuilder::push(), clang::Result, clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), clang::Qualifiers::setObjCLifetime(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, clang::TemplateArgument::Type, and clang::Typename.
Referenced by CheckTemplateArgument().
bool Sema::checkThisInStaticMemberFunctionAttributes | ( | CXXMethodDecl * | Method | ) |
Check whether 'this' shows up in the attributes of the given static member function.
Definition at line 18870 of file SemaDeclCXX.cpp.
References clang::Decl::attrs().
Referenced by ActOnFinishDelayedAttribute(), and checkThisInStaticMemberFunctionType().
bool Sema::checkThisInStaticMemberFunctionExceptionSpec | ( | CXXMethodDecl * | Method | ) |
Whether this' shows up in the exception specification of a static member function.
Definition at line 18828 of file SemaDeclCXX.cpp.
References E, 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::exceptions(), clang::TypeLoc::getAs(), clang::FunctionProtoType::getExceptionSpecType(), clang::FunctionProtoType::getNoexceptExpr(), clang::TypeSourceInfo::getTypeLoc(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by actOnDelayedExceptionSpecification(), and checkThisInStaticMemberFunctionType().
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 18791 of file SemaDeclCXX.cpp.
References checkThisInStaticMemberFunctionAttributes(), checkThisInStaticMemberFunctionExceptionSpec(), E, clang::TypeLoc::getAs(), clang::FunctionTypeLoc::getReturnLoc(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::TypeSourceInfo::getTypeLoc(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), clang::DeclaratorDecl::getTypeSourceInfo(), and clang::FunctionProtoType::hasTrailingReturn().
Referenced by CheckFunctionDeclaration().
void Sema::CheckThreadLocalForLargeAlignment | ( | VarDecl * | VD | ) |
Definition at line 14648 of file SemaDecl.cpp.
References Context, clang::SemaBase::Diag(), clang::ASTContext::getDeclAlign(), clang::Decl::getLocation(), clang::TargetInfo::getMaxTLSAlign(), clang::CharUnits::getQuantity(), clang::ASTContext::getTargetInfo(), clang::VarDecl::getTLSKind(), clang::VarDecl::hasDependentAlignment(), and clang::ASTContext::toCharUnitsFromBits().
Referenced by FinalizeDeclaration().
Sema::AssignConvertType Sema::CheckTransparentUnionArgumentConstraints | ( | QualType | ArgType, |
ExprResult & | RHS | ||
) |
Definition at line 9576 of file SemaExpr.cpp.
References clang::Type::castAs(), CheckAssignmentConstraints(), Compatible, ConstructTransparentUnion(), Context, clang::RecordDecl::fields(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsUnionType(), clang::RecordType::getDecl(), clang::PointerType::getPointeeType(), clang::Expr::getType(), clang::Decl::hasAttr(), ImpCastExprToType(), Incompatible, clang::Expr::isNullPointerConstant(), clang::Type::isPointerType(), clang::Type::isVoidType(), and clang::Expr::NPC_ValueDependentIsNull.
Referenced by clang::InitializationSequence::Perform(), and PerformImplicitConversion().
bool Sema::CheckTypeConstraint | ( | TemplateIdAnnotation * | TypeConstraint | ) |
Definition at line 1064 of file SemaTemplate.cpp.
References CheckConceptUseInDefinition(), clang::SemaBase::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.
Referenced by BuildTypeConstraint().
void Sema::CheckTypedefForVariablyModifiedType | ( | Scope * | S, |
TypedefNameDecl * | D | ||
) |
Definition at line 6716 of file SemaDecl.cpp.
References Context, clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::TypeSourceInfo::getType(), clang::TypedefNameDecl::getTypeSourceInfo(), clang::Type::isVariableArrayType(), clang::Type::isVariablyModifiedType(), setFunctionHasBranchProtectedScope(), clang::Decl::setInvalidDecl(), clang::TypedefNameDecl::setTypeSourceInfo(), clang::T, toString(), and TryToFixInvalidVariablyModifiedTypeSourceInfo().
Referenced by ActOnAliasDeclaration(), and ActOnTypedefDeclarator().
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 10820 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::Adopt(), clang::LookupResult::Ambiguous, computeDeclContext(), Context, clang::CPlusPlus17, clang::FixItHint::CreateInsertion(), clang::declaresSameEntity(), clang::SemaBase::Diag(), findFailedBooleanCondition(), clang::LookupResult::Found, clang::LookupResult::FoundOverloaded, clang::LookupResult::FoundUnresolvedValue, clang::NestedNameSpecifier::getAsType(), clang::getAsTypeTemplateDecl(), clang::SourceRange::getBegin(), clang::CXXScopeSpec::getBeginLoc(), clang::ASTContext::getDeducedTemplateSpecializationType(), clang::ASTContext::getDependentNameType(), clang::ASTContext::getElaboratedType(), clang::Expr::getExprLoc(), getLangOpts(), clang::Decl::getLocation(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::Stmt::getSourceRange(), getTemplateNameKindForDiagnostics(), clang::ASTContext::getTypeDeclType(), int, clang::NestedNameSpecifier::isDependent(), isEnableIf(), clang::SourceLocation::isValid(), Loc, LookupName(), LookupOrdinaryName, LookupQualifiedName(), MarkAnyDeclReferenced(), NoteTemplateLocation(), clang::LookupResult::NotFound, clang::LookupResult::NotFoundInCurrentInstantiation, RequireCompleteDeclContext(), clang::Result, clang::T, and clang::Typename.
QualType Sema::CheckTypenameType | ( | ElaboratedTypeKeyword | Keyword, |
SourceLocation | KeywordLoc, | ||
NestedNameSpecifierLoc | QualifierLoc, | ||
const IdentifierInfo & | II, | ||
SourceLocation | IILoc, | ||
TypeSourceInfo ** | TSI, | ||
bool | DeducedTSTContext | ||
) |
Definition at line 10789 of file SemaTemplate.cpp.
References clang::TypeLoc::castAs(), CheckTypenameType(), Context, clang::ASTContext::CreateTypeSourceInfo(), clang::ElaboratedTypeLoc::getNamedTypeLoc(), clang::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), and clang::T.
Referenced by ActOnTemplatedFriendTag(), ActOnTypenameType(), ActOnTypeRequirement(), BuildMemInitializer(), CheckTypenameType(), getDestructorName(), getTypeName(), 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 1980 of file Sema.cpp.
References clang::C, D, clang::SemaBase::Diag(), clang::ASTContext::DoubleTy, clang::Builtin::evaluateRequiredTargetFeatures(), clang::ASTContext::FloatTy, clang::QualType::getCanonicalType(), clang::ASTContext::getFloatTypeSemantics(), clang::ASTContext::getFunctionFeatureMap(), clang::Decl::getLocation(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ASTContext::getTypeSize(), clang::QualType::getUnqualifiedType(), clang::TargetInfo::hasBFloat16Type(), clang::TargetInfo::hasBitIntType(), clang::TargetInfo::hasFloat128Type(), clang::TargetInfo::hasFloat16Type(), clang::TargetInfo::hasFPReturn(), clang::TargetInfo::hasIbm128Type(), clang::TargetInfo::hasInt128Type(), clang::TargetInfo::hasLongDoubleType(), clang::TargetInfo::hasRISCVVTypes(), clang::IsArmStreamingFunction(), clang::Type::isBFloat16Type(), clang::Type::isBitIntType(), clang::Type::isDependentType(), clang::Type::isFloat128Type(), clang::Type::isFloat16Type(), clang::Type::isIbm128Type(), clang::Type::isIntegerType(), clang::QualType::isNull(), clang::Type::isRealFloatingType(), clang::Type::isRVVSizelessBuiltinType(), clang::Type::isSVESizelessBuiltinType(), Loc, clang::ASTContext::LongDoubleTy, clang::SemaBase::PDiag(), clang::Decl::setInvalidDecl(), and Visited.
Referenced by ActOnFinishFunctionBody(), CreateBuiltinBinOp(), and DiagnoseUseOfDecl().
bool Sema::CheckTypeTraitArity | ( | unsigned | Arity, |
SourceLocation | Loc, | ||
size_t | N | ||
) |
Definition at line 6003 of file SemaExprCXX.cpp.
References clang::SemaBase::Diag(), int, and Loc.
Referenced by BuildTypeTrait().
|
inline |
If Expr is a valid integer constant, get the value of the integer expression and return success or failure.
May output an error.
Negative argument is implicitly converted to unsigned, unless StrictlyUnsigned
is true.
Definition at line 4423 of file Sema.h.
References clang::AANT_ArgumentIntegerConstant, Context, clang::SemaBase::Diag(), getAttrLoc(), clang::Expr::getExprLoc(), clang::Expr::getIntegerConstantExpr(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), toString(), and UINT_MAX.
Referenced by clang::checkAMDGPUFlatWorkGroupSizeArguments(), clang::checkAMDGPUMaxNumWorkGroupsArguments(), clang::checkAMDGPUWavesPerEUArguments(), checkPositiveIntArgument(), CheckRegparmAttr(), clang::SemaAMDGPU::handleAMDGPUNumSGPRAttr(), clang::SemaAMDGPU::handleAMDGPUNumVGPRAttr(), clang::SemaSwift::handleAsyncError(), handleCallbackAttr(), handleConstructorAttr(), handleDestructorAttr(), handleDiagnoseAsBuiltinAttr(), handleFormatAttr(), handleInitPriorityAttr(), handleLayoutVersion(), handleMinVectorWidthAttr(), clang::SemaHLSL::handleNumThreadsAttr(), clang::SemaHLSL::handlePackOffsetAttr(), handlePassObjectSizeAttr(), handlePatchableFunctionEntryAttr(), clang::SemaOpenCL::handleSubGroupSize(), handleVTablePointerAuthentication(), clang::SemaHLSL::handleWaveSizeAttr(), and handleWorkGroupSize().
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 4227 of file SemaExpr.cpp.
References CheckExtensionTraitOperandType(), CheckObjCTraitOperandConstraints(), CheckUnevaluatedOperand(), CheckVecStepTraitOperandType(), CheckVectorElementsTraitOperandType(), Context, clang::SemaBase::Diag(), E, clang::ASTContext::getBaseElementType(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::getTraitSpelling(), clang::TargetInfo::getTriple(), clang::Expr::getType(), clang::Expr::HasSideEffects(), clang::Expr::IgnoreParens(), inTemplateInstantiation(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::Expr::isInstantiationDependent(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::Type::isVariableArrayType(), clang::Type::isWebAssemblyTableType(), RequireCompleteSizedExprType(), RequireCompleteSizedType(), clang::Result, and warnOnSizeofOnArrayDecay().
Referenced by CheckAlignasTypeArgument(), CheckAlignOfExpr(), CheckVecStepExpr(), and CreateUnaryExprOrTypeTraitExpr().
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 4519 of file SemaExpr.cpp.
References clang::C2y, captureVariablyModifiedType(), CheckExtensionTraitOperandType(), CheckObjCTraitOperandConstraints(), checkPtrAuthTypeDiscriminatorOperandType(), CheckVecStepTraitOperandType(), CheckVectorElementsTraitOperandType(), clang::DeclContext::containsDecl(), Context, clang::CPlusPlus, clang::SemaBase::Diag(), E, FunctionScopes, clang::Type::getAs(), clang::ASTContext::getBaseElementType(), getLangOpts(), clang::Type::getPointeeType(), clang::ASTContext::getTargetInfo(), clang::getTraitSpelling(), clang::TargetInfo::getTriple(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isIncompleteArrayType(), clang::Type::isVariablyModifiedType(), clang::Type::isWebAssemblyTableType(), and RequireCompleteSizedType().
ExprResult Sema::CheckUnevaluatedOperand | ( | Expr * | E | ) |
Definition at line 8656 of file SemaExprCXX.cpp.
References CheckUnusedVolatileAssignment(), and E.
Referenced by ActOnDecltypeExpression(), BuildCXXNoexceptExpr(), BuildCXXTypeId(), and CheckUnaryExprOrTypeTraitOperand().
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 20905 of file SemaExpr.cpp.
References Context, DefaultArgumentPromotion(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), clang::ExplicitCastExpr::getTypeAsWritten(), clang::InitializedEntity::InitializeParameter(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and PerformCopyInitialization().
Referenced by clang::SemaObjC::CheckMessageArgumentTypes(), and GatherArgumentsForCall().
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 20881 of file SemaExpr.cpp.
References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::Expr::getValueKind(), clang::ActionResult< PtrTy, Compress >::isUsable(), and RequireCompleteType().
Sema::AccessResult Sema::CheckUnresolvedLookupAccess | ( | UnresolvedLookupExpr * | E, |
DeclAccessPair | FoundDecl | ||
) |
Definition at line 1575 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, CheckAccess(), Context, E, clang::Found, getLangOpts(), and clang::Stmt::getSourceRange().
Referenced by FinishOverloadedCallExpr().
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 1589 of file SemaAccess.cpp.
References AR_accessible, clang::AS_public, clang::Type::castAs(), CheckAccess(), Context, E, clang::Found, getLangOpts(), getPointeeType(), and clang::Stmt::getSourceRange().
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 13720 of file SemaChecking.cpp.
References checkUnsafeAssignObject(), clang::QualType::getObjCLifetime(), Loc, LT, clang::Qualifiers::OCL_ExplicitNone, and clang::Qualifiers::OCL_Weak.
Referenced by AddInitializerToDecl(), and checkUnsafeExprAssigns().
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 13733 of file SemaChecking.cpp.
References clang::cast(), checkUnsafeAssignObject(), checkUnsafeAssigns(), clang::SemaBase::Diag(), Diags, getCurFunction(), 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::DiagnosticsEngine::isIgnored(), clang::ObjCPropertyRefExpr::isImplicitProperty(), clang::QualType::isNull(), clang::Type::isObjCRetainableType(), clang::ObjCPropertyAttribute::kind_assign, clang::ObjCPropertyAttribute::kind_weak, Loc, LT, clang::sema::FunctionScopeInfo::markSafeWeakUse(), clang::Qualifiers::OCL_None, and clang::Qualifiers::OCL_Weak.
Referenced by CheckAssignmentOperands().
void Sema::checkUnusedDeclAttributes | ( | Declarator & | D | ) |
checkUnusedDeclAttributes - Given a declarator which is not being used to build a declaration, complain about any decl attributes which might be lying around on it.
Definition at line 7530 of file SemaDeclAttr.cpp.
References checkUnusedDeclAttributes(), D, and clang::Decl::getAttrs().
Referenced by ActOnCastExpr(), ActOnTypeName(), and checkUnusedDeclAttributes().
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 17475 of file SemaExpr.cpp.
References clang::CPlusPlus20, E, ExprEvalContexts, getLangOpts(), 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 14131 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::NamedDecl::getName(), clang::CXXMethodDecl::getParent(), clang::Stmt::getSourceRange(), and clang::Expr::IgnoreParens().
Referenced by CheckAddressOfOperand().
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 13165 of file SemaDeclCXX.cpp.
References computeDeclContext(), clang::CPlusPlus11, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), CurContext, clang::SemaBase::Diag(), 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().
Referenced by BuildUsingDeclaration().
bool Sema::CheckUsingDeclRedeclaration | ( | SourceLocation | UsingLoc, |
bool | HasTypenameKeyword, | ||
const CXXScopeSpec & | SS, | ||
SourceLocation | NameLoc, | ||
const LookupResult & | Previous | ||
) |
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 13090 of file SemaDeclCXX.cpp.
References clang::LookupResult::begin(), Context, CurContext, D, clang::SemaBase::Diag(), E, 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().
Referenced by BuildUsingDeclaration().
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 12373 of file SemaDeclCXX.cpp.
References CheckOverload(), Context, clang::CPlusPlus11, CurContext, D, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), E, 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 BuildUsingDeclaration(), BuildUsingEnumDeclaration(), and 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 4801 of file SemaDecl.cpp.
References clang::VarDecl::demoteThisDefinitionToDeclaration(), clang::SemaBase::Diag(), clang::Decl::getDeclContext(), clang::VarDecl::getDescribedVarTemplate(), clang::NamedDecl::getFormalLinkage(), clang::Decl::getLocation(), clang::DeclaratorDecl::getNumTemplateParameterLists(), hasVisibleDefinition(), clang::Internal, clang::DeclContext::isDependentContext(), clang::VarDecl::isInline(), makeMergedDefinitionVisible(), notePreviousDefinition(), and clang::Decl::setInvalidDecl().
Referenced by AddInitializerToDecl(), and MergeVarDecl().
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 8954 of file SemaDecl.cpp.
References checkForConflictWithNonVisibleExternC(), CheckVariableDeclarationType(), clang::Decl::isInvalidDecl(), MergeVarDecl(), and Previous.
Referenced by ActOnVariableDeclarator(), and BuildVariableInstantiation().
void Sema::CheckVariableDeclarationType | ( | VarDecl * | NewVD | ) |
Definition at line 8638 of file SemaDecl.cpp.
References clang::C23, CheckAlignasUnderalignment(), CheckC23ConstexprVarType(), clang::SemaRISCV::checkRVVTypeSupport(), Context, clang::CPlusPlus, clang::FixItHint::CreateInsertion(), CurContext, clang::Default, clang::SemaBase::Diag(), diagnoseOpenCLTypes(), clang::Builtin::evaluateRequiredTargetFeatures(), clang::ASTContext::getAsConstantArrayType(), getASTContext(), clang::ASTContext::getAsVariableArrayType(), getCurFunctionDecl(), getCurScope(), clang::ASTContext::getFunctionFeatureMap(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getObjCObjectPointerType(), getOpenCLOptions(), clang::VariableArrayType::getSizeExpr(), clang::Stmt::getSourceRange(), clang::VarDecl::getStorageClass(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasGlobalStorage(), clang::NamedDecl::hasLinkage(), clang::VarDecl::hasLocalStorage(), clang::HIP, clang::IsArmStreamingFunction(), clang::Type::isBlockPointerType(), clang::VarDecl::isConstexpr(), clang::Type::isDependentType(), clang::VarDecl::isFileVarDecl(), clang::Type::isHLSLSpecificType(), clang::Decl::isInvalidDecl(), clang::VarDecl::isLocalVarDecl(), clang::QualType::isNull(), clang::Type::isObjCObjectType(), clang::Type::isRVVSizelessBuiltinType(), clang::Type::isSamplerT(), clang::Type::isSizelessType(), clang::VarDecl::isStaticLocal(), clang::Type::isSVESizelessBuiltinType(), clang::VarDecl::isThisDeclarationADefinition(), clang::Type::isUndeducedType(), clang::Type::isVariableArrayType(), clang::Type::isVariablyModifiedType(), clang::Type::isVoidType(), clang::Type::isWebAssemblyTableType(), clang::ConstantArrayType::isZeroSize(), LangOpts, clang::LangOptionsBase::NonGC, OpenCL(), clang::opencl_constant, clang::opencl_global, clang::opencl_local, clang::opencl_private, PPC(), RequireLiteralType(), RISCV(), clang::SC_Static, setFunctionHasBranchProtectedScope(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), clang::DeclaratorDecl::setTypeSourceInfo(), clang::T, TryToFixInvalidVariablyModifiedType(), and TryToFixInvalidVariablyModifiedTypeSourceInfo().
Referenced by buildCoroutinePromise(), CheckVariableDeclaration(), and DeduceVariableDeclarationType().
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 997 of file SemaExpr.cpp.
References clang::CPlusPlus11, clang::SemaBase::Diag(), DiagRuntimeBehavior(), clang::QualType::DK_nontrivial_c_struct, E, clang::Stmt::getBeginLoc(), getLangOpts(), clang::Expr::getType(), hasCStrMethod(), clang::QualType::isDestructedType(), clang::Type::isObjCObjectType(), clang::Type::isRecordType(), isValidVarArgType(), clang::SemaBase::PDiag(), VAK_Invalid, VAK_MSVCUndefined, VAK_Undefined, VAK_Valid, and VAK_ValidInCXX11.
Referenced by checkCall().
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 4510 of file SemaTemplate.cpp.
References BuildDeclarationNameExpr(), CheckVarTemplateId(), 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 4347 of file SemaTemplate.cpp.
References clang::TemplateSpecCandidateSet::addCandidate(), clang::TemplateSpecializationType::anyDependentTemplateArguments(), clang::AS_public, BuildVarTemplateInstantiation(), checkSpecializationReachability(), CheckTemplateArgumentList(), Context, D, DeduceTemplateArguments(), clang::SemaBase::Diag(), clang::VarTemplateDecl::findSpecialization(), clang::Decl::getDeclContext(), clang::TemplateSpecCandidateSet::getLocation(), getMoreSpecializedPartialSpecialization(), clang::VarTemplateDecl::getMostRecentDecl(), clang::VarTemplateDecl::getPartialSpecializations(), getTemplateArgumentBindingsText(), clang::VarTemplateDecl::getTemplatedDecl(), clang::DeclContext::isDependentContext(), clang::RedeclarableTemplateDecl::isMemberSpecialization(), clang::DeclAccessPair::make(), clang::MakeDeductionFailureInfo(), P, clang::Result, clang::TemplateSpecCandidate::set(), clang::Decl::setInvalidDecl(), clang::Success, and clang::sema::TemplateDeductionInfo::takeSugared().
Referenced by ActOnExplicitInstantiation(), BuildMemberReferenceExpr(), BuildTemplateIdExpr(), and CheckVarTemplateId().
Definition at line 4390 of file SemaExpr.cpp.
References CheckUnaryExprOrTypeTraitOperand(), E, clang::Expr::IgnoreParens(), and clang::Expr::isTypeDependent().
Referenced by CreateUnaryExprOrTypeTraitExpr().
bool Sema::CheckVectorCast | ( | SourceRange | R, |
QualType | VectorTy, | ||
QualType | Ty, | ||
CastKind & | Kind | ||
) |
Definition at line 7649 of file SemaExpr.cpp.
References areLaxCompatibleVectorTypes(), Context, clang::SemaBase::Diag(), clang::SourceRange::getBegin(), 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 12738 of file SemaExpr.cpp.
References clang::AltiVecVector, clang::Type::castAs(), CheckFloatComparison(), CheckVectorOperands(), Context, clang::SemaBase::Diag(), diagnoseTautologicalComparison(), clang::LangOptionsBase::GCC, clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::ASTContext::getLogicalOperationType(), GetSignedVectorType(), clang::Expr::getType(), clang::VectorType::getVectorKind(), clang::Type::hasFloatingRepresentation(), clang::QualType::isNull(), Loc, clang::LangOptionsBase::Mixed, and clang::LangOptionsBase::XL.
Referenced by CheckCompareOperands().
QualType Sema::CheckVectorConditionalTypes | ( | ExprResult & | Cond, |
ExprResult & | LHS, | ||
ExprResult & | RHS, | ||
SourceLocation | QuestionLoc | ||
) |
Definition at line 6795 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, | ||
BinaryOperatorKind | Opc | ||
) |
Definition at line 12962 of file SemaExpr.cpp.
References CheckVectorOperands(), clang::CPlusPlus, clang::SemaHLSL::emitLogicalOperatorFixIt(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), getLangOpts(), GetSignedVectorType(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), HLSL(), clang::LangOptionsBase::HLSL_2021, InvalidLogicalVectorOperands(), InvalidOperands(), clang::QualType::isNull(), Loc, and OpenCL().
Referenced by CheckLogicalOperands().
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 10143 of file SemaExpr.cpp.
References clang::AltiVecBool, clang::AltiVecVector, anyAltivecTypes(), clang::ASTContext::areCompatibleVectorTypes(), Context, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::Generic, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getCommonSugaredType(), clang::VectorType::getElementType(), getLangOpts(), clang::VectorType::getNumElements(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::QualType::getUnqualifiedType(), clang::VectorType::getVectorKind(), clang::SemaHLSL::handleVectorBinOpConversion(), clang::ASTContext::hasSameType(), HLSL(), ImpCastExprToType(), InvalidOperands(), clang::Type::isExtVectorBoolType(), clang::Type::isExtVectorType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isLaxVectorConversion(), clang::Expr::isLValue(), clang::Type::isRealType(), clang::Type::isRVVSizelessBuiltinType(), clang::Type::isScalarType(), clang::Type::isSizelessBuiltinType(), clang::Type::isSVESizelessBuiltinType(), clang::Type::isVectorType(), Loc, OpenCL(), clang::RVVFixedLengthData, clang::RVVFixedLengthMask, clang::RVVFixedLengthMask_1, clang::RVVFixedLengthMask_2, clang::RVVFixedLengthMask_4, clang::SveFixedLengthData, clang::SveFixedLengthPredicate, tryGCCVectorConvertAndSplat(), tryVectorConvertAndSplat(), and clang::Vector.
Referenced by CheckAdditionOperands(), CheckBitwiseOperands(), CheckConditionalOperands(), CheckMultiplyDivideOperands(), CheckRemainderOperands(), CheckSubtractionOperands(), CheckVectorCompareOperands(), CheckVectorConditionalTypes(), CheckVectorLogicalOperands(), CXXCheckConditionalOperands(), and OpenCLCheckVectorConditional().
void Sema::CheckVirtualDtorCall | ( | CXXDestructorDecl * | dtor, |
SourceLocation | Loc, | ||
bool | IsDelete, | ||
bool | CallCanBeVirtual, | ||
bool | WarnOnNonAbstractTypes, | ||
SourceLocation | DtorLoc | ||
) |
Definition at line 4002 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.
Referenced by ActOnCXXDelete().
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 862 of file SemaDecl.cpp.
References clang::LookupResult::Ambiguous, buildNamedType(), clang::Class, computeDeclContext(), clang::Sema::NameClassification::Concept(), Context, CorrectTypo(), clang::CPlusPlus, clang::CPlusPlus20, clang::UnresolvedLookupExpr::Create(), CTK_ErrorRecovery, D, clang::Sema::NameClassification::DependentNonType(), diagnoseTypo(), DiagnoseUseOfDecl(), clang::Sema::NameClassification::Error(), FilterAcceptableTemplateNames(), FirstDecl, clang::Found, clang::LookupResult::Found, clang::LookupResult::FoundOverloaded, clang::LookupResult::FoundUnresolvedValue, clang::Sema::NameClassification::FunctionTemplate(), clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getAssumedTemplateName(), getAsTemplateNameDecl(), getCurMethodDecl(), getLangOpts(), clang::DeclarationNameInfo::getName(), clang::ASTContext::getObjCInterfaceType(), clang::ASTContext::getOverloadedTemplateName(), clang::ASTContext::getQualifiedTemplateName(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::UsingShadowDecl::getTargetDecl(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::getUsingType(), clang::CXXScopeSpec::getWithLocInContext(), hasAnyAcceptableTemplateNames(), ImplicitlyDefineFunction(), clang::Token::is(), isCurrentClassName(), clang::CXXScopeSpec::isEmpty(), clang::CXXScopeSpec::isInvalid(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Token::isNot(), clang::Token::isOneOf(), isResultTypeOrTemplate(), clang::CXXScopeSpec::isSet(), isTagTypeWithMissingTag(), clang::ActionResult< PtrTy, Compress >::isUsable(), LookupBuiltin(), clang::SemaObjC::LookupIvarInObjCMethod(), LookupOrdinaryName, LookupParsedName(), clang::OpaquePtr< QualType >::make(), MarkAnyDeclReferenced(), clang::Sema::NameClassification::NonType(), clang::LookupResult::NotFound, clang::LookupResult::NotFoundInCurrentInstantiation, ObjC(), clang::Sema::NameClassification::OverloadSet(), clang::SemaBase::PDiag(), recoverFromTypeInKnownDependentBase(), clang::Result, clang::T, clang::Sema::NameClassification::TypeTemplate(), clang::Sema::NameClassification::UndeclaredNonType(), clang::Sema::NameClassification::UndeclaredTemplate(), clang::Sema::NameClassification::Unknown(), UseArgumentDependentLookup(), and clang::Sema::NameClassification::VarTemplate().
void Sema::CleanupVarDeclMarking | ( | ) |
Definition at line 19667 of file SemaExpr.cpp.
References E, MarkVarDeclODRUsed(), and MaybeODRUseExprs.
Referenced by ActOnGCCAsmStmt(), clang::SemaOpenMP::EndOpenMPClause(), InstantiateDefaultCtorDefaultArgs(), MaybeCreateExprWithCleanups(), MaybeCreateStmtWithCleanups(), and PopExpressionEvaluationContext().
void Sema::clearDelayedTypo | ( | TypoExpr * | TE | ) |
Clears the state of the given TypoExpr.
Definition at line 5745 of file SemaLookup.cpp.
Referenced by ActOnIdExpression(), and buildMemberCall().
|
inline |
Definition at line 1066 of file Sema.h.
Referenced by AddRecordMembersCompletionResults(), 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 618 of file SemaTemplateVariadic.cpp.
|
static |
Collect the set of unexpanded parameter packs within the given expression.
Definition at line 625 of file SemaTemplateVariadic.cpp.
References E.
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 611 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 601 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 589 of file SemaTemplateVariadic.cpp.
Referenced by ActOnTemplatedFriendTag(), clang::FoldExpandedConstraint::AreCompatibleForSubsumption(), calculateConstraintSatisfaction(), checkExceptionSpecification(), collectUnexpandedParameterPacks(), instantiateDependentAlignedAttr(), 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 595 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 606 of file SemaTemplateVariadic.cpp.
Sema::ReferenceCompareResult Sema::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).
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 4943 of file SemaOverload.cpp.
References clang::ASTContext::canBindObjCObjectType(), clang::ASTContext::getCanonicalType(), clang::ASTContext::getUnqualifiedArrayType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ASTContext::hasSimilarType(), clang::Type::isFunctionType(), clang::Type::isObjCObjectOrInterfaceType(), isQualificationConversionStep(), clang::Type::isReferenceType(), Loc, clang::ASTContext::UnwrapSimilarTypes(), and withoutUnaligned().
Referenced by CXXCheckConditionalOperands(), FindConversionForRefInit(), TryListConversion(), TryReferenceInit(), TryReferenceInitializationCore(), TryReferenceListInitialization(), and TryRefInitWithConversionFunction().
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 16096 of file SemaDeclCXX.cpp.
References DiagnoseSentinelCalls(), GatherArgumentsForCall(), clang::FunctionProtoType::getNumParams(), clang::Invalid, Loc, VariadicConstructor, and VariadicDoesNotApply.
Referenced by BuildCXXCastArgument(), CopyObject(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), and PerformImplicitConversion().
void Sema::completeExprArrayBound | ( | Expr * | E | ) |
Definition at line 9036 of file SemaType.cpp.
References Context, E, clang::ASTContext::getAsIncompleteArrayType(), clang::ASTContext::getConstantArrayType(), clang::Expr::getExprLoc(), clang::ASTContext::getSizeType(), clang::ASTContext::getTypeSize(), clang::Expr::IgnoreParens(), InstantiateVariableDefinition(), clang::isTemplateInstantiation(), clang::Normal, 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 1011 of file SemaLambda.cpp.
References clang::DeclContext::addDecl(), buildLambdaScopeReturnType(), buildTypeForLambdaCallOperator(), CheckParmsForFunctionDef(), 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().
Referenced by ActOnStartOfLambdaDefinition().
void Sema::CompleteMemberSpecialization | ( | NamedDecl * | Member, |
LookupResult & | Previous | ||
) |
Definition at line 9585 of file SemaTemplate.cpp.
References completeMemberSpecializationImpl(), clang::Enum, clang::Function, and clang::Member.
Referenced by ActOnFunctionDeclarator(), ActOnTag(), ActOnVariableDeclarator(), and 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 5360 of file SemaTemplateInstantiateDecl.cpp.
References deduceOpenCLAddressSpace(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::TypeSourceInfo::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), InstantiateVariableInitializer(), clang::VarDecl::isThisDeclarationADefinition(), 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 53 of file SemaCXXScopeSpec.cpp.
References ClassTemplate, Context, ContextType, diagnoseMissingImport(), clang::Type::getAs(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsRecordDecl(), clang::NestedNameSpecifier::getAsType(), clang::ASTContext::getCanonicalType(), getCurrentInstantiationOf(), 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 45 of file SemaCXXScopeSpec.cpp.
References CurContext, clang::Type::getAs(), clang::Type::isDependentType(), and clang::T.
Referenced by ActOnCXXEnterDeclaratorScope(), ActOnCXXExitDeclaratorScope(), ActOnCXXMemberDeclarator(), ActOnFriendFunctionDecl(), ActOnPseudoDestructorExpr(), ActOnTag(), ActOnTemplateIdType(), ActOnTemplateName(), ActOnTypenameType(), ActOnVariableDeclarator(), buildCoroutineHandle(), BuildCXXNestedNameSpecifier(), BuildMemberReferenceExpr(), BuildMemInitializer(), BuildQualifiedDeclarationNameExpr(), BuildQualifiedTemplateIdExpr(), BuildUsingDeclaration(), CheckBaseSpecifier(), CheckClassTemplate(), CheckExplicitObjectMemberFunction(), CheckQualifiedMemberReference(), CheckTypenameType(), CheckUsingDeclQualifier(), ClassifyName(), clang::SemaCodeCompletion::CodeCompleteQualifiedId(), DiagnoseEmptyLookup(), DiagnoseUnknownTemplateName(), DiagnoseUnknownTypeName(), emitEmptyLookupTypoDiagnostic(), getCurrentClass(), getDestructorName(), GetFullTypeForDeclarator(), getTypeName(), HandleDeclarator(), isCurrentClassNameTypo(), isDeclaratorFunctionLike(), LookupMemberExprInRecord(), LookupParsedName(), LookupTemplateName(), MatchTemplateParametersToScopeSpecifier(), clang::TreeTransform< Derived >::RebuildDependentNameType(), TryNamespaceTypoCorrection(), 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 15814 of file SemaDecl.cpp.
References E, and clang::ReturnStmt::setNRVOCandidate().
Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().
|
inlinestatic |
Definition at line 7338 of file Sema.h.
Referenced by ActOnCondition(), ActOnConditionVariable(), and clang::TreeTransform< Derived >::TransformCondition().
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 499 of file SemaAttr.cpp.
References clang::AANT_ArgumentConstantExpr, Context, clang::ConstantExpr::Create(), clang::ImplicitCastExpr::Create(), clang::Expr::EvalStatus::Diag, clang::SemaBase::Diag(), E, 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::Note, clang::Result, clang::Expr::EvalResult::Val, and clang::VK_PRValue.
Referenced by CreateAnnotationAttr(), and HandleAnnotateTypeAttr().
bool Sema::ConstraintExpressionDependsOnEnclosingTemplate | ( | const FunctionDecl * | Friend, |
unsigned | TemplateDepth, | ||
const Expr * | Constraint | ||
) |
Definition at line 1735 of file SemaTemplate.cpp.
References clang::Friend.
Referenced by FriendConstraintsDependOnEnclosingTemplate().
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 987 of file SemaTemplateVariadic.cpp.
References clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::Expr::containsUnexpandedParameterPack(), clang::NestedNameSpecifier::containsUnexpandedParameterPack(), clang::Type::containsUnexpandedParameterPack(), D, clang::EST_Dynamic, clang::DeclaratorChunk::FunctionTypeInfo::Exceptions, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::OpaquePtr< PtrTy >::get(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType(), clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::CXXScopeSpec::getScopeRep(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType(), clang::ValueDecl::getType(), 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 | ExecConfig = 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 5813 of file SemaExpr.cpp.
References clang::ASTContext::BuiltinInfo, clang::Call, Context, clang::SemaBase::Diag(), diagnoseTypo(), GatherArgumentsForCall(), clang::FunctionDecl::getBuiltinID(), clang::TypoCorrection::getCorrectionRange(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::FunctionDecl::getMinRequiredArguments(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getParametersSourceRange(), getVariadicCallType(), clang::Builtin::Context::hasCustomTypechecking(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::Invalid, isParenthetizedAndQualifiedAddressOfExpr(), clang::FunctionProtoType::isVariadic(), clang::SemaBase::PDiag(), and TryTypoCorrectionForCall().
Referenced by BuildResolvedCallExpr().
Sema::DeclGroupPtrTy Sema::ConvertDeclToDeclGroup | ( | Decl * | Ptr, |
Decl * | OwnedType = nullptr |
||
) |
Definition at line 72 of file SemaDecl.cpp.
References Context, clang::DeclGroupRef::Create(), and clang::OpaquePtr< PtrTy >::make().
Referenced by ActOnModuleDecl(), buildCoroutineParameterMoves(), BuildCXXForRangeStmt(), instantiateOMPDeclareSimdDeclAttr(), instantiateOMPDeclareVariantAttr(), clang::Parser::ParseTopLevelDecl(), and precomputeExpr().
ExprResult Sema::ConvertMemberDefaultInitExpression | ( | FieldDecl * | FD, |
Expr * | InitExpr, | ||
SourceLocation | InitLoc | ||
) |
Definition at line 4060 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(), and BuildCXXDefaultInitExpr().
ExprResult Sema::ConvertParamDefaultArgument | ( | ParmVarDecl * | Param, |
Expr * | DefaultArg, | ||
SourceLocation | EqualLoc | ||
) |
Definition at line 280 of file SemaDeclCXX.cpp.
References Context, clang::InitializationKind::CreateCopy(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::InitializedEntity::InitializeParameter(), MaybeCreateExprWithCleanups(), clang::InitializationSequence::Perform(), RequireCompleteType(), and clang::Result.
Referenced by ActOnParamDefaultArgument(), BuildCXXDefaultArgExpr(), and SubstDefaultArgument().
ExprResult Sema::ConvertVectorExpr | ( | Expr * | E, |
TypeSourceInfo * | TInfo, | ||
SourceLocation | BuiltinLoc, | ||
SourceLocation | RParenLoc | ||
) |
ConvertVectorExpr - Handle __builtin_convertvector.
Definition at line 5203 of file SemaChecking.cpp.
References clang::Type::castAs(), Context, clang::SemaBase::Diag(), E, 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 9174 of file SemaExprCXX.cpp.
References CreateRecoveryExpr(), E, ExprEvalContexts, clang::Stmt::getBeginLoc(), clang::Stmt::getEndLoc(), clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.
Referenced by ActOnCaseExpr(), ActOnCastExpr(), ActOnCoawaitExpr(), ActOnConditionalOp(), ActOnConstantExpression(), ActOnCoreturnStmt(), ActOnCoyieldExpr(), ActOnCXXFoldExpr(), ActOnCXXTypeConstructExpr(), ActOnFinishCXXInClassMemberInitializer(), ActOnFinishFullExpr(), ActOnPackIndexingExpr(), ActOnRequiresClause(), ActOnReturnStmt(), AddInitializerToDecl(), BuildCXXAssumeExpr(), BuildMemInitializer(), BuildResolvedCallExpr(), clang::SemaObjC::CheckObjCForCollectionOperand(), CheckPackExpansion(), CheckPlaceholderExpr(), CorrectDelayedTyposInBinOp(), FinishForRangeVarDecl(), clang::Parser::ParseConstraintExpression(), clang::Parser::ParseConstraintLogicalAndExpression(), clang::Parser::ParseConstraintLogicalOrExpression(), and clang::Parser::ParseOpenMPVarList().
|
inline |
TypoCorrection Sema::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.
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 5268 of file SemaLookup.cpp.
References checkCorrectionVisibility(), Consumer, CTK_ErrorRecovery, clang::DeclarationName::getAsIdentifierInfo(), clang::DeclarationName::getAsString(), clang::TypoCorrection::getCorrection(), clang::TypoCorrection::getEditDistance(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::Result, clang::TypoCorrection::setCorrectionRange(), clang::CorrectionCandidateCallback::WantObjCSuper, and clang::CorrectionCandidateCallback::WantRemainingKeywords.
Referenced by clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), ActOnSizeofParameterPackExpr(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), BuildCXXNestedNameSpecifier(), BuildMemInitializer(), BuildUsingDeclaration(), ClassifyName(), DiagnoseEmptyLookup(), diagnoseExprIntendedAsTemplateName(), DiagnoseInvalidRedeclaration(), DiagnoseUnknownTypeName(), clang::SemaObjC::FindProtocolDeclaration(), clang::SemaObjC::getObjCInterfaceDecl(), clang::SemaObjC::getObjCMessageKind(), getTypeName(), clang::SemaObjC::HandleExprPropertyRefExpr(), ImplicitlyDefineFunction(), LookupMemberExpr(), clang::SemaOpenMP::lookupOpenMPDeclareTargetName(), LookupTemplateName(), resolveAssumedTemplateNameAsType(), TryNamespaceTypoCorrection(), and TryTypoCorrectionForCall().
TypoExpr * Sema::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.
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 5365 of file SemaLookup.cpp.
References Consumer, CTK_ErrorRecovery, ExprEvalContexts, clang::DeclarationName::getAsIdentifierInfo(), clang::DeclarationNameInfo::getLoc(), and clang::DeclarationNameInfo::getName().
Referenced by DiagnoseEmptyLookup(), and LookupMemberExprInRecord().
Attr * Sema::CreateAnnotationAttr | ( | const AttributeCommonInfo & | CI, |
StringRef | Annot, | ||
MutableArrayRef< Expr * > | Args | ||
) |
CreateAnnotationAttr - Creates an annotation Annot with Args arguments.
Definition at line 2782 of file Sema.cpp.
References ConstantFoldAttrArgs(), and Context.
Referenced by CreateAnnotationAttr(), handleAnnotateAttr(), instantiateDependentAnnotationAttr(), and ProcessStmtAttribute().
Attr * Sema::CreateAnnotationAttr | ( | const ParsedAttr & | AL | ) |
Definition at line 2793 of file Sema.cpp.
References checkStringLiteralArgumentAttr(), CreateAnnotationAttr(), clang::ParsedAttr::getArgAsExpr(), clang::ParsedAttr::getNumArgs(), and clang::ParsedAttr::isArgIdent().
FunctionDecl * Sema::CreateBuiltin | ( | IdentifierInfo * | II, |
QualType | Type, | ||
unsigned | ID, | ||
SourceLocation | Loc | ||
) |
Definition at line 2289 of file SemaDecl.cpp.
References clang::Decl::addAttr(), AddKnownFunctionAttributes(), clang::ASTContext::BuiltinInfo, clang::C, clang::Consteval, Context, clang::CPlusPlus, clang::CPlusPlus20, clang::LinkageSpecDecl::Create(), clang::ParmVarDecl::Create(), clang::FunctionDecl::Create(), getCurFPFeatures(), getLangOpts(), clang::ASTContext::getTranslationUnitDecl(), clang::Type::isFunctionProtoType(), clang::Builtin::Context::isImmediate(), Loc, Parent, clang::SC_Extern, clang::SC_None, clang::Decl::setImplicit(), clang::ParmVarDecl::setScopeInfo(), and clang::Unspecified.
Referenced by LazilyCreateBuiltin().
ExprResult Sema::CreateBuiltinArraySubscriptExpr | ( | Expr * | Base, |
SourceLocation | LLoc, | ||
Expr * | Idx, | ||
SourceLocation | RLoc | ||
) |
Definition at line 5120 of file SemaExpr.cpp.
References clang::SemaObjC::BuildObjCSubscriptExpression(), captureVariablyModifiedType(), clang::Type::castAs(), clang::DeclContext::containsDecl(), Context, clang::CPlusPlus, clang::CPlusPlus11, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), E, clang::ExprError(), FunctionScopes, clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getArrayDecayedType(), clang::Type::getAs(), getASTContext(), clang::Stmt::getBeginLoc(), getDependentArraySubscriptType(), clang::VectorType::getElementType(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::Type::getPointeeType(), getPointeeType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Type::getSveEltType(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::QualType::hasQualifiers(), clang::Expr::IgnoreParenImpCasts(), ImpCastExprToType(), clang::Type::isArrayType(), clang::Type::isBuiltinType(), clang::QualType::isCForbiddenLValueType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isPRValue(), clang::Type::isSpecificBuiltinType(), clang::Type::isSubscriptableVectorType(), clang::LangOptions::isSubscriptPointerArithmetic(), clang::BuiltinType::isSVEBool(), clang::Type::isSveVLSBuiltinType(), clang::Expr::isTypeDependent(), clang::Type::isVariablyModifiedType(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), LangOpts, ObjC(), clang::OK_Ordinary, clang::OK_VectorComponent, RequireCompleteSizedType(), clang::Result, TemporaryMaterializationConversion(), clang::VK_LValue, clang::VK_PRValue, and clang::VK_XValue.
Referenced by ActOnArraySubscriptExpr(), actOnOMPReductionKindClause(), checkArrayLikeDecomposition(), and clang::InitializationSequence::Perform().
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 14768 of file SemaExpr.cpp.
References CheckAdditionOperands(), CheckAssignmentOperands(), CheckBitwiseOperands(), CheckCommaOperands(), CheckCompareOperands(), CheckLogicalOperands(), CheckMultiplyDivideOperands(), checkNonTrivialCUnion(), checkObjCPointerIntrospection(), CheckPointerToMemberOperands(), CheckRemainderOperands(), CheckShiftOperands(), CheckSubtractionOperands(), checkTypeSupport(), Context, convertHalfVecBinOp(), CorrectDelayedTyposInBinOp(), clang::CPlusPlus, clang::CPlusPlus11, clang::BinaryOperator::Create(), clang::CompoundAssignOperator::Create(), clang::InitializationKind::CreateDirectList(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), CurFPFeatureOverrides(), clang::SemaBase::Diag(), DiagnoseDirectIsaAccess(), DiagnoseSelfAssignment(), DiagnoseSelfMove(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::IdentifierTable::get(), clang::Type::getAsCXXRecordDecl(), clang::Stmt::getBeginLoc(), getCurScope(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), getLangOpts(), getLocForEndOfToken(), clang::Expr::getObjectKind(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::ASTContext::HalfTy, clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::ASTContext::Idents, clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParens(), clang::Init, clang::InitializedEntity::InitializeTemporary(), InvalidOperands(), clang::Type::isAtomicType(), clang::Type::isBlockPointerType(), clang::Type::isFixedPointType(), clang::Type::isImageType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isPipeType(), clang::Type::isSamplerT(), clang::ActionResult< PtrTy, Compress >::isUsable(), isVector(), LookupOrdinaryName, LookupSingleName(), needsConversionOfHalfVec(), NTCUC_Assignment, NTCUK_Copy, clang::OK_ObjCProperty, clang::OK_Ordinary, OpenCL(), clang::InitializationSequence::Perform(), RecordModifiableNonNullParam(), TUScope, UsualUnaryConversions(), clang::VK_LValue, and clang::VK_PRValue.
Referenced by clang::SemaOpenMP::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), BuildBinOp(), buildCounterUpdate(), buildPostUpdate(), buildSingleCopyAssignRecursively(), and clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
ExprResult Sema::CreateBuiltinMatrixSubscriptExpr | ( | Expr * | Base, |
Expr * | RowIdx, | ||
Expr * | ColumnIdx, | ||
SourceLocation | RBLoc | ||
) |
Definition at line 5006 of file SemaExpr.cpp.
References CheckPlaceholderExpr(), Context, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::Dim, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::Expr::getIntegerConstantExpr(), clang::Expr::getType(), clang::ASTContext::IncompleteMatrixIdxTy, clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Expr::isTypeDependent().
Referenced by ActOnArraySubscriptExpr(), and clang::TreeTransform< Derived >::RebuildMatrixSubscriptExpr().
ExprResult Sema::CreateBuiltinUnaryOp | ( | SourceLocation | OpLoc, |
UnaryOperatorKind | Opc, | ||
Expr * | InputExpr, | ||
bool | IsAfterAmp = false |
||
) |
Definition at line 15498 of file SemaExpr.cpp.
References clang::AltiVecBool, clang::ASTContext::BoolTy, clang::Type::castAs(), CheckAddressOfOperand(), CheckIncrementDecrementOperand(), CheckIndirectionOperand(), CheckRealImagOperand(), Context, convertVector(), clang::CPlusPlus, clang::UnaryOperator::Create(), CurFPFeatureOverrides(), DefaultFunctionArrayLvalueConversion(), DefaultLvalueConversion(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), clang::ExprError(), ExprEvalContexts, clang::ASTContext::FloatTy, clang::Generic, clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::ASTContext::getLogicalOperationType(), clang::Expr::getObjectKind(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Type::getPointeeType(), GetSignedVectorType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::VectorType::getVectorKind(), clang::ASTContext::HalfTy, clang::Type::hasIntegerRepresentation(), HLSL(), ImpCastExprToType(), clang::Type::isAnyComplexType(), clang::Type::isArithmeticType(), clang::Type::isAtomicType(), clang::Type::isBlockPointerType(), clang::Type::isComplexIntegerType(), clang::Type::isComplexType(), clang::Type::isDependentType(), clang::Type::isExtVectorType(), clang::Expr::isGLValue(), clang::Type::isHalfType(), clang::Type::isImageType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), isOverflowingIntegerType(), clang::Type::isPipeType(), clang::Type::isPointerType(), clang::Type::isSamplerT(), clang::Type::isScalarType(), isScopedEnumerationType(), clang::Type::isSpecificBuiltinType(), clang::Type::isSveVLSBuiltinType(), clang::Expr::isTypeDependent(), isUnevaluatedContext(), clang::SourceLocation::isValid(), clang::Type::isVectorType(), clang::QualType::isWebAssemblyReferenceType(), needsConversionOfHalfVec(), clang::OK_Ordinary, OpenCL(), RecordModifiableNonNullParam(), ScalarTypeToBooleanCastKind(), clang::T, UsualUnaryConversions(), and clang::VK_PRValue.
Referenced by clang::SemaOpenMP::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAffinityClause(), clang::SemaOpenMP::ActOnOpenMPDependClause(), buildCapture(), buildCaptureDecl(), BuildCaptureInit(), buildCoroutinePromise(), BuildExpressionFromDeclTemplateArgument(), BuildUnaryOp(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), collectPlacementArgs(), DefineImplicitLambdaToBlockPointerConversion(), clang::SemaOpenMP::getOpenMPCapturedExpr(), and clang::InterfaceKindVisitor::VisitReferenceType().
RecordDecl * Sema::CreateCapturedStmtRecordDecl | ( | CapturedDecl *& | CD, |
SourceLocation | Loc, | ||
unsigned | NumParams | ||
) |
Definition at line 4503 of file SemaStmt.cpp.
References clang::DeclContext::addDecl(), Context, clang::CPlusPlus, clang::CapturedDecl::Create(), clang::CXXRecordDecl::Create(), clang::RecordDecl::Create(), CurContext, getLangOpts(), clang::DeclContext::getParent(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), clang::DeclContext::isRecord(), Loc, clang::RecordDecl::setCapturedRecord(), clang::Decl::setImplicit(), clang::TagDecl::startDefinition(), and clang::Struct.
Referenced by ActOnCapturedRegionStart().
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 1671 of file SemaExpr.cpp.
References clang::Expr::containsUnexpandedParameterPack(), clang::Type::containsUnexpandedParameterPack(), Context, clang::GenericSelectionExpr::Create(), D, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::QualType::getCanonicalType(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::TypeLoc::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::QualType::hasQualifiers(), clang::Expr::HasSideEffects(), clang::Expr::IgnoreParens(), inTemplateInstantiation(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isRecordType(), clang::Expr::isTypeDependent(), LangOpts, P, clang::ASTContext::typesAreCompatible(), and Unevaluated.
Referenced by ActOnGenericSelectionExpr(), clang::TreeTransform< Derived >::RebuildGenericSelectionExpr(), and rebuildPotentialResultsAsNonOdrUsed().
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 832 of file SemaModule.cpp.
References clang::DeclContext::addDecl(), clang::Module::AllVisible, Consumer, clang::ImportDecl::CreateImplicit(), getASTContext(), getLangOpts(), getModuleLoader(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTConsumer::HandleImplicitImportDecl(), isSFINAEContext(), clang::VisibleModuleSet::isVisible(), Loc, clang::ModuleLoader::makeModuleVisible(), and clang::VisibleModuleSet::setVisible().
Referenced by diagnoseMissingImport().
CXXMethodDecl * Sema::CreateLambdaCallOperator | ( | SourceRange | IntroducerRange, |
CXXRecordDecl * | Class | ||
) |
Definition at line 975 of file SemaLambda.cpp.
References clang::AS_public, clang::Class, Context, clang::CXXMethodDecl::Create(), clang::ASTContext::DeclarationNames, clang::SourceRange::getBegin(), getCurFPFeatures(), clang::DeclarationNameTable::getCXXOperatorName(), clang::DeclarationNameLoc::makeCXXOperatorNameLoc(), clang::SC_None, clang::Decl::setAccess(), and clang::Unspecified.
Referenced by ActOnLambdaExpressionAfterIntroducer().
CXXRecordDecl * Sema::createLambdaClosureType | ( | SourceRange | IntroducerRange, |
TypeSourceInfo * | Info, | ||
unsigned | LambdaDependencyKind, | ||
LambdaCaptureDefault | CaptureDefault | ||
) |
Create a new lambda closure type.
Definition at line 251 of file SemaLambda.cpp.
References clang::DeclContext::addDecl(), clang::Class, Context, clang::CXXRecordDecl::CreateLambda(), CurContext, clang::SourceRange::getBegin(), getCurLambda(), getGenericLambdaTemplateParameterList(), clang::DeclContext::getParent(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), and clang::DeclContext::isRecord().
Referenced by ActOnLambdaExpressionAfterIntroducer().
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 852 of file SemaLambda.cpp.
References Context, clang::VarDecl::Create(), clang::TypeLoc::getAs(), getCurLambda(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getTypeLoc(), Id, clang::Init, clang::VarDecl::isParameterPack(), Loc, clang::sema::CapturingScopeInfo::LocalPacks, clang::Decl::markUsed(), clang::SC_Auto, clang::VarDecl::setInit(), clang::VarDecl::setInitCapture(), clang::VarDecl::setInitStyle(), and clang::Decl::setReferenced().
Referenced by ActOnLambdaExpressionAfterIntroducer().
CUDALaunchBoundsAttr * Sema::CreateLaunchBoundsAttr | ( | const AttributeCommonInfo & | CI, |
Expr * | MaxThreads, | ||
Expr * | MinBlocks, | ||
Expr * | MaxBlocks | ||
) |
Create an CUDALaunchBoundsAttr attribute.
Definition at line 5383 of file SemaDeclAttr.cpp.
References Context, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), getOffloadArch(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), makeLaunchBoundsArgExpr(), clang::OffloadArchToString(), SM, clang::SM_90, and clang::UNKNOWN.
Referenced by AddLaunchBoundsAttr().
MaterializeTemporaryExpr * Sema::CreateMaterializeTemporaryExpr | ( | QualType | T, |
Expr * | Temporary, | ||
bool | BoundToLvalueReference | ||
) |
Definition at line 7583 of file SemaInit.cpp.
References Cleanup, Context, currentEvaluationContext(), clang::Sema::ExpressionEvaluationContextRecord::ForRangeLifetimeExtendTemps, isInLifetimeExtendingContext(), clang::CleanupInfo::setExprNeedsCleanups(), and clang::T.
Referenced by BuildCoyieldExpr(), BuildResolvedCoawaitExpr(), CheckAddressOfOperand(), ImpCastExprToType(), clang::InitializationSequence::Perform(), and TemporaryMaterializationConversion().
ExprResult Sema::CreateOverloadedArraySubscriptExpr | ( | SourceLocation | LLoc, |
SourceLocation | RLoc, | ||
Expr * | Base, | ||
MultiExprArg | Args | ||
) |
Definition at line 15173 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::BestViableFunction(), clang::Type::castAs(), checkArgPlaceholdersForOverload(), clang::CXXOperatorCallExpr::Create(), CreateFunctionRefExpr(), clang::OverloadCandidateSet::CSK_Operator, 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::StringLiteral::getString(), clang::ValueDecl::getType(), clang::Expr::getValueKindForType(), clang::Expr::hasAnyTypeDependentArguments(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Passing, PrepareArgumentsForCallToObjectOfClassType(), Range, clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::OverloadCandidateSet::size(), and clang::VK_PRValue.
Referenced by ActOnArraySubscriptExpr().
ExprResult Sema::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.
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 14575 of file SemaOverload.cpp.
References allowAmbiguity(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), clang::OverloadCandidateSet::BestViableFunction(), clang::ImplicitConversionSequence::Better, clang::sema::checkAssignmentLifetime(), checkPlaceholderForOverload(), CompareImplicitConversionSequences(), clang::OverloadCandidateSet::CompleteCandidates(), clang::CPlusPlus20, clang::IntegerLiteral::Create(), clang::BinaryOperator::Create(), clang::CompoundAssignOperator::Create(), clang::CXXOperatorCallExpr::Create(), CreateFunctionRefExpr(), clang::CRK_DifferentOperator, clang::CRK_None, clang::OverloadCandidateSet::CSK_Operator, clang::ASTContext::DeclarationNames, clang::declaresSameEntity(), clang::ASTContext::DependentTy, Diag(), DiagnoseTwoPhaseOperatorLookup(), E, 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(), 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::StringLiteral::getString(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::Expr::getValueKindForType(), clang::ASTContext::hasSameUnqualifiedType(), clang::InitializedEntity::InitializeParameter(), clang::ASTContext::IntTy, clang::Type::isBooleanType(), clang::Sema::DefaultedFunctionKind::isComparison(), clang::BinaryOperator::isCompoundAssignmentOp(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), 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, clang::OverloadCandidateSet::NoteCandidates(), 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, clang::Passing, clang::Result, clang::Sema::CodeSynthesisContext::RewritingOperatorAsSpaceship, clang::OverloadCandidateSet::shouldDeferDiags(), clang::OverloadCandidateSet::size(), clang::VK_LValue, and clang::VK_PRValue.
Referenced by BuildOverloadedBinOp(), HasNonDeletedDefaultedEqualityComparison(), clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr(), and clang::TreeTransform< Derived >::RebuildCXXRewrittenBinaryOperator().
ExprResult Sema::CreateOverloadedUnaryOp | ( | SourceLocation | OpLoc, |
UnaryOperatorKind | Opc, | ||
const UnresolvedSetImpl & | Fns, | ||
Expr * | input, | ||
bool | RequiresADL = 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 14317 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::BestViableFunction(), clang::Type::castAs(), checkPlaceholderForOverload(), clang::IntegerLiteral::Create(), clang::UnaryOperator::Create(), clang::CXXOperatorCallExpr::Create(), CreateFunctionRefExpr(), clang::OverloadCandidateSet::CSK_Operator, 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(), clang::InitializedEntity::InitializeParameter(), clang::ASTContext::IntTy, clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), 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, clang::Passing, clang::OverloadCandidateSet::size(), clang::VK_LValue, and clang::VK_PRValue.
Referenced by BuildOperatorCoawaitCall(), BuildUnaryOp(), and 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 6395 of file SemaType.cpp.
References BumpAlloc, clang::Type::getTypeClass(), clang::OpaquePtr< QualType >::make(), and clang::T.
Referenced by ActOnCastExpr(), ActOnDependentTag(), ActOnMSVCUnknownTypeName(), clang::SemaObjC::ActOnObjCInstanceType(), clang::SemaObjC::actOnObjCProtocolQualifierType(), clang::SemaObjC::actOnObjCTypeArgsAndProtocolQualifiers(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperVarDecl(), ActOnPackExpansion(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), ActOnTagTemplateIdType(), ActOnTemplateIdType(), ActOnTypeName(), ActOnTypenameType(), BuildCXXForRangeStmt(), buildNamedType(), getDestructorName(), getInheritingConstructorName(), clang::SemaObjC::getObjCMessageKind(), getTypeName(), RebuildDeclaratorInCurrentInstantiation(), and recoverFromTypeInKnownDependentBase().
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 21168 of file SemaExpr.cpp.
References Begin, Context, clang::RecoveryExpr::Create(), clang::ASTContext::DependentTy, clang::ExprError(), clang::ASTContext::getLangOpts(), isSFINAEContext(), clang::Type::isUndeducedType(), and clang::T.
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), ActOnBlockStmtExpr(), ActOnCondition(), ActOnCXXTypeConstructExpr(), ActOnFinishCXXInClassMemberInitializer(), ActOnParamDefaultArgumentError(), ActOnStartCXXMemberReference(), ActOnUninitializedDecl(), AddInitializerToDecl(), BuildBaseInitializer(), BuildDeclarationNameExpr(), BuildDelegatingInitializer(), BuildDependentDeclRefExpr(), BuildMemberInitializer(), BuildReturnStmt(), CheckPlaceholderExpr(), CorrectDelayedTyposInExpr(), diagnoseNoViableConversion(), FinishOverloadedCallExpr(), clang::TreeTransform< Derived >::RebuildRecoveryExpr(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
concepts::Requirement::SubstitutionDiagnostic * Sema::createSubstDiagAt | ( | SourceLocation | Location, |
EntityPrinter | Printer | ||
) |
create a Requirement::SubstitutionDiagnostic with only a SubstitutedEntity and DiagLoc using ASTContext's allocator.
Definition at line 2700 of file SemaTemplateInstantiate.cpp.
References clang::C, Context, and OS.
Referenced by BuildExprRequirement().
ExprResult Sema::CreateUnaryExprOrTypeTraitExpr | ( | Expr * | E, |
SourceLocation | OpLoc, | ||
UnaryExprOrTypeTrait | ExprKind | ||
) |
Build a sizeof or alignof expression given an expression operand.
Definition at line 4643 of file SemaExpr.cpp.
References CheckAlignOfExpr(), CheckPlaceholderExpr(), CheckUnaryExprOrTypeTraitOperand(), CheckVecStepExpr(), Context, clang::SemaBase::Diag(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), clang::ASTContext::getSizeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isInvalid(), clang::Expr::isTypeDependent(), clang::Type::isVariableArrayType(), clang::Expr::refersToBitField(), and TransformToPotentiallyEvaluated().
ExprResult Sema::CreateUnaryExprOrTypeTraitExpr | ( | TypeSourceInfo * | TInfo, |
SourceLocation | OpLoc, | ||
UnaryExprOrTypeTrait | ExprKind, | ||
SourceRange | R | ||
) |
Build a sizeof or alignof expression given a type operand.
Definition at line 4617 of file SemaExpr.cpp.
References CheckUnaryExprOrTypeTraitOperand(), Context, clang::ExprError(), clang::SourceRange::getEnd(), clang::ASTContext::getSizeType(), clang::getTraitSpelling(), clang::TypeSourceInfo::getType(), clang::Type::isDependentType(), isUnevaluatedContext(), clang::Type::isVariablyModifiedType(), clang::T, and TransformToPotentiallyEvaluated().
Referenced by ActOnUnaryExprOrTypeTraitExpr(), and clang::TreeTransform< Derived >::RebuildUnaryExprOrTypeTrait().
ExprResult Sema::CreateUnresolvedLookupExpr | ( | CXXRecordDecl * | NamingClass, |
NestedNameSpecifierLoc | NNSLoc, | ||
DeclarationNameInfo | DNI, | ||
const UnresolvedSetImpl & | Fns, | ||
bool | PerformADL = true |
||
) |
Definition at line 14229 of file SemaOverload.cpp.
References clang::UnresolvedSetImpl::begin(), clang::UnresolvedLookupExpr::Create(), and clang::UnresolvedSetImpl::end().
Referenced by ActOnCXXFoldExpr().
|
inline |
Definition at line 1071 of file Sema.h.
Referenced by ActOnCXXTryBlock(), ActOnExplicitInstantiation(), ActOnFunctionDeclarator(), ActOnStartOfLambdaDefinition(), ActOnVariableDeclarator(), AddKnownFunctionAttributes(), clang::OverloadCandidateSet::BestViableFunction(), BuildArrayType(), BuildCXXConstructExpr(), BuildCXXThrow(), BuildLambdaExpr(), BuildResolvedCallExpr(), BuildVAArgExpr(), CheckCallingConvAttr(), CheckCompletedCXXClass(), CheckCompleteVariableDeclaration(), CheckFunctionDeclaration(), CheckFunctionTemplateSpecialization(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DeduceFunctionTypeFromReturnExpr(), clang::SemaBase::Diag(), DiagnoseBadTarget(), DiagnoseUseOfDecl(), emitCallStackNotes(), FinalizeDeclaration(), FindAllocationFunctions(), getCCForDeclaratorChunk(), GetDeclSpecTypeForDeclarator(), getEmissionStatus(), GetFullTypeForDeclarator(), handleCallConvAttr(), handleLambdaNumbering(), handleSharedAttr(), InstantiateVariableInitializer(), clang::isBetterOverloadCandidate(), IsOverloadOrOverrideImpl(), isUsualDeallocationFunction(), MarkFunctionReferenced(), MarkVarDeclODRUsed(), ShouldDeleteSpecialMember(), shouldIgnoreInHostDeviceCheck(), and SubstituteExplicitTemplateArguments().
|
inline |
Definition at line 1665 of file Sema.h.
References FpPragmaStack.
Referenced by actOnOMPReductionKindClause(), ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), BuildBinOp(), BuildCallExpr(), BuildCStyleCastExpr(), BuildCXXCastArgument(), BuildCXXFunctionalCastExpr(), BuildCXXNamedCast(), BuildCXXTypeConstructExpr(), BuildExpressionFromIntegralTemplateArgumentValue(), buildMemcpyForAssignmentOp(), BuildResolvedCallExpr(), buildSingleCopyAssignRecursively(), clang::SemaPseudoObject::checkAssignment(), clang::SemaPseudoObject::checkIncDec(), CreateBuiltinBinOp(), CreateBuiltinUnaryOp(), DefaultLvalueConversion(), ImpCastExprToType(), clang::InitializationSequence::Perform(), recordConversion(), clang::SemaPseudoObject::recreateSyntacticForm(), setExceptionMode(), and clang::SemaObjC::stripARCUnbridgedCast().
|
inline |
Definition at line 6453 of file Sema.h.
References ExprEvalContexts.
|
inline |
Definition at line 6447 of file Sema.h.
References ExprEvalContexts.
Referenced by ActOnCallExpr(), BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), clang::SemaCUDA::CheckCall(), CreateMaterializeTemporaryExpr(), InstantiateVariableInitializer(), isAlwaysConstantEvaluatedContext(), isCheckingDefaultArgumentOrInitializer(), isConstantEvaluatedContext(), isImmediateFunctionContext(), isInLifetimeExtendingContext(), isUnevaluatedContext(), and needsRebuildOfDefaultArgOrInit().
|
inline |
Is the module scope we are in a C++ Header Unit?
Definition at line 3109 of file Sema.h.
References false.
Referenced by ActOnStartOfFunctionDef(), and AddInitializerToDecl().
|
inline |
Is the module scope we are an implementation unit?
Definition at line 9593 of file Sema.h.
References false.
Referenced by ActOnModuleImport(), and ActOnStartExportDecl().
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 6967 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.
Referenced by CheckConditionalOperands().
DeclApplyPragmaWeak - A declaration (maybe definition) needs #pragma weak applied to it, possibly with an alias.
Definition at line 7582 of file SemaDeclAttr.cpp.
References clang::Decl::addAttr(), Context, CurContext, DeclClonePragmaWeak(), clang::WeakInfo::getAlias(), clang::NamedDecl::getIdentifier(), clang::WeakInfo::getLocation(), clang::IdentifierInfo::getName(), clang::ASTContext::getTranslationUnitDecl(), PushOnScopeChains(), clang::Decl::setDeclContext(), clang::Decl::setLexicalDeclContext(), and WeakTopLevelDecl.
Referenced by ActOnPragmaWeakAlias(), and ProcessPragmaWeak().
FunctionTemplateDecl * Sema::DeclareAggregateDeductionGuideFromInitList | ( | TemplateDecl * | Template, |
MutableArrayRef< QualType > | ParamTypes, | ||
SourceLocation | Loc | ||
) |
Definition at line 1253 of file SemaTemplateDeductionGuide.cpp.
References clang::Aggregate, AggregateDeductionCandidates, AliasTemplate, clang::Found, clang::Decl::getDeclContext(), clang::CXXRecordDecl::getDefinition(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::TemplateDecl::getTemplatedDecl(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::ClassTemplateDecl::getTemplatedDecl(), isCompleteType(), clang::DeclContext::isDependentContext(), Loc, clang::Sema::ContextRAII::pop(), clang::FunctionProtoType::Profile(), and clang::T.
Referenced by DeduceTemplateSpecializationFromInitializer().
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 3156 of file SemaExprCXX.cpp.
References clang::DeclContext::addDecl(), AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), clang::DeclContextLookupResult::begin(), Context, clang::ParmVarDecl::Create(), clang::FunctionDecl::Create(), clang::DeclContextLookupResult::end(), clang::EST_BasicNoexcept, clang::EST_Dynamic, clang::EST_DynamicNone, clang::FunctionProtoType::ExceptionSpecInfo::Exceptions, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::Func, clang::ASTContext::getCanonicalType(), getCurFPFeatures(), clang::ASTContext::getDefaultCallingConvention(), clang::ASTContext::getFunctionType(), getLangOpts(), getStdBadAlloc(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getTypeDeclType(), clang::LangOptions::hasGlobalAllocationFunctionVisibility(), clang::LangOptions::hasHiddenGlobalAllocationFunctionVisibility(), clang::LangOptions::hasProtectedGlobalAllocationFunctionVisibility(), IdResolver, LangOpts, clang::DeclContext::lookup(), P, clang::Decl::ReachableWhenImported, clang::SC_None, StdBadAlloc, clang::T, clang::IdentifierResolver::tryAddTopLevelDecl(), and clang::FunctionProtoType::ExceptionSpecInfo::Type.
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 3025 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(), and FindUsualDeallocationFunction().
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 14773 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, CheckImplicitSpecialMemberDeclaration(), clang::Constexpr, Context, clang::CopyAssignment, clang::CXXMethodDecl::Create(), clang::ParmVarDecl::Create(), CUDA(), clang::ASTContext::DeclarationNames, clang::Default, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getAddrSpaceQualType(), getASTContext(), getCurFPFeatures(), clang::DeclarationNameTable::getCXXOperatorName(), getDefaultCXXMethodAddrSpace(), clang::ASTContext::getElaboratedType(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getLValueReferenceType(), getScopeForContext(), clang::ASTContext::getTypeDeclType(), clang::CXXRecordDecl::hasTrivialCopyAssignment(), clang::CXXRecordDecl::implicitCopyAssignmentHasConstParam(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::CXXRecordDecl::needsImplicitCopyAssignment(), clang::CXXRecordDecl::needsOverloadResolutionForCopyAssignment(), clang::None, clang::ASTContext::NumImplicitCopyAssignmentOperatorsDeclared, PushOnScopeChains(), clang::SC_None, SetDeclDeleted(), clang::CXXRecordDecl::setImplicitCopyAssignmentIsDeleted(), ShouldDeleteSpecialMember(), SpecialMemberIsTrivial(), clang::Unspecified, and clang::QualType::withConst().
Referenced by AddImplicitlyDeclaredMembersToClass(), DeclareImplicitMemberFunctionsWithName(), and ForceDeclarationOfImplicitMembers().
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 15522 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, CheckImplicitSpecialMemberDeclaration(), clang::Constexpr, Context, clang::CopyConstructor, clang::CXXConstructorDecl::Create(), clang::ParmVarDecl::Create(), CUDA(), clang::ASTContext::DeclarationNames, clang::Default, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getAddrSpaceQualType(), getASTContext(), clang::ASTContext::getCanonicalType(), getCurFPFeatures(), clang::DeclarationNameTable::getCXXConstructorName(), getDefaultCXXMethodAddrSpace(), clang::ASTContext::getElaboratedType(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getLValueReferenceType(), getScopeForContext(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ASTContext::getTypeDeclType(), clang::Decl::hasAttr(), clang::CXXRecordDecl::hasTrivialCopyConstructor(), clang::CXXRecordDecl::hasTrivialCopyConstructorForCall(), clang::CXXRecordDecl::implicitCopyConstructorHasConstParam(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), inTemplateInstantiation(), clang::CXXRecordDecl::isLambda(), clang::CXXRecordDecl::needsImplicitCopyConstructor(), clang::CXXRecordDecl::needsOverloadResolutionForCopyConstructor(), clang::None, clang::ASTContext::NumImplicitCopyConstructorsDeclared, PushOnScopeChains(), clang::SC_None, SetDeclDeleted(), clang::CXXRecordDecl::setImplicitCopyConstructorIsDeleted(), ShouldDeleteSpecialMember(), SpecialMemberIsTrivial(), TAH_ConsiderTrivialABI, clang::Unspecified, clang::ASTContext::VoidTy, and clang::QualType::withConst().
Referenced by AddImplicitlyDeclaredMembersToClass(), DeclareImplicitMemberFunctionsWithName(), and ForceDeclarationOfImplicitMembers().
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 1319 of file SemaTemplateDeductionGuide.cpp.
References AliasTemplate, clang::Copy, D, clang::Decl::getCanonicalDecl(), clang::Decl::getDeclContext(), clang::CXXRecordDecl::getDefinition(), clang::TemplateDecl::getTemplatedDecl(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::ClassTemplateDecl::getTemplatedDecl(), isCompleteType(), clang::DeclContext::isDependentContext(), clang::FunctionDecl::isFunctionTemplateSpecialization(), clang::Decl::isImplicit(), clang::Decl::isInvalidDecl(), Loc, LookupConstructors(), P, clang::FunctionDecl::parameters(), and clang::Sema::ContextRAII::pop().
Referenced by DeclareImplicitMemberFunctionsWithName().
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 13856 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, CheckImplicitSpecialMemberDeclaration(), clang::Constexpr, Context, clang::CXXConstructorDecl::Create(), CUDA(), clang::ASTContext::DeclarationNames, clang::DefaultConstructor, defaultedSpecialMemberIsConstexpr(), getASTContext(), clang::ASTContext::getCanonicalType(), getCurFPFeatures(), clang::DeclarationNameTable::getCXXConstructorName(), getLangOpts(), clang::Decl::getLocation(), getScopeForContext(), clang::ASTContext::getTypeDeclType(), clang::CXXRecordDecl::hasTrivialDefaultConstructor(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::CXXRecordDecl::needsImplicitDefaultConstructor(), clang::ASTContext::NumImplicitDefaultConstructorsDeclared, PushOnScopeChains(), clang::Decl::setAccess(), SetDeclDeleted(), clang::FunctionDecl::setDefaulted(), clang::FunctionDecl::setTrivial(), ShouldDeleteSpecialMember(), clang::Unspecified, and clang::ASTContext::VoidTy.
Referenced by AddImplicitlyDeclaredMembersToClass(), DeclareImplicitMemberFunctionsWithName(), findTrivialSpecialMember(), and ForceDeclarationOfImplicitMembers().
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 14146 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, CheckImplicitSpecialMemberDeclaration(), clang::Constexpr, Context, clang::CXXDestructorDecl::Create(), CUDA(), clang::ASTContext::DeclarationNames, defaultedSpecialMemberIsConstexpr(), clang::Destructor, getASTContext(), clang::ASTContext::getCanonicalType(), getCurFPFeatures(), clang::DeclarationNameTable::getCXXDestructorName(), getLangOpts(), clang::Decl::getLocation(), getScopeForContext(), clang::ASTContext::getTypeDeclType(), clang::Decl::hasAttr(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::CXXRecordDecl::hasTrivialDestructorForCall(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::TagDecl::isCompleteDefinition(), clang::CXXRecordDecl::needsImplicitDestructor(), clang::ASTContext::NumImplicitDestructorsDeclared, PushOnScopeChains(), SetDeclDeleted(), ShouldDeleteSpecialMember(), clang::Unspecified, and clang::ASTContext::VoidTy.
Referenced by AddImplicitlyDeclaredMembersToClass(), DeclareImplicitMemberFunctionsWithName(), findTrivialSpecialMember(), and ForceDeclarationOfImplicitMembers().
void Sema::DeclareImplicitEqualityComparison | ( | CXXRecordDecl * | RD, |
FunctionDecl * | Spaceship | ||
) |
Definition at line 9038 of file SemaDeclCXX.cpp.
References clang::Sema::CodeSynthesisContext::DeclaringImplicitEqualityComparison, clang::Sema::CodeSynthesisContext::Entity, clang::Sema::CodeSynthesisContext::Kind, clang::Sema::CodeSynthesisContext::PointOfInstantiation, popCodeSynthesisContext(), pushCodeSynthesisContext(), 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 15130 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, CheckImplicitSpecialMemberDeclaration(), clang::Constexpr, Context, clang::CXXMethodDecl::Create(), clang::ParmVarDecl::Create(), CUDA(), clang::ASTContext::DeclarationNames, clang::Default, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getAddrSpaceQualType(), getASTContext(), getCurFPFeatures(), clang::DeclarationNameTable::getCXXOperatorName(), getDefaultCXXMethodAddrSpace(), clang::ASTContext::getElaboratedType(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getRValueReferenceType(), getScopeForContext(), clang::ASTContext::getTypeDeclType(), clang::CXXRecordDecl::hasTrivialMoveAssignment(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::MoveAssignment, clang::CXXRecordDecl::needsImplicitMoveAssignment(), clang::CXXRecordDecl::needsOverloadResolutionForMoveAssignment(), clang::None, clang::ASTContext::NumImplicitMoveAssignmentOperatorsDeclared, PushOnScopeChains(), clang::SC_None, SetDeclDeleted(), clang::CXXRecordDecl::setImplicitMoveAssignmentIsDeleted(), ShouldDeleteSpecialMember(), SpecialMemberIsTrivial(), and clang::Unspecified.
Referenced by AddImplicitlyDeclaredMembersToClass(), DeclareImplicitMemberFunctionsWithName(), and ForceDeclarationOfImplicitMembers().
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 15672 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::AS_public, CheckImplicitSpecialMemberDeclaration(), clang::Constexpr, Context, clang::CXXConstructorDecl::Create(), clang::ParmVarDecl::Create(), CUDA(), clang::ASTContext::DeclarationNames, clang::Default, defaultedSpecialMemberIsConstexpr(), clang::ASTContext::getAddrSpaceQualType(), getASTContext(), clang::ASTContext::getCanonicalType(), getCurFPFeatures(), clang::DeclarationNameTable::getCXXConstructorName(), getDefaultCXXMethodAddrSpace(), clang::ASTContext::getElaboratedType(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getRValueReferenceType(), getScopeForContext(), clang::ASTContext::getTypeDeclType(), clang::Decl::hasAttr(), clang::CXXRecordDecl::hasTrivialMoveConstructor(), clang::CXXRecordDecl::hasTrivialMoveConstructorForCall(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::MoveConstructor, clang::CXXRecordDecl::needsImplicitMoveConstructor(), clang::CXXRecordDecl::needsOverloadResolutionForMoveConstructor(), clang::None, clang::ASTContext::NumImplicitMoveConstructorsDeclared, PushOnScopeChains(), clang::SC_None, SetDeclDeleted(), clang::CXXRecordDecl::setImplicitMoveConstructorIsDeleted(), ShouldDeleteSpecialMember(), SpecialMemberIsTrivial(), TAH_ConsiderTrivialABI, clang::Unspecified, and clang::ASTContext::VoidTy.
Referenced by AddImplicitlyDeclaredMembersToClass(), DeclareImplicitMemberFunctionsWithName(), and ForceDeclarationOfImplicitMembers().
NamedDecl * Sema::DeclClonePragmaWeak | ( | NamedDecl * | ND, |
const IdentifierInfo * | II, | ||
SourceLocation | Loc | ||
) |
DeclClonePragmaWeak - clone existing decl (maybe definition), #pragma weak needs a non-definition decl and source may not have one.
Definition at line 7538 of file SemaDeclAttr.cpp.
References BuildParmVarDeclForTypedef(), clang::VarDecl::Create(), clang::FunctionDecl::Create(), clang::Type::getAs(), clang::Decl::getASTContext(), getCurFPFeatures(), clang::Decl::getDeclContext(), clang::DeclaratorDecl::getQualifier(), clang::DeclaratorDecl::getQualifierLoc(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::FunctionDecl::hasPrototype(), Loc, clang::SC_None, clang::DeclaratorDecl::setQualifierInfo(), clang::ParmVarDecl::setScopeInfo(), and clang::Unspecified.
Referenced by DeclApplyPragmaWeak().
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 2338 of file SemaExpr.cpp.
References Context, clang::ASTContext::getNameForTemplate(), GetNameFromUnqualifiedId(), Id, clang::IK_TemplateId, clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), and translateTemplateArguments().
Referenced by ActOnIdExpression(), and ActOnMemberAccessExpr().
TemplateDeductionResult Sema::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)
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 5146 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, clang::Init, 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::Result, clang::sema::TemplateDeductionInfo::SecondArg, clang::Success, and clang::TemplateArgument::Type.
Referenced by clang::SemaObjC::ActOnObjCForCollectionStmt(), BuildCXXNew(), BuildCXXTypeConstructExpr(), CheckTemplateArgument(), DeduceFunctionTypeFromReturnExpr(), deduceVarTypeFromInitializer(), 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 693 of file SemaLambda.cpp.
References adjustBlockReturnsToEnum(), Context, clang::CPlusPlus, clang::CPlusPlus14, clang::SemaBase::Diag(), findCommonEnumForBlockReturns(), getASTContext(), clang::ReturnStmt::getBeginLoc(), clang::ASTContext::getCanonicalFunctionResultType(), getLangOpts(), clang::Type::getNullability(), clang::ReturnStmt::getRetValue(), clang::Expr::getType(), clang::ASTContext::getTypeDeclType(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::hasWeakerNullability(), clang::Type::isDependentType(), clang::QualType::isNull(), clang::Type::isUndeducedType(), clang::sema::FunctionScopeInfo::Returns, clang::sema::CapturingScopeInfo::ReturnType, and clang::ASTContext::VoidTy.
Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().
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 3717 of file SemaStmt.cpp.
References clang::ASTContext::adjustDeducedFunctionResultType(), clang::AlreadyDiagnosed, Context, CUDA(), DeduceAutoType(), clang::SemaBase::Diag(), clang::OverloadExpr::find(), clang::sema::TemplateDeductionInfo::FirstArg, clang::Type::getAs(), getCurLambda(), clang::DeducedType::getDeducedType(), clang::Expr::getExprLoc(), getLangOpts(), clang::Decl::getLocation(), getReturnTypeLoc(), clang::Stmt::getSourceRange(), clang::FunctionDecl::getSourceRange(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::TypeLoc::getType(), clang::Decl::hasAttr(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::Inconsistent, clang::AutoType::isDecltypeAuto(), clang::DeducedType::isDeduced(), clang::DeclContext::isDependentContext(), clang::Decl::isInvalidDecl(), clang::isLambdaConversionOperator(), clang::Type::isVoidType(), clang::TemplateSpecCandidateSet::NoteCandidates(), clang::ASTContext::OverloadTy, clang::sema::TemplateDeductionInfo::SecondArg, clang::Success, and clang::ASTContext::VoidTy.
Referenced by ActOnCapScopeReturnStmt(), ActOnFinishFunctionBody(), and BuildReturnStmt().
void Sema::deduceOpenCLAddressSpace | ( | ValueDecl * | decl | ) |
Definition at line 6867 of file SemaDecl.cpp.
References Context, clang::ASTContext::getAddrSpaceQualType(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getDecayedType(), getLangOpts(), getOpenCLOptions(), clang::Type::isArrayType(), clang::Type::isSamplerT(), clang::Type::isVoidType(), clang::opencl_global, and clang::opencl_private.
Referenced by ActOnParamDeclarator(), ActOnVariableDeclarator(), CompleteVarTemplateSpecializationDecl(), and DeduceVariableDeclarationType().
bool Sema::DeduceReturnType | ( | FunctionDecl * | FD, |
SourceLocation | Loc, | ||
bool | Diagnose = true |
||
) |
Definition at line 5391 of file SemaTemplateDeduction.cpp.
References clang::ASTContext::adjustDeducedFunctionResultType(), clang::Type::castAs(), Context, clang::SemaBase::Diag(), Diagnose, 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 CanUseDecl(), completeFunctionType(), DeduceTemplateArguments(), DiagnoseUseOfDecl(), and GetTypeOfFunction().
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | ClassTemplatePartialSpecializationDecl * | Partial, |
ArrayRef< TemplateArgument > | TemplateArgs, | ||
sema::TemplateDeductionInfo & | Info | ||
) |
Definition at line 3445 of file SemaTemplateDeduction.cpp.
Referenced by ActOnExplicitInstantiation(), CheckFunctionTemplateSpecialization(), CheckVarTemplateId(), DeduceTemplateArguments(), DeduceTemplateArgumentsFromType(), FindAllocationFunctions(), getPatternForClassTemplateSpecialization(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), LookupDirect(), ResolveOverloadForDeduction(), 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 4852 of file SemaTemplateDeduction.cpp.
References Context, DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateArgumentsFromCallArgument(), clang::ASTContext::getArrayDecayedType(), clang::Type::getAs(), 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, clang::Result, runWithSufficientStackSpace(), clang::TemplateParameterList::size(), clang::Specialization, clang::Success, clang::TDF_ArgWithReferenceType, clang::TDF_IgnoreQualifiers, 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 4461 of file SemaTemplateDeduction.cpp.
References CurContext, DeduceTemplateArgumentsFromCallArgument(), clang::Function, FunctionTemplate, getASTContext(), getFirstInnerIndex(), clang::sema::TemplateDeductionInfo::getLocation(), clang::PackExpansionType::getNumExpansions(), clang::PackExpansionType::getPattern(), hasDeducibleTemplateParameters(), clang::Invalid, clang::InvalidExplicitArguments, clang::QualType::isNull(), clang::Result, 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 4984 of file SemaTemplateDeduction.cpp.
References DeduceTemplateArguments(), FunctionTemplate, 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 4725 of file SemaTemplateDeduction.cpp.
References adjustCCAndNoReturn(), CheckIfFunctionSpecializationIsImmediate(), Context, clang::CPlusPlus14, clang::CPlusPlus20, DeduceReturnType(), DeduceTemplateArgumentsByTypeMatch(), clang::sema::TemplateDeductionInfo::FirstArg, clang::Function, FunctionTemplate, getLangOpts(), clang::sema::TemplateDeductionInfo::getLocation(), clang::ASTContext::hasSameFunctionTypeIgnoringExceptionSpec(), clang::Invalid, clang::QualType::isNull(), isSameOrCompatibleFunctionType(), clang::MiscellaneousDeductionFailure, clang::NonDeducedMismatch, parentEvaluationContext(), clang::Result, runWithSufficientStackSpace(), clang::sema::TemplateDeductionInfo::SecondArg, clang::TemplateParameterList::size(), clang::Specialization, SubstAutoType(), SubstAutoTypeDependent(), clang::Success, clang::TDF_AllowCompatibleFunctionType, clang::TDF_TopLevelParameterTypeList, and Unevaluated.
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | TemplateParameterList * | TemplateParams, |
ArrayRef< TemplateArgument > | Ps, | ||
ArrayRef< TemplateArgument > | As, | ||
sema::TemplateDeductionInfo & | Info, | ||
SmallVectorImpl< DeducedTemplateArgument > & | Deduced, | ||
bool | NumberOfArgumentsMustMatch | ||
) |
Definition at line 2735 of file SemaTemplateDeduction.cpp.
TemplateDeductionResult Sema::DeduceTemplateArguments | ( | VarTemplatePartialSpecializationDecl * | Partial, |
ArrayRef< TemplateArgument > | TemplateArgs, | ||
sema::TemplateDeductionInfo & | Info | ||
) |
Definition at line 3451 of file SemaTemplateDeduction.cpp.
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 3458 of file SemaTemplateDeduction.cpp.
References AliasTemplate, Context, DeduceTemplateArguments(), clang::sema::TemplateDeductionInfo::getLocation(), clang::TemplateDecl::getTemplateParameters(), clang::ASTContext::getTypeDeclType(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::InstantiationDepth, clang::Invalid, clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::Result, runWithSufficientStackSpace(), clang::TemplateParameterList::size(), clang::SubstitutionFailure, clang::Success, and Unevaluated.
QualType Sema::DeduceTemplateSpecializationFromInitializer | ( | TypeSourceInfo * | TInfo, |
const InitializedEntity & | Entity, | ||
const InitializationKind & | Kind, | ||
MultiExprArg | Init | ||
) |
Definition at line 9841 of file SemaInit.cpp.
References AddOverloadCandidate(), AddTemplateOverloadCandidate(), clang::Aggregate, AliasTemplate, clang::AS_public, clang::LookupResult::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::OverloadCandidateSet::clear(), clang::Complete, Context, clang::CPlusPlus20, clang::OverloadCandidateSet::CSK_Normal, D, clang::ASTContext::DeclarationNames, DeclareAggregateDeductionGuideFromInitList(), clang::SemaBase::Diag(), DiagnoseUseOfDecl(), E, clang::LookupResult::empty(), clang::LookupResult::end(), clang::Type::getAsCXXRecordDecl(), getASTContext(), clang::TemplateName::getAsTemplateDecl(), clang::TypeLoc::getBeginLoc(), clang::Type::getContainedDeducedType(), clang::DeclarationNameTable::getCXXDeductionGuideName(), clang::Decl::getDeclContext(), clang::RecordDecl::getDefinition(), clang::TypeLoc::getEndLoc(), getLangOpts(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getRecordType(), clang::ASTContext::getRValueReferenceType(), clang::TypeLoc::getSourceRange(), clang::FunctionTemplateDecl::getTemplatedDecl(), getTemplateNameKindForDiagnostics(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::ASTContext::getTypeDeclType(), clang::TypeSourceInfo::getTypeLoc(), clang::Expr::hasAnyTypeDependentArguments(), clang::InitializationKind::IK_Direct, int, isCompleteType(), clang::TemplateName::isDependent(), isInitListConstructor(), clang::Decl::isInvalidDecl(), isOrIsDerivedFromSpecializationOf(), clang::ListInit, LookupOrdinaryName, LookupQualifiedName(), clang::DeclAccessPair::make(), MarkFunctionReferenced(), clang::OverloadCandidateSet::NoteCandidates(), NoteDeletedFunction(), NoteTemplateLocation(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::SemaBase::PDiag(), clang::Result, SubstAutoType(), SubstAutoTypeDependent(), and clang::LookupResult::suppressDiagnostics().
Referenced by BuildCXXNew(), BuildCXXTypeConstructExpr(), CheckTemplateArgument(), and deduceVarTypeFromInitializer().
Definition at line 13070 of file SemaDecl.cpp.
References CheckVariableDeclarationType(), deduceOpenCLAddressSpace(), deduceVarTypeFromInitializer(), clang::DirectInit, clang::NamedDecl::getDeclName(), getLangOpts(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::VarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Init, clang::Decl::isInvalidDecl(), clang::NamedDecl::isLinkageValid(), MergeVarDeclTypes(), ObjC(), OpenCL(), clang::Decl::setInvalidDecl(), and clang::ValueDecl::setType().
Referenced by ActOnUninitializedDecl(), and AddInitializerToDecl().
QualType Sema::deduceVarTypeFromInitializer | ( | VarDecl * | VDecl, |
DeclarationName | Name, | ||
QualType | Type, | ||
TypeSourceInfo * | TSI, | ||
SourceRange | Range, | ||
bool | DirectInit, | ||
Expr * | Init | ||
) |
Definition at line 12922 of file SemaDecl.cpp.
References clang::AlreadyDiagnosed, clang::C23, Context, clang::InitializationKind::CreateForInit(), DeduceAutoType(), DeduceTemplateSpecializationFromInitializer(), clang::SemaBase::Diag(), DiagnoseAutoDeductionFailure(), clang::DirectInit, forceUnknownAnyToType(), clang::ASTContext::getAutoDeductType(), clang::SourceRange::getBegin(), clang::TypeLoc::getBeginLoc(), clang::Type::getContainedAutoType(), clang::Type::getContainedDeducedType(), clang::NamedDecl::getDeclName(), clang::Expr::getExprLoc(), clang::AutoType::getKeyword(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getObjCIdType(), clang::ASTContext::getQualifiedType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::VarDecl::hasExternalStorage(), clang::ASTContext::hasSameUnqualifiedType(), clang::Init, clang::InitializedEntity::InitializeVariable(), int, inTemplateInstantiation(), clang::Type::isArrayType(), clang::Type::isConstantArrayType(), clang::VarDecl::isInitCapture(), clang::QualType::isNull(), clang::Type::isObjCIdType(), clang::VarDecl::isStaticDataMember(), Loc, Range, clang::Result, clang::Success, and clang::ASTContext::UnknownAnyTy.
Referenced by buildLambdaInitCaptureInitialization(), and DeduceVariableDeclarationType().
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 867 of file SemaExpr.cpp.
References Context, clang::CPlusPlus, clang::ASTContext::DoubleTy, E, clang::ExprError(), clang::LangOptionsBase::ExtendTo64, clang::ASTContext::FloatTy, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Expr::getExprLoc(), clang::BuiltinType::getKind(), getLangOpts(), getOpenCLOptions(), clang::CharUnits::getQuantity(), clang::ASTContext::getTargetInfo(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), ImpCastExprToType(), clang::InitializedEntity::InitializeTemporary(), clang::OpenCLOptions::isAvailableOption(), clang::Expr::isGLValue(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isNullPtrType(), isUnevaluatedContext(), clang::Type::isUnsignedIntegerType(), clang::ASTContext::LongLongTy, PerformCopyInitialization(), clang::TargetInfo::supportsExtendIntArgs(), clang::ASTContext::UnsignedLongLongTy, UsualUnaryConversions(), and clang::ASTContext::VoidPtrTy.
Referenced by BuildResolvedCallExpr(), clang::SemaObjC::CheckMessageArgumentTypes(), checkUnknownAnyArg(), and DefaultVariadicArgumentPromotion().
ExprResult Sema::DefaultFunctionArrayConversion | ( | Expr * | E, |
bool | Diagnose = true |
||
) |
DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4).
Definition at line 516 of file SemaExpr.cpp.
References clang::C99, checkAddressOfFunctionIsAvailable(), CheckPlaceholderExpr(), Context, clang::CPlusPlus, Diagnose, E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getArrayDecayedType(), clang::Expr::getExprLoc(), getLangOpts(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenCasts(), ImpCastExprToType(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isLValue(), and clang::QualType::isNull().
Referenced by ActOnStmtExprResult(), BuildExpressionFromDeclTemplateArgument(), DefaultFunctionArrayLvalueConversion(), IgnoredValueConversions(), isNullPointerValueTemplateArgument(), LookupMemberExpr(), and rebuildUnknownAnyFunction().
ExprResult Sema::DefaultFunctionArrayLvalueConversion | ( | Expr * | E, |
bool | Diagnose = true |
||
) |
Definition at line 752 of file SemaExpr.cpp.
References DefaultFunctionArrayConversion(), DefaultLvalueConversion(), Diagnose, E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), ActOnCapScopeReturnStmt(), ActOnGCCAsmStmt(), clang::SemaOpenMP::ActOnOMPArraySectionExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPHasDeviceAddrClause(), clang::SemaOpenMP::ActOnOpenMPUseDeviceAddrClause(), BuildAtomicExpr(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildObjCBoxedExpr(), clang::SemaARM::BuiltinARMMemoryTaggingCall(), BuiltinFunctionStart(), BuiltinIsWithinLifetime(), BuiltinOverflow(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), CheckArrow(), CheckBooleanCondition(), clang::SemaRISCV::CheckBuiltinFunctionCall(), CheckCommaOperands(), CheckCompareOperands(), CheckMatrixElementwiseOperands(), CheckMatrixMultiplyOperands(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), clang::SemaObjC::CheckObjCForCollectionOperand(), CheckSingleAssignmentConstraints(), CheckSizelessVectorConditionalTypes(), CheckSizelessVectorOperands(), CheckVectorConditionalTypes(), CheckVectorOperands(), clang::SemaCodeCompletion::CodeCompleteObjCInstanceMessage(), CreateBuiltinArraySubscriptExpr(), CreateBuiltinUnaryOp(), CreateGenericSelectionExpr(), CXXCheckConditionalOperands(), IgnoredValueConversions(), OpenCLArithmeticConversions(), OpenCLCheckVectorConditional(), PerformMemberExprBaseConversion(), rewriteBuiltinFunctionDecl(), and UsualUnaryConversions().
ExprResult Sema::DefaultLvalueConversion | ( | Expr * | E | ) |
Definition at line 640 of file SemaExpr.cpp.
References clang::Atomic, clang::Type::canDecayToPointerType(), CheckForNullPointerDereference(), CheckLValueToRValueConversionOperand(), CheckPlaceholderExpr(), Cleanup, Context, clang::CPlusPlus, clang::ImplicitCastExpr::Create(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), CurFPFeatureOverrides(), clang::SemaBase::Diag(), DiagnoseDirectIsaAccess(), clang::QualType::DK_nontrivial_c_struct, E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::IdentifierTable::get(), clang::Type::getAs(), clang::TargetInfo::getCXXABI(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getObjCLifetime(), getOpenCLOptions(), clang::ASTContext::getTargetInfo(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::ASTContext::Idents, clang::Expr::IgnoreParenCasts(), clang::Type::isAnyPointerType(), isCompleteType(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::Expr::isGLValue(), clang::Type::isHalfType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMemberPointerType(), clang::TargetCXXABI::isMicrosoft(), clang::Type::isNullPtrType(), clang::Type::isRecordType(), clang::Type::isVoidType(), LookupOrdinaryName, LookupSingleName(), clang::Qualifiers::OCL_Weak, OpenCL(), clang::ASTContext::OverloadTy, clang::CleanupInfo::setExprNeedsCleanups(), clang::T, TUScope, and clang::VK_PRValue.
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), ActOnCaseExpr(), ActOnCXXDelete(), clang::SemaObjC::ActOnObjCAtSynchronizedOperand(), clang::SemaOpenMP::ActOnOMPArraySectionExpr(), clang::SemaOpenMP::ActOnOMPArrayShapingExpr(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAllocateClause(), clang::SemaOpenMP::ActOnOpenMPAllocatorClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), clang::SemaOpenMP::ActOnOpenMPUsesAllocatorClause(), BuildArrayType(), BuildBuiltinOffsetOf(), buildCapture(), clang::SemaObjC::BuildIvarRefExpr(), clang::SemaObjC::BuildObjCAtThrowStmt(), clang::SemaObjC::BuildObjCSubscriptExpression(), BuildVectorLiteral(), clang::SemaARM::BuiltinARMMemoryTaggingCall(), BuiltinCountZeroBitsGeneric(), BuiltinDumpStruct(), BuiltinPopcountg(), CallExprUnaryConversions(), CheckCompareOperands(), CheckEnumConstant(), CheckObjCCollectionLiteralElement(), checkOpenMPIterationSpace(), CheckPointerToMemberOperands(), CheckRealImagOperand(), CheckTemplateArgument(), CreateBuiltinUnaryOp(), DefaultFunctionArrayLvalueConversion(), finishContextualImplicitConversion(), FinishOpenMPLinearClause(), clang::SemaOpenMP::getOpenMPCapturedExpr(), IgnoredValueConversions(), LookupMemberExpr(), PerformImplicitConversion(), processImplicitMapsWithDefaultMappers(), and VerifyIntegerConstantExpression().
ExprResult Sema::DefaultVariadicArgumentPromotion | ( | Expr * | E, |
VariadicCallType | CT, | ||
FunctionDecl * | FDecl | ||
) |
Definition at line 1042 of file SemaExpr.cpp.
References ActOnBinOp(), ActOnIdExpression(), BuildCallExpr(), clang::Call, CheckPlaceholderExpr(), clang::CPlusPlus, DefaultArgumentPromotion(), E, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), clang::Stmt::getBeginLoc(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), clang::Preprocessor::getIdentifierInfo(), getLangOpts(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::Type::isBlockPointerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isValidVarArgType(), maybeExtendBlockObject(), ObjC(), PP, RequireCompleteType(), clang::SemaObjC::stripARCUnbridgedCast(), TUScope, VAK_Undefined, and VariadicMethod.
Referenced by clang::SemaObjC::CheckMessageArgumentTypes(), and GatherArgumentsForCall().
void Sema::DefineDefaultedComparison | ( | SourceLocation | Loc, |
FunctionDecl * | FD, | ||
DefaultedComparisonKind | DCK | ||
) |
Definition at line 9052 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 DefineDefaultedFunction(), MarkFunctionReferenced(), and SetDeclDefaulted().
void Sema::DefineImplicitCopyAssignment | ( | SourceLocation | CurrentLocation, |
CXXMethodDecl * | MethodDecl | ||
) |
Defines an implicitly-declared copy assignment operator.
Definition at line 14908 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::Invalid, 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(), Other, ResolveExceptionSpec(), clang::LookupResult::resolveKind(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::VK_LValue, and clang::FunctionDecl::willHaveBody().
Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().
void Sema::DefineImplicitCopyConstructor | ( | SourceLocation | CurrentLocation, |
CXXConstructorDecl * | Constructor | ||
) |
DefineImplicitCopyConstructor - Checks for feasibility of defining this constructor as the copy constructor.
Definition at line 15624 of file SemaDeclCXX.cpp.
References ActOnCompoundStmt(), Context, clang::CopyConstructor, clang::CPlusPlus11, diagnoseDeprecatedCopyOperation(), getASTMutationListener(), getLangOpts(), Loc, MarkVTableUsed(), ResolveExceptionSpec(), and SetCtorInitializers().
Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().
void Sema::DefineImplicitDefaultConstructor | ( | SourceLocation | CurrentLocation, |
CXXConstructorDecl * | Constructor | ||
) |
DefineImplicitDefaultConstructor - Checks for feasibility of defining this constructor as the default constructor.
Definition at line 13921 of file SemaDeclCXX.cpp.
References Context, getASTMutationListener(), clang::Decl::isInvalidDecl(), Loc, MarkVTableUsed(), ResolveExceptionSpec(), and SetCtorInitializers().
Referenced by DefineDefaultedFunction(), MarkFunctionReferenced(), and PerformConstructorInitialization().
void Sema::DefineImplicitDestructor | ( | SourceLocation | CurrentLocation, |
CXXDestructorDecl * | Destructor | ||
) |
DefineImplicitDestructor - Checks for feasibility of defining this destructor as the default destructor.
Definition at line 14213 of file SemaDeclCXX.cpp.
References CheckDestructor(), Context, clang::Destructor, getASTMutationListener(), Loc, MarkBaseAndMemberDestructorsReferenced(), MarkVTableUsed(), and ResolveExceptionSpec().
Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().
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 15876 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(), and clang::VK_PRValue.
Referenced by MarkFunctionReferenced().
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 15807 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.
Referenced by MarkFunctionReferenced().
void Sema::DefineImplicitMoveAssignment | ( | SourceLocation | CurrentLocation, |
CXXMethodDecl * | MethodDecl | ||
) |
Defines an implicitly-declared move assignment operator.
Definition at line 15293 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(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNonObjectParameter(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), getPointeeType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::ASTContext::getTagDeclType(), clang::ValueDecl::getType(), clang::RecordDecl::hasFlexibleArrayMember(), clang::Invalid, 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(), LangOpts, Loc, LookupMemberName, clang::Decl::markUsed(), Other, ResolveExceptionSpec(), clang::LookupResult::resolveKind(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::VK_LValue, clang::VK_XValue, and clang::FunctionDecl::willHaveBody().
Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().
void Sema::DefineImplicitMoveConstructor | ( | SourceLocation | CurrentLocation, |
CXXConstructorDecl * | Constructor | ||
) |
DefineImplicitMoveConstructor - Checks for feasibility of defining this constructor as the move constructor.
Definition at line 15762 of file SemaDeclCXX.cpp.
References ActOnCompoundStmt(), Context, getASTMutationListener(), Loc, MarkVTableUsed(), clang::MoveConstructor, ResolveExceptionSpec(), and SetCtorInitializers().
Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().
void Sema::DefineInheritingConstructor | ( | SourceLocation | UseLoc, |
CXXConstructorDecl * | Constructor | ||
) |
Define the specified inheriting constructor.
Definition at line 14065 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), Context, clang::Sema::InheritedConstructorInfo::findConstructorForBase(), getASTMutationListener(), clang::Decl::getLocation(), clang::ConstructorUsingShadowDecl::getParent(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::Init, MarkFunctionReferenced(), MarkVTableUsed(), ResolveExceptionSpec(), SetCtorInitializers(), and clang::CXXRecordDecl::vbases().
Referenced by MarkFunctionReferenced().
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 18560 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 20182 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), ExprEvalContexts, FunctionScopes, getCurFunctionOrMethodDecl(), and Loc.
Referenced by DiagRuntimeBehavior().
DiagnoseAbsenceOfOverrideControl - Diagnose if 'override' keyword was not used in the declaration of an overriding method.
Definition at line 3202 of file SemaDeclCXX.cpp.
References clang::CXXMethodDecl::begin_overridden_methods(), D, 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().
Referenced by CheckCompletedCXXClass().
void Sema::DiagnoseAbstractType | ( | const CXXRecordDecl * | RD | ) |
Definition at line 5885 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), Diags, clang::NamedDecl::getDeclName(), clang::CXXRecordDecl::getFinalOverriders(), clang::DiagnosticsEngine::isLastDiagnosticIgnored(), and PureVirtualClassDiagSet.
Referenced by CheckCompletedCXXClass(), RequireNonAbstractType(), and SetCtorInitializers().
void Sema::DiagnoseAlwaysNonNullPointer | ( | Expr * | E, |
Expr::NullPointerConstantKind | NullType, | ||
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 11854 of file SemaChecking.cpp.
References clang::Call, CheckForReference(), clang::FixItHint::CreateInsertion(), D, clang::SemaBase::Diag(), E, clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), getCurFunction(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), getLocForEndOfToken(), getPrintingPolicy(), getSourceManager(), clang::Stmt::getSourceRange(), clang::FunctionDecl::getTemplatedKind(), clang::Expr::IgnoreImpCasts(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParens(), inTemplateInstantiation(), clang::Type::isArrayType(), clang::Type::isFunctionType(), IsInAnyMacroBody(), clang::Type::isIntegerType(), clang::SourceLocation::isMacroID(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::Type::isSpecificBuiltinType(), clang::NonNull, clang::Expr::NPCK_NotNull, clang::Expr::NPCK_ZeroExpression, clang::Expr::NPCK_ZeroLiteral, clang::FunctionDecl::param_begin(), clang::FunctionDecl::param_end(), clang::FunctionDecl::parameters(), clang::SemaBase::PDiag(), clang::Stmt::printPretty(), Range, SM, clang::Decl::specific_attrs(), clang::T, clang::FunctionDecl::TK_FunctionTemplate, and tryExprAsCall().
Referenced by CheckCompareOperands(), and CheckImplicitConversion().
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 2763 of file SemaLookup.cpp.
References clang::LookupResult::AmbiguousBaseSubobjects, clang::LookupResult::AmbiguousBaseSubobjectTypes, clang::LookupResult::AmbiguousReference, clang::LookupResult::AmbiguousReferenceToPlaceholderVariable, clang::LookupResult::AmbiguousTagHiding, Context, D, clang::SemaBase::Diag(), clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::Found, getAmbiguousPathsDisplayString(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::ASTContext::getTypeDeclType(), clang::LookupResult::Filter::hasNext(), clang::Decl::isInIdentifierNamespace(), clang::LookupResult::Filter::next(), Path, and clang::Result.
Referenced by ActOnSizeofParameterPackExpr().
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 7401 of file SemaOverload.cpp.
References diagnoseDiagnoseIfAttrsWith(), clang::Function, Loc, and clang::Result.
Referenced by checkCall().
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 7419 of file SemaOverload.cpp.
References diagnoseDiagnoseIfAttrsWith(), EvaluateAsBooleanCondition(), Loc, and clang::Result.
Referenced by DiagnoseUseOfDecl().
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 20302 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), DiagnoseAssignmentAsCondition(), E, clang::Stmt::getBeginLoc(), clang::SourceRange::getEnd(), getLocForEndOfToken(), clang::Selector::getNameForSlot(), clang::Stmt::getSourceRange(), clang::Expr::IgnoreParenCasts(), clang::Selector::isUnarySelector(), Loc, ObjC(), clang::OMF_init, and Open.
Referenced by CheckBooleanCondition(), and DiagnoseAssignmentAsCondition().
DiagnoseAssignmentEnum - Warn if assignment to enum is a constant integer not in the range of enum values.
Definition at line 1736 of file SemaStmt.cpp.
References AdjustAPSInt(), CmpEnumVals(), Context, clang::SemaBase::Diag(), Diags, clang::EnumDecl::enumerators(), EqEnumVals(), clang::Expr::EvaluateKnownConstInt(), clang::Type::getAs(), clang::Expr::getExprLoc(), clang::ASTContext::getIntWidth(), clang::QualType::getUnqualifiedType(), clang::Decl::hasAttr(), clang::ASTContext::hasSameUnqualifiedType(), clang::EnumDecl::isClosed(), clang::DiagnosticsEngine::isIgnored(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegerType(), clang::Type::isSignedIntegerOrEnumerationType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and IsValueInFlagEnum().
Referenced by DiagnoseAssignmentResult().
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 16819 of file SemaExpr.cpp.
References clang::Assigning, clang::Type::castAs(), clang::Casting, Compatible, CompatiblePointerDiscardsQualifiers, Context, clang::Converting, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseAssignmentEnum(), clang::SemaObjC::EmitRelatedResultTypeNote(), clang::SemaObjC::EmitRelatedResultTypeNoteForReturn(), clang::OverloadExpr::find(), FunctionVoidPointer, clang::Qualifiers::getAddressSpace(), clang::ASTContext::getArrayDecayedType(), clang::ObjCObjectPointerType::getInterfaceType(), getLangOpts(), clang::Decl::getLocation(), clang::Qualifiers::getObjCLifetime(), clang::Type::getPointeeOrArrayElementType(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::QualType::getUnqualifiedType(), HandleFunctionTypeMismatch(), clang::ObjCInterfaceDecl::hasDefinition(), clang::ConversionFixItGenerator::Hints, Incompatible, IncompatibleBlockPointer, IncompatibleFunctionPointer, IncompatibleFunctionPointerStrict, IncompatibleNestedPointerAddressSpaceMismatch, IncompatibleNestedPointerQualifiers, IncompatibleObjCQualifiedId, IncompatibleObjCWeakRef, IncompatiblePointer, IncompatiblePointerDiscardsQualifiers, IncompatiblePointerSign, IncompatibleVectors, clang::Initializing, IntToBlockPointer, IntToPointer, clang::Type::isArrayType(), isInvalid(), clang::ConversionFixItGenerator::isNull(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjCQualifiedIdType(), clang::Type::isSpecificBuiltinType(), IsStringLiteralToNonConstPointerConversion(), clang::ConversionFixItGenerator::Kind, Loc, maybeDiagnoseAssignmentToFunction(), NoteAllOverloadCandidates(), ObjC(), clang::ASTContext::OverloadTy, clang::Passing, clang::Passing_CFAudited, clang::SemaBase::PDiag(), PointerToInt, clang::ObjCObjectPointerType::quals(), clang::Returning, clang::Sending, and clang::ConversionFixItGenerator::tryToFixConversion().
Referenced by ActOnIndirectGotoStmt(), CheckAssignmentOperands(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), clang::InitializationSequence::Perform(), and PerformImplicitConversion().
Definition at line 5375 of file SemaTemplateDeduction.cpp.
References clang::SemaBase::Diag(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Init, and clang::VarDecl::isInitCapture().
Referenced by clang::SemaObjC::ActOnObjCForCollectionStmt(), and deduceVarTypeFromInitializer().
void Sema::DiagnoseAvailabilityOfDecl | ( | NamedDecl * | D, |
ArrayRef< SourceLocation > | Locs, | ||
const ObjCInterfaceDecl * | UnknownObjCClass, | ||
bool | ObjCPropertyAccess, | ||
bool | AvoidPartialAvailabilityChecks = false , |
||
ObjCInterfaceDecl * | ClassReceiver = nullptr |
||
) |
Definition at line 1096 of file SemaAvailability.cpp.
References clang::AR_Available, clang::AR_NotYetIntroduced, Context, D, EmitAvailabilityWarning(), clang::ObjCPropertyDecl::findPropertyDecl(), clang::Decl::getAvailability(), getCurFunctionAvailabilityContext(), clang::Result, and ShouldDiagnoseAvailabilityOfDecl().
Referenced by DiagnoseUseOfDecl().
bool Sema::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:
Definition at line 6114 of file SemaDecl.cpp.
References clang::SemaBase::Diag(), clang::DeclarationNameInfo::getLoc(), and clang::DeclarationNameInfo::getName().
Referenced by ActOnAliasDeclaration(), ActOnEnumConstant(), ActOnTag(), CheckClassTemplate(), CheckUsingShadowDecl(), and HandleDeclarator().
void Sema::DiagnoseCommaOperator | ( | const Expr * | LHS, |
SourceLocation | Loc | ||
) |
Look for instances where it is likely the comma operator is confused with another operator.
There is an explicit list of acceptable expressions for the left hand side of the comma operator, otherwise emit a warning.
Definition at line 13879 of file SemaExpr.cpp.
References clang::Scope::BreakScope, Context, clang::Scope::ContinueScope, clang::Scope::ControlScope, clang::FixItHint::CreateInsertion(), clang::Scope::DeclScope, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), getCurScope(), clang::Stmt::getEndLoc(), clang::Scope::getFlags(), getLangOpts(), clang::Preprocessor::getLocForEndOfToken(), clang::Stmt::getSourceRange(), IgnoreCommaOperand(), inTemplateInstantiation(), clang::SourceLocation::isMacroID(), LangOpts, Loc, and PP.
Referenced by CheckCommaOperands().
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 7915 of file SemaExpr.cpp.
References Context, clang::SemaBase::Diag(), findMacroSpelling(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::isNullPointerConstant(), clang::Expr::NPC_ValueDependentIsNotNull, clang::Expr::NPCK_CXX11_nullptr, clang::Expr::NPCK_NotNull, clang::Expr::NPCK_ZeroExpression, and clang::Expr::NPCK_ZeroLiteral.
Referenced by CheckConditionalOperands(), and CXXCheckConditionalOperands().
bool clang::Sema::diagnoseConflictingFunctionEffect | ( | const FunctionEffectsRef & | FX, |
const FunctionEffectWithCondition & | EC, | ||
SourceLocation | NewAttrLoc | ||
) |
Warn and return true if adding a function effect to a set would create a conflict.
Definition at line 1388 of file SemaFunctionEffects.cpp.
References clang::FunctionEffect::Allocating, clang::FunctionEffectWithCondition::Cond, clang::FunctionEffectWithCondition::description(), clang::SemaBase::Diag(), clang::FunctionEffectWithCondition::Effect, clang::EffectConditionExpr::getCondition(), Incompatible, clang::FunctionEffect::kind(), and clang::FunctionEffect::NonBlocking.
Referenced by handleNonBlockingNonAllocatingTypeAttr(), and clang::TreeTransform< Derived >::TransformFunctionProtoType().
void Sema::DiagnoseDeletedDefaultedFunction | ( | FunctionDecl * | FD | ) |
Produce notes explaining why a defaulted function was defined as deleted.
Definition at line 9762 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().
Referenced by CheckCompletedCXXClass(), and NoteDeletedFunction().
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 2393 of file SemaExpr.cpp.
References clang::LookupResult::begin(), CheckCXXThisCapture(), CodeSynthesisContexts, clang::FixItHint::CreateInsertion(), CurContext, D, clang::Sema::CodeSynthesisContext::DefaultFunctionArgumentInstantiation, clang::SemaBase::Diag(), clang::DeclContext::Equals(), clang::Decl::getDeclContext(), getLangOpts(), clang::Decl::getLocation(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), clang::DeclContext::getParent(), and clang::LookupResult::getRepresentativeDecl().
Referenced by BuildRecoveryCallExpr(), and DiagnoseEmptyLookup().
void Sema::DiagnoseDiscardedExprMarkedNodiscard | ( | const Expr * | E | ) |
DiagnoseDiscardedExprMarkedNodiscard - Given an expression that is semantically a discarded-value expression, diagnose if any [[nodiscard]] value has been discarded.
Definition at line 416 of file SemaStmt.cpp.
References E.
Referenced by BuildMemberReferenceExpr().
bool Sema::DiagnoseEmptyLookup | ( | Scope * | S, |
CXXScopeSpec & | SS, | ||
LookupResult & | R, | ||
CorrectionCandidateCallback & | CCC, | ||
TemplateArgumentListInfo * | ExplicitTemplateArgs = nullptr , |
||
ArrayRef< Expr * > | Args = {} , |
||
DeclContext * | LookupCtx = nullptr , |
||
TypoExpr ** | Out = nullptr |
||
) |
Diagnose an empty lookup.
Definition at line 2452 of file SemaExpr.cpp.
References clang::LookupResult::addDecl(), AddOverloadCandidate(), AddOverloadedCallCandidates(), AddTemplateOverloadCandidate(), clang::AS_none, clang::OverloadCandidateSet::BestViableFunction(), clang::LookupResult::clear(), computeDeclContext(), Context, CorrectTypo(), CorrectTypoDelayed(), clang::CPlusPlus, clang::OverloadCandidateSet::CSK_Normal, CTK_ErrorRecovery, CurContext, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::SemaBase::Diag(), DiagnoseDependentMemberLookup(), diagnoseTypo(), clang::LookupResult::empty(), clang::Type::getAsCXXRecordDecl(), clang::TypoCorrection::getAsString(), clang::NestedNameSpecifier::getAsType(), clang::getAsTypeTemplateDecl(), clang::TypoCorrection::getCorrection(), clang::TypoCorrection::getCorrectionDeclAs(), clang::TypoCorrection::getCorrectionSpecifier(), clang::Decl::getDeclContext(), clang::TypoCorrection::getFoundDecl(), getLangOpts(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), clang::LookupResult::getLookupNameInfo(), clang::DeclContext::getLookupParent(), clang::LookupResult::getNameLoc(), clang::CXXScopeSpec::getRange(), clang::ASTContext::getRecordType(), clang::DeclContext::getRedeclContext(), clang::NamedDecl::getUnderlyingDecl(), clang::NamedDecl::isCXXClassMember(), clang::CXXScopeSpec::isEmpty(), clang::TypoCorrection::isOverloaded(), LookupQualifiedName(), LookupTemplateName(), clang::DeclAccessPair::make(), clang::OR_Success, clang::SemaBase::PDiag(), clang::LookupResult::resolveKind(), clang::LookupResult::setLookupName(), clang::LookupResult::setNamingClass(), clang::TemplateArgumentListInfo::size(), clang::LookupResult::suppressDiagnostics(), TemplateNameIsRequired, and clang::TypoCorrection::WillReplaceSpecifier().
Referenced by ActOnIdExpression(), ActOnLambdaExpressionAfterIntroducer(), and BuildRecoveryCallExpr().
Warn if a for/while loop statement S
, which is followed by PossibleBody
, has a suspicious null statement as a body.
Definition at line 13849 of file SemaChecking.cpp.
References CurrentInstantiationScope, clang::SemaBase::Diag(), Diags, clang::Stmt::getBeginLoc(), clang::SourceManager::getPresumedColumnNumber(), clang::NullStmt::getSemiLoc(), clang::DiagnosticsEngine::isIgnored(), ShouldDiagnoseEmptyStmtBody(), and SourceMgr.
Referenced by ActOnCompoundStmt().
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 13828 of file SemaChecking.cpp.
References CurrentInstantiationScope, clang::SemaBase::Diag(), clang::NullStmt::getSemiLoc(), ShouldDiagnoseEmptyStmtBody(), and SourceMgr.
Referenced by ActOnFinishSwitchStmt(), ActOnIfStmt(), and FinishCXXForRangeStmt().
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 20358 of file SemaExpr.cpp.
References Context, clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), E, clang::SourceRange::getBegin(), clang::ParenExpr::getBeginLoc(), clang::SourceRange::getEnd(), clang::Stmt::getSourceRange(), clang::ParenExpr::getSubExpr(), clang::Expr::IgnoreParens(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isMacroID(), clang::ParenExpr::isProducedByFoldExpansion(), clang::Expr::isTypeDependent(), Loc, and clang::Expr::MLV_Valid.
Referenced by CheckBooleanCondition().
void Sema::diagnoseEquivalentInternalLinkageDeclarations | ( | SourceLocation | Loc, |
const NamedDecl * | D, | ||
ArrayRef< const NamedDecl * > | Equiv | ||
) |
Definition at line 10780 of file SemaOverload.cpp.
References D, Diag(), E, clang::Module::getFullModuleName(), clang::Decl::getLocation(), and Loc.
Referenced by clang::OverloadCandidateSet::BestViableFunction(), and clang::LookupResult::resolveKind().
void Sema::diagnoseExprIntendedAsTemplateName | ( | Scope * | S, |
ExprResult | TemplateName, | ||
SourceLocation | Less, | ||
SourceLocation | Greater | ||
) |
Definition at line 618 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::Adopt(), CorrectTypo(), CTK_ErrorRecovery, clang::SemaBase::Diag(), diagnoseTypo(), clang::Found, clang::DeclarationName::getAsString(), getAsTemplateNameDecl(), clang::DeclarationNameInfo::getBeginLoc(), clang::TypoCorrection::getCorrectionDecl(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getRange(), clang::Greater, clang::TypoCorrection::isKeyword(), clang::Less, LookupMemberName, LookupOrdinaryName, and clang::SemaBase::PDiag().
void Sema::diagnoseFunctionEffectConversion | ( | QualType | DstType, |
QualType | SrcType, | ||
SourceLocation | Loc | ||
) |
Warn when implicitly changing function effects.
Definition at line 632 of file Sema.cpp.
References clang::SemaBase::Diag(), clang::FunctionEffectsRef::get(), and Loc.
Referenced by ImpCastExprToType().
void clang::Sema::diagnoseFunctionEffectMergeConflicts | ( | const FunctionEffectSet::Conflicts & | Errs, |
SourceLocation | NewLoc, | ||
SourceLocation | OldLoc | ||
) |
Definition at line 1434 of file SemaFunctionEffects.cpp.
References clang::SemaBase::Diag().
Referenced by CheckOverridingFunctionAttributes(), and MergeFunctionDecl().
void Sema::DiagnoseFunctionSpecifiers | ( | const DeclSpec & | DS | ) |
Diagnose function specifiers on a declaration of an identifier that does not identify a function.
Definition at line 6652 of file SemaDecl.cpp.
References clang::SemaBase::Diag(), clang::DeclSpec::getExplicitSpecLoc(), clang::DeclSpec::getNoreturnSpecLoc(), clang::DeclSpec::getVirtualSpecLoc(), clang::DeclSpec::hasExplicitSpecifier(), clang::DeclSpec::isNoreturnSpecified(), and clang::DeclSpec::isVirtualSpecified().
Referenced by clang::SemaObjC::ActOnObjCExceptionDecl(), ActOnParamDeclarator(), ActOnTypedefDeclarator(), ActOnVariableDeclarator(), HandleField(), HandleMSProperty(), and ParsedFreeStandingDeclSpec().
void Sema::DiagnoseHiddenVirtualMethods | ( | CXXMethodDecl * | MD | ) |
Diagnose methods which overload virtual methods in a base class without overriding any.
Definition at line 10328 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), Diags, FindHiddenVirtualMethods(), clang::Decl::getLocation(), clang::DiagnosticsEngine::isIgnored(), clang::Decl::isInvalidDecl(), and NoteHiddenVirtualMethods().
Referenced by CheckCompletedCXXClass().
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 2871 of file SemaType.cpp.
References clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), E, getSourceManager(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), Loc, clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, clang::DeclSpec::TQ_unaligned, and clang::DeclSpec::TQ_volatile.
Referenced by CheckConstructorDeclarator(), CheckDestructorDeclarator(), and diagnoseRedundantReturnTypeQualifiers().
void Sema::DiagnoseImmediateEscalatingReason | ( | FunctionDecl * | FD | ) |
Definition at line 2495 of file SemaDeclCXX.cpp.
References D, Diag(), clang::SemaBase::Diag(), E, clang::CXXCtorInitializer::getAnyMember(), clang::Stmt::getBeginLoc(), clang::Decl::getLocation(), clang::CXXCtorInitializer::getSourceRange(), clang::Stmt::getSourceRange(), clang::FunctionDecl::hasBody(), clang::Expr::IgnoreImplicit(), clang::Init, clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isImmediateEscalating(), clang::CXXCtorInitializer::isWritten(), Loc, Range, clang::T, and clang::DynamicRecursiveASTVisitor::TraverseConstructorInitializer().
Referenced by CheckImmediateEscalatingFunctionDefinition(), EvaluateAndDiagnoseImmediateInvocation(), and HandleImmediateInvocations().
bool Sema::DiagnoseInvalidExplicitObjectParameterInLambda | ( | CXXMethodDecl * | Method, |
SourceLocation | CallLoc | ||
) |
Returns true if the explicit object parameter was invalid.
Definition at line 395 of file SemaLambda.cpp.
References BuildBasePathArray(), CheckBaseClassAccess(), Context, clang::SemaBase::Diag(), getAmbiguousPathsDisplayString(), getASTContext(), clang::Type::getCanonicalTypeUnqualified(), clang::QualType::getDesugaredType(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getRecordType(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::CXXRecordDecl::isCapturelessLambda(), clang::Type::isDependentType(), IsDerivedFrom(), clang::isLambdaCallWithExplicitObjectParameter(), clang::ASTContext::LambdaCastPaths, and Path.
Referenced by PrepareExplicitObjectArgument().
void Sema::DiagnoseInvalidJumps | ( | Stmt * | Body | ) |
Definition at line 1042 of file JumpDiagnostics.cpp.
Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().
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 14451 of file SemaChecking.cpp.
References clang::SemaBase::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 5553 of file SemaLookup.cpp.
References Context, diagnoseMissingImport(), getDefinitionToImport(), clang::Decl::getLocation(), clang::ASTContext::getModulesWithMergedDefinition(), getOwningModule(), and Loc.
Referenced by computeDeclContext(), diagnoseMissingArgument(), diagnoseMissingImport(), diagnoseTypo(), DiagnoseUninstantiableTemplate(), and RequireCompleteEnumDecl().
void Sema::diagnoseMissingImport | ( | SourceLocation | Loc, |
const NamedDecl * | Decl, | ||
SourceLocation | DeclLoc, | ||
ArrayRef< Module * > | Modules, | ||
MissingImportKind | MIK, | ||
bool | Recover | ||
) |
Definition at line 5583 of file SemaLookup.cpp.
References createImplicitModuleImportForErrorRecovery(), clang::SemaBase::Diag(), getASTContext(), 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::ASTContext::isInSameModule(), clang::Module::isModuleMapModule(), clang::Module::isPrivateModule(), PP, and SourceMgr.
void Sema::diagnoseMissingTemplateArguments | ( | const CXXScopeSpec & | SS, |
bool | TemplateKeyword, | ||
TemplateDecl * | TD, | ||
SourceLocation | Loc | ||
) |
Definition at line 4541 of file SemaTemplate.cpp.
References Context, diagnoseMissingTemplateArguments(), clang::ASTContext::getQualifiedTemplateName(), clang::CXXScopeSpec::getScopeRep(), and Loc.
void Sema::diagnoseMissingTemplateArguments | ( | TemplateName | Name, |
SourceLocation | Loc | ||
) |
Definition at line 4532 of file SemaTemplate.cpp.
References clang::SemaBase::Diag(), getTemplateNameKindForDiagnostics(), int, Loc, and NoteTemplateLocation().
Referenced by BuildDeclarationNameExpr(), BuildMemberReferenceExpr(), BuildTemplateIdExpr(), CheckTemplateTypeArgument(), diagnoseMissingTemplateArguments(), and DiagnoseUnknownTypeName().
Definition at line 4059 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::CompleteCandidates(), clang::OverloadCandidateSet::CSK_Normal, Diag(), clang::OverloadCandidateSet::empty(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), IsUserDefinedConversion(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_No_Viable_Function, and clang::ImplicitConversionSequence::UserDefined.
Referenced by BuildConvertedConstantExpression().
void Sema::DiagnoseNonDefaultPragmaAlignPack | ( | PragmaAlignPackDiagnoseKind | Kind, |
SourceLocation | IncludeLoc | ||
) |
Definition at line 547 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.
Referenced by clang::sema::SemaPPCallbacks::FileChanged().
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 10048 of file SemaDeclCXX.cpp.
References checkTrivialSubobjectCall(), Context, clang::CopyAssignment, clang::CopyConstructor, clang::Decl::getLocation(), clang::ASTContext::getRecordType(), TAH_IgnoreTrivialABI, and TSK_CompleteObject.
Referenced by CheckNontrivialField().
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 616 of file Sema.cpp.
References clang::SemaBase::Diag(), clang::Type::getNullability(), Loc, clang::NonNull, clang::Nullable, and clang::NullableResult.
Referenced by ImpCastExprToType(), PerformConstructorInitialization(), and PerformImplicitConversion().
void Sema::DiagnosePrecisionLossInComplexDivision | ( | ) |
Definition at line 1226 of file SemaAttr.cpp.
References clang::SemaBase::Diag(), ExcessPrecisionNotSatisfied, clang::SourceLocation::isValid(), LocationOfExcessPrecisionNotSatisfied, and clang::Num.
Referenced by ActOnEndOfTranslationUnit().
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 6129 of file SemaDecl.cpp.
References clang::CXXScopeSpec::clear(), Context, clang::FixItHint::CreateRemoval(), CurContext, clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXDestructorName, clang::SemaBase::Diag(), clang::DeclContext::Encloses(), clang::DeclContext::Equals(), clang::Type::getAsAdjusted(), clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifierLoc::getLocalSourceRange(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::DeclContext::getParent(), clang::NestedNameSpecifierLoc::getPrefix(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::TypeLoc::getSourceRange(), clang::TypeLoc::getTemplateKeywordLoc(), clang::ASTContext::getTypeDeclType(), clang::NestedNameSpecifierLoc::getTypeLoc(), clang::ASTContext::hasSameType(), clang::Type::isDecltypeType(), clang::DeclContext::isRecord(), clang::SourceLocation::isValid(), clang::CXXScopeSpec::isValid(), LangOpts, Loc, clang::CXXScopeSpec::location_data(), clang::T, clang::TemplateIdAnnotation::TemplateKWLoc, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
Referenced by ActOnClassTemplateSpecialization(), ActOnCXXMemberDeclarator(), ActOnTag(), CheckClassTemplate(), and HandleDeclarator().
void Sema::DiagnoseReturnInConstructorExceptionHandler | ( | CXXTryStmt * | TryBlock | ) |
Definition at line 18137 of file SemaDeclCXX.cpp.
References E, clang::CXXTryStmt::getHandler(), clang::CXXTryStmt::getNumHandlers(), and SearchForReturnInStmt().
Referenced by ActOnFinishFunctionBody().
void Sema::DiagnoseSelfMove | ( | const Expr * | LHSExpr, |
const Expr * | RHSExpr, | ||
SourceLocation | OpLoc | ||
) |
DiagnoseSelfMove - Emits a warning if a value is moved to itself.
Definition at line 13917 of file SemaChecking.cpp.
References clang::FixItHint::CreateInsertion(), D, clang::SemaBase::Diag(), Diags, clang::CallExpr::getArg(), clang::MemberExpr::getBase(), clang::DeclRefExpr::getBeginLoc(), clang::Decl::getCanonicalDecl(), clang::DeclRefExpr::getDecl(), clang::MemberExpr::getMemberDecl(), clang::CallExpr::getNumArgs(), getSelfAssignmentClassMemberCandidate(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), inTemplateInstantiation(), clang::CallExpr::isCallToStdMove(), and clang::DiagnosticsEngine::isIgnored().
Referenced by CreateBuiltinBinOp().
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 412 of file SemaExpr.cpp.
References Context, clang::CPlusPlus11, clang::FixItHint::CreateInsertion(), D, clang::SemaBase::Diag(), clang::Type::getAs(), clang::Decl::getAttr(), clang::Stmt::getEndLoc(), getLangOpts(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::AttributeCommonInfo::getRange(), int, clang::SourceLocation::isInvalid(), clang::Preprocessor::isMacroDefined(), clang::ASTContext::isSentinelNullExpr(), clang::Expr::isValueDependent(), Loc, and PP.
Referenced by BuildCXXNew(), BuildResolvedCallExpr(), clang::SemaObjC::CheckMessageArgumentTypes(), and 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 8426 of file SemaDecl.cpp.
References computeShadowedDeclKind(), clang::SemaBase::Diag(), getCaptureLocation(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::sema::CapturingScopeInfo::isCXXThisCaptured(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), and clang::sema::LambdaScopeInfo::ShadowingDecls.
Referenced by BuildLambdaExpr().
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 15184 of file SemaDecl.cpp.
References Context, D, clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::CharUnits::getQuantity(), clang::ASTContext::getTypeSizeInChars(), clang::Type::isDependentType(), clang::QualType::isPODType(), LangOpts, clang::Parameter, and clang::T.
Referenced by ActOnFinishFunctionBody().
void Sema::DiagnoseStaticAssertDetails | ( | const Expr * | E | ) |
Try to print more useful information about a failed static_assert with expression \E.
Definition at line 17151 of file SemaDeclCXX.cpp.
References Context, ConvertAPValueToString(), clang::SemaBase::Diag(), E, clang::Expr::EvaluateAsRValue(), clang::Expr::getType(), clang::Type::isBooleanType(), clang::Result, and UsefulToPrintExpr().
Referenced by BuildStaticAssertDeclaration().
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 854 of file SemaTemplate.cpp.
References clang::SemaBase::Diag(), getLangOpts(), clang::Decl::isTemplateParameter(), Loc, and NoteTemplateParameterLocation().
Referenced by ActOnAliasDeclaration(), ActOnDecompositionDeclarator(), ActOnEnumConstant(), ActOnExceptionDeclarator(), ActOnNamespaceAliasDef(), ActOnParamDeclarator(), ActOnTag(), CheckClassTemplate(), HandleDeclarator(), HandleField(), HandleMSProperty(), and maybeDiagnoseTemplateParameterShadow().
void Sema::diagnoseTypo | ( | const TypoCorrection & | Correction, |
const PartialDiagnostic & | TypoDiag, | ||
bool | ErrorRecovery = true |
||
) |
Definition at line 5527 of file SemaLookup.cpp.
References diagnoseTypo(), and clang::SemaBase::PDiag().
Referenced by clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), ActOnSizeofParameterPackExpr(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), BuildCXXNestedNameSpecifier(), BuildMemInitializer(), BuildUsingDeclaration(), ClassifyName(), ConvertArgumentsForCall(), DiagnoseEmptyLookup(), diagnoseExprIntendedAsTemplateName(), DiagnoseInvalidRedeclaration(), diagnoseTypo(), DiagnoseUnknownTypeName(), emitEmptyLookupTypoDiagnostic(), clang::SemaObjC::FindProtocolDeclaration(), clang::SemaObjC::getObjCInterfaceDecl(), clang::SemaObjC::getObjCMessageKind(), getTypeName(), clang::SemaObjC::HandleExprPropertyRefExpr(), ImplicitlyDefineFunction(), LookupMemberExpr(), clang::SemaOpenMP::lookupOpenMPDeclareTargetName(), LookupTemplateName(), resolveAssumedTemplateNameAsType(), and TryNamespaceTypoCorrection().
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 5680 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 2028 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.
Referenced by DiagnoseUseOfDecl().
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 509 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 526 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 461 of file SemaTemplateVariadic.cpp.
References clang::Expr::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), E, clang::Stmt::getBeginLoc(), and getEnclosingLambdaOrBlock().
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 562 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 445 of file SemaTemplateVariadic.cpp.
References clang::Type::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), Loc, and clang::T.
Referenced by ActOnAliasDeclaration(), ActOnBaseSpecifier(), ActOnBlockArguments(), ActOnCaseExpr(), ActOnClassTemplateSpecialization(), ActOnCXXAssumeAttr(), ActOnCXXForRangeStmt(), ActOnDecompositionDeclarator(), ActOnExceptionDeclarator(), ActOnFinishConceptDefinition(), ActOnFinishCXXInClassMemberInitializer(), ActOnFinishFullExpr(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnLambdaExpressionAfterIntroducer(), ActOnNonTypeTemplateParameter(), ActOnParamDefaultArgument(), ActOnRequiresClause(), ActOnStaticAssertDeclaration(), ActOnTag(), ActOnTemplateTemplateParameter(), ActOnTypeParameter(), ActOnUsingDeclaration(), ActOnVarTemplateSpecialization(), AddInitializerToDecl(), BuildBaseInitializer(), BuildMemberInitializer(), BuildReturnStmt(), BuildTypeConstraint(), clang::checkAMDGPUMaxNumWorkGroupsArguments(), clang::checkAMDGPUWavesPerEUArguments(), CheckEnumConstant(), checkExceptionSpecification(), CheckMicrosoftIfExistsSymbol(), CheckTemplateParameterList(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), getLambdaType(), handleAlignedAttr(), HandleDeclarator(), HandleField(), HandleMSProperty(), InventTemplateParameter(), makeLaunchBoundsArgExpr(), and VerifyBitField().
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 576 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 486 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 355 of file SemaTemplateVariadic.cpp.
References clang::declaresSameEntity(), clang::SemaBase::Diag(), E, clang::Func, FunctionScopes, getEnclosingLambdaOrBlock(), int, and Loc.
Referenced by checkExceptionSpecification(), CheckTemplateParameterList(), DiagnoseUnexpandedParameterPack(), and DiagnoseUnexpandedParameterPackInRequiresExpr().
void Sema::DiagnoseUnguardedAvailabilityViolations | ( | Decl * | FD | ) |
Issue any -Wunguarded-availability warnings in FD
.
Definition at line 1065 of file SemaAvailability.cpp.
References D, and clang::Decl::getAsFunction().
Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().
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 761 of file SemaTemplate.cpp.
References Context, Definition, clang::SemaBase::Diag(), diagnoseMissingImport(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::ASTContext::getTypeDeclType(), hasReachableDefinition(), clang::Decl::isInvalidDecl(), isSFINAEContext(), NoteTemplateLocation(), clang::Decl::setInvalidDecl(), clang::TSK_ExplicitInstantiationDeclaration, and clang::TSK_ImplicitInstantiation.
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.
References computeDeclContext(), Context, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::ASTContext::getDependentTemplateName(), clang::IdentifierInfo::getName(), clang::CXXScopeSpec::getScopeRep(), isDependentScopeSpecifier(), clang::CXXScopeSpec::isSet(), clang::OpaquePtr< TemplateName >::make(), and clang::TNK_Dependent_template_name.
void Sema::DiagnoseUnknownTypeName | ( | IdentifierInfo *& | II, |
SourceLocation | IILoc, | ||
Scope * | S, | ||
CXXScopeSpec * | SS, | ||
ParsedType & | SuggestedType, | ||
bool | IsTemplateName = false |
||
) |
Definition at line 683 of file SemaDecl.cpp.
References ActOnTypenameType(), computeDeclContext(), clang::NestedNameSpecifier::containsErrors(), Context, CorrectTypo(), clang::CPlusPlus, clang::FixItHint::CreateInsertion(), CTK_ErrorRecovery, clang::SemaBase::Diag(), diagnoseMissingTemplateArguments(), diagnoseTypo(), clang::OpaquePtr< PtrTy >::get(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), getLangOpts(), clang::IdentifierInfo::getName(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), getTypeName(), isDependentScopeSpecifier(), clang::IdentifierInfo::isEditorPlaceholder(), clang::CXXScopeSpec::isInvalid(), isMicrosoftMissingTypename(), clang::CXXScopeSpec::isSet(), isTemplateName(), clang::CXXScopeSpec::isValid(), LookupOrdinaryName, clang::CXXScopeSpec::MakeTrivial(), clang::SemaBase::PDiag(), and clang::TNK_Type_template.
Referenced by BuildCXXNestedNameSpecifier().
void Sema::DiagnoseUnsatisfiedConstraint | ( | const ASTConstraintSatisfaction & | Satisfaction, |
bool | First = true |
||
) |
Emit diagnostics explaining why a constraint expression was deemed unsatisfied.
Definition at line 1401 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 1391 of file SemaConcept.cpp.
References clang::ConstraintSatisfaction::Details, diagnoseUnsatisfiedConstraintExpr(), clang::First, and clang::ConstraintSatisfaction::IsSatisfied.
Referenced by BuildStaticAssertDeclaration(), checkAddressOfFunctionIsAvailable(), CheckDeducedPlaceholderConstraints(), DiagnoseBadDeduction(), diagnoseUnsatisfiedRequirement(), DiagnoseUseOfDecl(), diagnoseWellFormedUnsatisfiedConstraintExpr(), EnsureTemplateArgumentListConstraints(), NoteFunctionCandidate(), and NoteSurrogateCandidate().
void Sema::DiagnoseUnterminatedPragmaAlignPack | ( | ) |
Definition at line 586 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 1236 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 2101 of file SemaDecl.cpp.
References clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::Decl::hasAttr(), clang::VarDecl::isCXXCondDecl(), clang::NamedDecl::isPlaceholderVar(), clang::Decl::isReferenced(), clang::SemaBase::PDiag(), and RefsMinusAssignments.
Referenced by ActOnPopScope().
void Sema::DiagnoseUnusedDecl | ( | const NamedDecl * | ND | ) |
Definition at line 2070 of file SemaDecl.cpp.
References D, clang::SemaBase::Diag(), DiagnoseUnusedDecl(), and Loc.
Referenced by ActOnPopScope(), BuildVariableInstantiation(), DiagnoseUnusedDecl(), and DiagnoseUnusedNestedTypedefs().
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 2075 of file SemaDecl.cpp.
References Context, D, GenerateFixForUnusedDecl(), getLangOpts(), clang::Decl::getLocation(), clang::SemaBase::PDiag(), ShouldDiagnoseUnusedDecl(), and UnusedLocalTypedefNameCandidates.
DiagnoseUnusedExprResult - If the statement passed in is an expression whose result is unused, warn.
Definition at line 420 of file SemaStmt.cpp.
Referenced by ActOnFinishFullExpr(), and CheckCommaOperands().
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 2006 of file SemaLambda.cpp.
References CaptureHasSideEffects(), clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), getLangOpts(), 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().
Referenced by BuildLambdaExpr().
void Sema::DiagnoseUnusedNestedTypedefs | ( | const RecordDecl * | D | ) |
Definition at line 2052 of file SemaDecl.cpp.
References D, clang::SemaBase::Diag(), DiagnoseUnusedNestedTypedefs(), and Loc.
Referenced by ActOnPopScope(), and DiagnoseUnusedNestedTypedefs().
void Sema::DiagnoseUnusedNestedTypedefs | ( | const RecordDecl * | D, |
DiagReceiverTy | DiagReceiver | ||
) |
Definition at line 2057 of file SemaDecl.cpp.
References D, DiagnoseUnusedDecl(), DiagnoseUnusedNestedTypedefs(), and clang::T.
void Sema::DiagnoseUnusedParameters | ( | ArrayRef< ParmVarDecl * > | Parameters | ) |
Diagnose any unused parameters in the given sequence of ParmVarDecl pointers.
Definition at line 15168 of file SemaDecl.cpp.
References clang::SemaBase::Diag(), inTemplateInstantiation(), and clang::Parameter.
Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().
bool Sema::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.
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 216 of file SemaExpr.cpp.
References CheckConceptUseInDefinition(), CheckFunctionConstraints(), checkTypeSupport(), Concept, clang::DeclContext::containsDecl(), Context, clang::CPlusPlus, clang::CPlusPlus14, CUDA(), CurContext, D, DeduceReturnType(), clang::SemaBase::Diag(), diagnoseArgIndependentDiagnoseIfAttrs(), DiagnoseAvailabilityOfDecl(), diagnoseUnavailableAlignedAllocation(), DiagnoseUnsatisfiedConstraint(), DiagnoseUnusedOfDecl(), diagnoseUseOfInternalDeclInInlineFunction(), clang::LangOptionsBase::FEM_UnsetOnCommandLine, clang::ObjCPropertyDecl::findPropertyDecl(), clang::Decl::getCanonicalDecl(), getCurFunction(), clang::Preprocessor::getCurrentFPEvalMethod(), clang::Decl::getDeclContext(), getLangOpts(), clang::Preprocessor::getLastFPEvalPragmaLocation(), clang::Decl::getLocation(), clang::SemaOpenMP::getOpenMPDeclareMapperVarName(), clang::StringLiteral::getString(), clang::ASTContext::getTargetInfo(), clang::Decl::hasAttr(), clang::sema::FunctionScopeInfo::HasOMPDeclareReductionCombiner, clang::ConstraintSatisfaction::IsSatisfied, clang::TargetInfo::isTLSSupported(), isUnevaluatedContext(), clang::SourceLocation::isValid(), LangOpts, Loc, NoteDeletedFunction(), OpenMP(), ParsingInitForAutoVars, PP, SuppressedDiagnostics, targetDiag(), and clang::VarDecl::TLS_None.
Referenced by clang::SemaObjC::ActOnClassPropertyRefExpr(), ActOnCXXDelete(), ActOnDecltypeExpression(), ActOnLambdaExpressionAfterIntroducer(), ActOnNamespaceAliasDef(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), ActOnUsingDirective(), clang::SemaObjC::BuildClassMessage(), BuildCXXCastArgument(), BuildCXXNestedNameSpecifier(), BuildCXXNew(), BuildDeclarationNameExpr(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildIvarRefExpr(), BuildMemberReferenceExpr(), clang::SemaObjC::BuildObjCBoxedExpr(), BuildTypeofExprType(), CheckConceptTemplateId(), CheckConstrainedAuto(), CheckCXXThrowOperand(), CheckDestructor(), checkDestructorReference(), CheckParmsForFunctionDef(), CheckTemplateArgument(), CheckTemplateIdType(), ClassifyName(), ConvertDeclSpecToType(), CreateFunctionRefExpr(), DeduceTemplateSpecializationFromInitializer(), DiagnoseUseOfOverloadedDecl(), diagnoseUseOfProtocols(), FinalizeVarWithDestructor(), clang::SemaObjC::FindProtocolDeclaration(), FinishOverloadedCallExpr(), getConstructorName(), GetEnumUnderlyingType(), clang::SemaObjC::getObjCMessageKind(), getTypeName(), clang::SemaObjC::HandleExprPropertyRefExpr(), LookupMemberExpr(), MarkBaseAndMemberDestructorsReferenced(), MarkVirtualBaseDestructorsReferenced(), MaybeBindToTemporary(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), PerformImplicitConversion(), clang::TreeTransform< Derived >::RebuildUnresolvedUsingType(), and SetDelegatingInitializer().
void Sema::DiagnoseUseOfDeletedFunction | ( | SourceLocation | Loc, |
SourceRange | Range, | ||
DeclarationName | Name, | ||
OverloadCandidateSet & | CandidateSet, | ||
FunctionDecl * | Fn, | ||
MultiExprArg | Args, | ||
bool | IsMember = false |
||
) |
Definition at line 16449 of file SemaOverload.cpp.
References clang::StringLiteral::getString(), Loc, clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, and Range.
Referenced by FinishOverloadedCallExpr(), resolveAllocationOverload(), and resolveBuiltinNewDeleteOverload().
|
inline |
Definition at line 6492 of file Sema.h.
References D, DiagnoseUseOfDecl(), and Loc.
Referenced by BuildCXXConstructExpr().
Warn when implicitly casting 0 to nullptr.
Definition at line 644 of file Sema.cpp.
References CodeSynthesisContexts, clang::CPlusPlus11, clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), Diags, E, 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 5350 of file SemaDecl.cpp.
References clang::CPlusPlus, D, DiagPlaceholderVariableDefinition(), clang::First, getLangOpts(), clang::Decl::getLocation(), and clang::NamedDecl::isPlaceholderVar().
Referenced by ActOnDefinedDeclarationSpecifier().
void Sema::DiagPlaceholderVariableDefinition | ( | SourceLocation | Loc | ) |
Definition at line 714 of file SemaDeclCXX.cpp.
References clang::CPlusPlus26, clang::SemaBase::Diag(), getLangOpts(), and Loc.
Referenced by ActOnDecompositionDeclarator(), ActOnLambdaExpressionAfterIntroducer(), ActOnVariableDeclarator(), CheckAnonMemberRedeclaration(), and DiagPlaceholderFieldDeclDefinitions().
bool Sema::DiagRedefinedPlaceholderFieldDecl | ( | SourceLocation | Loc, |
RecordDecl * | ClassDecl, | ||
const IdentifierInfo * | Name | ||
) |
Definition at line 4225 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), clang::Found, clang::Decl::getDeclContext(), getLangOpts(), clang::Decl::getLocation(), clang::NamedDecl::isPlaceholderVar(), Loc, clang::DeclContext::lookup(), and clang::Result.
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 20225 of file SemaExpr.cpp.
References ConstantEvaluated, DiagIfReachable(), DiscardedStatement, ExprEvalContexts, ImmediateFunctionContext, Loc, PotentiallyEvaluated, PotentiallyEvaluatedIfUsed, Unevaluated, UnevaluatedAbstract, and UnevaluatedList.
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 20252 of file SemaExpr.cpp.
References DiagRuntimeBehavior(), and Loc.
Referenced by AnalyzeComparison(), BuildVAArgExpr(), BuiltinConstantArgRange(), CheckForNullPointerDereference(), CheckImplicitConversion(), CheckNonNullArgument(), CheckTautologicalComparison(), checkVariadicArgument(), DiagnoseBadDivideOrRemainderValues(), DiagnoseBadShiftValues(), DiagnoseFloatingImpCast(), DiagnoseImpCast(), diagnoseSubtractionOnNullPointer(), diagnoseTautologicalComparison(), DiagRuntimeBehavior(), and LookupMemberExpr().
void Sema::DiscardCleanupsInEvaluationContext | ( | ) |
Definition at line 17904 of file SemaExpr.cpp.
References Cleanup, ExprCleanupObjects, ExprEvalContexts, MaybeODRUseExprs, and clang::CleanupInfo::reset().
Referenced by ActOnBlockError(), ActOnBlockStmtExpr(), ActOnCapturedRegionEnd(), ActOnCapturedRegionError(), ActOnExprStmtError(), ActOnFinishFunctionBody(), ActOnGCCAsmStmt(), ActOnLambdaError(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd(), clang::SemaOpenACC::ActOnStartDeclDirective(), clang::SemaOpenACC::ActOnStartStmtDirective(), ActOnStmtExprError(), BuildBaseInitializer(), BuildCXXDefaultInitExpr(), BuildMemberInitializer(), BuildStmtExpr(), checkForMultipleExportedDefaultConstructors(), 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 14464 of file SemaChecking.cpp.
References Context, E, clang::Type::getPointeeType(), clang::ASTContext::getTypeAlignInChars(), clang::Expr::IgnoreParens(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isIntegerType(), clang::Type::isPointerType(), and clang::T.
Referenced by ActOnCastExpr(), BuildCXXNamedCast(), CheckImplicitConversion(), and clang::InitializationSequence::Perform().
void Sema::emitAndClearUnusedLocalTypedefWarnings | ( | ) |
Definition at line 1087 of file Sema.cpp.
References clang::SemaBase::Diag(), and UnusedLocalTypedefNameCandidates.
Referenced by ActOnEndOfTranslationUnit().
void Sema::emitDeferredDiags | ( | ) |
Definition at line 1876 of file Sema.cpp.
References D, DeviceDeferredDiags, and LangOpts.
Referenced by ActOnEndOfTranslationUnitFragment().
void Sema::EmitDiagnostic | ( | unsigned | DiagID, |
const DiagnosticBuilder & | DB | ||
) |
Cause the built diagnostic to be emitted on the DiagosticsEngine.
This is closely coupled to the SemaDiagnosticBuilder class and should not be used elsewhere.
Definition at line 1595 of file Sema.cpp.
References AccessCheckingSFINAE, Context, clang::CPlusPlus11, clang::SemaBase::Diag(), Diags, clang::DiagnosticsEngine::EmitDiagnostic(), clang::ASTContext::getDiagAllocator(), clang::DiagnosticIDs::getDiagnosticSFINAEResponse(), clang::Diagnostic::getID(), 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().
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 1087 of file SemaConcept.cpp.
References CheckConstraintSatisfaction(), clang::SemaBase::Diag(), DiagnoseUnsatisfiedConstraint(), clang::TemplateDecl::getAssociatedConstraints(), clang::SourceRange::getBegin(), clang::MultiLevelTemplateArgumentList::getInnermost(), getTemplateArgumentBindingsText(), getTemplateNameKindForDiagnostics(), clang::TemplateDecl::getTemplateParameters(), int, and clang::ConstraintSatisfaction::IsSatisfied.
Referenced by CheckTemplateArgumentList().
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 1342 of file SemaDecl.cpp.
References CurContext, EnterTemplatedContext(), clang::Scope::getEntity(), and clang::Scope::getParent().
Referenced by ActOnCXXEnterDeclaratorScope(), and ActOnCXXEnterDeclInitializer().
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 1390 of file SemaDecl.cpp.
References clang::DeclContext::getLookupParent(), and getTemplateDepth().
Referenced by ActOnClassTemplateSpecialization(), ActOnReenterTemplateScope(), CheckClassTemplate(), and EnterDeclaratorContext().
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 6336 of file SemaOverload.cpp.
References CCEK_TemplateArg, clang::ConstantExpr::Create(), clang::Expr::EvalStatus::Diag, Diag(), E, clang::Expr::EvaluateAsConstantExpr(), clang::ExprError(), clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), clang::APValue::isAbsent(), clang::APValue::isInt(), clang::Type::isRecordType(), clang::None, clang::Result, clang::T, and clang::Expr::EvalResult::Val.
Referenced by CheckConvertedConstantExpression(), and CheckTemplateArgument().
void Sema::EvaluateImplicitExceptionSpec | ( | SourceLocation | Loc, |
FunctionDecl * | FD | ||
) |
Evaluate the implicit exception specification for a defaulted special member function.
Definition at line 7520 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 17190 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::Empty, 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, clang::Note, PP, clang::Result, clang::T, and TemporaryMaterializationConversion().
Referenced by BuildStaticAssertDeclaration().
void Sema::ExitDeclaratorContext | ( | Scope * | S | ) |
Definition at line 1377 of file SemaDecl.cpp.
References CurContext, clang::Scope::getEntity(), and clang::Scope::getParent().
Referenced by ActOnCXXExitDeclaratorScope(), and ActOnCXXExitDeclInitializer().
Definition at line 1999 of file SemaExpr.cpp.
References clang::PredefinedExpr::ComputeName(), Context, clang::Preprocessor::CreateString(), CurContext, clang::SemaBase::Diag(), getLangOpts(), clang::Token::getLocation(), getPredefinedExprDecl(), getPredefinedExprKind(), clang::ASTContext::getTranslationUnitDecl(), clang::isFunctionLocalStringLiteralMacro(), clang::tok::isStringLiteral(), OS, PP, clang::Token::setKind(), clang::Token::startToken(), and clang::Lexer::Stringify().
Referenced by ActOnStringLiteral(), and ActOnUnevaluatedStringLiteral().
Definition at line 12858 of file SemaOverload.cpp.
References clang::Type::getAs(), clang::ASTContext::getCanonicalType(), and clang::CanQual< T >::getUnqualifiedType().
Referenced by IsStandardConversion().
void Sema::FillInlineAsmIdentifierInfo | ( | Expr * | Res, |
llvm::InlineAsmIdentifierInfo & | Info | ||
) |
Definition at line 748 of file SemaStmtAsm.cpp.
References Context, clang::Expr::EvaluateAsLValue(), clang::Expr::EvaluateAsRValue(), clang::ASTContext::getAsArrayType(), clang::APValue::getInt(), clang::CharUnits::getQuantity(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Expr::EvalResult::isGlobalLValue(), clang::Expr::isPRValue(), clang::T, and clang::Expr::EvalResult::Val.
void Sema::FilterAcceptableTemplateNames | ( | LookupResult & | R, |
bool | AllowFunctionTemplates = true , |
||
bool | AllowDependent = true |
||
) |
Definition at line 146 of file SemaTemplate.cpp.
References clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), getAsTemplateNameDecl(), clang::LookupResult::Filter::hasNext(), clang::LookupResult::makeFilter(), and clang::LookupResult::Filter::next().
Referenced by ClassifyName(), isTemplateName(), and LookupTemplateName().
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 1581 of file SemaDecl.cpp.
References Context, D, clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::LookupResult::Filter::hasNext(), isDeclInScope(), isOutOfScopePreviousDeclaration(), clang::LookupResult::makeFilter(), and clang::LookupResult::Filter::next().
Referenced by ActOnAliasDeclaration(), ActOnDecompositionDeclarator(), ActOnFinishConceptDefinition(), ActOnFunctionDeclarator(), ActOnNamespaceAliasDef(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveStart(), ActOnStartConceptDefinition(), ActOnTypedefNameDecl(), ActOnVariableDeclarator(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
void Sema::FilterUsingLookup | ( | Scope * | S, |
LookupResult & | lookup | ||
) |
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 12719 of file SemaDeclCXX.cpp.
References CurContext, D, clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::Decl::getIdentifierNamespace(), clang::LookupResult::Filter::hasNext(), clang::Decl::IDNS_Ordinary, isDeclInScope(), clang::DeclContext::isFunctionOrMethod(), clang::Decl::isLocalExternDecl(), clang::LookupResult::Filter::next(), and Previous.
Referenced by BuildUsingDeclaration(), and BuildUsingEnumDeclaration().
void Sema::FinalizeDeclaration | ( | Decl * | D | ) |
FinalizeDeclaration - called by ParseDeclarationAfterDeclarator to perform any semantic actions necessary after any initializer has been attached.
Definition at line 14668 of file SemaDecl.cpp.
References clang::Decl::addAttr(), AddPushedVisibilityAttribute(), clang::SemaCUDA::checkAllowedInitializer(), checkAttributesAfterMerging(), CheckStaticLocalForDllExport(), CheckThreadLocalForLargeAlignment(), Context, CUDA(), clang::SemaBase::Diag(), clang::Decl::dropAttr(), FinalizeDeclaration(), clang::Decl::getAttr(), clang::Decl::getDeclContext(), clang::getDLLAttr(), clang::Redeclarable< decl_type >::getFirstDecl(), clang::VarDecl::getInit(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::Decl::getParentFunctionOrMethod(), clang::DeclContext::getRedeclContext(), clang::Stmt::getSourceRange(), clang::VarDecl::getTLSKind(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasGlobalStorage(), inTemplateInstantiation(), clang::NamedDecl::isExternallyVisible(), clang::DeclContext::isFileContext(), clang::VarDecl::isFileVarDecl(), clang::Attr::isInherited(), clang::Type::isIntegralOrEnumerationType(), clang::VarDecl::isOutOfLine(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::isStaticLocal(), clang::VarDecl::isThisDeclarationADefinition(), LangOpts, MarkUnusedFileScopedDecl(), ParsingInitForAutoVars, PragmaClangBSSSection, PragmaClangDataSection, PragmaClangRelroSection, PragmaClangRodataSection, clang::Sema::PragmaClangSection::PragmaLocation, RegisterTypeTagForDatatype(), clang::Sema::PragmaClangSection::SectionName, clang::Decl::setInvalidDecl(), clang::Decl::specific_attrs(), and clang::Sema::PragmaClangSection::Valid.
Referenced by ActOnCXXForRangeIdentifier(), FinalizeDeclaration(), and FinishForRangeVarDecl().
Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup | ( | Scope * | S, |
const DeclSpec & | DS, | ||
ArrayRef< Decl * > | Group | ||
) |
Definition at line 14825 of file SemaDecl.cpp.
References clang::SemaOpenMP::ActOnOpenMPDeclareTargetInitializer(), clang::ASTContext::addDeclaratorForUnnamedTagDecl(), BuildDeclaratorGroup(), Context, clang::CPlusPlus, D, clang::SemaBase::Diag(), getLangOpts(), clang::Decl::getLocation(), clang::DeclSpec::getRepAsDecl(), clang::DeclaratorDecl::getSourceRange(), clang::ValueDecl::getType(), clang::DeclSpec::getTypeSpecType(), handleTagNumbering(), clang::Type::hasAutoForTrailingReturnType(), clang::DeclSpec::hasAutoTypeSpec(), hasDeducedAuto(), clang::DeclSpec::isDeclRep(), clang::DeclSpec::isTypeSpecOwned(), LangOpts, and OpenMP().
Referenced by ActOnCXXForRangeIdentifier().
void Sema::FinalizeVarWithDestructor | ( | VarDecl * | VD, |
const RecordType * | DeclInitType | ||
) |
FinalizeVarWithDestructor - Prepare for calling destructor on the constructed variable.
Definition at line 16033 of file SemaDeclCXX.cpp.
References CheckDestructorAccess(), clang::Expr::containsErrors(), Context, clang::Destructor, 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 clang::SemaBase::PDiag().
Referenced by ActOnBlockStmtExpr(), BuildExceptionDeclaration(), and CheckCompleteVariableDeclaration().
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 2712 of file SemaExprCXX.cpp.
References adjustCCAndNoReturn(), AFS_Class, AFS_Global, clang::AS_public, clang::LookupResult::begin(), clang::Type::castAs(), CheckAllocationAccess(), clang::LookupResult::clear(), Context, clang::CPlusPlus11, CUDA(), D, clang::ASTContext::DeclarationNames, DeclareGlobalNewDelete(), DeduceTemplateArguments(), clang::SemaBase::Diag(), Diagnose, clang::LookupResult::empty(), clang::LookupResult::end(), clang::SemaCUDA::EraseUnwantedMatches(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), getCurFunctionDecl(), clang::DeclarationNameTable::getCXXOperatorName(), clang::RecordType::getDecl(), clang::ASTContext::getFunctionType(), getLangOpts(), clang::LookupResult::getNamingClass(), clang::ASTContext::getSizeType(), getStdAlignValT(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::getTypeSize(), hasNewExtendedAlignment(), clang::ASTContext::hasSameType(), clang::LookupResult::isAmbiguous(), isNonPlacementDeallocationFunction(), clang::Type::isRecordType(), LookupOrdinaryName, LookupQualifiedName(), clang::DeclAccessPair::make(), clang::LookupResult::makeFilter(), Range, resolveAllocationOverload(), resolveDeallocationOverload(), clang::Success, clang::LookupResult::suppressDiagnostics(), clang::FunctionProtoType::ExtProtoInfo::Variadic, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by BuildCXXNew().
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 3228 of file SemaLookup.cpp.
References addAssociatedClassesAndNamespaces(), Context, D, clang::OverloadExpr::decls(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::Decl::getAsFunction(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::OverloadTy, and clang::Result.
Referenced by ArgumentDependentLookup(), 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 7267 of file SemaExprCXX.cpp.
References clang::Class, Context, clang::CPlusPlus, clang::CPlusPlus17, clang::CPlusPlus20, clang::InitializationKind::CreateCopy(), 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(), getASTContext(), 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::InitializedEntity::InitializeTemporary(), clang::Qualifiers::isAddressSpaceSupersetOf(), clang::Type::isAnyPointerType(), IsDerivedFrom(), clang::ActionResult< PtrTy, Compress >::isInvalid(), 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(), Kind, Loc, clang::ASTContext::mergeExceptionSpecs(), clang::Expr::NPC_ValueDependentIsNull, clang::InitializationSequence::Perform(), Pointer, clang::Qualifiers::setAddressSpace(), clang::Qualifiers::setObjCGCAttr(), clang::Qualifiers::setObjCLifetime(), clang::T, and clang::FunctionType::ExtInfo::withNoReturn().
Referenced by convertPointersToCompositeType(), CXXCheckConditionalOperands(), and FindCompositePointerType().
|
inline |
Definition at line 8403 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 3306 of file SemaExprCXX.cpp.
References AR_inaccessible, CheckAllocationAccess(), Context, D, clang::SemaBase::Diag(), Diagnose, clang::Found, clang::FunctionDecl::getDeletedMessage(), clang::Decl::getLocation(), clang::ASTContext::getRecordType(), clang::StringLiteral::getString(), hasNewExtendedAlignment(), clang::FunctionDecl::isDeleted(), LookupOrdinaryName, LookupQualifiedName(), NoteDeletedFunction(), and resolveDeallocationOverload().
Referenced by ActOnCXXDelete(), FindDeallocationFunctionForDestructor(), findDeleteForPromise(), and ShouldDeleteSpecialMember().
FunctionDecl * Sema::FindDeallocationFunctionForDestructor | ( | SourceLocation | StartLoc, |
CXXRecordDecl * | RD | ||
) |
Definition at line 3289 of file SemaExprCXX.cpp.
References Context, clang::ASTContext::DeclarationNames, FindDeallocationFunction(), FindUsualDeallocationFunction(), clang::DeclarationNameTable::getCXXOperatorName(), clang::ASTContext::getRecordType(), hasNewExtendedAlignment(), and Loc.
Referenced by CheckDestructor().
Find the failed Boolean condition within a given Boolean constant expression, and describe it with a string.
Definition at line 3421 of file SemaTemplate.cpp.
References collectConjunctionTerms(), ConstantEvaluated, Context, getPrintingPolicy(), clang::Expr::IgnoreParenImpCasts(), lookThroughRangesV3Condition(), PP, clang::PrintingPolicy::PrintCanonicalTypes, and clang::Stmt::printPretty().
Referenced by BuildStaticAssertDeclaration(), CheckTemplateIdType(), and CheckTypenameType().
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 358 of file SemaCXXScopeSpec.cpp.
References clang::Found, clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), clang::NestedNameSpecifier::Identifier, isAcceptableNestedNameSpecifier(), LookupName(), LookupNestedNameSpecifierName, and clang::Result.
Referenced by ActOnMemberAccessExpr().
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 10289 of file SemaDeclCXX.cpp.
References AddMostOverridenMethods(), clang::DeclContextLookupResult::begin(), E, clang::DeclContextLookupResult::end(), clang::NamedDecl::getDeclName(), clang::CXXMethodDecl::getParent(), clang::DeclarationName::isIdentifier(), clang::DeclContext::lookup(), and clang::CXXRecordDecl::lookupInBases().
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 13973 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::Type::castAs(), clang::TypeLoc::castAs(), clang::Constexpr, Context, clang::CXXConstructorDecl::Create(), clang::ParmVarDecl::Create(), clang::declaresSameEntity(), clang::DefaultConstructor, defaultedSpecialMemberIsConstexpr(), clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::Decl::getAccess(), clang::FunctionDecl::getConstexprKind(), getCurFPFeatures(), clang::NamedDecl::getDeclName(), clang::CXXConstructorDecl::getExplicitSpecifier(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::Decl::getLocation(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionProtoType::getParamType(), clang::FunctionProtoType::getParamTypes(), clang::ConstructorUsingShadowDecl::getParent(), clang::FunctionType::getReturnType(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLoc::IgnoreParens(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDeleted(), clang::Decl::isInvalidDecl(), Loc, clang::DeclContext::lookup(), mergeDeclAttributes(), clang::SC_None, clang::Decl::setAccess(), SetDeclDeleted(), clang::Decl::setImplicit(), clang::Decl::setInvalidDecl(), clang::FunctionTypeLoc::setParam(), clang::FunctionDecl::setParams(), clang::ParmVarDecl::setScopeInfo(), clang::ValueDecl::setType(), ShouldDeleteSpecialMember(), clang::FunctionProtoType::ExceptionSpecInfo::Type, and clang::Unspecified.
Referenced by BuildCXXConstructExpr(), clang::Sema::InheritedConstructorInfo::findConstructorForBase(), and PerformConstructorInitialization().
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 6156 of file SemaTemplateInstantiateDecl.cpp.
References D, FindInstantiatedDecl(), 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 6178 of file SemaTemplateInstantiateDecl.cpp.
References clang::TemplateArgumentListInfo::addArgument(), ArgumentPackSubstitutionIndex, clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, CheckTemplateIdType(), ClassTemplate, CodeSynthesisContexts, clang::Type::containsErrors(), Context, CurContext, CurrentInstantiationScope, D, clang::DeclContext::decls_begin(), clang::DeclContext::decls_end(), clang::SemaBase::Diag(), clang::Enum, clang::DeclContext::Equals(), FindInstantiatedContext(), FindInstantiatedDecl(), findInstantiationOf(), clang::LocalInstantiationScope::findInstantiationOf(), clang::Found, clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getDeclContext(), clang::Decl::getFriendObjectKind(), clang::MultiLevelTemplateArgumentList::getInnermost(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), clang::Decl::getNonTransparentDeclContext(), clang::MultiLevelTemplateArgumentList::getNumRetainedOuterLevels(), clang::DeclContext::getParent(), clang::TemplateDecl::getTemplateParameters(), clang::EnumDecl::getTemplateSpecializationKind(), clang::CXXRecordDecl::getTemplateSpecializationKind(), getTrivialTemplateArgumentLoc(), clang::ASTContext::getTypeDeclType(), hasUncompilableErrorOccurred(), clang::LocalInstantiationScope::InstantiatedLocal(), isDependentContextAtLevel(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), isInstantiationOf(), clang::Decl::isInvalidDecl(), Loc, clang::DeclContext::lookup(), clang::TemplateArgument::Pack, RebuildingImmediateInvocation, RequireCompleteType(), clang::Result, clang::SemaBase::SemaRef, clang::TemplateParameterList::size(), SubstDecl(), SubstDeclarationNameInfo(), clang::T, clang::TSK_ExplicitSpecialization, and usesPartialOrExplicitSpecialization().
Referenced by BuildVariableInstantiation(), FindInstantiatedContext(), FindInstantiatedDecl(), HandleDependentAccessCheck(), 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 6646 of file SemaDecl.cpp.
References Context, clang::ASTContext::getExternCContextDecl(), clang::DeclContext::lookup(), and clang::Result.
Referenced by checkForConflictWithNonVisibleExternC(), checkGlobalOrExternCConflict(), and ImplicitlyDefineFunction().
bool Sema::findMacroSpelling | ( | SourceLocation & | loc, |
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 2144 of file Sema.cpp.
References clang::SourceLocation::isMacroID().
Referenced by AnalyzeBitFieldAssignment(), diagnoseBadTypeAttribute(), DiagnoseConditionalForNull(), and diagnoseZeroToNullptrConversion().
FunctionDecl * Sema::FindUsualDeallocationFunction | ( | SourceLocation | StartLoc, |
bool | CanProvideSize, | ||
bool | Overaligned, | ||
DeclarationName | Name | ||
) |
Definition at line 3270 of file SemaExprCXX.cpp.
References Context, DeclareGlobalNewDelete(), clang::ASTContext::getTranslationUnitDecl(), LookupOrdinaryName, LookupQualifiedName(), resolveDeallocationOverload(), and clang::Result.
Referenced by ActOnCXXDelete(), FindDeallocationFunctionForDestructor(), and findDeleteForPromise().
StmtResult Sema::FinishCXXForRangeStmt | ( | Stmt * | ForRange, |
Stmt * | Body | ||
) |
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 3199 of file SemaStmt.cpp.
References DiagnoseEmptyStmtBody(), DiagnoseForRangeVariableCopies(), clang::SemaObjC::FinishObjCForCollectionStmt(), clang::ForStmt::getRParenLoc(), ObjC(), clang::ForStmt::setBody(), and clang::StmtError().
Referenced by clang::TreeTransform< Derived >::FinishCXXForRangeStmt().
void Sema::finishLambdaExplicitCaptures | ( | sema::LambdaScopeInfo * | LSI | ) |
Note that we have finished the explicit captures for the given lambda.
Definition at line 543 of file SemaLambda.cpp.
References clang::sema::LambdaScopeInfo::finishedExplicitCaptures().
Referenced by ActOnLambdaExpressionAfterIntroducer().
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 3904 of file SemaTemplateDeduction.cpp.
References clang::Sema::OriginalCallArg::ArgIdx, clang::TemplateArgumentList::asArray(), clang::sema::TemplateDeductionInfo::AssociatedConstraintsSatisfaction, CheckInstantiatedFunctionTemplateConstraints(), CheckOriginalCallArgDeduction(), clang::ConstraintsNotSatisfied, Context, ConvertDeducedTemplateArguments(), clang::TemplateArgumentList::CreateCopy(), CurrentInstantiationScope, clang::Sema::OriginalCallArg::DecomposedParam, clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, clang::sema::TemplateDeductionInfo::diag_begin(), clang::sema::TemplateDeductionInfo::diag_end(), clang::Decl::FOK_None, FunctionTemplate, clang::Decl::getFriendObjectKind(), clang::Decl::getLexicalDeclContext(), clang::sema::TemplateDeductionInfo::getLocation(), getPackIndexForParam(), clang::Sema::SFINAETrap::hasErrorOccurred(), instantiateExplicitSpecifierDeferred(), clang::InstantiationDepth, clang::FunctionDecl::isDefined(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::QualType::isNull(), isSameDeclaration(), clang::ConstraintSatisfaction::IsSatisfied, clang::MiscellaneousDeductionFailure, clang::NonDependentConversionFailure, clang::Sema::OriginalCallArg::OriginalParamType, clang::sema::TemplateDeductionInfo::reset(), clang::Result, clang::Specialization, SubstDecl(), clang::SubstitutionFailure, SubstType(), clang::Success, SuppressedDiagnostics, clang::sema::TemplateDeductionInfo::takeCanonical(), clang::sema::TemplateDeductionInfo::takeSugared(), and Unevaluated.
ExprResult Sema::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).
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 16227 of file SemaOverload.cpp.
References clang::ASTContext::BoundMemberTy, clang::ASTContext::BuiltinFnTy, clang::ASTContext::BuiltinInfo, clang::UnaryOperator::Create(), clang::ImplicitCastExpr::Create(), clang::GenericSelectionExpr::Create(), E, clang::ExprError(), clang::Found, clang::ActionResult< PtrTy, Compress >::get(), clang::TargetInfo::getCXXABI(), clang::Decl::getDeclContext(), clang::ASTContext::getMemberPointerType(), clang::ASTContext::getTargetInfo(), clang::Expr::getType(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::Expr::getValueKind(), clang::ASTContext::hasSameType(), clang::Builtin::Context::isDirectlyAddressable(), clang::CXXMethodDecl::isImplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::TargetCXXABI::isMicrosoft(), Loc, clang::OK_Ordinary, clang::DeclRefExpr::setHadMultipleCandidates(), clang::ast_matchers::type, clang::VK_LValue, and clang::VK_PRValue.
Referenced by CheckSingleAssignmentConstraints(), CheckTemplateArgument(), clang::InitializationSequence::Diagnose(), FinishOverloadedCallExpr(), clang::InitializationSequence::Perform(), and PerformImplicitConversion().
ExprResult Sema::FixOverloadedFunctionReference | ( | ExprResult | E, |
DeclAccessPair | FoundDecl, | ||
FunctionDecl * | Fn | ||
) |
Definition at line 16425 of file SemaOverload.cpp.
References E, and clang::Found.
void Sema::ForceDeclarationOfImplicitMembers | ( | CXXRecordDecl * | Class | ) |
Force the declaration of any implicitly-declared members of this class.
Definition at line 1011 of file SemaLookup.cpp.
References CanDeclareSpecialMemberFunction(), clang::Class, clang::CPlusPlus11, DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), and getLangOpts().
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 20901 of file SemaExpr.cpp.
References E.
Referenced by ActOnFinishFullExpr(), AddInitializerToDecl(), clang::SemaObjC::BuildInstanceMessage(), and deduceVarTypeFromInitializer().
bool Sema::FormatStringHasSArg | ( | const StringLiteral * | FExpr | ) |
Definition at line 8118 of file SemaChecking.cpp.
References Context, clang::ASTContext::getAsConstantArrayType(), getLangOpts(), clang::StringLiteral::getString(), clang::ASTContext::getTargetInfo(), clang::Expr::getType(), clang::analyze_format_string::ParseFormatStringHasSArg(), and clang::T.
Referenced by clang::SemaObjC::DiagnoseCStringFormatDirectiveInCFAPI(), and DiagnoseCStringFormatDirectiveInObjCAPI().
RedeclarationKind Sema::forRedeclarationInCurContext | ( | ) | const |
Definition at line 5763 of file SemaLookup.cpp.
References CurContext.
Referenced by ActOnAliasDeclaration(), clang::SemaObjC::ActOnCompatibilityAlias(), ActOnFinishConceptDefinition(), clang::SemaObjC::ActOnForwardClassDeclaration(), clang::SemaObjC::ActOnForwardProtocolDeclaration(), clang::SemaObjC::ActOnMethodParmDeclaration(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveStart(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), ActOnStartConceptDefinition(), clang::SemaObjC::ActOnStartProtocolInterface(), ActOnTag(), BuildVariableInstantiation(), CheckClassTemplate(), HandleDeclarator(), isDeclaratorFunctionLike(), shouldSkipAnonEnumBody(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
void Sema::FreeVisContext | ( | ) |
FreeVisContext - Deallocate and null out VisContext.
Definition at line 1343 of file SemaAttr.cpp.
References VisContext.
Referenced by PopPragmaVisibility(), and ~Sema().
bool Sema::FriendConstraintsDependOnEnclosingTemplate | ( | const FunctionDecl * | FD | ) |
Definition at line 1066 of file SemaConcept.cpp.
References CalculateTemplateDepthForConstraints(), ConstraintExpressionDependsOnEnclosingTemplate(), clang::TemplateDecl::getAssociatedConstraints(), clang::FunctionDecl::getDescribedFunctionTemplate(), and clang::Decl::getFriendObjectKind().
Referenced by ActOnFunctionDeclarator().
bool Sema::FunctionNonObjectParamTypesAreEqual | ( | const FunctionDecl * | OldFunction, |
const FunctionDecl * | NewFunction, | ||
unsigned * | ArgPos = nullptr , |
||
bool | Reversed = false |
||
) |
Definition at line 3410 of file SemaOverload.cpp.
References clang::Decl::getFunctionType(), clang::FunctionDecl::getNumNonObjectParams(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), and clang::Reversed.
Referenced by sameFunctionParameterTypeLists().
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 3376 of file SemaOverload.cpp.
References clang::ASTContext::hasSameType(), clang::ASTContext::removePtrSizeAddrSpace(), and clang::Reversed.
Referenced by IsOverloadOrOverrideImpl().
bool Sema::FunctionParamTypesAreEqual | ( | const FunctionProtoType * | OldType, |
const FunctionProtoType * | NewType, | ||
unsigned * | ArgPos = nullptr , |
||
bool | Reversed = false |
||
) |
Definition at line 3403 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 5953 of file SemaExpr.cpp.
References clang::SemaHLSL::ActOnOutParamExpr(), clang::ASTContext::ARCUnbridgedCastTy, BuildCXXDefaultArgExpr(), CheckStaticArrayArgument(), checkUnknownAnyArg(), Context, DefaultVariadicArgumentPromotion(), clang::ActionResult< PtrTy, Compress >::get(), clang::FunctionType::ExtParameterInfo::getABI(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Stmt::getBeginLoc(), clang::FunctionProtoType::getExtParameterInfo(), getLangOpts(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionProtoType::getParamType(), clang::FunctionType::getReturnType(), clang::Expr::getType(), clang::Decl::hasAttr(), HLSL(), clang::HLSLInOut, clang::HLSLOut, clang::Expr::IgnoreParenNoopCasts(), clang::InitializedEntity::InitializeParameter(), clang::Invalid, clang::Type::isBlockPointerType(), clang::FunctionDecl::isExternC(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::FunctionType::ExtParameterInfo::isNoEscape(), clang::FunctionProtoType::isParamConsumed(), ObjC(), PerformCopyInitialization(), RequireCompleteType(), clang::InitializedEntity::setParameterCFAudited(), clang::SemaObjC::stripARCUnbridgedCast(), clang::ASTContext::UnknownAnyTy, and VariadicDoesNotApply.
Referenced by BuildCXXNew(), CompleteConstructorCall(), and ConvertArgumentsForCall().
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 3101 of file SemaDeclCXX.cpp.
References Context, clang::QualType::getAsString(), clang::ASTContext::getTypeDeclType(), and Path.
Referenced by AttachBaseSpecifiers(), CheckDerivedToBaseConversion(), DiagnoseAmbiguousLookup(), DiagnoseInvalidExplicitObjectParameterInLambda(), and findDecomposableBaseClass().
|
inline |
Definition at line 533 of file Sema.h.
References Consumer.
Referenced by getASTMutationListener(), clang::IncrementalParser::IncrementalParser(), and clang::ParseAST().
|
inline |
Definition at line 532 of file Sema.h.
References Context.
Referenced by ActOnArraySubscriptExpr(), ActOnCapturedRegionEnd(), ActOnCXXNestedNameSpecifierIndexedPack(), ActOnEndOfTranslationUnit(), ActOnExplicitInstantiation(), ActOnFinishExportDecl(), ActOnModuleDecl(), ActOnModuleImport(), clang::SemaHLSL::ActOnOutParamExpr(), ActOnPseudoDestructorExpr(), clang::SemaHLSL::ActOnVariableDeclarator(), AddImplicitlyDeclaredMembersToClass(), clang::TypoCorrectionConsumer::addNamespaces(), AddOverrideResults(), clang::ExternalASTMerger::AddSources(), AnalyzeCompoundAssignment(), assignInheritanceModel(), BuildBitIntType(), BuildCallExpr(), buildCapture(), buildCaptureDecl(), BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), buildDeclareReductionRef(), buildDeclRefExpr(), buildDistanceFunc(), BuildExpressionFromDeclTemplateArgument(), buildLambdaCaptureFixit(), buildLoopVarFunc(), BuildModuleInclude(), BuildPackIndexingExpr(), BuildPointerType(), BuildReferenceType(), buildUserDefinedMapperRef(), BuiltinFunctionStart(), BuiltinOverflow(), canPassInRegisters(), castVector(), CheckArgTypeMatches(), checkArithmeticBinOpPointerOperands(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), clang::interp::CheckArraySize(), CheckBitcastType(), clang::SemaHLSL::CheckBuiltinFunctionCall(), CheckBuiltinTargetInSupported(), CheckBuiltinTargetNotInUnsupported(), checkBuiltinTemplateIdType(), checkClassLevelDLLAttribute(), CheckCompareOperands(), checkConditionalPointerCompatibility(), clang::interp::CheckConstant(), CheckCountedByAttrOnField(), clang::interp::CheckDecl(), CheckDeclarationCausesMultiVersioning(), CheckDeducedPlaceholderConstraints(), clang::interp::CheckDeleteSource(), CheckForImmediateInvocation(), checkFormatStringExpr(), clang::interp::CheckGlobalInitialized(), CheckImplicitConversion(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionAdditionalRules(), CheckMultiVersionFunction(), CheckMultiVersionValue(), clang::interp::CheckNewDeleteForms(), clang::interp::CheckNewTypeMismatch(), checkNoThrow(), CheckObjCDictionaryLiteralDuplicateKeys(), checkObjCMethodX86VectorTypes(), checkObjCPointerTypesForAssignment(), checkOpenMPLoop(), CheckOriginalCallArgDeduction(), CheckOverridingFunctionReturnType(), clang::interp::CheckPointerToIntegralCast(), checkPointerTypesForAssignment(), CheckRedeclarationModuleOwnership(), checkSizelessVectorShift(), CheckStaticArrayArgument(), CheckStaticLocalForDllExport(), CheckTemplateParameterList(), CheckTemporary(), CheckVariableDeclarationType(), CheckWaveActive(), clang::interp::cleanupAfterFunctionCall(), clang::interp::CMP3(), clang::interp::CmpHelper< FunctionPointer >(), clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< FunctionPointer >(), clang::interp::CmpHelperEQ< Pointer >(), compareEnableIfAttrs(), CompareStandardConversionSequences(), clang::ConversionFixItGenerator::compareTypesSimple(), constructBufferConceptDecl(), constructStructuredBufferConstraintExpr(), constructTypedBufferConstraintExpr(), convertHalfVecBinOp(), clang::CoroutineStmtBuilder::CoroutineStmtBuilder(), CreateBuiltinArraySubscriptExpr(), clang::CreateHLSLAttributedResourceType(), createImplicitModuleImportForErrorRecovery(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), clang::CStyleCastPtrExpr(), clang::Sema::CXXThisScopeRAII::CXXThisScopeRAII(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DeduceAutoType(), deduceClosureReturnType(), DeduceFromInitializerList(), deduceOpenCLPointeeAddrSpace(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecializationFromInitializer(), DetectPrecisionLossInComplexDivision(), clang::InitializationSequence::Diagnose(), clang::SemaHLSL::DiagnoseAvailabilityViolations(), DiagnoseBadConversion(), DiagnoseInvalidExplicitObjectParameterInLambda(), DiagnoseLocalRegisterBinding(), diagnoseMissingImport(), DiagnoseNarrowingInInitList(), clang::interp::diagnoseNonConstexprBuiltin(), diagnoseObjCLiteralComparison(), diagnoseRepeatedUseOfWeak(), diagnoseUnavailableAlignedAllocation(), clang::interp::DoBitCast(), clang::interp::DoBitCastPtr(), DoEmitAvailabilityWarning(), emitBadConversionNotes(), emitReadOnlyPlacementAttrWarning(), clang::PreferredTypeBuilder::enterCondition(), clang::PreferredTypeBuilder::enterSubscript(), EvaluateAndDiagnoseImmediateInvocation(), FinalizeVarWithDestructor(), FindCompositePointerType(), findOMPAllocatorHandleT(), FixDependencyOfIdExpressionsInLambdaWithDependentObjectParameter(), clang::interp::Free(), getAllocatorKind(), getDefaultCXXMethodAddrSpace(), getEmissionStatus(), GetExplicitObjectExpr(), clang::interp::getField(), getImplicitCodeSegAttrFromClass(), getImplicitCodeSegOrSectionAttrForFunction(), clang::SemaHLSL::getInoutParameterType(), clang::interp::getIntPrimType(), clang::interp::getLongPrimType(), getMoreSpecialized(), getOpenCLKernelParameterType(), getParallelRegionParams(), getPreferredTypeOfBinaryRHS(), getPreferredTypeOfUnaryArg(), clang::interp::GetPtrBase(), clang::interp::GetPtrBasePop(), getTargetRegionParams(), getTaskloopRegionParams(), getTaskRegionParams(), clang::interp::GetTypeidPtr(), clang::interp::handleFixedPointOverflow(), handleFloatVectorBinOpConversion(), handleIntegerVectorBinOpConversion(), handleLoopHintAttr(), handleMIGServerRoutineAttr(), handleNakedAttr(), HandleNeonVectorTypeAttr(), handlePackedAttr(), handlerCanCatch(), clang::handleSimpleAttribute(), handleVecTypeHint(), hasNewExtendedAlignment(), hasUserDefinedMapper(), clang::interp::InitGlobalTemp(), clang::interp::InitGlobalTempComp(), clang::InitializationSequence::InitializeFrom(), clang::HLSLExternalSemaSource::InitializeSema(), instantiateDependentAllocAlignAttr(), instantiateDependentDiagnoseIfAttr(), instantiateDependentEnableIfAttr(), instantiateDependentHLSLParamModifierAttr(), instantiateDependentSYCLKernelAttr(), instantiateOMPDeclareVariantAttr(), InstantiateVariableDefinition(), InstantiateVariableInitializer(), clang::interp::interp__builtin_assume_aligned(), clang::interp::interp__builtin_atomic_lock_free(), clang::interp::interp__builtin_eh_return_data_regno(), clang::interp::interp__builtin_inf(), clang::interp::interp__builtin_is_aligned_up_down(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_nan(), clang::interp::interp__builtin_operator_new(), clang::interp::interp__builtin_os_log_format_buffer_size(), clang::interp::interp__builtin_overflowop(), clang::interp::interp__builtin_strlen(), clang::interp::InterpretOffsetOf(), clang::FilenamePatternConstraint::isAutoGenerated(), clang::isBetterOverloadCandidate(), isConstNotMutableType(), IsLayoutCompatible(), isMacroDefined(), IsPointerInterconvertibleBaseOf(), IsRedefinitionInModule(), clang::SemaHLSL::IsScalarizedLayoutCompatible(), IsStandardConversion(), isTriviallyEqualityComparableType(), IsVectorConversion(), IsZeroInitializer(), isZeroSizedArray(), LookupBuiltin(), lookupBuiltinFunction(), mapCodeCompletionContext(), MarkFunctionReferenced(), markUsedForAliasOrIfunc(), MarkVarDeclODRUsed(), mergeEnforceTCBAttrImpl(), MergeFunctionDecl(), mergeParamDeclTypes(), clang::ParseAST(), clang::Parser::ParseFirstTopLevelDecl(), clang::Parser::parseMapperModifier(), parseOpenMPReductionId(), PerformImplicitConversion(), PerformPendingInstantiations(), ProcessAPINotes(), ProcessAPINotes(), processCapturedRegions(), propagateDLLAttrToBaseClassTemplate(), clang::interp::pushInteger(), clang::TreeTransform< Derived >::RebuildQualifiedType(), rejectConstNotMutableType(), clang::ExternalASTMerger::RemoveSources(), repeatForLambdaConversionFunctionCallingConvs(), reportOriginalDsa(), sameFunctionParameterTypeLists(), setPrototype(), ShouldDiagnoseAvailabilityInContext(), ShouldDiagnoseAvailabilityOfDecl(), clang::interp::SubPtr(), tryGCCVectorConvertAndSplat(), TryObjectArgumentInitialization(), TryOrBuildParenListInitialization(), TryReferenceInit(), TryReferenceInitializationCore(), TryReferenceListInitialization(), updateAttrsForLateParsedTemplate(), validatePackoffset(), and VerifyBitField().
|
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 101 of file SemaTemplate.cpp.
References D.
Referenced by ClassifyName(), diagnoseExprIntendedAsTemplateName(), FilterAcceptableTemplateNames(), hasAnyAcceptableTemplateNames(), isTemplateName(), LookupQualifiedName(), and LookupTemplateName().
ASTMutationListener * Sema::getASTMutationListener | ( | ) | const |
Definition at line 590 of file Sema.cpp.
References getASTConsumer(), and clang::ASTConsumer::GetASTMutationListener().
Referenced by ActOnModuleDecl(), DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), clang::SemaObjC::handleBoxable(), InstantiateDefaultArgument(), InstantiateFunctionDefinition(), InstantiateInClassInitializer(), InstantiateVariableInitializer(), and UpdateExceptionSpec().
|
inlinestatic |
A helper function to provide Attribute Location for the Attr types AND the ParsedAttr.
Definition at line 4412 of file Sema.h.
Referenced by checkFunctionOrMethodParameterIndex(), checkUInt32Argument(), handlePatchableFunctionEntryAttr(), and clang::ASTNodeImporter::VisitAttributedStmt().
SourceLocation Sema::getAttrLoc | ( | const ParsedAttr & | AL | ) |
Definition at line 88 of file SemaDeclAttr.cpp.
References clang::AttributeCommonInfo::getLoc().
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 3436 of file SemaDecl.cpp.
References clang::Type::getAs(), clang::AttributedType::getModifiedType(), clang::AttributedType::isCallingConv(), and clang::T.
Referenced by handleFunctionTypeAttr(), and MergeFunctionDecl().
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 19263 of file SemaExpr.cpp.
References Loc, TryCapture_Implicit, and tryCaptureVariable().
Referenced by BuildDeclarationNameExpr(), and 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 9094 of file SemaType.cpp.
References completeExprArrayBound(), E, clang::Expr::getType(), and clang::Type::isIncompleteArrayType().
Referenced by AdjustFunctionParmAndArgTypesForDeduction(), RequireCompleteExprType(), TryReferenceInitialization(), and TryReferenceListInitialization().
ParsedType Sema::getConstructorName | ( | const IdentifierInfo & | II, |
SourceLocation | NameLoc, | ||
Scope * | S, | ||
CXXScopeSpec & | SS, | ||
bool | EnteringContext | ||
) |
Definition at line 93 of file SemaExprCXX.cpp.
References Context, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), getCurrentClass(), clang::ASTContext::getDependentNameType(), clang::NamedDecl::getIdentifier(), clang::CXXScopeSpec::getLastQualifierNameLoc(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::ASTContext::getTypeDeclType(), clang::DeclContext::isDependentContext(), clang::Decl::isInvalidDecl(), clang::CXXScopeSpec::isNotEmpty(), clang::DeclContext::lookup(), clang::OpaquePtr< QualType >::make(), MarkAnyDeclReferenced(), clang::None, RequireCompleteDeclContext(), and clang::T.
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 3407 of file SemaStmt.cpp.
References clang::Sema::NamedReturnInfo::Candidate, Context, clang::ValueDecl::getType(), clang::Type::getTypeClass(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isCanonicalUnqualified(), clang::Sema::NamedReturnInfo::isCopyElidable(), clang::Type::isDependentType(), clang::Type::isRecordType(), clang::Type::isSpecificBuiltinType(), clang::Sema::NamedReturnInfo::MoveEligible, and clang::Sema::NamedReturnInfo::S.
Referenced by ActOnCapScopeReturnStmt(), and BuildReturnStmt().
BlockScopeInfo * Sema::getCurBlock | ( | ) |
Retrieve the current block, if any.
Definition at line 2361 of file Sema.cpp.
Referenced by ActOnBlockArguments(), ActOnBlockStart(), AddKeywordsToConsumer(), AddOrdinaryNameResults(), checkDeclInTargetContext(), clang::PreferredTypeBuilder::enterReturn(), and clang::SemaOpenMP::isOpenMPCapturedDecl().
CapturedRegionScopeInfo * Sema::getCurCapturedRegion | ( | ) |
Retrieve the current captured region, if any.
Definition at line 2735 of file Sema.cpp.
Referenced by checkDeclInTargetContext(), clang::SemaOpenMP::isOpenMPCapturedDecl(), and processCapturedRegions().
sema::CompoundScopeInfo & Sema::getCurCompoundScope | ( | ) | const |
Definition at line 447 of file SemaStmt.cpp.
References clang::sema::FunctionScopeInfo::CompoundScopes, and getCurFunction().
Referenced by ActOnCompoundStmt(), ActOnForStmt(), and ActOnWhileStmt().
|
inline |
Definition at line 527 of file Sema.h.
References CurFPFeatures.
Referenced by ActOnAfterCompoundStatementLeadingPragmas(), ActOnCompoundStmt(), addBlockPointerConversion(), addFunctionPointerConversion(), CreateBuiltin(), CreateLambdaCallOperator(), CreateNewFunctionDecl(), DeclareGlobalAllocationFunction(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DeclClonePragmaWeak(), findInheritingConstructor(), InsertOCLBuiltinDeclarationsFromTable(), MarkAsLateParsedTemplate(), and rewriteBuiltinFunctionDecl().
|
inline |
Definition at line 940 of file Sema.h.
References FunctionScopes.
Referenced by ActOnAddrLabel(), ActOnAfterCompoundStatementLeadingPragmas(), ActOnBlockStmtExpr(), ActOnCapScopeReturnStmt(), ActOnCaseExpr(), ActOnCaseStmt(), ActOnCompoundStmt(), ActOnCoroutineBodyStart(), ActOnCoyieldExpr(), ActOnCXXTryBlock(), ActOnDefaultStmt(), ActOnFinishFunctionBody(), ActOnFinishSwitchStmt(), clang::SemaObjC::ActOnObjCAtTryStmt(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(), ActOnReturnStmt(), ActOnSEHTryBlock(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), ActOnStartOfSwitchStmt(), clang::SemaObjC::ActOnSuperMessage(), AddInitializerToDecl(), AddKeywordsToConsumer(), AddOrdinaryNameResults(), BuildArrayType(), BuildCompoundLiteralExpr(), buildCoroutineParameterMoves(), buildCoroutinePromise(), BuildDeclRefExpr(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildIvarRefExpr(), BuildReturnStmt(), CheckAssignmentOperands(), CheckCompletedCoroutineBody(), CheckCompleteVariableDeclaration(), CheckConstraintExpression(), checkCoroutineContext(), CheckShadow(), checkUnsafeExprAssigns(), clang::SemaCodeCompletion::CodeCompleteCase(), DiagnoseAlwaysNonNullPointer(), DiagnoseUseOfDecl(), getCurCompoundScope(), handleFallThroughAttr(), LookupMemberExpr(), MarkExpressionAsImmediateEscalating(), and RecordModifiableNonNullParam().
FunctionScopeInfo * Sema::getCurFunctionAvailabilityContext | ( | ) |
Retrieve the current function, if any, that should be analyzed for potential availability violations.
Definition at line 1085 of file SemaAvailability.cpp.
References FunctionScopes.
Referenced by clang::SemaObjC::ActOnObjCAvailabilityCheckExpr(), and DiagnoseAvailabilityOfDecl().
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 1570 of file Sema.cpp.
References getFunctionLevelDeclContext().
Referenced by ActOnFinishFunctionBody(), clang::SemaOpenMP::ActOnOpenMPCall(), ActOnStartOfFunctionDef(), ActOnVariableDeclarator(), clang::OverloadCandidateSet::BestViableFunction(), BuildMemberReferenceExpr(), BuildResolvedCallExpr(), BuildReturnStmt(), BuildUnresolvedCoawaitExpr(), clang::SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(), clang::SemaRISCV::CheckBuiltinFunctionCall(), clang::SemaCUDA::CheckCall(), clang::SemaCUDA::CheckLambdaCapture(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), clang::SemaARM::CheckSMEBuiltinFunctionCall(), clang::SemaARM::CheckSVEBuiltinFunctionCall(), CheckVariableDeclarationType(), checkVAStartABI(), clang::SemaBase::Diag(), clang::SemaCUDA::DiagIfDeviceCode(), clang::SemaCUDA::DiagIfHostCode(), DiagnoseBadTarget(), diagnoseUseOfInternalDeclInInlineFunction(), diagnoseZeroToNullptrConversion(), FindAllocationFunctions(), getSelfAssignmentClassMemberCandidate(), clang::isBetterOverloadCandidate(), IsSimplyAccessible(), isUsualDeallocationFunction(), LookupMemberExpr(), and clang::SemaCUDA::RecordImplicitHostDeviceFuncUsedByDevice().
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 1582 of file Sema.cpp.
References getFunctionLevelDeclContext().
Referenced by AddKeywordsToConsumer(), BuildReturnStmt(), CheckTCBEnforcement(), DiagIfReachable(), and handleInitPriorityAttr().
LambdaScopeInfo * Sema::getCurGenericLambda | ( | ) |
Retrieve the current generic lambda info, if any.
Definition at line 2431 of file Sema.cpp.
Referenced by clang::getStackIndexOfNearestEnclosingCaptureCapableLambda().
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 2406 of file Sema.cpp.
References E.
Referenced by ActOnFinishFullExpr(), ActOnFinishFunctionBody(), ActOnLambdaExplicitTemplateParameterList(), ActOnLambdaExpressionAfterIntroducer(), ActOnSuperScopeSpecifier(), checkDeclInTargetContext(), CheckExplicitObjectParameter(), createLambdaClosureType(), createLambdaInitCaptureVarDecl(), DeduceFunctionTypeFromReturnExpr(), DoMarkPotentialCapture(), GetDeclSpecTypeForDeclarator(), getDecltypeForExpr(), GetFullTypeForDeclarator(), clang::SemaOpenMP::isOpenMPCapturedDecl(), rebuildPotentialResultsAsNonOdrUsed(), and tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs().
|
inline |
Definition at line 736 of file Sema.h.
References CurContext, and OriginalLexicalContext.
Referenced by ActOnGCCAsmStmt(), clang::SemaOpenMP::ActOnOpenMPAllocateDirective(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::SemaHLSL::ActOnStartBuffer(), ActOnStartOfFunctionDef(), clang::SemaOpenMP::ActOnStartOpenMPDeclareTargetContext(), ActOnTagFinishDefinition(), clang::SemaObjC::CheckObjCDeclScope(), clang::SemaOpenMP::CheckOMPRequiresDecl(), clang::SemaOpenMP::CheckOMPThreadPrivateDecl(), clang::SemaSYCL::DiagIfDeviceCode(), EmitAvailabilityWarning(), 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 1575 of file Sema.cpp.
References getFunctionLevelDeclContext(), and clang::DeclContext::getParent().
Referenced by ActOnFinishFunctionBody(), ActOnIdExpression(), ActOnNameClassifiedAsNonType(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), AddClassMessageCompletions(), AddOrdinaryNameResults(), AddSuperSendCompletion(), clang::SemaObjC::BuildClassMessage(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildIvarRefExpr(), BuildReturnStmt(), CheckForModifiableLvalue(), clang::SemaObjC::checkRetainCycles(), ClassifyName(), clang::SemaCodeCompletion::CodeCompleteObjCInstanceMessage(), clang::SemaCodeCompletion::CodeCompleteObjCMessageReceiver(), clang::SemaCodeCompletion::CodeCompleteObjCSuperMessage(), findMethodInCurrentClass(), clang::findRetainCycleOwner(), getBaseMessageSendResultType(), clang::SemaObjC::getObjCMessageKind(), IsSimplyAccessible(), clang::SemaObjC::LookupIvarInObjCMethod(), LookupMemberExpr(), and LookupPotentialTypoResult().
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 2583 of file SemaDeclCXX.cpp.
References computeDeclContext(), clang::CPlusPlus, CurContext, getLangOpts(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isNotEmpty().
Referenced by getConstructorName(), and isCurrentClassName().
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 172 of file SemaCXXScopeSpec.cpp.
References clang::CPlusPlus, CurContext, clang::NestedNameSpecifier::getAsType(), 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 284 of file SemaLambda.cpp.
References Concept, Context, CurContext, DefaultArgument, ExprEvalContexts, clang::DeclContext::getLexicalParent(), clang::ASTContext::getManglingNumberContext(), clang::DeclContext::getParent(), inTemplateInstantiation(), clang::DeclContext::isDependentContext(), isInInlineFunction(), clang::ASTContext::NeedExtraManglingDecl, and Normal.
Referenced by ActOnBlockStart(), ActOnVariableDeclarator(), BuildAnonymousStructOrUnion(), handleLambdaNumbering(), and handleTagNumbering().
|
inline |
Get the module unit whose scope we are currently within.
Definition at line 9588 of file Sema.h.
References clang::Module::Module().
Referenced by ActOnAnnotModuleEnd(), ActOnEndOfTranslationUnit(), ActOnFinishLinkageSpecification(), ActOnModuleImport(), ActOnTag(), ActOnTagFinishDefinition(), AddOrdinaryNameResults(), DeclareGlobalNewDelete(), diagnoseMissingImport(), makeMergedDefinitionVisible(), and notePreviousDefinition().
QualType Sema::getCurrentThisType | ( | ) |
Try to retrieve the type of the 'this' pointer.
Definition at line 1230 of file SemaExprCXX.cpp.
References adjustCVQualifiersForCXXThisWithinLambda(), Context, CurContext, CXXThisTypeOverride, FunctionScopes, getFunctionLevelDeclContext(), clang::ASTContext::getPointerType(), clang::ASTContext::getTypeDeclType(), inTemplateInstantiation(), clang::isLambdaCallOperator(), clang::isLambdaCallWithImplicitObjectParameter(), and clang::QualType::isNull().
Referenced by ActOnCXXThis(), ActOnDependentIdExpression(), ActOnLambdaClosureQualifiers(), ActOnLambdaExpressionAfterIntroducer(), addThisCompletion(), BuildCaptureInit(), BuildImplicitMemberExpr(), CaptureHasSideEffects(), CheckCXXThisCapture(), clang::SemaCodeCompletion::CodeCompleteOrdinaryName(), DefineImplicitCopyAssignment(), DefineImplicitMoveAssignment(), GetExplicitObjectType(), getPrivateItem(), clang::SemaOpenMP::isOpenMPCapturedDecl(), LookupInlineAsmField(), recoverFromMSUnqualifiedLookup(), 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 732 of file Sema.h.
Referenced by ActOnCaseStmt(), ActOnCXXTryBlock(), ActOnDefaultStmt(), ActOnGotoStmt(), ActOnIndirectGotoStmt(), ActOnLabelStmt(), ActOnMSVCUnknownTypeName(), clang::SemaObjC::ActOnObjCBoolLiteral(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::SemaHLSL::ActOnOutParamExpr(), ActOnReturnStmt(), ActOnStartOfLambdaDefinition(), ActOnSuperScopeSpecifier(), BuildCXXForRangeStmt(), BuildCXXThrow(), buildDistanceFunc(), buildLoopVarFunc(), BuildMemberReferenceExpr(), BuildNonArrayForRange(), BuiltinSEHScopeCheck(), CheckAccess(), CheckFieldDecl(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), checkSuspensionContext(), CheckVariableDeclarationType(), CreateBuiltinBinOp(), DiagnoseCommaOperator(), emitReplacement(), findOMPAllocatorHandleT(), findOMPAlloctraitT(), findOMPDependT(), findOMPEventHandleT(), finishLinearClauses(), clang::Parser::getCurScope(), GetDeclSpecTypeForDeclarator(), isValidInteropVariable(), lookupBuiltinFunction(), LookupInlineAsmField(), LookupInlineAsmIdentifier(), clang::Parser::ReenterTemplateScopes(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
DarwinSDKInfo * Sema::getDarwinSDKInfoForAvailabilityChecking | ( | ) |
Definition at line 100 of file Sema.cpp.
References clang::Preprocessor::getFileManager(), clang::Preprocessor::getHeaderSearchInfo(), clang::HeaderSearch::getHeaderSearchOpts(), clang::FileManager::getVirtualFileSystem(), clang::parseDarwinSDKInfo(), PP, and clang::HeaderSearchOptions::Sysroot.
Referenced by getDarwinSDKInfoForAvailabilityChecking().
DarwinSDKInfo * Sema::getDarwinSDKInfoForAvailabilityChecking | ( | SourceLocation | Loc, |
StringRef | Platform | ||
) |
Definition at line 89 of file Sema.cpp.
References clang::SemaBase::Diag(), getDarwinSDKInfoForAvailabilityChecking(), and Loc.
Referenced by handleAvailabilityAttr().
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 9631 of file SemaType.cpp.
References Context, clang::ASTContext::DependentTy, E, 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 1589 of file Sema.cpp.
References clang::Default, getASTContext(), clang::ASTContext::getDefaultOpenCLPointeeAddrSpace(), getLangOpts(), and OpenCL().
Referenced by DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), getDummyLambdaType(), and GetFullTypeForDeclarator().
|
inline |
Definition at line 7832 of file Sema.h.
References clang::Sema::DefaultedFunctionKind::asComparison(), and getDefaultedFunctionKind().
Referenced by MarkFunctionReferenced().
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 6609 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 BuildFieldReferenceExpr(), CheckCompletedCXXClass(), CheckExplicitlyDefaultedFunction(), computeImplicitExceptionSpec(), DefineDefaultedFunction(), DiagnoseDeletedDefaultedFunction(), getDefaultedComparisonKind(), getSpecialMember(), InstantiateFunctionDefinition(), PrintInstantiationStack(), and SetDeclDefaulted().
ParsedType Sema::getDestructorName | ( | const IdentifierInfo & | II, |
SourceLocation | NameLoc, | ||
Scope * | S, | ||
CXXScopeSpec & | SS, | ||
ParsedType | ObjectType, | ||
bool | EnteringContext | ||
) |
Definition at line 143 of file SemaExprCXX.cpp.
References clang::CXXScopeSpec::Adopt(), CheckTypenameType(), computeDeclContext(), Context, clang::FixItHint::CreateInsertion(), CreateParsedType(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), D, clang::SemaBase::Diag(), clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::Found, clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getElaboratedType(), clang::CXXScopeSpec::getEndLoc(), clang::Decl::getLocation(), clang::IdentifierInfo::getName(), clang::NamedDecl::getNameAsString(), clang::NestedNameSpecifier::getPrefix(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ASTContext::getTypeDeclType(), GetTypeFromParser(), clang::CXXScopeSpec::getWithLocInContext(), clang::LookupResult::Filter::hasNext(), clang::ASTContext::hasSameUnqualifiedType(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::CXXScopeSpec::isInvalid(), clang::QualType::isNull(), clang::CXXScopeSpec::isSet(), clang::CXXScopeSpec::isValid(), clang::CXXScopeSpec::location_data(), LookupDestructorName, LookupName(), LookupQualifiedName(), clang::OpaquePtr< QualType >::make(), MarkAnyDeclReferenced(), clang::LookupResult::Filter::next(), clang::None, RequireCompleteDeclContext(), and clang::T.
Referenced by clang::Parser::ParseUnqualifiedId().
ParsedType Sema::getDestructorTypeForDecltype | ( | const DeclSpec & | DS, |
ParsedType | ObjectType | ||
) |
Definition at line 468 of file SemaExprCXX.cpp.
References BuildDecltypeType(), Context, clang::SemaBase::Diag(), clang::DeclSpec::getRepAsExpr(), GetTypeFromParser(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isDependentType(), clang::QualType::isNull(), clang::OpaquePtr< QualType >::make(), 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 529 of file Sema.h.
References Diags.
Referenced by ActOnCXXTypeid(), ActOnFinishFunctionBody(), clang::sema::AnalysisBasedWarnings::AnalysisBasedWarnings(), calculateConstraintSatisfaction(), clang::sema::checkAssignmentLifetime(), clang::sema::checkCaptureByLifetime(), CheckCastAlign(), CheckCommaOperands(), CheckCompleteVariableDeclaration(), CheckConstexprFunctionBody(), CheckFallThroughForBody(), checkMoreSpecializedThanPrimary(), createSubstDiag(), DiagnoseBadDeduction(), diagnoseTautologicalComparison(), DoEmitAvailabilityWarning(), hasUncompilableErrorOccurred(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), isAcceptableTagRedeclaration(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), MergeTypedefNameDecl(), clang::sema::shouldRunGSLAssignmentAnalysis(), 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 9582 of file SemaType.cpp.
References Context, clang::ASTContext::getElaboratedType(), clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::isValid(), and clang::T.
Referenced by ActOnTemplateIdType(), BuildMemInitializer(), buildNamedType(), BuildQualifiedDeclarationNameExpr(), and ConvertDeclSpecToType().
Sema::FunctionEmissionStatus Sema::getEmissionStatus | ( | const FunctionDecl * | Decl, |
bool | Final = false |
||
) |
Definition at line 20357 of file SemaDecl.cpp.
References CUDA(), CUDADiscarded, clang::Device, Emitted, getASTContext(), clang::FunctionDecl::getCanonicalDecl(), clang::FunctionDecl::getDefinition(), clang::Global, clang::Decl::hasAttr(), clang::FunctionDecl::hasSkippedBody(), clang::Host, clang::SemaCUDA::IdentifyTarget(), clang::DeclContext::isDependentContext(), clang::isDiscardableGVALinkage(), LangOpts, OMPDiscarded, OpenMP(), clang::T, TemplateDiscarded, and Unknown.
Referenced by ActOnFinishFunctionBody(), clang::SemaCUDA::CheckCall(), clang::SemaCUDA::DiagIfDeviceCode(), clang::SemaSYCL::DiagIfDeviceCode(), clang::SemaCUDA::DiagIfHostCode(), clang::SemaOpenMP::diagIfOpenMPDeviceCode(), and clang::SemaOpenMP::diagIfOpenMPHostCode().
FunctionScopeInfo * Sema::getEnclosingFunction | ( | ) | const |
Definition at line 2376 of file Sema.cpp.
Referenced by clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveStart(), and clang::SemaObjC::BuildInstanceMessage().
CapturingScopeInfo * Sema::getEnclosingLambdaOrBlock | ( | ) | const |
Get the innermost lambda or block enclosing the current location, if any.
This looks through intervening non-lambda, non-block scopes such as local functions.
Definition at line 2388 of file Sema.cpp.
Referenced by ActOnNonTypeTemplateParameter(), ActOnTemplateTemplateParameter(), ActOnTypeParameter(), CheckParameter(), DiagnoseUnexpandedParameterPack(), and DiagnoseUnexpandedParameterPacks().
SourceRange Sema::getExprRange | ( | Expr * | E | ) | const |
Definition at line 507 of file SemaExpr.cpp.
References E, and clang::Stmt::getSourceRange().
|
inline |
Definition at line 535 of file Sema.h.
Referenced by AddClassMessageCompletions(), and CheckExtVectorComponent().
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.
Referenced by maybeRecoverWithZeroInitialization(), SuggestInitializationFixit(), and warnAboutAmbiguousFunction().
std::string Sema::getFixItZeroLiteralForType | ( | QualType | T, |
SourceLocation | Loc | ||
) | const |
Definition at line 223 of file SemaFixItUtils.cpp.
References getScalarZeroExpressionForType(), Loc, and clang::T.
Referenced by DiagnoseNullConversion().
|
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 3023 of file SemaChecking.cpp.
References clang::Sema::FormatStringInfo::ArgPassingKind, FAPK_Fixed, FAPK_VAList, FAPK_Variadic, clang::Sema::FormatStringInfo::FirstDataArg, and clang::Sema::FormatStringInfo::FormatIdx.
Referenced by checkFormatStringExpr(), and clang::SemaObjC::GetFormatNSStringIdx().
|
static |
Definition at line 6256 of file SemaChecking.cpp.
References FST_FreeBSDKPrintf, FST_Kprintf, FST_NSString, FST_OSLog, FST_Printf, FST_Scanf, FST_Strfmon, FST_Strftime, and FST_Unknown.
Referenced by checkFormatStringExpr(), and clang::SemaObjC::GetFormatNSStringIdx().
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 1297 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 1550 of file Sema.cpp.
References CurContext, and clang::DeclContext::getParent().
Referenced by CheckCXXThisType(), ClassifyImplicitMemberAccess(), DiagnoseConstAssignment(), diagnoseInstanceReference(), enclosingClassIsRelatedToClassInWhichMembersWereFound(), getCurFunctionDecl(), getCurFunctionOrMethodDecl(), getCurMethodDecl(), getCurrentThisType(), and clang::SemaObjC::tryCaptureObjCSelf().
|
inline |
Definition at line 11053 of file Sema.h.
References FunctionScopes, and FunctionScopesStart.
Referenced by getTemplateDepth().
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 2891 of file SemaTemplateDeduction.cpp.
References Context, clang::ASTContext::getInjectedTemplateArg(), and getTrivialTemplateArgumentLoc().
Referenced by substituteParameterMappings().
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 11046 of file SemaDecl.cpp.
References CodeSegStack, getASTContext(), getImplicitCodeSegAttrFromClass(), and clang::Decl::hasAttr().
Referenced by ActOnFunctionDeclarator(), ActOnStartOfLambdaDefinition(), and 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 59 of file SemaExprCXX.cpp.
References Context, CreateParsedType(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsType(), clang::ASTContext::getDependentNameType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), clang::CXXScopeSpec::getScopeRep(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::None, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
|
inline |
Definition at line 11044 of file Sema.h.
References InventedParameterInfos, and InventedParameterInfosStart.
Referenced by getTemplateDepth().
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 1651 of file SemaLambda.cpp.
References Context, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::getReturnType(), clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::RQ_None, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, and clang::FunctionType::ExtInfo::withCallingConv().
Referenced by addBlockPointerConversion(), addFunctionPointerConversions(), and DeduceReturnType().
|
inline |
Definition at line 525 of file Sema.h.
References LangOpts.
Referenced by ActOnAnnotModuleBegin(), ActOnAnnotModuleEnd(), ActOnArraySubscriptExpr(), ActOnBlockArguments(), ActOnBlockStmtExpr(), ActOnCallExpr(), ActOnCapScopeReturnStmt(), ActOnCaseExpr(), ActOnCastExpr(), ActOnCharacterConstant(), ActOnCompoundStmt(), ActOnConditionalOp(), ActOnCXXAssumeAttr(), ActOnCXXDelete(), ActOnCXXExitDeclInitializer(), ActOnCXXMemberDeclarator(), ActOnCXXNamedCast(), ActOnCXXNestedNameSpecifierDecltype(), ActOnCXXNew(), ActOnCXXTryBlock(), ActOnCXXTypeid(), ActOnDecltypeExpression(), ActOnDecompositionDeclarator(), ActOnDependentMemberExpr(), ActOnDoStmt(), ActOnEndOfTranslationUnit(), ActOnEnumBody(), ActOnEnumConstant(), ActOnExplicitInstantiation(), ActOnFields(), ActOnFinishFullExpr(), ActOnFinishFunctionBody(), ActOnFinishKNRParamDeclarations(), ActOnFinishLinkageSpecification(), ActOnForEachDeclStmt(), ActOnForStmt(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnIdExpression(), ActOnIfStmt(), ActOnInitList(), ActOnLabelStmt(), ActOnLambdaExpressionAfterIntroducer(), ActOnMemberAccessExpr(), ActOnModuleDecl(), ActOnModuleImport(), ActOnMSVCUnknownTypeName(), ActOnNameClassifiedAsUndeclaredNonType(), ActOnNumericConstant(), actOnOMPReductionKindClause(), ActOnPackIndexingExpr(), ActOnPackIndexingType(), ActOnParamDeclarator(), ActOnParamDefaultArgument(), ActOnParenExpr(), ActOnPopScope(), ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), ActOnPragmaMSAllocText(), ActOnPragmaOptionsAlign(), ActOnPragmaPack(), ActOnSEHTryBlock(), ActOnStartCXXMemberReference(), ActOnStartExportDecl(), ActOnStartLinkageSpecification(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), ActOnStartOfTranslationUnit(), ActOnStringLiteral(), ActOnTag(), ActOnTemplateIdType(), ActOnTemplateName(), ActOnTemplateTypeArgument(), ActOnTypedefDeclarator(), ActOnTypeName(), ActOnTypenameType(), ActOnUnevaluatedStringLiteral(), ActOnUninitializedDecl(), ActOnUsingDeclaration(), ActOnVariableDeclarator(), AddAlignmentAttributesForRecord(), clang::TypoCorrectionConsumer::addCorrection(), addFixitForObjCARCConversion(), addFunctionPointerConversion(), AddImplicitlyDeclaredMembersToClass(), AddInitializerToDecl(), AddKeywordsToConsumer(), AddKnownFunctionAttributes(), AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), AddModeAttr(), AddMsStructLayoutForRecord(), AddOrdinaryNameResults(), AddRecordMembersCompletionResults(), AdjustDestructorExceptionSpec(), AdjustFunctionParmAndArgTypesForDeduction(), AnalyzeBitFieldAssignment(), AnalyzeComparison(), AnalyzeImplicitConversions(), ArgumentDependentLookup(), clang::OverloadCandidateSet::BestViableFunction(), BuildAnonymousStructOrUnion(), BuildArrayType(), BuildAtomicType(), BuildBinOp(), BuildBlockPointerType(), BuildCallExpr(), buildCapture(), buildCaptureDecl(), buildCapturedStmtCaptureList(), BuildCompoundLiteralExpr(), BuildConvertedConstantExpression(), BuildCStyleCastExpr(), BuildCXXConstructExpr(), BuildCXXForRangeStmt(), BuildCXXNamedCast(), BuildCXXNestedNameSpecifier(), BuildCXXNew(), BuildCXXThrow(), BuildCXXTypeConstructExpr(), BuildDeclarationNameExpr(), buildDeclareReductionRef(), BuildDeclRefExpr(), BuildExceptionDeclaration(), BuildExpressionFromIntegralTemplateArgumentValue(), BuildExtVectorType(), BuildFieldReferenceExpr(), BuildFunctionType(), BuildImplicitMemberExpr(), buildLambdaCaptureFixit(), BuildLambdaExpr(), buildLambdaInitCaptureInitialization(), buildLambdaThisCaptureFixit(), BuildMemberPointerType(), BuildMemberReferenceExpr(), BuildMemInitializer(), BuildModuleInclude(), BuildPointerType(), BuildPredefinedExpr(), BuildPseudoDestructorExpr(), BuildQualifiedDeclarationNameExpr(), BuildRecoveryCallExpr(), BuildReferenceType(), BuildResolvedCallExpr(), BuildReturnStmt(), buildSingleCopyAssignRecursively(), BuildStaticAssertDeclaration(), BuildTypeofExprType(), BuildUnaryOp(), buildUserDefinedMapperRef(), BuildUsingDeclaration(), BuildVAArgExpr(), BuildVectorLiteral(), BuiltinDumpStruct(), BuiltinOverflow(), calculateConstraintSatisfaction(), clang::interp::CallVirt(), canPassInRegisters(), CanUseDecl(), captureInBlock(), captureInCapturedRegion(), CheckAdditionOperands(), CheckAddressOfMemberAccess(), CheckAddressOfOperand(), checkAllocateClauses(), CheckAllocatedType(), CheckAllocationAccess(), CheckAltivecInitFromScalar(), CheckAnonMemberRedeclaration(), checkARCPropertyImpl(), checkArithmeticBinOpPointerOperands(), checkArithmeticOpPointerOperand(), checkArraySize(), CheckAssignmentConstraints(), CheckAssignmentOperands(), CheckBaseClassAccess(), CheckBaseSpecifier(), clang::interp::CheckBitCast(), CheckBitwiseOperands(), checkBlockPointerTypesForAssignment(), CheckBooleanCondition(), CheckBoolLikeConversion(), CheckC23ConstexprInitConversion(), CheckC23ConstexprInitStringLiteral(), clang::interp::CheckCallable(), clang::interp::CheckCallDepth(), checkCaseValue(), checkClassLevelDLLAttribute(), CheckCommaOperands(), CheckCompareOperands(), CheckComparisonCategoryType(), CheckCompletedCXXClass(), CheckCompleteVariableDeclaration(), checkCondition(), CheckConditionalOperand(), CheckConditionalOperands(), checkConditionalPointerCompatibility(), clang::interp::CheckConstant(), CheckConstexprCtorInitializer(), CheckConstexprDeclStmt(), CheckConstexprDestructorSubobjects(), CheckConstexprFunctionBody(), CheckConstexprFunctionDefinition(), CheckConstexprFunctionStmt(), CheckConstexprMissingReturn(), CheckConstexprParameterTypes(), CheckConstexprReturnType(), CheckConstraintExpression(), CheckConstructorAccess(), CheckConversionDeclarator(), CheckCountedByAttrOnField(), CheckCXX98CompatAccessibleCopy(), CheckCXXThrowOperand(), CheckDerivedToBaseConversion(), CheckDestructorAccess(), CheckDistantExceptionSpec(), clang::interp::CheckDummy(), clang::interp::CheckDynamicMemoryAllocation(), CheckEffectiveAccess(), checkEnumArithmeticConversions(), CheckEnumConstant(), CheckEquivalentExceptionSpec(), clang::CheckEquivalentExceptionSpecImpl(), checkEscapingByref(), CheckExceptionSpecCompatibility(), CheckExceptionSpecSubset(), CheckExplicitInstantiationScope(), CheckExplicitlyDefaultedComparison(), CheckExplicitlyDefaultedSpecialMember(), CheckExplicitObjectParameter(), checkExportedDecl(), clang::sema::checkExprLifetimeImpl(), clang::interp::CheckExtern(), CheckExtVectorCast(), CheckExtVectorComponent(), CheckFieldDecl(), checkForConflictWithNonVisibleExternC(), CheckForFunctionRedefinition(), CheckFormatString(), CheckForModifiableLvalue(), CheckFriendAccess(), CheckFunctionCall(), CheckFunctionDeclaration(), CheckFunctionOrTemplateParamDeclarator(), CheckFunctionReturnType(), CheckFunctionTemplateSpecialization(), clang::interp::CheckGlobalInitialized(), checkGlobalOrExternCConflict(), CheckImmediateEscalatingFunctionDefinition(), CheckImplicitConversion(), CheckIncrementDecrementOperand(), checkIndirectCopyRestoreSource(), CheckIndirectionOperand(), CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), clang::interp::CheckLiteralType(), CheckLogicalOperands(), CheckLookupAccess(), CheckMain(), checkMapClauseExpressionBase(), CheckMemaccessSize(), CheckMemberAccess(), CheckMemberOperatorAccess(), CheckMultiplyDivideOperands(), clang::interp::CheckMutable(), checkNestingOfRegions(), checkNewAttributesAfterDef(), CheckNontrivialField(), CheckNonTypeTemplateParameterType(), CheckObjCCollectionLiteralElement(), checkObjCPointerIntrospection(), checkOpenMPIterationSpace(), checkOpenMPLoop(), CheckOperatorNewDeleteTypes(), CheckOriginalCallArgDeduction(), CheckOverridingFunctionExceptionSpec(), CheckParameter(), CheckParmsForFunctionDef(), CheckPlaceholderExpr(), checkPointerAuthEnabled(), clang::interp::CheckPointerToIntegralCast(), CheckPointerToMemberOperands(), checkPointerTypesForAssignment(), CheckProtocolMethodDefs(), CheckRemainderOperands(), CheckShadow(), CheckShadowingDeclModification(), clang::interp::CheckShift(), CheckSimplerImplicitMovesMSVCWorkaround(), CheckSingleAssignmentConstraints(), CheckSpecializationInstantiationRedecl(), checkSpecializationReachability(), checkSpecializationVisibility(), CheckSpecifiedExceptionType(), CheckStaticArrayArgument(), CheckStringInit(), CheckStructuredBindingMemberAccess(), CheckSubtractionOperands(), checkTargetClonesAttrString(), CheckTautologicalComparison(), CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), CheckTemplateIdType(), CheckTemplateSpecializationScope(), CheckTemplateTemplateArgument(), CheckTemplateTypeArgument(), clang::interp::CheckThis(), CheckTypenameType(), CheckUnaryExprOrTypeTraitOperand(), checkUndefinedButUsed(), CheckUnresolvedLookupAccess(), CheckUnresolvedMemberAccess(), CheckUnusedVolatileAssignment(), CheckUsingDeclQualifier(), CheckUsingShadowDecl(), CheckVariableDeclarationType(), checkVariadicArgument(), CheckVectorCompareOperands(), CheckVectorLogicalOperands(), CheckVectorOperands(), clang::interp::CheckVolatile(), ClassifyImplicitMemberAccess(), ClassifyName(), compareConversionFunctions(), CompareImplicitConversionSequences(), CompareStandardConversionSequences(), completeFunctionType(), CompleteNonViableCandidate(), CompleteVarTemplateSpecializationDecl(), ConvertDeclSpecToType(), ConvertDeducedTemplateArguments(), CreateBuiltin(), CreateBuiltinArraySubscriptExpr(), CreateBuiltinBinOp(), CreateBuiltinUnaryOp(), CreateCapturedStmtRecordDecl(), createImplicitModuleImportForErrorRecovery(), CreateNewFunctionDecl(), DeclareGlobalAllocationFunction(), DeclareGlobalNewDelete(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMemberFunctionsWithName(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DeduceAutoType(), deduceClosureReturnType(), DeduceFunctionTypeFromReturnExpr(), DeduceNonTypeTemplateArgument(), deduceOpenCLAddressSpace(), deducePropertyOwnershipFromType(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecializationFromInitializer(), DeduceVariableDeclarationType(), deduceVarTypeFromInitializer(), DefaultArgumentPromotion(), defaultedSpecialMemberIsConstexpr(), DefaultFunctionArrayConversion(), DefaultLvalueConversion(), DefaultVariadicArgumentPromotion(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitMoveAssignment(), DetectPrecisionLossInComplexDivision(), clang::InitializationSequence::Diagnose(), diagnoseArithmeticOnFunctionPointer(), diagnoseArithmeticOnNullPointer(), diagnoseArithmeticOnTwoFunctionPointers(), diagnoseArithmeticOnTwoVoidPointers(), diagnoseArithmeticOnVoidPointer(), DiagnoseAssignmentResult(), clang::SemaHLSL::DiagnoseAvailabilityViolations(), DiagnoseBadShiftValues(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseCommaOperator(), DiagnoseDefaultTemplateArgument(), DiagnoseDependentMemberLookup(), DiagnoseEmptyLookup(), diagnoseExprIntendedAsTemplateName(), clang::ParsedAttr::diagnoseLangOpts(), diagnoseListInit(), DiagnoseMismatchedNewDelete(), diagnoseMissingConstinit(), DiagnoseNarrowingInInitList(), clang::interp::diagnoseNonConstexprBuiltin(), diagnoseNonConstVariable(), DiagnoseNullConversion(), diagnoseOpenCLTypes(), DiagnoseRetainableFlexibleArrayMember(), DiagnoseSentinelCalls(), diagnoseSubtractionOnNullPointer(), diagnoseTautologicalComparison(), DiagnoseTemplateParameterShadow(), diagnoseTypo(), diagnoseUncapturableValueReferenceOrBinding(), diagnoseUnknownDecl(), DiagnoseUnknownTypeName(), DiagnoseUnusedButSetDecl(), DiagnoseUnusedDecl(), DiagnoseUnusedLambdaCapture(), DiagnoseUseOfDecl(), diagnoseUseOfInternalDeclInInlineFunction(), DiagnoseWeakIvars(), diagnoseXorMisusedAsPow(), diagnoseZeroToNullptrConversion(), DiagPlaceholderFieldDeclDefinitions(), DiagPlaceholderVariableDefinition(), DiagRedefinedPlaceholderFieldDecl(), DiagReservedModuleName(), DiagUninitUse(), DoEmitAvailabilityWarning(), clang::interp::DoShift(), EmitDiagForCXXThrowInNonThrowingFunc(), EmitDiagnostic(), emitEmptyLookupTypoDiagnostic(), clang::SemaHLSL::emitLogicalOperatorFixIt(), emitReplacement(), clang::EnterExpressionEvaluationContext::EnterExpressionEvaluationContext(), ExpandFunctionLocalPredefinedMacros(), filterNonConflictingPreviousTypedefDecls(), FinalizeDeclaration(), FinalizeDeclaratorGroup(), FindAllocationFunctions(), FindCompositePointerType(), findDeleteForPromise(), clang::DeclSpec::Finish(), FinishForRangeVarDecl(), ForceDeclarationOfImplicitMembers(), FormatStringHasSArg(), funcHasParameterSizeMangling(), clang::FunctionCallFilterCCC::FunctionCallFilterCCC(), GatherArgumentsForCall(), getCCForDeclaratorChunk(), getCurrentClass(), getCurrentInstantiationOf(), GetDeclSpecTypeForDeclarator(), getDefaultCXXMethodAddrSpace(), getDefaultedFunctionKind(), getDummyLambdaType(), clang::interp::getField(), GetFullTypeForDeclarator(), getLambdaType(), getNamedReturnInfo(), getNonFieldDeclScope(), getNonOdrUseReasonInCurrentContext(), getNonTagTypeDeclKind(), getNSNumberFactoryMethod(), getOpenCLKernelParameterType(), getPrivateItem(), getTargetRegionParams(), getTopMostPointOfInstantiation(), GetTypeForDeclarator(), GetTypeForDeclaratorCast(), getTypeName(), GetTypeOfFunction(), getUDSuffixLoc(), HandleAddressSpaceTypeAttribute(), HandleArmSveVectorBitsTypeAttr(), handleAvailabilityAttr(), handleConstructorAttr(), HandleDeclarator(), handleDelayedForbiddenType(), handleDeprecatedAttr(), handleFallThroughAttr(), HandleField(), handleFloatConversion(), handleFunctionTypeAttr(), handleGlobalAttr(), handleInitPriorityAttr(), handleLambdaNumbering(), handleLikely(), HandleMatrixTypeAttr(), handleMSConstexprAttr(), HandleMSProperty(), handleNakedAttr(), HandleNeonVectorTypeAttr(), handleNoCfCheckAttr(), handleObjCOwnershipTypeAttr(), HandleRISCVRVVVectorBitsTypeAttr(), handleSharedAttr(), handleStandardNoReturnAttr(), handleTagNumbering(), handleUnlikely(), handleUnusedAttr(), handleVTablePointerAuthentication(), handleWarnUnusedResult(), hasAcceptableDefinition(), HasAccess(), hasNewExtendedAlignment(), hasUserDefinedMapper(), IgnoredValueConversions(), ImpCastExprToType(), ImplicitlyDefineFunction(), clang::interp::IncDecHelper(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), Initialize(), clang::InitializationSequence::InitializeFrom(), clang::TemplateDeclInstantiator::InitMethodInstantiation(), InsertOCLBuiltinDeclarationsFromTable(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), InstantiateVariableInitializer(), clang::interp::interp__builtin_classify_type(), clang::interp::interp__builtin_operator_new(), clang::interp::InvalidNewDeleteExpr(), isAbstractType(), isAcceptableTagRedeclContext(), clang::isBetterOverloadCandidate(), isCapturingReferenceToHostVarInCUDADeviceLambda(), isConstNotMutableType(), isCurrentClassNameTypo(), IsCXX98CompatWarning(), IsDerivedFrom(), IsEnumConstOrFromMacro(), isExternalWithNoLinkageType(), isFunctionDefinitionDiscarded(), isIncompleteDeclExternC(), isLibstdcxxPointerReturnFalseHack(), isMainFileLoc(), isMemberAccessibleForDeletion(), isNonPlacementDeallocationFunction(), isNullPointerValueTemplateArgument(), IsOverloadOrOverrideImpl(), isPotentialImplicitMemberAccess(), isReferenceToNonConstCapture(), isResultTypeOrTemplate(), IsSimplyAccessible(), IsStandardConversion(), isStdInitializerList(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), isTagTypeWithMissingTag(), isTautologicalBoundsCheck(), isTemplateName(), isUnavailableAlignedAllocationFunction(), isUsualDeallocationFunction(), isValidVarArgType(), isVariableCapturable(), IsVectorConversion(), LookupBinOp(), LookupBuiltin(), LookupDirect(), LookupInlineAsmField(), LookupMemberExpr(), LookupName(), LookupObjCInterfaceDeclForLiteral(), LookupSpecialMember(), LookupTemplateName(), mapCodeCompletionContext(), MarkDeclRefReferenced(), MarkExpressionAsImmediateEscalating(), MarkExprReferenced(), MarkFunctionReferenced(), MarkMemberReferenced(), MaybeBindToTemporary(), maybeExtendBlockObject(), MaybeProduceObjCObject(), MergeCompatibleFunctionDecls(), MergeCXXFunctionDecl(), mergeDeclAttribute(), MergeFunctionDecl(), mergeInternalLinkageAttr(), MergeTypedefNameDecl(), mergeTypeWithPrevious(), MergeVarDecl(), MergeVarDeclExceptionSpecs(), MergeVarDeclTypes(), mightBeIntendedToBeTemplateName(), NoteFunctionCandidate(), clang::interp::OffsetHelper(), OpenCLCheckVectorConditional(), ParsedFreeStandingDeclSpec(), clang::InitializationSequence::Perform(), PerformImplicitConversion(), PerformMoveOrCopyInitialization(), PopExpressionEvaluationContext(), PrintInstantiationStack(), ProcessDeclAttribute(), processImplicitMapsWithDefaultMappers(), clang::interp::PtrPtrCast(), PushOnScopeChains(), RegisterLocallyScopedExternCDecl(), repeatForLambdaConversionFunctionCallingConvs(), RequireLiteralType(), RequireStructuralType(), ResolveConstructorOverload(), Sema(), SetDeclDefaulted(), setExceptionMode(), clang::DeclSpec::SetStorageClassSpec(), setTagNameForLinkagePurposes(), clang::OverloadCandidateSet::shouldDeferDiags(), ShouldDeleteSpecialMember(), ShouldDiagnoseAvailabilityInContext(), shouldIgnoreDueToReservedName(), shouldSkipAnonEnumBody(), ShouldSplatAltivecScalarInCast(), clang::interp::SubPtr(), SubstituteExplicitTemplateArguments(), TemporaryMaterializationConversion(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), tryCaptureVariable(), TryConstructorInitialization(), TryDefaultInitialization(), TryImplicitConversion(), TryListConversion(), TryListInitialization(), tryLookupUnambiguousFieldDecl(), TryNamespaceTypoCorrection(), TryOCLSamplerInitialization(), TryOCLZeroOpaqueTypeInitialization(), TryReferenceInit(), TryReferenceInitializationCore(), TryReferenceListInitialization(), TryUserDefinedConversion(), TryValueInitialization(), tryVectorConvertAndSplat(), UseArgumentDependentLookup(), UsualUnaryConversions(), ValidateObjCLiteralInterfaceDecl(), VerifyBitField(), VerifyIntegerConstantExpression(), warnAboutRedundantParens(), and warnOnReservedIdentifier().
SourceLocation Sema::getLocationOfStringLiteralByte | ( | const StringLiteral * | SL, |
unsigned | ByteNo | ||
) | const |
Definition at line 118 of file SemaChecking.cpp.
References Context, clang::StringLiteral::getLocationOfByte(), getSourceManager(), clang::ASTContext::getTargetInfo(), and LangOpts.
Referenced by ActOnGCCAsmStmt(), and CheckC23ConstexprInitStringLiteral().
SourceLocation Sema::getLocForEndOfToken | ( | SourceLocation | Loc, |
unsigned | Offset = 0 |
||
) |
Calls Lexer::getLocForEndOfToken()
Definition at line 82 of file Sema.cpp.
References clang::Lexer::getLocForEndOfToken(), LangOpts, Loc, and SourceMgr.
Referenced by clang::SemaObjC::ActOnAtEnd(), ActOnCXXDelete(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnLambdaExpressionAfterIntroducer(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaObjC::actOnObjCTypeParam(), addFixitForObjCARCConversion(), clang::SemaObjC::adornBoolConversionDiagWithTernaryFixit(), clang::SemaObjC::AtomicPropertySetterGetterRules(), BuildLambdaExpr(), BuiltinDumpStruct(), CheckCompletedCXXClass(), CheckConversionDeclarator(), CheckEquivalentExceptionSpec(), CheckExplicitlyDefaultedComparison(), CheckFunctionDeclaration(), CheckLogicalOperands(), CheckMain(), CheckMemorySizeofForComparison(), clang::SemaObjC::CheckObjCBridgeRelatedConversions(), CheckParameter(), checkStringLiteralArgumentAttr(), checkTypeParamListConsistency(), CheckUsingDeclQualifier(), CreateBuiltinBinOp(), CreateIfFixit(), clang::SemaObjC::CreatePropertyDecl(), clang::InitializationSequence::Diagnose(), DiagnoseAlwaysNonNullPointer(), DiagnoseAssignmentAsCondition(), DiagnoseDirectIsaAccess(), diagnoseLogicalNotOnLHSofCheck(), DiagnoseMismatchedNewDelete(), DiagnoseNarrowingInInitList(), diagnoseNoViableConversion(), diagnoseObjCARCConversion(), diagnoseObjCLiteralComparison(), DiagnoseSentinelCalls(), diagnoseXorMisusedAsPow(), DoEmitAvailabilityWarning(), clang::DeclSpec::Finish(), fixItNullability(), GetFullTypeForDeclarator(), handleFallThroughAttr(), isNullPointerValueTemplateArgument(), maybeRecoverWithZeroInitialization(), clang::SemaObjC::ParseObjCEncodeExpression(), setTagNameForLinkagePurposes(), SuggestInitializationFixit(), clang::ConversionFixItGenerator::tryToFixConversion(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
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 1585 of file SemaLookup.cpp.
References CodeSynthesisContextLookupModules, CodeSynthesisContexts, getDefiningModule(), and LookupModulesCache.
Referenced by isModuleVisible().
const llvm::MapVector< FieldDecl *, Sema::DeleteLocs > & Sema::getMismatchingDeleteExpressions | ( | ) | const |
ModuleLoader & Sema::getModuleLoader | ( | ) | const |
Retrieve the module loader associated with the preprocessor.
Definition at line 86 of file Sema.cpp.
References clang::Preprocessor::getModuleLoader(), and PP.
Referenced by ActOnModuleDecl(), ActOnModuleImport(), BuildModuleInclude(), and createImplicitModuleImportForErrorRecovery().
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 6061 of file SemaTemplateDeduction.cpp.
References clang::FunctionDecl::getAssociatedConstraints(), clang::Decl::getDescribedTemplate(), clang::FunctionDecl::getTemplateInstantiationPattern(), IsAtLeastAsConstrained(), clang::FunctionDecl::isFunctionTemplateSpecialization(), and P.
Referenced by CheckMemberSpecialization(), and clang::isBetterOverloadCandidate().
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 6329 of file SemaTemplateDeduction.cpp.
References clang::ClassTemplatePartialSpecializationDecl::getInjectedSpecializationType(), getMoreSpecialized(), and Loc.
Referenced by CheckVarTemplateId(), and getPatternForClassTemplateSpecialization().
VarTemplatePartialSpecializationDecl * Sema::getMoreSpecializedPartialSpecialization | ( | VarTemplatePartialSpecializationDecl * | PS1, |
VarTemplatePartialSpecializationDecl * | PS2, | ||
SourceLocation | Loc | ||
) |
Definition at line 6354 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgumentList::asArray(), Context, getMoreSpecialized(), clang::VarTemplateSpecializationDecl::getSpecializedTemplate(), clang::VarTemplateSpecializationDecl::getTemplateArgs(), clang::ASTContext::getTemplateSpecializationType(), and Loc.
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 5759 of file SemaTemplateDeduction.cpp.
References clang::Type::castAs(), Context, clang::TemplateDecl::getAssociatedConstraints(), GetImplicitObjectParameterType(), clang::TemplateArgument::getKind(), clang::ASTContext::getLangOpts(), clang::FunctionDecl::getOverloadedOperator(), clang::CXXMethodDecl::getRefQualifier(), clang::FunctionDecl::getReturnType(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), IsAtLeastAsConstrained(), isAtLeastAsSpecializedAs(), clang::Type::isRValueReferenceType(), clang::CXXMethodDecl::isStatic(), Loc, clang::OO_None, 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(), and clang::isBetterOverloadCandidate().
UnresolvedSetIterator Sema::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.
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 5986 of file SemaTemplateDeduction.cpp.
References clang::declaresSameEntity(), clang::SemaBase::Diag(), getMoreSpecializedTemplate(), getTemplateArgumentBindingsText(), HandleFunctionTypeMismatch(), clang::QualType::isNull(), Loc, clang::TemplateSpecCandidateSet::NoteCandidates(), and clang::TPOC_Other.
Referenced by ActOnExplicitInstantiation(), and CheckFunctionTemplateSpecialization().
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 3355 of file SemaStmt.cpp.
References Context, clang::ASTContext::getDeclAlign(), clang::Decl::getKind(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeAlignInChars(), clang::Decl::hasAttr(), clang::VarDecl::hasDependentAlignment(), clang::VarDecl::hasLocalStorage(), clang::VarDecl::isExceptionVariable(), clang::Type::isIncompleteType(), clang::Type::isObjectType(), clang::Type::isRValueReferenceType(), clang::QualType::isVolatileQualified(), clang::Sema::NamedReturnInfo::MoveEligible, and clang::Sema::NamedReturnInfo::MoveEligibleAndCopyElidable.
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 3329 of file SemaStmt.cpp.
References clang::Sema::NamedReturnInfo::Candidate, clang::Expr::containsErrors(), Context, clang::CPlusPlus23, clang::ImplicitCastExpr::Create(), E, ForceOff, ForceOn, clang::VarDecl::getInit(), getLangOpts(), getNamedReturnInfo(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::Expr::IgnoreParens(), clang::Expr::isXValue(), and clang::VK_XValue.
Referenced by BuildCoreturnStmt(), BuildCXXThrow(), BuildReturnStmt(), and getNamedReturnInfo().
DeclarationNameInfo Sema::GetNameForDeclarator | ( | Declarator & | D | ) |
GetNameForDeclarator - Determine the full declaration name for the given Declarator.
Definition at line 5821 of file SemaDecl.cpp.
References D, and GetNameFromUnqualifiedId().
Referenced by ActOnCXXMemberDeclarator(), ActOnExplicitInstantiation(), ActOnFriendFunctionDecl(), ActOnFunctionDeclarator(), ActOnVariableDeclarator(), CheckFunctionOrTemplateParamDeclarator(), CreateNewFunctionDecl(), and HandleDeclarator().
DeclarationNameInfo Sema::GetNameFromUnqualifiedId | ( | const UnqualifiedId & | Name | ) |
Retrieves the declaration name from a parsed unqualified-id.
Definition at line 5826 of file SemaDecl.cpp.
References Context, CurContext, clang::ASTContext::DeclarationNames, clang::SemaBase::Diag(), clang::TemplateName::getAsTemplateDecl(), clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXConstructorName(), clang::DeclarationNameTable::getCXXConversionFunctionName(), clang::DeclarationNameTable::getCXXDeductionGuideName(), clang::DeclarationNameTable::getCXXDestructorName(), clang::DeclarationNameTable::getCXXLiteralOperatorName(), clang::DeclarationNameTable::getCXXOperatorName(), clang::NamedDecl::getIdentifier(), clang::ASTContext::getNameForTemplate(), getTemplateNameKindForDiagnostics(), clang::ASTContext::getTypeDeclType(), GetTypeFromParser(), clang::IK_ConstructorName, clang::IK_ConstructorTemplateId, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::IK_DestructorName, clang::IK_Identifier, clang::IK_ImplicitSelfParam, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::IK_TemplateId, int, clang::QualType::isNull(), NoteTemplateLocation(), clang::DeclarationNameInfo::setCXXLiteralOperatorNameLoc(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::DeclarationNameInfo::setLoc(), clang::DeclarationNameInfo::setName(), and clang::DeclarationNameInfo::setNamedTypeInfo().
Referenced by ActOnAliasDeclaration(), ActOnMSDependentExistsStmt(), ActOnTemplateName(), ActOnUsingDeclaration(), CheckMicrosoftIfExistsSymbol(), DecomposeUnqualifiedId(), GetNameForDeclarator(), and 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 2264 of file SemaDecl.cpp.
References clang::CPlusPlus, clang::Scope::DeclScope, and getLangOpts().
Referenced by ActOnEnumConstant(), ActOnTag(), and MergeTypedefNameDecl().
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 2252 of file SemaExpr.cpp.
References Context, D, getLangOpts(), isCapturingReferenceToHostVarInCUDADeviceLambda(), isUnevaluatedContext(), clang::NOUR_Constant, clang::NOUR_None, clang::NOUR_Unevaluated, and OpenMP().
Referenced by BuildDeclRefExpr(), and BuildMemberExpr().
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 16936 of file SemaDecl.cpp.
References clang::Class, clang::Enum, getLangOpts(), clang::Interface, NTK_NonClass, NTK_NonEnum, NTK_NonStruct, NTK_NonUnion, NTK_Template, NTK_TemplateTemplateArgument, NTK_TypeAlias, NTK_TypeAliasTemplate, NTK_Typedef, clang::Struct, and clang::Union.
Referenced by ActOnExplicitInstantiation(), ActOnTag(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
const NormalizedConstraint * Sema::getNormalizedAssociatedConstraints | ( | NamedDecl * | ConstrainedDecl, |
ArrayRef< const Expr * > | AssociatedConstraints | ||
) |
Definition at line 1413 of file SemaConcept.cpp.
References Context, and clang::Decl::getCanonicalDecl().
Referenced by clang::getNormalizedAssociatedConstraints(), and MaybeEmitAmbiguousAtomicConstraintsDiagnostic().
IdentifierInfo * Sema::getNullabilityKeyword | ( | NullabilityKind | nullability | ) |
Retrieve the keyword associated.
Definition at line 3774 of file SemaType.cpp.
References clang::Preprocessor::getIdentifierInfo(), clang::NonNull, clang::Nullable, clang::NullableResult, PP, and clang::Unspecified.
Referenced by GetFullTypeForDeclarator(), and 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 979 of file SemaTemplateVariadic.cpp.
References getNumArgumentsInExpansionFromUnexpanded(), and clang::T.
Referenced by getPackIndexForParam(), and clang::TemplateDeclInstantiator::SubstFunctionType().
std::optional< unsigned > Sema::getNumArgumentsInExpansionFromUnexpanded | ( | llvm::ArrayRef< UnexpandedParameterPack > | Unexpanded, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 929 of file SemaTemplateVariadic.cpp.
References CurrentInstantiationScope, clang::LocalInstantiationScope::findInstantiationOf(), clang::getDepthAndIndex(), clang::MultiLevelTemplateArgumentList::getNumLevels(), clang::MultiLevelTemplateArgumentList::hasTemplateArgument(), and clang::Result.
Referenced by getNumArgumentsInExpansion().
|
inline |
Definition at line 526 of file Sema.h.
References OpenCLFeatures.
Referenced by ActOnNumericConstant(), BuildMemberPointerType(), BuildPointerType(), BuildReferenceType(), CheckAssignmentOperands(), CheckFieldDecl(), clang::SemaOpenCL::checkSubgroupExt(), CheckVariableDeclarationType(), ConvertDeclSpecToType(), deduceOpenCLAddressSpace(), DefaultArgumentPromotion(), DefaultLvalueConversion(), diagnoseOpenCLTypes(), GetFullTypeForDeclarator(), getOpenCLKernelParameterType(), clang::SemaOpenCL::handleAccessAttr(), Initialize(), clang::InitializationSequence::Perform(), clang::DeclSpec::SetStorageClassSpec(), and TryOCLZeroOpaqueTypeInitialization().
|
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 1735 of file Sema.h.
References OptimizeOffPragmaLocation.
LabelDecl * Sema::GetOrCreateMSAsmLabel | ( | StringRef | ExternalLabelName, |
SourceLocation | Location, | ||
bool | AlwaysCreate | ||
) |
Definition at line 968 of file SemaStmtAsm.cpp.
References clang::C, Context, clang::Preprocessor::getIdentifierInfo(), Label, LookupOrCreateLabel(), OS, and PP.
NamespaceDecl * Sema::getOrCreateStdNamespace | ( | ) |
Retrieve the special "std" namespace, which may require us to implicitly define the namespace.
Definition at line 11891 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 ActOnUsingDirective(), and DeclareGlobalNewDelete().
Get the module owning an entity.
Definition at line 3115 of file Sema.h.
References clang::Decl::getOwningModule().
Referenced by diagnoseMissingImport(), getDefiningModule(), and hasAcceptableDefaultArgument().
|
inline |
Definition at line 531 of file Sema.h.
References PP.
Referenced by ActOnDocumentableDecls(), AddOverrideResults(), CheckUnreachable(), clang::SemaObjC::DiagnoseOwningPropertyGetterSynthesis(), DiagnoseSwitchLabelsFallthrough(), diagnoseXorMisusedAsPow(), DoEmitAvailabilityWarning(), clang::IncrementalParser::IncrementalParser(), InsertOCLBuiltinDeclarationsFromTable(), clang::IncrementalParser::Parse(), clang::ParseAST(), clang::PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(), ProduceSignatureHelp(), ShouldDiagnoseAvailabilityInContext(), and clang::ASTWriter::WriteAST().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 14578 of file Sema.h.
References clang::TypeLoc::getSourceRange().
|
inline |
Retrieve a suitable printing policy for diagnostics.
Definition at line 817 of file Sema.h.
References Context, getPrintingPolicy(), and PP.
Referenced by ActOnCXXForRangeIdentifier(), CheckDeducedPlaceholderConstraints(), CheckEquivalentExceptionSpec(), checkPreviousOMPAllocateAttribute(), CheckVirtualDtorCall(), DiagnoseAlwaysNonNullPointer(), diagnoseNoViableConversion(), EmitDiagnostic(), findFailedBooleanCondition(), getCompletionPrintingPolicy(), getPrintingPolicy(), getTemplateArgumentBindingsText(), InstantiateClass(), InstantiateFunctionDefinition(), MarkFunctionReferenced(), noteLocation(), PrintInstantiationStack(), and ProcessAPINotes().
|
static |
Retrieve a suitable printing policy for diagnostics.
Definition at line 129 of file Sema.cpp.
References clang::PrintingPolicy::Bool, Context, clang::PrintingPolicy::EntireContentsOfLargeArray, clang::ASTContext::getBoolName(), clang::ASTContext::getLangOpts(), clang::Preprocessor::getMacroInfo(), clang::ASTContext::getPrintingPolicy(), and PP.
TypeLoc Sema::getReturnTypeLoc | ( | FunctionDecl * | FD | ) | const |
Definition at line 3710 of file SemaStmt.cpp.
References clang::TypeLoc::getAsAdjusted(), clang::TypeSourceInfo::getTypeLoc(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by ActOnConversionDeclarator(), and DeduceFunctionTypeFromReturnExpr().
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 2161 of file Sema.cpp.
References clang::Scope::DeclScope, clang::DeclContext::getPrimaryContext(), and clang::Scope::TemplateParamScope.
Referenced by buildImplicitMapper(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), clang::SemaObjC::handleIBOutletCollection(), and TryTypoCorrectionForCall().
|
static |
Finds the scope corresponding to the given decl context, if it happens to be an enclosing scope.
Otherwise return NULL.
Definition at line 1566 of file SemaDecl.cpp.
References clang::DeclContext::getPrimaryContext().
Referenced by ActOnFriendFunctionDecl(), ActOnTag(), and CheckClassTemplate().
Returns a field in a CXXRecordDecl that has the same name as the decl SelfAssigned
when inside a CXXMethodDecl.
Definition at line 14555 of file SemaExpr.cpp.
References getCurFunctionDecl(), clang::NamedDecl::getDeclName(), and Parent.
Referenced by DiagnoseSelfAssignment(), and DiagnoseSelfMove().
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 8292 of file SemaDecl.cpp.
References Diags, 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 8279 of file SemaDecl.cpp.
References D, Diags, clang::Decl::getDeclContext(), clang::LookupResult::getFoundDecl(), clang::DeclContext::isRecord(), and shouldWarnIfShadowedDecl().
Referenced by ActOnDecompositionDeclarator(), ActOnTypedefNameDecl(), ActOnVariableDeclarator(), and CheckShadow().
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 8265 of file SemaDecl.cpp.
References D, Diags, clang::LookupResult::getFoundDecl(), and shouldWarnIfShadowedDecl().
Definition at line 12726 of file SemaExpr.cpp.
References Context, clang::ASTContext::BuiltinVectorTypeInfo::EC, clang::ASTContext::getBuiltinVectorTypeInfo(), clang::ASTContext::getIntTypeForBitwidth(), clang::ASTContext::getScalableVectorType(), clang::ASTContext::getTypeSize(), clang::Type::isSizelessBuiltinType(), and V.
Referenced by CheckSizelessVectorCompareOperands().
Return a signed ext_vector_type that is of identical size and number of elements.
For floating point vectors, return an integer type of identical size and number of elements. In the non ext_vector_type case, search from the largest type to the smallest type to avoid cases where long long == long, where long gets picked over long long.
Definition at line 12683 of file SemaExpr.cpp.
References clang::ASTContext::BoolTy, clang::ASTContext::CharTy, Context, clang::Generic, clang::VectorType::getElementType(), clang::ASTContext::getExtVectorType(), clang::VectorType::getNumElements(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::ASTContext::Int128Ty, clang::ASTContext::IntTy, clang::Type::isExtVectorBoolType(), clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::ASTContext::ShortTy, and V.
Referenced by CheckVectorCompareOperands(), CheckVectorLogicalOperands(), convertHalfVecBinOp(), and CreateBuiltinUnaryOp().
|
inline |
Definition at line 530 of file Sema.h.
References SourceMgr.
Referenced by ActOnAnnotModuleEnd(), ActOnCXXTryBlock(), ActOnEndOfTranslationUnit(), ActOnFields(), ActOnFinishFunctionBody(), ActOnModuleDecl(), ActOnStringLiteral(), ActOnVariableDeclarator(), addFixitForObjCARCConversion(), AnalyzeImplicitConversions(), BuildCXXNew(), BuildCXXThrow(), BuildModuleInclude(), BuildUsingDeclaration(), BuiltinOverflow(), CheckConstexprFunctionBody(), clang::SemaObjC::checkInitMethod(), CheckLiteralOperatorDeclaration(), CheckMemaccessSize(), CheckMoveOnConstruction(), CheckNontrivialField(), checkTargetClonesAttrString(), CheckUnreachable(), CheckVirtualDtorCall(), clang::SemaCodeCompletion::CodeCompleteIncludedFile(), DiagnoseAbsenceOfOverrideControl(), DiagnoseAlwaysNonNullPointer(), DiagnoseBaseOrMemInitializerOrder(), diagnoseIgnoredQualifiers(), DiagnoseMismatchedNewDelete(), diagnoseRepeatedUseOfWeak(), diagnoseUseOfInternalDeclInInlineFunction(), diagnoseXorMisusedAsPow(), DiagReservedModuleName(), DoEmitAvailabilityWarning(), EmitDiagForCXXThrowInNonThrowingFunc(), clang::sema::SemaPPCallbacks::FileChanged(), clang::DeclSpec::Finish(), GetFullTypeForDeclarator(), getLocationOfStringLiteralByte(), getUDSuffixLoc(), handleInitPriorityAttr(), handleObjCOwnershipTypeAttr(), handleStandardNoReturnAttr(), InstantiateFunctionDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), InstantiateVariableDefinition(), IsEnumConstOrFromMacro(), isLibstdcxxPointerReturnFalseHack(), isSameWidthConstantConversion(), clang::SemaCUDA::maybeAddHostDeviceAttrs(), notePreviousDefinition(), clang::IncrementalParser::Parse(), clang::ParseAST(), clang::SemaObjC::ParseObjCSelectorExpression(), and clang::PrintingCodeCompleteConsumer::ProcessOverloadCandidates().
|
inline |
Definition at line 5835 of file Sema.h.
References clang::Sema::DefaultedFunctionKind::asSpecialMember(), and getDefaultedFunctionKind().
Referenced by CheckCompletedCXXClass(), CheckConstructorAccess(), clang::InitializationSequence::Diagnose(), MergeCXXFunctionDecl(), MergeFunctionDecl(), and ShouldDeleteSpecialMember().
EnumDecl * Sema::getStdAlignValT | ( | ) | const |
Definition at line 11745 of file SemaDeclCXX.cpp.
References Context, clang::LazyOffsetPtr< T, OffsT, Get >::get(), clang::ASTContext::getExternalSource(), and StdAlignValT.
Referenced by ActOnTag(), BuildCXXNew(), DeclareGlobalNewDelete(), FindAllocationFunctions(), getTypeSourceInfoForStdAlignValT(), and isNonPlacementDeallocationFunction().
CXXRecordDecl * Sema::getStdBadAlloc | ( | ) | const |
Definition at line 11740 of file SemaDeclCXX.cpp.
References Context, clang::LazyOffsetPtr< T, OffsT, Get >::get(), clang::ASTContext::getExternalSource(), and StdBadAlloc.
Referenced by ActOnTag(), DeclareGlobalAllocationFunction(), and DeclareGlobalNewDelete().
NamespaceDecl * Sema::getStdNamespace | ( | ) | const |
Definition at line 11749 of file SemaDeclCXX.cpp.
References Context, clang::LazyOffsetPtr< T, OffsT, Get >::get(), clang::ASTContext::getExternalSource(), and StdNamespace.
Referenced by ActOnCXXTypeid(), ActOnStartNamespaceDef(), ActOnTag(), BuildStdInitializerList(), buildStdNoThrowDeclRef(), CheckComparisonCategoryType(), DiagnoseTwoPhaseLookup(), emitReplacement(), getOrCreateStdNamespace(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), isStdInitializerList(), lookupCoroutineHandleType(), lookupCoroutineTraits(), lookupPromiseType(), LookupStdInitializerList(), LookupStdSourceLocationImpl(), and lookupStdTypeTraitMember().
IdentifierInfo * Sema::getSuperIdentifier | ( | ) | const |
Definition at line 2715 of file Sema.cpp.
References clang::IdentifierTable::get(), and clang::ASTContext::Idents.
Referenced by clang::SemaCodeCompletion::CodeCompleteObjCSuperMessage().
std::string Sema::getTemplateArgumentBindingsText | ( | const TemplateParameterList * | Params, |
const TemplateArgument * | Args, | ||
unsigned | NumArgs | ||
) |
Definition at line 11135 of file SemaTemplate.cpp.
References clang::NamedDecl::getIdentifier(), clang::TemplateParameterList::getParam(), getPrintingPolicy(), 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 11129 of file SemaTemplate.cpp.
References clang::TemplateArgumentList::data(), getTemplateArgumentBindingsText(), and clang::TemplateArgumentList::size().
Referenced by checkAddressOfFunctionIsAvailable(), CheckVarTemplateId(), DiagnoseBadDeduction(), EnsureTemplateArgumentListConstraints(), getMostSpecialized(), getPatternForClassTemplateSpecialization(), getTemplateArgumentBindingsText(), 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 1237 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 54 of file SemaTemplate.cpp.
References D, getFunctionScopes(), and getInventedParameterInfos().
Referenced by ActOnStmtExpr(), and EnterTemplatedContext().
MultiLevelTemplateArgumentList Sema::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 , |
||
bool | ForDefaultArgumentSubstitution = 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. |
SkipForSpecialization | when specified, any template specializations in a traversal would be ignored. |
ForDefaultArgumentSubstitution | indicates we should continue looking when encountering a specialized member function template, rather than returning immediately. |
Definition at line 470 of file SemaTemplateInstantiate.cpp.
References clang::Decl::castFromDeclContext(), Context, clang::Function, clang::Decl::isFileContextDecl(), and clang::Result.
Referenced by ActOnExplicitInstantiation(), BuildCXXDefaultInitExpr(), CalculateTemplateDepthForConstraints(), CheckDeducedArgumentConstraints(), CheckTemplateArgumentList(), InstantiateClassTemplateSpecialization(), InstantiateClassTemplateSpecializationMembers(), InstantiateDefaultArgument(), InstantiateExceptionSpec(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), RequireCompleteEnumDecl(), SubstituteConstraintExpressionWithoutSatisfaction(), and substituteParameterMappings().
Sema::TemplateNameKindForDiagnostics Sema::getTemplateNameKindForDiagnostics | ( | TemplateName | Name | ) |
Definition at line 1291 of file SemaDecl.cpp.
References AliasTemplate, ClassTemplate, Concept, DependentTemplate, FunctionTemplate, TemplateTemplateParam, and VarTemplate.
Referenced by CheckTemplateArgumentList(), CheckTypenameType(), DeduceTemplateSpecializationFromInitializer(), diagnoseMissingArgument(), diagnoseMissingTemplateArguments(), EnsureTemplateArgumentListConstraints(), GetDeclSpecTypeForDeclarator(), and GetNameFromUnqualifiedId().
TemplateParameterList * Sema::GetTemplateParameterList | ( | TemplateDecl * | TD | ) |
Returns the template parameter list with all default template argument information.
Definition at line 1772 of file SemaTemplate.cpp.
References D, clang::Decl::FOK_None, clang::Decl::getFriendObjectKind(), clang::NamedDecl::getMostRecentDecl(), and clang::Decl::getPreviousDecl().
Referenced by CheckClassTemplate(), and CheckTemplateArgumentList().
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 11373 of file SemaTemplate.cpp.
References CodeSynthesisContexts, clang::CPlusPlus, getLangOpts(), clang::Decl::getLocation(), clang::isa(), and clang::FunctionDecl::isFunctionTemplateSpecialization().
Referenced by DoEmitAvailabilityWarning().
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 2827 of file SemaTemplateDeduction.cpp.
References BuildExpressionFromDeclTemplateArgument(), BuildExpressionFromNonTypeTemplateArgument(), Context, clang::TemplateArgument::Declaration, E, clang::TemplateArgument::Expression, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateArgument::getAsExpr(), clang::TemplateName::getAsQualifiedTemplateName(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getNullPtrType(), clang::TemplateArgument::getParamTypeForDecl(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TemplateArgument::Integral, clang::QualType::isNull(), Loc, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::StructuralValue, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, clang::TemplateParam, and clang::TemplateArgument::Type.
Referenced by ActOnNonTypeTemplateParameter(), checkBuiltinTemplateIdType(), ConvertDeducedTemplateArgument(), FindInstantiatedDecl(), formImmediatelyDeclaredConstraint(), getIdentityTemplateArgumentLoc(), getTrivialIntegralTemplateArgument(), getTrivialTypeTemplateArgument(), 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 D, GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), getLangOpts(), inferARCWriteback(), and clang::T.
Referenced by ActOnBlockArguments(), ActOnCXXNew(), ActOnDecompositionDeclarator(), ActOnExceptionDeclarator(), ActOnExplicitInstantiation(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), clang::SemaObjC::ActOnIvar(), ActOnNonTypeTemplateParameter(), clang::SemaObjC::ActOnObjCExceptionDecl(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperVarDecl(), ActOnParamDeclarator(), clang::SemaObjC::ActOnProperty(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), ActOnTypeName(), BuildAnonymousStructOrUnion(), BuildMicrosoftCAnonymousStruct(), getLambdaType(), HandleDeclarator(), HandleField(), and HandleMSProperty().
TypeSourceInfo * Sema::GetTypeForDeclaratorCast | ( | Declarator & | D, |
QualType | FromTy | ||
) |
Definition at line 5817 of file SemaType.cpp.
References Context, D, GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), clang::ASTContext::getInnerObjCOwnership(), getLangOpts(), ObjC(), clang::Qualifiers::OCL_None, and transferARCOwnership().
Referenced by ActOnBuiltinBitCastExpr(), ActOnCastExpr(), and ActOnCXXNamedCast().
|
static |
Definition at line 2751 of file SemaType.cpp.
References clang::OpaquePtr< PtrTy >::get(), and clang::QualType::isNull().
Referenced by ActOnAliasDeclaration(), ActOnAlignasTypeArgument(), ActOnArrayTypeTrait(), ActOnAsTypeExpr(), ActOnBaseSpecifier(), ActOnBuiltinOffsetOf(), clang::SemaObjC::ActOnClassMessage(), ActOnCompoundLiteral(), ActOnConvertVectorExpr(), ActOnCXXTypeConstructExpr(), ActOnCXXTypeid(), ActOnCXXUuidof(), ActOnGenericSelectionExpr(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaObjC::ActOnMethodParmDeclaration(), clang::SemaObjC::ActOnObjCBridgedCast(), clang::SemaObjC::actOnObjCTypeArgsAndProtocolQualifiers(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaObjC::actOnObjCTypeParam(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperType(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionType(), ActOnPackExpansion(), ActOnPseudoDestructorExpr(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), ActOnTag(), ActOnTemplateName(), ActOnTemplateTypeArgument(), ActOnTypeParameter(), ActOnTypeRequirement(), ActOnTypeTrait(), ActOnUnaryExprOrTypeTraitExpr(), clang::SemaSYCL::ActOnUniqueStableNameExpr(), ActOnUsingEnumDeclaration(), ActOnVAArg(), AddClassMessageCompletions(), BuildCXXNestedNameSpecifier(), BuildMemInitializer(), canDelayFunctionBody(), CheckConversionDeclarator(), CheckDeductionGuideDeclarator(), CheckDestructorDeclarator(), checkExceptionSpecification(), clang::SemaCodeCompletion::CodeCompleteObjCClassMessage(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDecl(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDeclSelector(), ConvertDeclSpecToType(), CreateNewFunctionDecl(), GetDeclSpecTypeForDeclarator(), getDestructorName(), getDestructorTypeForDecltype(), GetFullTypeForDeclarator(), GetNameFromUnqualifiedId(), handleAlignedAttr(), clang::SemaObjC::handleIBOutletCollection(), clang::SemaSYCL::handleKernelEntryPointAttr(), handleLifetimeCategoryAttr(), handlePreferredName(), handlePreferredTypeAttr(), clang::SemaHLSL::handleResourceTypeAttr(), handleTypeTagForDatatypeAttr(), handleVecTypeHint(), clang::SemaObjC::ParseObjCEncodeExpression(), ProcessAPINotes(), RebuildDeclaratorInCurrentInstantiation(), and translateTemplateArgument().
ParsedType Sema::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.
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 288 of file SemaDecl.cpp.
References ActOnTypenameType(), clang::LookupResult::Ambiguous, clang::LookupResult::AmbiguousTagHiding, buildNamedType(), CheckTypenameType(), computeDeclContext(), Context, CorrectTypo(), clang::CPlusPlus, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), CreateParsedType(), CTK_ErrorRecovery, clang::declaresSameEntity(), clang::SemaBase::Diag(), diagnoseTypo(), DiagnoseUseOfDecl(), clang::LookupResult::Found, clang::LookupResult::FoundOverloaded, clang::LookupResult::FoundUnresolvedValue, clang::OpaquePtr< PtrTy >::get(), clang::ActionResult< PtrTy, Compress >::get(), clang::getAsTypeTemplateDecl(), clang::SourceRange::getBegin(), clang::TypoCorrection::getCorrectionAsIdentifierInfo(), clang::TypoCorrection::getCorrectionSpecifier(), clang::ASTContext::getDeducedTemplateSpecializationType(), clang::ASTContext::getDependentNameType(), getLangOpts(), clang::Decl::getLocation(), clang::IdentifierInfo::getName(), clang::ASTContext::getObjCInterfaceType(), clang::ASTContext::getQualifiedTemplateName(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::UsingShadowDecl::getTargetDecl(), clang::ASTContext::getTypeDeclType(), getTypeName(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::NamedDecl::getUnderlyingDecl(), clang::ASTContext::getUsingType(), clang::CXXScopeSpec::getWithLocInContext(), clang::ASTContext::IntTy, clang::DeclContext::isDependentContext(), isDependentScopeSpecifier(), clang::CXXScopeSpec::isEmpty(), clang::CXXScopeSpec::isNotEmpty(), clang::Type::isRecordType(), isTemplateName(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), LookupTagName, clang::OpaquePtr< QualType >::make(), clang::CXXScopeSpec::MakeTrivial(), MarkAnyDeclReferenced(), clang::No, clang::None, clang::LookupResult::NotFound, clang::LookupResult::NotFoundInCurrentInstantiation, clang::SemaBase::PDiag(), clang::TypeLocBuilder::push(), recoverFromTypeInKnownDependentBase(), RequireCompleteDeclContext(), clang::Result, clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::T, clang::Typename, and clang::Yes.
Referenced by ActOnPseudoDestructorExpr(), DiagnoseUnknownTypeName(), findOMPAllocatorHandleT(), findOMPAlloctraitT(), findOMPDependT(), findOMPEventHandleT(), getTypeName(), clang::SemaObjC::handleIBOutletCollection(), and clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec().
const Sema::TypoExprState & Sema::getTypoExprState | ( | TypoExpr * | TE | ) | const |
Definition at line 5738 of file SemaLookup.cpp.
Referenced by ActOnIdExpression().
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 881 of file Sema.cpp.
References clang::VarDecl::DeclarationOnly, clang::Decl::hasAttr(), isExternalWithNoLinkageType(), clang::Decl::isInvalidDecl(), and UndefinedButUsed.
Referenced by checkUndefinedButUsed().
Sema::VariadicCallType Sema::getVariadicCallType | ( | FunctionDecl * | FDecl, |
const FunctionProtoType * | Proto, | ||
Expr * | Fn | ||
) |
Definition at line 5710 of file SemaExpr.cpp.
References clang::ASTContext::BoundMemberTy, Context, clang::FunctionProtoType::isVariadic(), VariadicBlock, VariadicConstructor, VariadicDoesNotApply, VariadicFunction, and VariadicMethod.
Referenced by CheckFunctionCall(), and ConvertArgumentsForCall().
NamedDecl * Sema::HandleDeclarator | ( | Scope * | S, |
Declarator & | D, | ||
MultiTemplateParamsArg | TemplateParameterLists | ||
) |
Get the innermost enclosing declaration scope.
Definition at line 6257 of file SemaDecl.cpp.
References ActOnDecompositionDeclarator(), ActOnFunctionDeclarator(), ActOnTypedefDeclarator(), ActOnVariableDeclarator(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), CheckExtraCXXDefaultArguments(), computeDeclContext(), clang::CPlusPlus, CurContext, D, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), diagnoseQualifiedDeclaration(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), forRedeclarationInCurContext(), clang::Decl::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::DeclContext::getEnclosingNamespaceContext(), clang::Decl::getKind(), getLangOpts(), clang::DeclarationNameInfo::getName(), GetNameForDeclarator(), clang::DeclContext::getRedeclContext(), clang::Decl::getSourceRange(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), hasDefinition(), clang::IK_TemplateId, clang::DeclContext::isDependentContext(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isFunctionType(), clang::DeclContext::isRecord(), clang::Decl::isTemplateParameter(), clang::DeclContext::isTranslationUnit(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), LookupRedeclarationWithLinkage, OpenMP(), Previous, PushOnScopeChains(), RebuildDeclaratorInCurrentInstantiation(), RemoveUsingDecls(), RequireCompleteDeclContext(), clang::DeclSpec::SCS_extern, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, UPPC_DeclarationQualifier, and UPPC_DeclarationType.
Referenced by ActOnCXXMemberDeclarator(), ActOnDeclarator(), ActOnStartOfFunctionDef(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), and ActOnTemplateDeclarator().
void Sema::HandleDelayedAccessCheck | ( | sema::DelayedDiagnostic & | DD, |
Decl * | Ctx | ||
) |
Definition at line 1509 of file SemaAccess.cpp.
References AR_inaccessible, CheckEffectiveAccess(), D, clang::sema::DelayedDiagnostic::getAccessData(), clang::Decl::getDeclContext(), clang::Decl::getLexicalDeclContext(), clang::Decl::isLocalExternDecl(), clang::sema::DelayedDiagnostic::Loc, clang::Target, and clang::sema::DelayedDiagnostic::Triggered.
Referenced by PopParsingDeclaration().
void Sema::handleDelayedAvailabilityCheck | ( | sema::DelayedDiagnostic & | DD, |
Decl * | Ctx | ||
) |
Definition at line 685 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.
Referenced by PopParsingDeclaration().
void Sema::HandleDependentAccessCheck | ( | const DependentDiagnostic & | DD, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 1535 of file SemaAccess.cpp.
References CheckAccess(), Context, FindInstantiatedDecl(), clang::DependentDiagnostic::getAccess(), clang::DependentDiagnostic::getAccessBaseObjectType(), clang::DependentDiagnostic::getAccessLoc(), clang::DependentDiagnostic::getAccessNamingClass(), clang::DependentDiagnostic::getAccessTarget(), clang::DependentDiagnostic::getDiagnostic(), clang::DependentDiagnostic::isAccessToMember(), clang::QualType::isNull(), Loc, clang::DeclAccessPair::make(), and SubstType().
Referenced by PerformDependentDiagnostics().
ExprResult Sema::HandleExprEvaluationContextForTypeof | ( | Expr * | E | ) |
Definition at line 17912 of file SemaExpr.cpp.
References CheckPlaceholderExpr(), E, clang::ExprError(), clang::Expr::getType(), clang::Type::isVariablyModifiedType(), clang::Result, and TransformToPotentiallyEvaluated().
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 18402 of file SemaDecl.cpp.
References clang::LookupResult::Ambiguous, CheckExtraCXXDefaultArguments(), CheckFieldDecl(), Context, clang::CPlusPlus, D, clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), clang::LookupResult::Found, clang::LookupResult::FoundOverloaded, clang::LookupResult::FoundUnresolvedValue, clang::Decl::getBeginLoc(), getLangOpts(), clang::DecompositionDeclarator::getLSquareLoc(), clang::DecompositionDeclarator::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::ASTContext::IntTy, isDeclInScope(), clang::Decl::isInvalidDecl(), clang::Decl::isTemplateParameter(), Loc, LookupMemberName, LookupName(), clang::LookupResult::NotFound, clang::LookupResult::NotFoundInCurrentInstantiation, Previous, PushOnScopeChains(), clang::DeclSpec::SCS_mutable, clang::NamedDecl::setModulePrivate(), clang::T, and UPPC_DataMemberType.
Referenced by ActOnCXXMemberDeclarator(), and ActOnField().
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 3281 of file SemaOverload.cpp.
References clang::Type::castAs(), ft_default, ft_different_class, ft_noexcept, ft_parameter_arity, ft_parameter_mismatch, ft_qualifer_mismatch, ft_return_type, clang::Type::getAs(), clang::Type::getCanonicalTypeUnqualified(), clang::FunctionProtoType::getMethodQuals(), clang::QualType::getNonReferenceType(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::Type::getPointeeType(), clang::FunctionType::getReturnType(), clang::ASTContext::hasSameType(), clang::Type::isInstantiationDependentType(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), clang::Type::isPointerType(), and tryGetFunctionProtoType().
Referenced by clang::InitializationSequence::Diagnose(), DiagnoseAssignmentResult(), getMostSpecialized(), and NoteHiddenVirtualMethods().
void Sema::handleLambdaNumbering | ( | CXXRecordDecl * | Class, |
CXXMethodDecl * | Method, | ||
std::optional< CXXRecordDecl::LambdaNumbering > | NumberingOverride = std::nullopt |
||
) |
Number lambda for linkage purposes if necessary.
Definition at line 458 of file SemaLambda.cpp.
References clang::Class, Context, clang::CXXRecordDecl::LambdaNumbering::ContextDecl, CUDA(), clang::CXXRecordDecl::LambdaNumbering::DeviceManglingNumber, getCurrentMangleNumberContext(), clang::MangleNumberingContext::getDeviceManglingNumber(), clang::ASTContext::getExternalSource(), getLangOpts(), clang::MangleNumberingContext::getManglingNumber(), clang::ASTContext::getManglingNumberContext(), clang::MangleNumberingContext::getNextLambdaIndex(), clang::CXXRecordDecl::LambdaNumbering::HasKnownInternalLinkage, clang::CXXRecordDecl::LambdaNumbering::IndexInContext, clang::CXXRecordDecl::LambdaNumbering::ManglingNumber, and clang::ASTContext::NeedExtraManglingDecl.
Referenced by ActOnStartOfLambdaDefinition().
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 19005 of file SemaDeclCXX.cpp.
References clang::LookupResult::Ambiguous, CheckExtraCXXDefaultArguments(), Context, clang::CPlusPlus, clang::MSPropertyDecl::Create(), D, clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), clang::LookupResult::Found, clang::LookupResult::FoundOverloaded, clang::LookupResult::FoundUnresolvedValue, clang::Decl::getBeginLoc(), getLangOpts(), clang::ParsedAttr::getPropertyDataGetter(), clang::ParsedAttr::getPropertyDataSetter(), clang::DeclSpec::getSpecifierName(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::ASTContext::IntTy, isDeclInScope(), clang::Decl::isInvalidDecl(), clang::Decl::isTemplateParameter(), Loc, LookupMemberName, LookupName(), clang::LookupResult::NotFound, clang::LookupResult::NotFoundInCurrentInstantiation, Previous, ProcessDeclAttributes(), PushOnScopeChains(), clang::Decl::setAccess(), clang::NamedDecl::setModulePrivate(), clang::T, TUScope, and UPPC_DataMemberType.
Referenced by ActOnCXXMemberDeclarator().
Definition at line 672 of file SemaExceptionSpec.cpp.
References AR_accessible, AR_delayed, AR_dependent, AR_inaccessible, CheckBaseClassAccess(), clang::Qualifiers::compatiblyIncludes(), Context, clang::Type::getAs(), getASTContext(), clang::ASTContext::getCanonicalType(), clang::Type::getPointeeType(), clang::ReferenceType::getPointeeType(), clang::ASTContext::getUnqualifiedArrayType(), clang::ASTContext::hasSameUnqualifiedType(), clang::QualType::isConstQualified(), IsDerivedFrom(), IsFunctionConversion(), clang::Type::isMemberPointerType(), clang::Type::isNullPtrType(), clang::Type::isObjectType(), clang::Type::isPointerType(), IsQualificationConversion(), clang::Type::isRecordType(), clang::Type::isVoidType(), clang::QualType::isVolatileQualified(), and clang::Result.
Referenced by CheckExceptionSpecSubset(), and throwEscapes().
Definition at line 4844 of file SemaDecl.cpp.
References Context, getCurrentMangleNumberContext(), clang::ASTContext::getLangOpts(), getLangOpts(), clang::MangleNumberingContext::getManglingNumber(), clang::ASTContext::getManglingNumberContext(), getMSManglingNumber(), and clang::ASTContext::setManglingNumber().
Referenced by ActOnAliasDeclaration(), FinalizeDeclaratorGroup(), and ParsedFreeStandingDeclSpec().
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 1683 of file SemaLookup.cpp.
Referenced by hasReachableDefaultArgument(), and hasVisibleDefaultArgument().
|
inline |
Definition at line 15032 of file Sema.h.
References D, hasAcceptableDefinition(), and Kind.
bool Sema::hasAcceptableDefinition | ( | NamedDecl * | D, |
NamedDecl ** | Suggested, | ||
AcceptableKind | Kind, | ||
bool | OnlyNeedComplete = false |
||
) |
Definition at line 9148 of file SemaType.cpp.
References CodeSynthesisContexts, Context, D, clang::ASTContext::getExternalSource(), getLangOpts(), hasMergedDefinitionInCurrentModule(), hasVisibleMergedDefinition(), isAcceptable(), clang::Decl::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 158 of file SemaTemplate.cpp.
References clang::LookupResult::begin(), clang::LookupResult::end(), and getAsTemplateNameDecl().
Referenced by ClassifyName().
bool Sema::hasAnyUnrecoverableErrorsInThisFunction | ( | ) | const |
Determine whether any errors occurred within this function/method/ block.
Definition at line 2337 of file Sema.cpp.
Referenced by ActOnBlockStmtExpr(), ActOnFinishFunctionBody(), and BuildStmtExpr().
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 7087 of file SemaChecking.cpp.
References E, and clang::Expr::getType().
Referenced by checkVariadicArgument().
Definition at line 8166 of file SemaType.cpp.
References clang::Type::getAs(), clang::AttributedType::getModifiedType(), clang::AttributedType::isCallingConv(), and clang::T.
Referenced by adjustMemberFunctionCC(), CheckMemberSpecialization(), and CheckMSVCRTEntryPoint().
Definition at line 1650 of file SemaLookup.cpp.
References Context, and clang::ASTContext::getModulesWithMergedDefinition().
Referenced by hasAcceptableDefinition().
|
inline |
Determine whether any declaration of an entity is reachable.
Definition at line 9309 of file Sema.h.
References D, hasReachableDeclarationSlow(), and isReachable().
bool Sema::hasReachableDeclarationSlow | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules = nullptr |
||
) |
Definition at line 2072 of file SemaLookup.cpp.
References D, hasAcceptableDeclarationImpl(), isReachable(), 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 1702 of file SemaLookup.cpp.
References D, hasAcceptableDefaultArgument(), and Reachable.
Referenced by diagnoseMissingArgument(), and SubstDefaultTemplateArgumentIfAvailable().
Definition at line 15024 of file Sema.h.
References D, and 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 9258 of file SemaType.cpp.
References D, hasAcceptableDefinition(), and Reachable.
Referenced by CheckConceptRedefinition(), computeDeclContext(), DiagnoseUninstantiableTemplate(), 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 1763 of file SemaLookup.cpp.
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 1797 of file SemaLookup.cpp.
References D, hasAcceptableMemberSpecialization(), and Reachable.
Determine if D
and Suggested
have a structurally compatible layout as described in C11 6.2.7/1.
Definition at line 9133 of file SemaType.cpp.
References D, clang::Default, clang::Decl::getASTContext(), and clang::StructuralEquivalenceContext::IsEquivalent().
Referenced by ActOnDuplicateDefinition().
bool Sema::hasUncompilableErrorOccurred | ( | ) | const |
Whether uncompilable error has occurred.
This includes error happens in deferred diagnostics.
Definition at line 1686 of file Sema.cpp.
References CurContext, DeviceDeferredDiags, getDiagnostics(), hasUncompilableErrorOccurred(), clang::DiagnosticIDs::isDefaultMappingAsError(), and Loc.
Referenced by ActOnFinishFunctionBody(), FindInstantiatedDecl(), hasUncompilableErrorOccurred(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), maybeAddDeclWithEffects(), and performFunctionEffectAnalysis().
|
inline |
Determine whether any declaration of an entity is visible.
Definition at line 9300 of file Sema.h.
References D, hasVisibleDeclarationSlow(), and isVisible().
bool Sema::hasVisibleDeclarationSlow | ( | const NamedDecl * | D, |
llvm::SmallVectorImpl< Module * > * | Modules | ||
) |
Definition at line 2064 of file SemaLookup.cpp.
References D, hasAcceptableDeclarationImpl(), isVisible(), 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 1696 of file SemaLookup.cpp.
References D, hasAcceptableDefaultArgument(), and Visible.
Referenced by CheckDeductionGuideTemplate(), CheckTemplateParameterList(), and isPreferredLookupResult().
Definition at line 15015 of file Sema.h.
References D, and 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 9241 of file SemaType.cpp.
References D, hasAcceptableDefinition(), and Visible.
Referenced by ActOnClassTemplateSpecialization(), clang::SemaObjC::ActOnStartClassInterface(), clang::SemaObjC::ActOnStartProtocolInterface(), ActOnTag(), CheckClassTemplate(), CheckForFunctionRedefinition(), checkVarDeclRedefinition(), hasVisibleDefinition(), MergeTypedefNameDecl(), and shouldSkipAnonEnumBody().
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 1757 of file SemaLookup.cpp.
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 1791 of file SemaLookup.cpp.
References D, hasAcceptableMemberSpecialization(), and Visible.
Definition at line 1643 of file SemaLookup.cpp.
References Context, clang::ASTContext::getModulesWithMergedDefinition(), and isModuleVisible().
Referenced by hasAcceptableDefinition().
|
inline |
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 12598 of file SemaDeclCXX.cpp.
References clang::DeclarationName::CXXConversionFunctionName, clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::UsingShadowDecl::getIntroducer(), clang::DeclarationName::getNameKind(), IdResolver, clang::DeclContext::removeDecl(), clang::IdentifierResolver::RemoveDecl(), and clang::BaseUsingDecl::removeShadowDecl().
|
inline |
Definition at line 1076 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnFunctionDeclarator(), ActOnNumericConstant(), ActOnStartExportDecl(), ActOnVariableDeclarator(), BuildImplicitMemberExpr(), BuildMemberPointerType(), BuildPointerType(), BuildReferenceType(), CheckBaseSpecifier(), CheckFunctionReturnType(), CheckImplicitConversion(), CheckVectorLogicalOperands(), CheckVectorOperands(), ConvertDeclSpecToType(), CreateBuiltinUnaryOp(), GatherArgumentsForCall(), GetFullTypeForDeclarator(), instantiateDependentHLSLParamModifierAttr(), isValidVarArgType(), mergeDeclAttribute(), MergeFunctionDecl(), PerformImplicitConversion(), and ProcessDeclAttribute().
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 8578 of file SemaExprCXX.cpp.
References CheckPlaceholderExpr(), CheckUnusedVolatileAssignment(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus17, DefaultFunctionArrayConversion(), DefaultFunctionArrayLvalueConversion(), DefaultLvalueConversion(), E, 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(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), BuildMemberReferenceExpr(), BuildReturnStmt(), and CheckCommaOperands().
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 692 of file Sema.cpp.
References Context, clang::CPlusPlus, clang::CPlusPlus11, clang::ImplicitCastExpr::Create(), CreateMaterializeTemporaryExpr(), CurFPFeatureOverrides(), clang::SemaBase::Diag(), diagnoseFunctionEffectConversion(), diagnoseNullableToNonnullConversion(), diagnoseZeroToNullptrConversion(), E, 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::ASTContext::hasAnyFunctionEffects(), isCast(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isPRValue(), clang::SC_Register, and clang::VK_PRValue.
Referenced by ActOnBlockStmtExpr(), ActOnCaseExpr(), ActOnCXXDelete(), ActOnGCCAsmStmt(), ActOnNumericConstant(), clang::SemaObjC::ActOnObjCBoolLiteral(), BuildCallExpr(), BuildCXXTypeId(), BuildExpressionFromDeclTemplateArgument(), BuildImplicitBaseInitializer(), clang::SemaObjC::BuildInstanceMessage(), BuildResolvedCallExpr(), BuildReturnStmt(), BuildVectorLiteral(), clang::SemaARM::BuiltinARMMemoryTaggingCall(), BuiltinCallWithStaticChain(), CallExprUnaryConversions(), castElement(), castVector(), checkArithmeticOrEnumeralThreeWayCompare(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), CheckAssignmentConstraints(), CheckCompareOperands(), checkConditionalBlockPointerCompatibility(), checkConditionalNullPointer(), checkConditionalObjectPointersCompatibility(), CheckConditionalOperands(), checkConditionalPointerCompatibility(), CheckEnumConstant(), checkMemberDecomposition(), CheckPlaceholderExpr(), checkPointerIntegerMismatch(), CheckPointerToMemberOperands(), CheckSingleAssignmentConstraints(), CheckSizelessVectorConditionalTypes(), checkSizelessVectorShift(), CheckTemplateArgument(), CheckTemplateArgumentPointerToMember(), CheckTransparentUnionArgumentConstraints(), CheckVectorConditionalTypes(), CheckVectorOperands(), checkVectorShift(), ConstantFoldAttrArgs(), convertVector(), CreateBuiltinArraySubscriptExpr(), CreateBuiltinUnaryOp(), CreateFunctionRefExpr(), CXXCheckConditionalOperands(), DeduceNullPtrTemplateArgument(), DefaultArgumentPromotion(), DefaultFunctionArrayConversion(), clang::SemaObjC::FindCompositeObjCPointerType(), FindCompositePointerType(), handleComplexFloatConversion(), handleComplexIntConversion(), handleComplexIntegerToFloatConversion(), handleFloatConversion(), handleIntToFloatConversion(), clang::SemaHLSL::handleVectorBinOpConversion(), IgnoredValueConversions(), LookupMemberExpr(), OpenCLConvertScalarsToVectors(), clang::InitializationSequence::Perform(), PerformImplicitConversion(), PerformObjectMemberConversion(), PerformQualificationConversion(), PrepareScalarCast(), prepareVectorSplat(), rebuildPotentialResultsAsNonOdrUsed(), clang::TreeTransform< Derived >::RebuildShuffleVectorExpr(), ShouldTryAgainWithRedefinitionType(), tryGCCVectorConvertAndSplat(), tryVectorConvertAndSplat(), UsualArithmeticConversions(), and UsualUnaryConversions().
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 16425 of file SemaDecl.cpp.
References ActOnDeclarator(), AddKnownFunctionAttributes(), clang::Block, clang::C99, Context, CorrectTypo(), CTK_NonError, D, clang::SemaBase::Diag(), Diagnose, diagnoseTypo(), Diags, clang::DiagnosticsEngine::Error, clang::EST_None, findLocallyScopedExternCDecl(), clang::DeclSpec::getAttributes(), clang::TypoCorrection::getCorrectionDecl(), clang::DiagnosticsEngine::getDiagnosticLevel(), clang::Scope::getEntity(), clang::DeclaratorChunk::getFunction(), clang::ASTContext::getFunctionNoProtoType(), getLangOpts(), clang::Decl::getLocation(), clang::IdentifierInfo::getName(), clang::Scope::getParent(), clang::ASTContext::getPrintingPolicy(), clang::LangOptions::implicitFunctionsAllowed(), clang::ASTContext::IntTy, clang::Scope::isCompoundStmtScope(), clang::DeclContext::isFunctionOrMethod(), clang::Decl::isImplicit(), clang::DeclContext::isTranslationUnit(), LangOpts, Loc, LookupOrdinaryName, clang::ParsedAttributesView::none(), clang::SemaBase::PDiag(), PushOnScopeChains(), clang::Decl::setImplicit(), clang::DeclSpec::SetTypeSpecType(), clang::DeclSpec::TST_int, and clang::ASTContext::typesAreCompatible().
Referenced by ActOnIdExpression(), and ClassifyName().
|
inline |
Definition at line 874 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().
Referenced by ActOnClassTemplateSpecialization(), ActOnTag(), and CheckClassTemplate().
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 ActOnTypedefNameDecl(), 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::inferLifetimeBoundAttribute | ( | FunctionDecl * | FD | ) |
Add [[clang:::lifetimebound]] attr for std:: functions and methods.
Definition at line 219 of file SemaAttr.cpp.
References Context, clang::FunctionDecl::getBuiltinID(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), and P.
Referenced by AddKnownFunctionAttributes().
void Sema::inferLifetimeCaptureByAttribute | ( | FunctionDecl * | FD | ) |
Add [[clang:::lifetime_capture_by(this)]] to STL container methods.
Definition at line 272 of file SemaAttr.cpp.
References Context, and clang::sema::isGLSPointerType().
Referenced by AddKnownFunctionAttributes(), and CheckFunctionDeclaration().
void Sema::inferNullableClassAttribute | ( | CXXRecordDecl * | CRD | ) |
Add _Nullable attributes for std:: types.
Definition at line 317 of file SemaAttr.cpp.
References Context, clang::NamedDecl::getName(), clang::Decl::hasAttr(), clang::Decl::isInStdNamespace(), clang::Nullable, and clang::Redeclarable< decl_type >::redecls().
Referenced by ActOnTag(), and CheckClassTemplate().
void Sema::Initialize | ( | ) |
Perform initialization that occurs after the parser has been initialized but before it parses anything.
Definition at line 311 of file Sema.cpp.
References addImplicitTypedef(), clang::OpenCLOptions::addSupport(), clang::IdentifierResolver::begin(), clang::ASTContext::buildImplicitRecord(), clang::Class, Consumer, Context, 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, clang::ASTContext::OCLClkEventTy, clang::ASTContext::OCLEventTy, clang::ASTContext::OCLQueueTy, clang::ASTContext::OCLReserveIDTy, clang::ASTContext::OCLSamplerTy, 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 6491 of file SemaOverload.cpp.
References Context, GetExplicitObjectExpr(), clang::Expr::getExprLoc(), clang::FunctionDecl::getParamDecl(), clang::InitializedEntity::InitializeParameter(), and PerformCopyInitialization().
|
inline |
Definition at line 7801 of file Sema.h.
References ExprEvalContexts, and PotentiallyEvaluated.
Referenced by EvaluateAndDiagnoseImmediateInvocation(), and HandleImmediateInvocations().
void Sema::InstantiateAttrs | ( | const MultiLevelTemplateArgumentList & | TemplateArgs, |
const Decl * | Pattern, | ||
Decl * | Inst, | ||
LateInstantiatedAttrVec * | LateAttrs = nullptr , |
||
LocalInstantiationScope * | OuterMostScope = nullptr |
||
) |
Definition at line 744 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::addAttr(), clang::SemaSwift::AddParameterABIAttr(), clang::SemaObjC::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(), instantiateOMPDeclareSimdDeclAttr(), instantiateOMPDeclareVariantAttr(), clang::sema::instantiateTemplateAttribute(), isRelevantAttr(), ObjC(), and Swift().
Referenced by BuildVariableInstantiation(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), InstantiateClass(), 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 704 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::addAttr(), clang::Decl::attrs(), Context, clang::sema::instantiateTemplateAttributeForDecl(), and isRelevantAttr().
Referenced by CheckTemplateIdType().
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 3632 of file SemaTemplateInstantiate.cpp.
References ActOnFields(), ActOnFinishCXXNonNestedClass(), ActOnFinishDelayedMemberInitializers(), CheckCompletedCXXClass(), Consumer, Context, CurrentInstantiationScope, clang::DeclContext::decls(), clang::TemplateDeclInstantiator::delayed_partial_spec_begin(), clang::TemplateDeclInstantiator::delayed_partial_spec_end(), clang::TemplateDeclInstantiator::delayed_var_partial_spec_begin(), clang::TemplateDeclInstantiator::delayed_var_partial_spec_end(), clang::LocalInstantiationScope::deleteScopes(), DiagnoseUninstantiableTemplate(), clang::TemplateDeclInstantiator::disableLateAttributeInstantiation(), E, clang::TemplateDeclInstantiator::enableLateAttributeInstantiation(), clang::Enum, clang::TagDecl::getBraceRange(), clang::CXXRecordDecl::getDefinition(), clang::SourceManager::getExpansionLineNumber(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getFilename(), clang::Decl::getFriendObjectKind(), clang::TagDecl::getInnerLocStart(), clang::CXXRecordDecl::getInstantiatedFromMemberClass(), clang::Decl::getLocation(), clang::CXXRecordDecl::getMemberSpecializationInfo(), clang::NamedDecl::getNameForDiagnostic(), clang::CXXRecordDecl::getNumBases(), getPrintingPolicy(), clang::TemplateDeclInstantiator::getStartingScope(), clang::TagDecl::getTagKind(), clang::ASTConsumer::HandleTagDeclDefinition(), InstantiateAttrs(), clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), clang::sema::instantiateTemplateAttribute(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::FunctionDecl::isConstexpr(), clang::Decl::isDefinedOutsideFunctionOrMethod(), clang::DeclContext::isDependentContext(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::FunctionDecl::isVirtualAsWritten(), Loc, MarkVirtualMembersReferenced(), MarkVTableUsed(), clang::Member, OS, P, PerformDependentDiagnostics(), clang::Sema::ContextRAII::pop(), PotentiallyEvaluated, clang::TagDecl::setBraceRange(), clang::TemplateDeclInstantiator::setEvaluateConstraints(), clang::Decl::setInvalidDecl(), clang::Decl::setLocation(), clang::TypeDecl::setLocStart(), clang::MemberSpecializationInfo::setPointOfInstantiation(), clang::TagDecl::setTagKind(), clang::CXXRecordDecl::setTemplateSpecializationKind(), clang::MemberSpecializationInfo::setTemplateSpecializationKind(), clang::Decl::setVisibleDespiteOwningModule(), SourceMgr, clang::TagDecl::startDefinition(), SubstBaseSpecifiers(), clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ImplicitInstantiation, and clang::declvisitor::Base< Ptr, ImplClass, RetTy >::Visit().
Referenced by ActOnExplicitInstantiation(), 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 4225 of file SemaTemplateInstantiate.cpp.
References CheckFunctionConstraints(), CheckSpecializationInstantiationRedecl(), Consumer, Context, D, clang::DeclContext::decls(), clang::Enum, 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(), InstantiateClassMembers(), 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 ActOnExplicitInstantiation(), InstantiateClassMembers(), and InstantiateClassTemplateSpecializationMembers().
bool Sema::InstantiateClassTemplateSpecialization | ( | SourceLocation | PointOfInstantiation, |
ClassTemplateSpecializationDecl * | ClassTemplateSpec, | ||
TemplateSpecializationKind | TSK, | ||
bool | Complain = true |
||
) |
Definition at line 4203 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().
Referenced by ActOnExplicitInstantiation().
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 4450 of file SemaTemplateInstantiate.cpp.
References getTemplateInstantiationArgs(), and InstantiateClassMembers().
Referenced by ActOnExplicitInstantiation().
bool Sema::InstantiateDefaultArgument | ( | SourceLocation | CallLoc, |
FunctionDecl * | FD, | ||
ParmVarDecl * | Param | ||
) |
Definition at line 4715 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::FOK_None, getASTMutationListener(), clang::Decl::getFriendObjectKind(), clang::Decl::getLexicalDeclContext(), getTemplateInstantiationArgs(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), and SubstDefaultArgument().
Referenced by BuildCXXDefaultArgExpr(), and CheckCXXDefaultArgExpr().
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 914 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().
Referenced by ActOnStartOfFunctionDef(), InstantiateFunctionDefinition(), and ReferenceDllExportedMembers().
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 3881 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 4763 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 573 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(), clang::Result, SubstExpr(), tryResolveExplicitSpecifier(), and Unevaluated.
Referenced by instantiateExplicitSpecifierDeferred(), 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 4950 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(), DefineImplicitLambdaToFunctionPointerConversion(), and instantiateOMPDeclareVariantAttr().
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 4967 of file SemaTemplateInstantiateDecl.cpp.
References ActOnFinishFunctionBody(), ActOnSkippedFunctionBody(), ActOnStartOfFunctionDef(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), Consumer, Context, clang::CopyAssignment, clang::CopyConstructor, clang::CPlusPlus11, CurFPFeatures, D, clang::SemaBase::Diag(), DiagnoseUninstantiableTemplate(), FpPragmaStack, clang::Function, clang::ActionResult< PtrTy, Compress >::get(), getASTMutationListener(), clang::DeclaratorDecl::getBeginLoc(), clang::FunctionDecl::getBody(), clang::Type::getContainedAutoType(), clang::TargetInfo::getCXXABI(), clang::Decl::getDeclContext(), getDefaultedFunctionKind(), clang::FunctionDecl::getDefinition(), getDiagnostics(), clang::Decl::getEndLoc(), clang::SourceManager::getExpansionLineNumber(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getFilename(), clang::DeclarationNameInfo::getInfo(), clang::DeclaratorDecl::getInnerLocStart(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNameInfo(), clang::TypeSpecTypeLoc::getNameLoc(), clang::DeclContext::getParent(), clang::Decl::getPreviousDecl(), getPrintingPolicy(), clang::FunctionDecl::getReturnType(), getSourceManager(), clang::ASTContext::getTargetInfo(), getTemplateInstantiationArgs(), clang::TypeSourceInfo::getType(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::ASTConsumer::HandleTopLevelDecl(), clang::DiagnosticsEngine::hasErrorOccurred(), clang::FunctionDecl::hasSkippedBody(), InstantiateDefaultCtorDefaultArgs(), InstantiateMemInitializers(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::FunctionDecl::isDefaulted(), clang::Decl::isFromASTFile(), clang::FunctionDecl::isInlined(), clang::SourceManager::isInSystemHeader(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::FunctionDecl::isLateTemplateParsed(), clang::TargetCXXABI::isMicrosoft(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isThisDeclarationInstantiatedFromAFriendDefinition(), LateParsedInstantiations, LateParsedTemplateMap, LateTemplateParser, Loc, clang::MoveAssignment, clang::MoveConstructor, OpaqueParser, OS, PendingInstantiations, clang::Sema::LocalEagerInstantiationScope::perform(), PerformDependentDiagnostics(), clang::Sema::ContextRAII::pop(), PotentiallyEvaluated, clang::TypeLocBuilder::push(), SetDeclDefaulted(), clang::TypeSpecTypeLoc::setNameLoc(), clang::ValueDecl::setType(), clang::DeclaratorDecl::setTypeSourceInfo(), SourceMgr, SubstQualifier(), SubstStmt(), clang::T, clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, updateAttrsForLateParsedTemplate(), and clang::FunctionDecl::willHaveBody().
Referenced by ActOnExplicitInstantiation(), CheckIfFunctionSpecializationIsImmediate(), CheckPlaceholderExpr(), DeduceReturnType(), InstantiateClassMembers(), instantiateOMPDeclareVariantAttr(), clang::SemaCUDA::isEmptyConstructor(), clang::SemaCUDA::isEmptyDestructor(), MarkFunctionReferenced(), and PerformPendingInstantiations().
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 3931 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::Init, clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::Sema::InstantiatingTemplate::isInvalid(), PotentiallyEvaluated, clang::Decl::setInvalidDecl(), and SubstInitializer().
Referenced by BuildCXXDefaultInitExpr(), and InstantiateClassMembers().
void Sema::InstantiateMemInitializers | ( | CXXConstructorDecl * | New, |
const CXXConstructorDecl * | Tmpl, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 5807 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::Init, clang::CXXConstructorDecl::inits(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::Member, clang::Decl::setInvalidDecl(), SubstInitializer(), and SubstType().
Referenced by InstantiateFunctionDefinition().
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 5590 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(), 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::ASTConsumer::HandleCXXStaticMemberVarInstantiation(), clang::VarDecl::hasInit(), InstantiateVariableInitializer(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), 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::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 ActOnExplicitInstantiation(), completeExprArrayBound(), DoMarkVarDeclReferenced(), InstantiateClassMembers(), and PerformPendingInstantiations().
void Sema::InstantiateVariableInitializer | ( | VarDecl * | Var, |
VarDecl * | OldVar, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Instantiate the initializer of a variable.
Definition at line 5518 of file SemaTemplateInstantiateDecl.cpp.
References ActOnUninitializedDecl(), AddInitializerToDecl(), clang::VarDecl::CallInit, clang::SemaCUDA::checkAllowedInitializer(), CUDA(), currentEvaluationContext(), 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::Init, clang::Sema::ExpressionEvaluationContextRecord::InLifetimeExtendingContext, clang::Expr::isConstantInitializer(), clang::VarDecl::isCXXForRangeDecl(), clang::VarDecl::isDirectInit(), clang::VarDecl::isInline(), clang::VarDecl::isInlineSpecified(), clang::VarDecl::isObjCForDecl(), clang::VarDecl::isOutOfLine(), clang::VarDecl::isStaticDataMember(), parentEvaluationContext(), PotentiallyEvaluated, clang::Sema::ExpressionEvaluationContextRecord::RebuildDefaultArgOrDefaultInit, 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 13490 of file Sema.h.
References CodeSynthesisContexts, and NonInstantiationEntries.
Referenced by ActOnFields(), clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(), clang::SemaObjC::ActOnObjCForCollectionStmt(), ActOnStartOfFunctionDef(), AddImplicitlyDeclaredMembersToClass(), BuildBinOp(), BuildCXXNoexceptExpr(), BuildCXXTypeId(), BuiltinSEHScopeCheck(), CheckCompleteVariableDeclaration(), CheckExplicitlyDefaultedComparison(), CheckExplicitlyDefaultedSpecialMember(), CheckFunctionDeclaration(), CheckIdentityFieldAssignment(), checkLiteralOperatorTemplateParameterList(), CheckLogicalOperands(), CheckMoveOnConstruction(), CheckTautologicalComparison(), CheckUnaryExprOrTypeTraitOperand(), CreateGenericSelectionExpr(), DeclareImplicitCopyConstructor(), deduceVarTypeFromInitializer(), DiagnoseAlwaysNonNullPointer(), diagnoseAndRemoveTypeQualifiers(), DiagnoseCommaOperator(), DiagnoseFloatingImpCast(), DiagnoseForRangeVariableCopies(), DiagnoseSelfAssignment(), DiagnoseSelfMove(), diagnoseTautologicalComparison(), DiagnoseTwoPhaseLookup(), DiagnoseUnusedParameters(), FinalizeDeclaration(), getCurrentMangleNumberContext(), getCurrentThisType(), HandleImmediateInvocations(), handleNonNullAttr(), isAcceptableTagRedeclaration(), makeUnavailableInSystemHeader(), MergeFunctionDecl(), warnAboutRedundantParens(), and warnBracedScalarInit().
QualType Sema::InvalidLogicalVectorOperands | ( | SourceLocation | Loc, |
ExprResult & | LHS, | ||
ExprResult & | RHS | ||
) |
Diagnose cases where a scalar was implicitly converted to a vector and diagnose the underlying types.
Otherwise, diagnose the error as invalid vector logical operands for non-C++ cases.
Definition at line 9857 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreImpCasts(), clang::Type::isVectorType(), Loc, and clang::Vector.
Referenced by CheckVectorLogicalOperands().
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 9833 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), and Loc.
Referenced by CheckAdditionOperands(), checkArithmeticOrEnumeralCompare(), checkArithmeticOrEnumeralThreeWayCompare(), CheckBitwiseOperands(), CheckCompareOperands(), CheckLogicalOperands(), CheckMatrixElementwiseOperands(), CheckMatrixMultiplyOperands(), CheckMultiplyDivideOperands(), CheckRemainderOperands(), CheckShiftOperands(), CheckSubtractionOperands(), CheckVectorLogicalOperands(), CheckVectorOperands(), convertPointersToCompositeType(), and CreateBuiltinBinOp().
IdentifierInfo * Sema::InventAbbreviatedTemplateParameterTypeName | ( | const IdentifierInfo * | ParamName, |
unsigned | Index | ||
) |
Invent a new identifier for parameters of abbreviated templates.
Definition at line 116 of file Sema.cpp.
References Context, clang::IdentifierTable::get(), clang::IdentifierInfo::getName(), clang::ASTContext::Idents, and OS.
Referenced by InventTemplateParameter().
bool Sema::isAbstractType | ( | SourceLocation | Loc, |
QualType | T | ||
) |
Definition at line 5853 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 15003 of file Sema.h.
References D, isReachable(), isVisible(), Kind, and Visible.
Referenced by hasAcceptableDeclarationImpl(), hasAcceptableDefaultArgument(), and 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 318 of file SemaCXXScopeSpec.cpp.
References Context, clang::ASTContext::getLangOpts(), clang::ASTContext::getTypeDeclType(), clang::NamedDecl::getUnderlyingDecl(), clang::Type::isDependentType(), and clang::T.
Referenced by BuildCXXNestedNameSpecifier(), and FindFirstQualifierInScope().
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 16961 of file SemaDecl.cpp.
References clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), getDiagnostics(), clang::Decl::getLocation(), getRedeclDiagFromTagKind(), clang::TagDecl::getTagKind(), clang::TypeWithKeyword::getTagTypeKindName(), inTemplateInstantiation(), isClassCompatTagKind(), clang::DiagnosticsEngine::isIgnored(), isTemplate(), Loc, clang::NewTag, and Previous.
Referenced by ActOnClassTemplateSpecialization(), ActOnExplicitInstantiation(), ActOnTag(), ActOnTagTemplateIdType(), CheckClassTemplate(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
|
inline |
Definition at line 7769 of file Sema.h.
References currentEvaluationContext(), clang::Sema::ExpressionEvaluationContextRecord::InConditionallyConstantEvaluateContext, clang::Sema::ExpressionEvaluationContextRecord::isConstantEvaluated(), and isConstantEvaluatedOverride.
Referenced by CheckForImmediateInvocation().
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 1768 of file SemaConcept.cpp.
References CalculateTemplateDepthForConstraints(), Context, clang::FunctionDecl::getTemplatedKind(), clang::Result, clang::AtomicConstraint::subsumes(), clang::subsumes(), clang::FunctionDecl::TK_FunctionTemplate, and clang::FunctionDecl::TK_NonTemplate.
Referenced by CheckTemplateTemplateArgument(), getMoreConstrainedFunction(), getMoreSpecialized(), getMoreSpecializedTemplate(), and SetEligibleMethods().
|
inline |
Definition at line 6469 of file Sema.h.
References clang::Sema::ExpressionEvaluationContextRecord::EK_AttrArgument, and ExprEvalContexts.
Referenced by ActOnIdExpression(), and BuildDeclarationNameExpr().
bool Sema::IsBlockPointerConversion | ( | QualType | FromType, |
QualType | ToType, | ||
QualType & | ConvertedType | ||
) |
Definition at line 3166 of file SemaOverload.cpp.
References clang::Type::getAs(), clang::FunctionType::getExtInfo(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::Type::getPointeeType(), clang::FunctionType::getReturnType(), clang::QualType::getUnqualifiedType(), clang::QualType::hasQualifiers(), clang::ASTContext::hasSameType(), clang::Type::isRecordType(), clang::FunctionProtoType::isVariadic(), and clang::ASTContext::mergeExtParameterInfo().
Referenced by IsStandardConversion().
|
inlinestatic |
Definition at line 2084 of file Sema.h.
References clang::CStyleCast, clang::FunctionalCast, and clang::OtherCast.
Referenced by clang::SemaObjC::CheckObjCConversion(), diagnoseObjCARCConversion(), ImpCastExprToType(), and PerformImplicitConversion().
|
inline |
Definition at line 7793 of file Sema.h.
References clang::Sema::ExpressionEvaluationContextRecord::Context, currentEvaluationContext(), clang::Sema::ExpressionEvaluationContextRecord::IsCurrentlyCheckingDefaultArgumentOrInitializer, and PotentiallyEvaluatedIfUsed.
Referenced by BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), CheckForImmediateInvocation(), and MarkDeclRefReferenced().
|
inline |
Definition at line 14945 of file Sema.h.
References Kind, Loc, and clang::T.
Referenced by ActOnCXXDelete(), BuildArrayType(), buildDeclareReductionRef(), CheckAddressOfOperand(), clang::SemaObjC::CheckObjCForCollectionOperand(), checkTupleLikeDecomposition(), DeclareAggregateDeductionGuideFromInitList(), DeclareImplicitDeductionGuides(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecializationFromInitializer(), DefaultLvalueConversion(), IsDerivedFrom(), isNullPointerValueTemplateArgument(), IsUserDefinedConversion(), lookupStdTypeTraitMember(), PerformImplicitConversion(), clang::SemaCodeCompletion::ProduceCallSignatureHelp(), clang::SemaCodeCompletion::ProduceConstructorSignatureHelp(), RequireLiteralType(), ResolveConstructorOverload(), TryConstructorInitialization(), TryInitializerListConstruction(), TryListConversion(), TryListInitialization(), TryReferenceInit(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
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 2769 of file SemaOverload.cpp.
References clang::Type::getAs(), and clang::ComplexType::getElementType().
Referenced by IsStandardConversion().
|
inline |
Definition at line 2151 of file Sema.h.
References currentEvaluationContext(), clang::Sema::ExpressionEvaluationContextRecord::isConstantEvaluated(), and isConstantEvaluatedOverride.
Referenced by AnalyzeComparison(), BuiltinConstantArgRange(), clang::SemaARM::CheckARMCoprocessorImmediate(), checkFormatStringExpr(), CheckImplicitConversion(), CheckNonNullArguments(), CheckTautologicalComparison(), and MarkDeclRefReferenced().
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 2597 of file SemaDeclCXX.cpp.
References getCurrentClass(), and clang::NamedDecl::getIdentifier().
Referenced by ClassifyName(), and 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 2603 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 2759 of file Sema.cpp.
References computeDeclContext(), D, forRedeclarationInCurContext(), clang::Decl::getBeginLoc(), LookupOrdinaryName, LookupQualifiedName(), and clang::Result.
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 1561 of file SemaDecl.cpp.
References D, IdResolver, and clang::IdentifierResolver::isDeclInScope().
Referenced by ActOnDecompositionDeclarator(), ActOnEnumConstant(), ActOnExceptionDeclarator(), clang::SemaObjC::ActOnIvar(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), ActOnTag(), ActOnVariableDeclarator(), CheckAnonMemberRedeclaration(), CheckClassTemplate(), FilterLookupForScope(), FilterUsingLookup(), HandleField(), HandleMSProperty(), and MergeCXXFunctionDecl().
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 318 of file SemaTemplate.cpp.
References Context, clang::LookupResult::empty(), clang::LookupResult::getAsSingle(), clang::getAsTypeTemplateDecl(), clang::ASTContext::getQualifiedTemplateName(), clang::CXXScopeSpec::getScopeRep(), clang::LookupResult::isAmbiguous(), LookupOrdinaryName, LookupTemplateName(), clang::OpaquePtr< TemplateName >::make(), and clang::LookupResult::suppressDiagnostics().
Referenced by clang::Parser::ParseUnqualifiedId().
bool Sema::isDependentScopeSpecifier | ( | const CXXScopeSpec & | SS | ) |
Definition at line 165 of file SemaCXXScopeSpec.cpp.
References clang::CXXScopeSpec::getScopeRep(), clang::NestedNameSpecifier::isDependent(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isSet().
Referenced by ActOnDependentMemberExpr(), ActOnTemplateIdType(), ActOnUsingEnumDeclaration(), BuildCXXNestedNameSpecifier(), BuildMemberReferenceExpr(), BuildMemInitializer(), DiagnoseUnknownTemplateName(), DiagnoseUnknownTypeName(), getDestructorName(), GetFullTypeForDeclarator(), getTypeName(), LookupParsedName(), and LookupTemplateName().
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 2938 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(), BuildBuiltinOffsetOf(), buildDeclareReductionRef(), buildUserDefinedMapperRef(), CheckDerivedToBaseConversion(), CheckOriginalCallArgDeduction(), CheckOverridingFunctionReturnType(), CheckPointerToMemberOperands(), CompareDerivedToBaseConversions(), CompareStandardConversionSequences(), clang::ConversionFixItGenerator::compareTypesSimple(), DiagnoseBadConversion(), DiagnoseInvalidExplicitObjectParameterInLambda(), FindBaseInitializer(), FindCompositePointerType(), handlerCanCatch(), hasUserDefinedMapper(), clang::InitializationSequence::InitializeFrom(), IsPointerInterconvertibleBaseOf(), IsUserDefinedConversion(), PerformObjectMemberConversion(), TryImplicitConversion(), TryListConversion(), TryListInitialization(), TryObjectArgumentInitialization(), and TryUserDefinedConversion().
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 2963 of file SemaDeclCXX.cpp.
References clang::CPlusPlus, clang::Type::getAsCXXRecordDecl(), getLangOpts(), clang::TagDecl::isBeingDefined(), isCompleteType(), clang::CXXRecordDecl::isDerivedFrom(), and Loc.
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 10736 of file SemaOverload.cpp.
References clang::ASTContext::hasSameType().
Referenced by clang::OverloadCandidateSet::BestViableFunction(), and 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 870 of file Sema.cpp.
References getLangOpts(), clang::Type::getLinkage(), clang::ValueDecl::getType(), clang::NamedDecl::hasExternalFormalLinkage(), clang::isExternalFormalLinkage(), and isFunctionOrVarDeclExternC().
Referenced by checkUndefinedButUsed(), getUndefinedButUsed(), MarkFunctionReferenced(), 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 2732 of file SemaOverload.cpp.
References clang::CPlusPlus, clang::Type::getAs(), and clang::HLSL.
Referenced by IsStandardConversion(), and IsVectorElementConversion().
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 1873 of file SemaOverload.cpp.
References clang::ASTContext::adjustFunctionType(), clang::CanQual< T >::castAs(), clang::EST_None, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::FunctionProtoType::ExtProtoInfo::FunctionEffects, clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::MemberPointerType::getClass(), clang::ASTContext::getFunctionType(), clang::ASTContext::getFunctionTypeWithExceptionSpec(), clang::FunctionType::ExtInfo::getNoReturn(), clang::MemberPointerType::getPointeeType(), getPointeeType(), clang::ASTContext::hasAnyFunctionEffects(), clang::ASTContext::hasSameUnqualifiedType(), clang::ASTContext::mergeExtParameterInfo(), and clang::FunctionType::ExtInfo::withNoReturn().
Referenced by BuildExpressionFromDeclTemplateArgument(), CheckOriginalCallArgDeduction(), checkPointerTypesForAssignment(), handlerCanCatch(), isSameOrCompatibleFunctionType(), and IsStandardConversion().
|
inline |
Definition at line 7781 of file Sema.h.
References currentEvaluationContext(), and clang::Sema::ExpressionEvaluationContextRecord::isImmediateFunctionContext().
Referenced by CheckForImmediateInvocation(), and MarkDeclRefReferenced().
bool Sema::isImplicitlyDeleted | ( | FunctionDecl * | FD | ) |
Determine whether the given function is an implicitly-deleted special member function.
Definition at line 15803 of file SemaDeclCXX.cpp.
References clang::FunctionDecl::isDefaulted(), and clang::FunctionDecl::isDeleted().
Referenced by clang::InitializationSequence::Diagnose().
bool Sema::isIncompatibleTypedef | ( | const TypeDecl * | Old, |
TypedefNameDecl * | New | ||
) |
Definition at line 2437 of file SemaDecl.cpp.
References Context, clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::ASTContext::getTypeDeclType(), clang::TypedefNameDecl::getUnderlyingType(), clang::ASTContext::hasSameType(), clang::Type::isDependentType(), clang::SourceLocation::isValid(), clang::Type::isVariablyModifiedType(), notePreviousDefinition(), and clang::Decl::setInvalidDecl().
Referenced by clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), and MergeTypedefNameDecl().
bool Sema::isInitListConstructor | ( | const FunctionDecl * | Ctor | ) |
Determine whether Ctor is an initializer-list constructor, as defined in [dcl.init.list]p2.
Definition at line 12026 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().
Referenced by DeduceTemplateSpecializationFromInitializer(), IsInitializerListConstructorConversion(), clang::SemaCodeCompletion::ProduceConstructorSignatureHelp(), ResolveConstructorOverload(), and TryUserDefinedConversion().
|
inline |
Definition at line 7785 of file Sema.h.
References currentEvaluationContext(), and clang::Sema::ExpressionEvaluationContextRecord::InLifetimeExtendingContext.
Referenced by BuildCXXDefaultInitExpr(), CreateMaterializeTemporaryExpr(), and IgnoredValueConversions().
bool Sema::IsInsideALocalClassWithinATemplateFunction | ( | ) |
Definition at line 11191 of file SemaTemplate.cpp.
References CurContext, 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 2567 of file SemaOverload.cpp.
References clang::CPlusPlus, clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::BuiltinType::getKind(), clang::ASTContext::getLangOpts(), clang::Expr::getSourceBitField(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasSameUnqualifiedType(), clang::ASTContext::IntTy, clang::Type::isAnyCharacterType(), clang::Type::isBooleanType(), clang::Type::isCharType(), clang::Type::isEnumeralType(), clang::Type::isIntegerType(), clang::Type::isIntegralType(), clang::ASTContext::isPromotableIntegerType(), clang::Type::isSignedIntegerType(), clang::Type::isUnsignedIntegerType(), clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, and clang::ASTContext::UnsignedLongTy.
Referenced by CheckTemplateArgument(), IsStandardConversion(), and IsVectorElementConversion().
Definition at line 8879 of file SemaExpr.cpp.
References Context, clang::ASTContext::getCanonicalType(), and clang::FunctionType::SME_AttributeMask.
Referenced by CheckOverridingFunctionAttributes(), checkPointerTypesForAssignment(), and MergeFunctionDecl().
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 835 of file SemaCXXScopeSpec.cpp.
References BuildCXXNestedNameSpecifier(), and clang::CXXScopeSpec::isInvalid().
Is this a legal conversion between two types, one of which is known to be a vector type?
Definition at line 7600 of file SemaExpr.cpp.
References clang::LangOptionsBase::All, areLaxCompatibleVectorTypes(), Context, clang::Type::getAs(), clang::ASTContext::getLangOpts(), clang::LangOptionsBase::Integer, clang::Type::isIntegralOrEnumerationType(), clang::Type::isVectorType(), and clang::LangOptionsBase::None.
Referenced by CheckAssignmentConstraints(), CheckVectorOperands(), and IsVectorConversion().
Definition at line 14158 of file SemaChecking.cpp.
References getASTContext(), and isLayoutCompatible().
Referenced by clang::SemaHLSL::IsScalarizedLayoutCompatible().
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 44 of file SemaExceptionSpec.cpp.
References Context, CurContext, D, clang::ASTContext::getSourceManager(), clang::SourceManager::isInSystemHeader(), and clang::IdentifierInfo::isStr().
|
inline |
Definition at line 1379 of file Sema.h.
References clang::Found, isMemberAccessibleForDeletion(), and clang::SemaBase::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 1606 of file SemaAccess.cpp.
References AR_accessible, AR_delayed, AR_dependent, AR_inaccessible, clang::AS_public, CheckAccess(), Context, clang::SemaBase::Diag(), clang::Found, getLangOpts(), and Loc.
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 3513 of file SemaOverload.cpp.
References clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::MemberPointerType::getClass(), clang::ASTContext::getMemberPointerType(), clang::MemberPointerType::getPointeeType(), clang::QualType::getTypePtr(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::isNullPointerConstant(), clang::Expr::NPC_ValueDependentIsNotNull, and clang::Expr::NPC_ValueDependentIsNull.
Referenced by IsStandardConversion().
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 667 of file SemaDecl.cpp.
References clang::CXXRecordDecl::bases(), Context, CurContext, clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::CXXScopeSpec::getScopeRep(), clang::ASTContext::hasSameUnqualifiedType(), clang::DeclContext::isFunctionOrMethod(), clang::DeclContext::isRecord(), and clang::NestedNameSpecifier::Super.
Referenced by DiagnoseUnknownTypeName().
Definition at line 1898 of file SemaLookup.cpp.
References getLookupModules(), clang::Module::getTopLevelModule(), clang::Module::isGlobalModule(), clang::Module::isModuleVisible(), and clang::VisibleModuleSet::isVisible().
Referenced by checkModuleImportContext(), and hasVisibleMergedDefinition().
bool Sema::isMoreSpecializedThanPrimary | ( | ClassTemplatePartialSpecializationDecl * | T, |
sema::TemplateDeductionInfo & | Info | ||
) |
Definition at line 6340 of file SemaTemplateDeduction.cpp.
References clang::sema::TemplateDeductionInfo::clearSFINAEDiagnostic(), clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::ClassTemplatePartialSpecializationDecl::getInjectedSpecializationType(), getMoreSpecialized(), and clang::ClassTemplateSpecializationDecl::getSpecializedTemplate().
Referenced by checkMoreSpecializedThanPrimary().
bool Sema::isMoreSpecializedThanPrimary | ( | VarTemplatePartialSpecializationDecl * | T, |
sema::TemplateDeductionInfo & | Info | ||
) |
Definition at line 6372 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgumentList::asArray(), clang::sema::TemplateDeductionInfo::clearSFINAEDiagnostic(), Context, 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 2995 of file SemaOverload.cpp.
References AdoptQualifiers(), BuildSimilarlyQualifiedPointerType(), clang::ASTContext::canAssignObjCInterfaces(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::ObjCObjectPointerType::getInterfaceType(), clang::FunctionProtoType::getMethodQuals(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::Type::getPointeeType(), clang::ObjCObjectPointerType::getPointeeType(), clang::ASTContext::getPointerType(), clang::QualType::getQualifiers(), clang::FunctionType::getReturnType(), clang::ASTContext::hasSameUnqualifiedType(), clang::QualType::isAtLeastAsQualifiedAs(), clang::Type::isObjCBuiltinType(), clang::Type::isPointerType(), clang::FunctionProtoType::isVariadic(), and clang::ObjC.
Referenced by clang::SemaObjC::DiagnosePropertyMismatch(), clang::SemaObjC::HandlePropertyInClassExtension(), isAllowableExplicitConversion(), clang::SemaObjC::isObjCWritebackConversion(), and SelectPropertyForSynthesisFromProtocols().
bool Sema::IsOverload | ( | FunctionDecl * | New, |
FunctionDecl * | Old, | ||
bool | UseMemberUsingDeclRules, | ||
bool | ConsiderCudaAttrs = true |
||
) |
Definition at line 1627 of file SemaOverload.cpp.
References IsOverloadOrOverrideImpl().
Referenced by AddOverrideResults(), CheckFunctionDeclaration(), CheckMultiVersionAdditionalDecl(), clang::SemaCUDA::checkTargetOverload(), and clang::SemaCUDA::maybeAddHostDeviceAttrs().
bool Sema::IsOverride | ( | FunctionDecl * | MD, |
FunctionDecl * | BaseMD, | ||
bool | UseMemberUsingDeclRules, | ||
bool | ConsiderCudaAttrs = true |
||
) |
Definition at line 1633 of file SemaOverload.cpp.
References IsOverloadOrOverrideImpl().
Referenced by AddOverriddenMethods().
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 2847 of file SemaOverload.cpp.
References clang::ASTContext::areCompatibleVectorTypes(), BuildSimilarlyQualifiedPointerType(), clang::Type::castAs(), clang::CPlusPlus, clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::PointerType::getPointeeType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isBlockPointerType(), clang::Type::isFunctionType(), clang::Type::isIncompleteOrObjectType(), isNullPointerConstantForConversion(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::Type::isVectorType(), clang::Type::isVoidType(), and clang::ASTContext::typesAreCompatible().
Referenced by IsStandardConversion().
bool Sema::IsPointerInterconvertibleBaseOf | ( | const TypeSourceInfo * | Base, |
const TypeSourceInfo * | Derived | ||
) |
Definition at line 14164 of file SemaChecking.cpp.
References clang::Type::getAsCXXRecordDecl(), getASTContext(), clang::TypeLoc::getBeginLoc(), clang::Type::getCanonicalTypeUnqualified(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), IsDerivedFrom(), 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 284 of file SemaExprMember.cpp.
References clang::LookupResult::begin(), clang::CPlusPlus, clang::LookupResult::empty(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::NamedDecl::isCXXClassMember(), clang::CXXScopeSpec::isEmpty(), clang::LookupResult::isOverloadedResult(), and clang::LookupResult::isUnresolvableResult().
Referenced by ActOnIdExpression(), attemptRecovery(), BuildQualifiedDeclarationNameExpr(), and BuildQualifiedTemplateIdExpr().
|
inline |
Are precise floating point semantics currently enabled?
Definition at line 1836 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 3703 of file SemaOverload.cpp.
References clang::ASTContext::getCanonicalType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameUnqualifiedType(), isQualificationConversionStep(), and clang::ASTContext::UnwrapSimilarTypes().
Referenced by CheckOriginalCallArgDeduction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), CompareQualificationConversions(), handlerCanCatch(), isAllowableExplicitConversion(), isNullPointerValueTemplateArgument(), and IsStandardConversion().
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 15740 of file SemaExpr.cpp.
References D, E, and clang::NamedDecl::isCXXClassMember().
Referenced by BuildUnaryOp().
Determine whether a declaration is reachable.
Definition at line 14996 of file Sema.h.
Referenced by ArgumentDependentLookup(), hasReachableDeclaration(), hasReachableDeclarationSlow(), isAcceptable(), and IsRedefinitionInModule().
Check the redefinition in C++20 Modules.
[basic.def.odr]p14: For any definable item D with definitions in multiple translation units,
Return true if the redefinition is not allowed. Return false otherwise.
Definition at line 1715 of file SemaDecl.cpp.
References getASTContext(), clang::Decl::getOwningModule(), clang::Module::getTopLevelModule(), clang::Module::isHeaderLikeModule(), clang::Module::isNamedModule(), and isReachable().
Referenced by CheckConceptRedefinition().
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 1342 of file SemaTemplateDeduction.cpp.
References Context, clang::Type::getAs(), clang::ASTContext::hasSameFunctionTypeIgnoringExceptionSpec(), clang::ASTContext::hasSameType(), IsFunctionConversion(), and P.
Referenced by DeduceTemplateArguments(), and DeduceTemplateArgumentsByTypeMatch().
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 1250 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 ActOnCXXDelete(), ActOnPseudoDestructorExpr(), BuildArrayType(), BuildCXXDefaultInitExpr(), CheckAddressOfOperand(), CheckArrow(), CheckCompareOperands(), CheckTemplateIdType(), computeDeclContext(), CopyObject(), createImplicitModuleImportForErrorRecovery(), CreateRecoveryExpr(), diagnoseNoViableConversion(), DiagnoseUninstantiableTemplate(), EmitDiagnostic(), LookupMemberExpr(), MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), recordConversion(), RequireCompleteEnumDecl(), and clang::Sema::SFINAETrap::SFINAETrap().
bool Sema::IsSimplyAccessible | ( | NamedDecl * | Decl, |
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 1926 of file SemaAccess.cpp.
References AR_inaccessible, clang::AS_none, Context, clang::CPlusPlus, CurContext, clang::declaresSameEntity(), getCurFunctionDecl(), getCurMethodDecl(), getLangOpts(), clang::ObjCInterfaceDecl::isSuperClassOf(), clang::DeclAccessPair::make(), clang::sema::AccessedEntity::Member, clang::ObjCIvarDecl::Package, clang::ObjCIvarDecl::Private, and clang::ObjCIvarDecl::Public.
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 11909 of file SemaDeclCXX.cpp.
References clang::CPlusPlus, clang::IdentifierTable::get(), clang::Type::getAs(), clang::TemplateName::getAsTemplateDecl(), clang::ClassTemplateDecl::getCanonicalDecl(), clang::NamedDecl::getIdentifier(), clang::Preprocessor::getIdentifierTable(), getLangOpts(), clang::TemplateParameterList::getMinRequiredArguments(), clang::Decl::getNonTransparentDeclContext(), clang::TemplateParameterList::getParam(), getStdNamespace(), clang::ClassTemplateDecl::getTemplatedDecl(), clang::TemplateSpecializationType::getTemplateName(), clang::TemplateDecl::getTemplateParameters(), PP, clang::Specialization, StdInitializerList, StdNamespace, and clang::TemplateSpecializationType::template_arguments().
Referenced by CompareImplicitConversionSequences(), DeduceFromInitializerList(), diagnoseListInit(), isInitListConstructor(), clang::InitializationSequence::Perform(), TryInitializerListConstruction(), TryListConversion(), and TryListInitialization().
Definition at line 165 of file SemaInit.cpp.
References Context, clang::Init, and SIF_None.
Referenced by TryListConversion().
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 4123 of file SemaExprCXX.cpp.
References 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.
Referenced by DiagnoseAssignmentResult(), and IsStandardConversion().
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 643 of file SemaDecl.cpp.
References clang::Class, clang::Enum, clang::LookupResult::Found, clang::LookupResult::getAsSingle(), clang::LookupResult::getResultKind(), clang::Interface, LookupName(), LookupTagName, clang::Struct, clang::LookupResult::suppressDiagnostics(), clang::DeclSpec::TST_class, clang::DeclSpec::TST_enum, clang::DeclSpec::TST_interface, clang::DeclSpec::TST_struct, clang::DeclSpec::TST_union, clang::DeclSpec::TST_unspecified, and clang::Union.
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 173 of file SemaTemplate.cpp.
References clang::LookupResult::begin(), Context, clang::CPlusPlus, D, clang::ASTContext::DeclarationNames, clang::LookupResult::empty(), clang::LookupResult::end(), FilterAcceptableTemplateNames(), FoundNothing, clang::OpaquePtr< PtrTy >::get(), clang::ASTContext::getAssumedTemplateName(), getAsTemplateNameDecl(), clang::DeclarationNameTable::getCXXLiteralOperatorName(), clang::DeclarationNameTable::getCXXOperatorName(), getLangOpts(), clang::ASTContext::getOverloadedTemplateName(), clang::ASTContext::getQualifiedTemplateName(), clang::CXXScopeSpec::getScopeRep(), clang::UsingShadowDecl::getTargetDecl(), clang::IK_Identifier, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::LookupResult::isAmbiguous(), clang::CXXScopeSpec::isInvalid(), LookupOrdinaryName, LookupTemplateName(), clang::OpaquePtr< TemplateName >::make(), None, clang::LookupResult::suppressDiagnostics(), clang::TNK_Concept_template, clang::TNK_Function_template, clang::TNK_Non_template, clang::TNK_Type_template, clang::TNK_Undeclared_template, clang::TNK_Var_template, and clang::LookupResult::wasNotFoundInCurrentInstantiation().
Referenced by ActOnTemplateName(), DiagnoseUnknownTypeName(), getTypeName(), and clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec().
bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs | ( | TemplateParameterList * | PParam, |
TemplateDecl * | AArg, | ||
const DefaultArguments & | DefaultArgs, | ||
SourceLocation | Loc, | ||
bool | IsDeduced | ||
) |
Definition at line 6388 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgumentListInfo::addArgument(), CheckTemplateArgumentList(), Context, DeduceTemplateArguments(), clang::TemplateParameterList::getDepth(), clang::TemplateParameterList::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(), runWithSufficientStackSpace(), clang::TemplateParameterList::size(), and clang::Success.
Referenced by CheckTemplateTemplateArgument().
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 1501 of file SemaExprCXX.cpp.
References clang::Class, CXXThisTypeOverride, clang::Type::getAsCXXRecordDecl(), and clang::QualType::isNull().
Referenced by ActOnStartCXXMemberReference(), and LookupMemberExprInRecord().
bool Sema::isUnavailableAlignedAllocationFunction | ( | const FunctionDecl & | FD | ) | const |
Determine whether FD
is an aligned allocation or deallocation function that is unavailable.
Definition at line 2014 of file SemaExprCXX.cpp.
References getLangOpts(), clang::FunctionDecl::isDefined(), and clang::FunctionDecl::isReplaceableGlobalAllocationFunction().
Referenced by CanUseDecl(), and diagnoseUnavailableAlignedAllocation().
|
inline |
Determines whether we are currently in a context that is not evaluated as per C++ [expr] p5.
Definition at line 7777 of file Sema.h.
References currentEvaluationContext(), and clang::Sema::ExpressionEvaluationContextRecord::isUnevaluated().
Referenced by ActOnIfStmt(), BuildBuiltinOffsetOf(), BuildCXXTypeId(), BuildDeclarationNameExpr(), BuildDeclRefExpr(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildIvarRefExpr(), CheckAddressOfOperand(), CheckCXXThisCapture(), CheckForImmediateInvocation(), CheckIdentityFieldAssignment(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), CheckIndirectionOperand(), checkSuspensionContext(), CheckTCBEnforcement(), CheckVirtualDtorCall(), CreateBuiltinUnaryOp(), CreateUnaryExprOrTypeTraitExpr(), DefaultArgumentPromotion(), DiagnoseSelfAssignment(), DiagnoseUseOfDecl(), DoMarkVarDeclReferenced(), clang::EnterExpressionEvaluationContext::EnterExpressionEvaluationContext(), getNonOdrUseReasonInCurrentContext(), inferARCLifetimeForPointee(), LookupMemberExpr(), MarkDeclRefReferenced(), MarkVTableUsed(), and TransformToPotentiallyEvaluated().
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 345 of file SemaTemplateVariadic.cpp.
References FunctionScopes.
bool Sema::isUsualDeallocationFunction | ( | const CXXMethodDecl * | FD | ) |
Definition at line 1709 of file SemaExprCXX.cpp.
References clang::SemaCUDA::CFP_HostDevice, clang::SemaCUDA::CFP_WrongSide, CUDA(), D, getCurFunctionDecl(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::FunctionDecl::getNumParams(), clang::SemaCUDA::IdentifyPreference(), clang::CXXMethodDecl::isUsualDeallocationFunction(), clang::DeclContext::lookup(), and clang::Result.
Referenced by CheckOperatorDeleteDeclaration(), and isNonPlacementDeallocationFunction().
Determine if type T is a valid subject for a nonnull and similar attributes.
Dependent types are considered valid so they can be checked during instantiation time. 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.
Definition at line 1253 of file SemaDeclAttr.cpp.
References clang::RecordDecl::fields(), clang::Type::getAsUnionType(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), clang::Type::isDependentType(), clang::Type::isReferenceType(), and clang::T.
Referenced by AddAllocAlignAttr(), AddAssumeAlignedAttr(), attrNonNullArgCheck(), CheckNonNullArguments(), handleNoEscapeAttr(), and handleNonNullAttr().
llvm::Error Sema::isValidSectionSpecifier | ( | StringRef | Str | ) |
Used to implement to perform semantic checking on attribute((section("foo"))) specifiers.
In this case, "foo" is passed in to be checked. If the section specifier is invalid, return an Error that indicates the problem.
This is a simple quality of implementation feature to catch errors and give good diagnostics in cases when the assembler or code generator would otherwise reject the section specifier.
Definition at line 2893 of file SemaDeclAttr.cpp.
References Context, clang::ASTContext::getTargetInfo(), and clang::TargetInfo::getTriple().
Referenced by ActOnPragmaClangSection(), checkCodeSegName(), and checkSectionName().
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 7518 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 936 of file SemaExpr.cpp.
References Context, clang::CPlusPlus11, clang::QualType::DK_nontrivial_c_struct, clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), getLangOpts(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), HLSL(), clang::QualType::isCXX98PODType(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::Type::isIncompleteType(), clang::Type::isObjCLifetimeType(), clang::Type::isObjCObjectType(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), VAK_Invalid, VAK_MSVCUndefined, VAK_Undefined, VAK_Valid, and VAK_ValidInCXX11.
Referenced by checkVariadicArgument(), and DefaultVariadicArgumentPromotion().
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 19995 of file SemaDecl.cpp.
References E, clang::EnumDecl::enumerators(), FlagBitsCache, clang::EnumDecl::isClosedFlag(), and clang::TagDecl::isCompleteDefinition().
Referenced by ActOnEnumBody(), DiagnoseAssignmentEnum(), and ShouldDiagnoseSwitchCaseNotInEnum().
Determine whether a declaration is visible to name lookup.
Definition at line 14990 of file Sema.h.
Referenced by ActOnNamespaceAliasDef(), ArgumentDependentLookup(), argumentDependentLookup(), CheckUsingShadowDecl(), filterNonConflictingPreviousTypedefDecls(), hasVisibleDeclaration(), hasVisibleDeclarationSlow(), isAcceptable(), isPreferredLookupResult(), LookupQualifiedNameInUsingDirectives(), MergeCXXFunctionDecl(), and shouldAddReversedEqEq().
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 2333 of file SemaDecl.cpp.
References clang::Builtin::Context::allowTypeMismatch(), clang::ASTContext::BuiltinInfo, Context, CreateBuiltin(), CurContext, clang::SemaBase::Diag(), clang::ASTContext::GE_Missing_setjmp, clang::ASTContext::GE_Missing_type, clang::ASTContext::GetBuiltinType(), clang::Decl::getDeclContext(), getHeaderName(), clang::Builtin::Context::getHeaderName(), clang::Builtin::Context::getName(), clang::Builtin::Context::isHeaderDependentFunction(), clang::QualType::isNull(), clang::Builtin::Context::isPredefinedLibFunction(), LangOpts, Loc, LookupNecessaryTypesForBuiltin(), PushOnScopeChains(), RegisterLocallyScopedExternCDecl(), and TUScope.
Referenced by LookupBuiltin().
void Sema::LazyProcessLifetimeCaptureByParams | ( | FunctionDecl * | FD | ) |
Definition at line 3962 of file SemaDeclAttr.cpp.
References clang::SemaBase::Diag(), clang::TypeLoc::getAsAdjusted(), clang::AttributedTypeLoc::getAttrAs(), clang::AttributedTypeLoc::getModifiedLoc(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::isInstanceMethod(), Loc, and clang::FunctionDecl::parameters().
Referenced by AddKnownFunctionAttributes().
void Sema::LoadExternalVTableUses | ( | ) |
Load any externally-stored vtable uses.
Definition at line 18474 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 996 of file Sema.cpp.
References WeakUndeclaredIdentifiers.
Referenced by ActOnEndOfTranslationUnit(), and ProcessPragmaWeak().
void Sema::LookupBinOp | ( | Scope * | S, |
SourceLocation | OpLoc, | ||
BinaryOperatorKind | Opc, | ||
UnresolvedSetImpl & | Functions | ||
) |
Definition at line 15295 of file SemaExpr.cpp.
References clang::CPlusPlus20, getLangOpts(), clang::BinaryOperator::getOverloadedOperator(), clang::getRewrittenOverloadedOperator(), LookupOverloadedOperatorName(), and clang::OO_None.
Referenced by ActOnCXXFoldExpr(), BuildOverloadedBinOp(), and HasNonDeletedDefaultedEqualityComparison().
bool Sema::LookupBuiltin | ( | LookupResult & | R | ) |
Lookup a builtin function, when name lookup would otherwise fail.
Definition at line 916 of file SemaLookup.cpp.
References clang::LookupResult::addDecl(), clang::ASTContext::BuiltinInfo, Context, clang::CPlusPlus, clang::CreateRISCVIntrinsicManager(), D, clang::DeclarationName::getAsIdentifierInfo(), getASTContext(), clang::IdentifierInfo::getBuiltinID(), getLangOpts(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), clang::IdentifierInfo::getName(), clang::LookupResult::getNameLoc(), InsertOCLBuiltinDeclarationsFromTable(), clang::SemaRISCV::IntrinsicManager, clang::LookupResult::isForRedeclaration(), clang::Builtin::Context::isPredefinedLibFunction(), LazilyCreateBuiltin(), LookupOrdinaryName, LookupRedeclarationWithLinkage, OpenCL(), PP, RISCV(), and TUScope.
Referenced by ClassifyName(), LookupDirect(), clang::SemaObjC::LookupInObjCMethod(), and LookupName().
DeclContext::lookup_result Sema::LookupConstructors | ( | CXXRecordDecl * | Class | ) |
Look up the constructors for the given class.
Definition at line 3548 of file SemaLookup.cpp.
References CanDeclareSpecialMemberFunction(), clang::Class, Context, clang::ASTContext::DeclarationNames, clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXConstructorName(), clang::ASTContext::getTypeDeclType(), runWithSufficientStackSpace(), and clang::T.
Referenced by BuildUsingDeclaration(), CheckCXX98CompatAccessibleCopy(), CopyObject(), DeclareImplicitDeductionGuides(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), clang::SemaCodeCompletion::ProduceConstructorSignatureHelp(), TryConstructorInitialization(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().
CXXMethodDecl * Sema::LookupCopyingAssignment | ( | CXXRecordDecl * | Class, |
unsigned | Quals, | ||
bool | RValueThis, | ||
unsigned | ThisQuals | ||
) |
Look up the copying assignment operator for the given class.
Definition at line 3566 of file SemaLookup.cpp.
References clang::Class, clang::Qualifiers::Const, clang::CopyAssignment, LookupSpecialMember(), clang::Result, and clang::Qualifiers::Volatile.
CXXConstructorDecl * Sema::LookupCopyingConstructor | ( | CXXRecordDecl * | Class, |
unsigned | Quals | ||
) |
Look up the copying constructor for the given class.
Definition at line 3528 of file SemaLookup.cpp.
References clang::Class, clang::Qualifiers::Const, clang::CopyConstructor, LookupSpecialMember(), clang::Result, and clang::Qualifiers::Volatile.
Referenced by CheckCXXThrowOperand().
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 1966 of file SemaCoroutine.cpp.
References clang::SemaBase::Diag(), clang::Found, clang::IdentifierTable::get(), clang::Preprocessor::getIdentifierTable(), getStdNamespace(), LookupOrdinaryName, LookupQualifiedName(), PP, clang::Result, and StdCoroutineTraitsCache.
Referenced by lookupPromiseType().
CXXConstructorDecl * Sema::LookupDefaultConstructor | ( | CXXRecordDecl * | Class | ) |
Look up the default constructor for the given class.
Definition at line 3520 of file SemaLookup.cpp.
References clang::Class, clang::DefaultConstructor, LookupSpecialMember(), and clang::Result.
Referenced by TryConstructorInitialization(), TryListInitialization(), and TryValueInitialization().
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 3595 of file SemaLookup.cpp.
References clang::Class, clang::Destructor, and LookupSpecialMember().
Referenced by ActOnCXXDelete(), ActOnDecltypeExpression(), canRecoverDotPseudoDestructorCallsOnPointerObjects(), CheckCXXThrowOperand(), checkDestructorReference(), CheckParmsForFunctionDef(), FinalizeVarWithDestructor(), MarkBaseAndMemberDestructorsReferenced(), MarkVirtualBaseDestructorsReferenced(), MaybeBindToTemporary(), clang::InitializationSequence::Perform(), SetDelegatingInitializer(), clang::SemaObjC::SetIvarInitializers(), and clang::UsedDeclVisitor< Derived >::VisitCXXDeleteExpr().
bool Sema::LookupInlineAsmField | ( | StringRef | Base, |
StringRef | Member, | ||
unsigned & | Offset, | ||
SourceLocation | AsmLoc | ||
) |
Definition at line 821 of file SemaStmtAsm.cpp.
References Context, clang::CPlusPlus, clang::IdentifierTable::get(), clang::Type::getAs(), clang::ASTContext::getASTRecordLayout(), getCurrentThisType(), getCurScope(), clang::RecordType::getDecl(), clang::FieldDecl::getFieldIndex(), clang::ASTRecordLayout::getFieldOffset(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::Type::getPointeeType(), clang::ASTContext::Idents, clang::LookupResult::isSingleResult(), LookupMemberName, LookupName(), LookupOrdinaryName, LookupQualifiedName(), MarkAnyDeclReferenced(), clang::Member, RequireCompleteType(), clang::Result, and clang::ASTContext::toCharUnitsFromBits().
ExprResult Sema::LookupInlineAsmIdentifier | ( | CXXScopeSpec & | SS, |
SourceLocation | TemplateKWLoc, | ||
UnqualifiedId & | Id, | ||
bool | IsUnevaluatedContext | ||
) |
Definition at line 774 of file SemaStmtAsm.cpp.
References ActOnIdExpression(), CheckNakedParmReference(), CheckPlaceholderExpr(), clang::ExprError(), getCurScope(), Id, clang::Type::isDependentType(), clang::Type::isFunctionType(), PopExpressionEvaluationContext(), PushExpressionEvaluationContext(), RequireCompleteExprType(), clang::Result, ReuseLambdaContextDecl, clang::T, and UnevaluatedAbstract.
Referenced by clang::Parser::ParseMSAsmIdentifier().
ExprResult Sema::LookupInlineAsmVarDeclField | ( | Expr * | RefExpr, |
StringRef | Member, | ||
SourceLocation | AsmLoc | ||
) |
Definition at line 890 of file SemaStmtAsm.cpp.
References BuildMemberReferenceExpr(), Context, clang::CXXDependentScopeMemberExpr::Create(), E, clang::IdentifierTable::get(), clang::Type::getAs(), clang::RecordType::getDecl(), clang::LookupResult::getFoundDecl(), clang::Expr::getType(), clang::ASTContext::Idents, clang::Type::isDependentType(), LookupMemberName, LookupQualifiedName(), clang::Member, clang::Result, 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 2734 of file SemaLookup.cpp.
References clang::LookupResult::addDecl(), clang::Class, Context, E, clang::LookupResult::empty(), clang::RecordType::getDecl(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::ASTContext::getRecordType(), LookupQualifiedName(), clang::CXXRecordDecl::MergeAccess(), clang::LookupResult::resolveKind(), clang::Result, and clang::LookupResult::setNamingClass().
Referenced by LookupParsedName(), and LookupQualifiedName().
Sema::LiteralOperatorLookupResult Sema::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].
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 3603 of file SemaLookup.cpp.
References clang::LookupResult::Ambiguous, CheckTemplateArgument(), Context, CTAK_Specified, D, clang::SemaBase::Diag(), clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::Decl::getAsFunction(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::TemplateParameterList::getParam(), clang::LookupResult::getResultKind(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::LookupResult::Filter::hasNext(), clang::ASTContext::hasSameUnqualifiedType(), int, clang::Decl::isInvalidDecl(), clang::Decl::isTemplateParameterPack(), LOLR_Cooked, LOLR_Error, LOLR_ErrorNoDiagnostic, LOLR_Raw, LOLR_StringTemplatePack, LOLR_Template, LookupName(), clang::LookupResult::makeFilter(), clang::LookupResult::Filter::next(), NoteOverloadCandidate(), clang::LookupResult::Filter::restart(), and clang::TemplateParameterList::size().
Referenced by ActOnNumericConstant(), ActOnStringLiteral(), and BuildCookedLiteralOperatorCall().
CXXMethodDecl * Sema::LookupMovingAssignment | ( | CXXRecordDecl * | Class, |
unsigned | Quals, | ||
bool | RValueThis, | ||
unsigned | ThisQuals | ||
) |
Look up the moving assignment operator for the given class.
Definition at line 3581 of file SemaLookup.cpp.
References clang::Class, clang::Qualifiers::Const, LookupSpecialMember(), clang::MoveAssignment, clang::Result, and clang::Qualifiers::Volatile.
CXXConstructorDecl * Sema::LookupMovingConstructor | ( | CXXRecordDecl * | Class, |
unsigned | Quals | ||
) |
Look up the moving constructor for the given class.
Definition at line 3539 of file SemaLookup.cpp.
References clang::Class, clang::Qualifiers::Const, LookupSpecialMember(), clang::MoveConstructor, clang::Result, 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 2179 of file SemaLookup.cpp.
References clang::LookupResult::addDecl(), clang::IdentifierResolver::begin(), clang::CPlusPlus, D, clang::Scope::DeclScope, clang::IdentifierResolver::end(), clang::DeclContext::Equals(), clang::LookupResult::getAcceptableDecl(), getLangOpts(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), clang::DeclContext::getRedeclContext(), IdResolver, isNamespaceOrTranslationUnitScope(), LookupBuiltin(), LookupObjCImplicitSelfParam, LookupRedeclarationWithLinkage, clang::LookupResult::resolveKind(), and clang::LookupResult::setShadowed().
Referenced by ActOnAliasDeclaration(), ActOnDecompositionDeclarator(), ActOnEnumConstant(), ActOnFinishConceptDefinition(), ActOnFriendFunctionDecl(), ActOnIdExpression(), ActOnLambdaExpressionAfterIntroducer(), clang::SemaObjC::ActOnMethodParmDeclaration(), ActOnNamespaceAliasDef(), clang::SemaObjC::ActOnObjCBoolLiteral(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveStart(), ActOnParamDeclarator(), ActOnPragmaDump(), ActOnPragmaUnused(), ActOnSizeofParameterPackExpr(), ActOnStartConceptDefinition(), ActOnTag(), BuildBuiltinCallExpr(), BuildCXXNestedNameSpecifier(), buildMemcpyForAssignmentOp(), BuildOperatorCoawaitLookupExpr(), BuildUsingDeclaration(), BuildUsingEnumDeclaration(), CheckAnonMemberRedeclaration(), CheckClassTemplate(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), clang::SemaObjC::checkObjCBridgeRelatedComponents(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), CheckShadow(), CheckTypenameType(), DiagnoseInvalidRedeclaration(), emitReplacement(), FindFirstQualifierInScope(), getDestructorName(), clang::SemaObjC::getObjCMessageKind(), getOpenCLEnumType(), getOpenCLTypedefType(), getTypeName(), HandleDeclarator(), HandleField(), HandleMSProperty(), clang::SemaObjC::handleNSErrorDomain(), clang::SemaObjC::isKnownName(), isTagName(), isValidInteropVariable(), lookupBuiltinFunction(), LookupInlineAsmField(), LookupLiteralOperator(), clang::LookupNamed(), clang::LookupNamespace(), LookupOverloadedOperatorName(), LookupParsedName(), LookupPredefedObjCSuperType(), LookupSingleName(), LookupTemplateName(), markUsedForAliasOrIfunc(), ProcessAPINotes(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
Definition at line 995 of file SemaLookup.cpp.
References LookupPredefedObjCSuperType().
Referenced by ActOnFunctionDeclarator(), and LazilyCreateBuiltin().
LabelDecl * Sema::LookupOrCreateLabel | ( | IdentifierInfo * | II, |
SourceLocation | IdentLoc, | ||
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 4370 of file SemaLookup.cpp.
References Context, clang::LabelDecl::Create(), CurContext, clang::Decl::getDeclContext(), clang::Scope::getFnParent(), clang::SourceLocation::isValid(), Loc, LookupLabel, LookupSingleName(), and PushOnScopeChains().
Referenced by GetOrCreateMSAsmLabel().
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 14512 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::OperatorRewriteInfo::AllowRewrittenCandidates, clang::OverloadCandidateSet::OperatorRewriteInfo::allowsReversed(), clang::ASTContext::DeclarationNames, clang::DeclarationNameTable::getCXXOperatorName(), clang::OverloadCandidateSet::getLocation(), clang::OverloadCandidateSet::getRewriteInfo(), clang::getRewrittenOverloadedOperator(), clang::OO_None, and clang::Reversed.
void Sema::LookupOverloadedOperatorName | ( | OverloadedOperatorKind | Op, |
Scope * | S, | ||
UnresolvedSetImpl & | Functions | ||
) |
Definition at line 3282 of file SemaLookup.cpp.
References clang::UnresolvedSetImpl::append(), clang::LookupResult::begin(), Context, clang::ASTContext::DeclarationNames, clang::LookupResult::end(), clang::DeclarationNameTable::getCXXOperatorName(), clang::LookupResult::isAmbiguous(), LookupName(), and LookupOperatorName.
Referenced by BuildUnaryOp(), and LookupBinOp().
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 2680 of file SemaLookup.cpp.
References clang::Type::castAs(), computeDeclContext(), clang::Type::getAs(), clang::NestedNameSpecifier::getKind(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::TagType::isBeingDefined(), clang::DeclContext::isDependentContext(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::CXXScopeSpec::isEmpty(), clang::Type::isIncompleteType(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isNotEmpty(), clang::QualType::isNull(), LookupInSuper(), LookupName(), LookupQualifiedName(), RequireCompleteDeclContext(), clang::LookupResult::setContextRange(), clang::LookupResult::setNotFoundInCurrentInstantiation(), and clang::NestedNameSpecifier::Super.
Referenced by ActOnExplicitInstantiation(), ActOnIdExpression(), ActOnNamespaceAliasDef(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), ActOnUsingDirective(), buildDeclareReductionRef(), BuildMemInitializer(), BuildQualifiedDeclarationNameExpr(), buildUserDefinedMapperRef(), CheckMicrosoftIfExistsSymbol(), CheckTemplateTypeArgument(), ClassifyName(), hasUserDefinedMapper(), isTagTypeWithMissingTag(), LookupMemberExprInRecord(), clang::SemaOpenMP::lookupOpenMPDeclareTargetName(), and LookupPotentialTypoResult().
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 2396 of file SemaLookup.cpp.
References clang::AS_none, clang::DeclContextLookupResult::begin(), Context, clang::DeclarationName::CXXConversionFunctionName, E, clang::Found, getAsTemplateNameDecl(), clang::Decl::getCanonicalDecl(), clang::CXXRecordDecl::getDefinition(), clang::LookupResult::getIdentifierNamespace(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), clang::ASTContext::getTypeDeclType(), clang::NamedDecl::getUnderlyingDecl(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::DeclContext::isDependentContext(), clang::DeclContext::isFileContext(), clang::LookupResult::isForRedeclaration(), clang::Decl::isInIdentifierNamespace(), clang::LookupResult::isTemplateNameLookup(), clang::DeclContext::lookup(), LookupDirect(), clang::CXXRecordDecl::lookupInBases(), LookupLabel, LookupNamespaceName, LookupObjCProtocolName, LookupOperatorName, LookupQualifiedNameInUsingDirectives(), Path, clang::LookupResult::resolveKind(), clang::Result, clang::LookupResult::setNamingClass(), clang::LookupResult::setNotFoundInCurrentInstantiation(), clang::DeclContext::setUseQualifiedLookup(), clang::DeclContext::shouldUseQualifiedLookup(), Specifier, and clang::T.
Referenced by ActOnCXXTypeid(), ActOnFriendFunctionDecl(), ActOnStartNamespaceDef(), ActOnTag(), BuildBuiltinOffsetOf(), buildCoroutineHandle(), BuildCXXNestedNameSpecifier(), buildDeclareReductionRef(), BuildNonArrayForRange(), buildSingleCopyAssignRecursively(), buildStdNoThrowDeclRef(), BuildUsingDeclaration(), BuildVariableInstantiation(), CheckClassTemplate(), checkTupleLikeDecomposition(), CheckTypenameType(), CXXRecordMembersNamed(), DeduceTemplateSpecializationFromInitializer(), DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), DiagnoseTwoPhaseLookup(), doesUsualArrayDeleteWantSize(), emitReplacement(), EvaluateStaticAssertMessageAsString(), FindAllocationFunctions(), FindDeallocationFunction(), FindUsualDeallocationFunction(), getDestructorName(), getTypeName(), HandleDeclarator(), clang::HLSLExternalSemaSource::InitializeSema(), isDeclaratorFunctionLike(), lookupCoroutineHandleType(), lookupCoroutineTraits(), LookupInlineAsmField(), LookupInlineAsmVarDeclField(), LookupInSuper(), lookupMember(), clang::LookupNamed(), clang::LookupNamespace(), LookupParsedName(), LookupPotentialTypoResult(), lookupPromiseType(), LookupQualifiedName(), LookupStdInitializerList(), LookupStdSourceLocationImpl(), lookupStdTypeTraitMember(), LookupTemplateName(), clang::SemaCodeCompletion::ProduceCallSignatureHelp(), clang::TreeTransform< Derived >::RebuildDependentNameType(), resolveAllocationOverload(), resolveBuiltinNewDeleteOverload(), shouldAddReversedEqEq(), 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 2670 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 3273 of file SemaLookup.cpp.
References clang::LookupResult::getAsSingle(), Loc, and LookupName().
Referenced by clang::SemaObjC::ActOnAtEnd(), clang::SemaObjC::ActOnCompatibilityAlias(), ActOnEndOfTranslationUnit(), ActOnExceptionDeclarator(), clang::SemaObjC::ActOnForwardClassDeclaration(), clang::SemaObjC::ActOnIvar(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOpenMPUsesAllocatorClause(), ActOnPragmaMSAllocText(), ActOnPragmaRedefineExtname(), ActOnPragmaWeakAlias(), ActOnPragmaWeakID(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), clang::SemaObjC::ActOnTypedefedProtocols(), clang::SemaObjC::BuildObjCStringLiteral(), clang::SemaCodeCompletion::CodeCompleteObjCImplementationCategory(), clang::SemaCodeCompletion::CodeCompleteObjCInterfaceCategory(), clang::SemaCodeCompletion::CodeCompleteObjCSuperclass(), clang::SemaCodeCompletion::CodeCompleteObjCSuperMessage(), CreateBuiltinBinOp(), createFriendTagNNSFixIt(), DefaultLvalueConversion(), DiagnoseDirectIsaAccess(), findOMPAllocatorHandleT(), clang::SemaObjC::getObjCInterfaceDecl(), isMethodDeclaredInRootProtocol(), LookupObjCInterfaceDeclForLiteral(), LookupOrCreateLabel(), clang::SemaObjC::LookupProtocol(), maybeDiagnoseTemplateParameterShadow(), and shouldSkipAnonEnumBody().
Sema::SpecialMemberOverloadResult Sema::LookupSpecialMember | ( | CXXRecordDecl * | D, |
CXXSpecialMemberKind | SM, | ||
bool | ConstArg, | ||
bool | VolatileArg, | ||
bool | RValueThis, | ||
bool | ConstThis, | ||
bool | VolatileThis | ||
) |
Definition at line 3299 of file SemaLookup.cpp.
References clang::QualType::addConst(), AddMethodCandidate(), AddMethodTemplateCandidate(), AddOverloadCandidate(), AddTemplateOverloadCandidate(), clang::QualType::addVolatile(), clang::Sema::SpecialMemberOverloadResult::Ambiguous, clang::AS_public, clang::DeclContextLookupResult::begin(), clang::OverloadCandidateSet::BestViableFunction(), BumpAlloc, CanDeclareSpecialMemberFunction(), clang::Expr::Classify(), Context, clang::CopyAssignment, clang::CopyConstructor, clang::CPlusPlus11, clang::OverloadCandidateSet::CSK_Normal, clang::ASTContext::DeclarationNames, clang::DefaultConstructor, clang::Destructor, clang::DeclContextLookupResult::empty(), clang::DeclContextLookupResult::end(), clang::ASTContext::getCanonicalType(), clang::getConstructorInfo(), clang::DeclarationNameTable::getCXXConstructorName(), clang::DeclarationNameTable::getCXXOperatorName(), clang::DeclAccessPair::getDecl(), clang::CXXRecordDecl::getDefinition(), clang::CXXRecordDecl::getDestructor(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getTagDeclType(), clang::NamedDecl::getUnderlyingDecl(), clang::FunctionDecl::isDeleted(), clang::DeclContext::lookup(), clang::DeclAccessPair::make(), clang::MoveAssignment, clang::MoveConstructor, clang::CXXRecordDecl::needsImplicitCopyAssignment(), clang::CXXRecordDecl::needsImplicitCopyConstructor(), clang::CXXRecordDecl::needsImplicitDefaultConstructor(), clang::CXXRecordDecl::needsImplicitDestructor(), clang::CXXRecordDecl::needsImplicitMoveAssignment(), clang::CXXRecordDecl::needsImplicitMoveConstructor(), clang::Sema::SpecialMemberOverloadResult::NoMemberOrDeleted, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Result, runWithSufficientStackSpace(), SM, SpecialMemberCache, clang::Sema::SpecialMemberOverloadResult::Success, clang::VK_LValue, and clang::VK_PRValue.
Referenced by checkMoveAssignmentForRepeatedMove(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), lookupCallFromSpecialMember(), 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.
References clang::Type::castAs(), clang::LookupResult::clear(), computeDeclContext(), CorrectTypo(), clang::CPlusPlus11, CTK_ErrorRecovery, clang::SemaBase::Diag(), diagnoseTypo(), clang::LookupResult::empty(), FilterAcceptableTemplateNames(), clang::Found, FoundFunctions, FoundNothing, clang::Type::getAs(), getAsTemplateNameDecl(), clang::Decl::getCanonicalDecl(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::Decl::getLocation(), clang::CXXScopeSpec::getRange(), clang::Sema::RequiredTemplateKind::getTemplateKeywordLoc(), clang::NamedDecl::getUnderlyingDecl(), clang::Sema::RequiredTemplateKind::hasTemplateKeyword(), clang::LookupResult::isAmbiguous(), clang::TagType::isBeingDefined(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::CXXScopeSpec::isEmpty(), clang::Type::isIncompleteType(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isNotEmpty(), clang::QualType::isNull(), clang::Type::isObjCObjectOrInterfaceType(), clang::LookupResult::isSingleResult(), clang::Type::isVectorType(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), None, clang::SemaBase::PDiag(), RequireCompleteDeclContext(), clang::LookupResult::setTemplateNameLookup(), and clang::CorrectionCandidateCallback::WantTypeSpecifiers.
Referenced by ActOnIdExpression(), ActOnTemplateName(), BuildQualifiedTemplateIdExpr(), DiagnoseEmptyLookup(), isDeductionGuideName(), isTemplateName(), and LookupMemberExprInRecord().
void Sema::LookupVisibleDecls | ( | DeclContext * | Ctx, |
LookupNameKind | Kind, | ||
VisibleDeclConsumer & | Consumer, | ||
bool | IncludeGlobalScope = true , |
||
bool | IncludeDependentBases = false , |
||
bool | LoadExternal = true |
||
) |
Definition at line 4362 of file SemaLookup.cpp.
References Consumer.
void Sema::LookupVisibleDecls | ( | Scope * | S, |
LookupNameKind | Kind, | ||
VisibleDeclConsumer & | Consumer, | ||
bool | IncludeGlobalScope = true , |
||
bool | LoadExternal = true |
||
) |
Definition at line 4354 of file SemaLookup.cpp.
References Consumer.
Referenced by AddRecordMembersCompletionResults(), clang::SemaCodeCompletion::CodeCompleteAfterIf(), clang::SemaCodeCompletion::CodeCompleteDeclSpec(), clang::SemaCodeCompletion::CodeCompleteExpression(), clang::SemaCodeCompletion::CodeCompleteMemberReferenceExpr(), clang::SemaCodeCompletion::CodeCompleteNamespaceAliasDecl(), clang::SemaCodeCompletion::CodeCompleteObjCMessageReceiver(), clang::SemaCodeCompletion::CodeCompleteObjCPassingType(), clang::SemaCodeCompletion::CodeCompleteOperatorName(), clang::SemaCodeCompletion::CodeCompleteOrdinaryName(), clang::SemaCodeCompletion::CodeCompleteQualifiedId(), clang::SemaCodeCompletion::CodeCompleteTag(), clang::SemaCodeCompletion::CodeCompleteUsing(), clang::SemaCodeCompletion::CodeCompleteUsingDirective(), and clang::SemaCodeCompletion::GatherGlobalCodeCompletions().
|
inline |
|
inline |
Definition at line 1091 of file Sema.h.
Referenced by handleInterruptAttr().
|
inline |
Definition at line 7301 of file Sema.h.
References ActOnFinishFullExpr(), clang::ActionResult< PtrTy, Compress >::get(), and clang::Expr::getExprLoc().
Referenced by BuildCoreturnStmt(), and buildSingleCopyAssignRecursively().
|
inline |
Definition at line 7294 of file Sema.h.
References clang::Expr::getExprLoc(), and MakeFullExpr().
Referenced by ActOnCondition(), 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(), isNonNegativeIntegerValue(), and MakeFullExpr().
|
inline |
Definition at line 7297 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 1545 of file SemaLookup.cpp.
References Context, getCurrentModule(), makeMergedDefinitionVisible(), clang::ASTContext::mergeDefinitionIntoModule(), and clang::Decl::setVisibleDespiteOwningModule().
Referenced by ActOnClassTemplateSpecialization(), ActOnDuplicateDefinition(), ActOnDuplicateODRHashDefinition(), ActOnTag(), CheckClassTemplate(), CheckForFunctionRedefinition(), CheckRedeclarationModuleOwnership(), checkVarDeclRedefinition(), makeMergedDefinitionVisible(), and MergeTypedefNameDecl().
|
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 569 of file Sema.cpp.
References clang::Decl::addAttr(), Context, CurContext, clang::ASTContext::getSourceManager(), clang::Decl::hasAttr(), inTemplateInstantiation(), and clang::SourceManager::isInSystemHeader().
Referenced by diagnoseObjCARCConversion().
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 20066 of file SemaExpr.cpp.
References D, Loc, MarkFunctionReferenced(), MarkVariableReferenced(), and clang::Decl::setReferenced().
Referenced by ActOnSizeofParameterPackExpr(), BuildCXXNestedNameSpecifier(), clang::SemaObjC::BuildIvarRefExpr(), BuildMemInitializer(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTypenameType(), ClassifyName(), getConstructorName(), getDestructorName(), getTypeName(), LookupInlineAsmField(), and MarkExprReferenced().
void Sema::MarkAsLateParsedTemplate | ( | FunctionDecl * | FD, |
Decl * | FnD, | ||
CachedTokens & | Toks | ||
) |
Definition at line 11169 of file SemaTemplate.cpp.
References getCurFPFeatures(), LateParsedTemplateMap, and 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 5694 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 clang::SemaBase::PDiag().
Referenced by ActOnFinishFunctionBody(), DefineImplicitDestructor(), and SetCtorInitializers().
void Sema::MarkCaptureUsedInEnclosingContext | ( | ValueDecl * | Capture, |
SourceLocation | Loc, | ||
unsigned | CapturingScopeIndex | ||
) |
Definition at line 18437 of file SemaExpr.cpp.
References Loc, and MarkVarDeclODRUsed().
Referenced by CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures().
void Sema::MarkDeclarationsReferencedInExpr | ( | Expr * | E, |
bool | SkipLocalVariables = false , |
||
ArrayRef< const Expr * > | StopAt = {} |
||
) |
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 20171 of file SemaExpr.cpp.
References E.
Referenced by clang::SemaOpenMP::ActOnOpenMPLoopInitialization(), clang::SemaOpenMP::ActOnOpenMPRegionEnd(), BuildCXXDefaultInitExpr(), and CheckCXXDefaultArgExpr().
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 20117 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 20015 of file SemaExpr.cpp.
References E, ExprEvalContexts, getLangOpts(), isCheckingDefaultArgumentOrInitializer(), isConstantEvaluatedContext(), isImmediateFunctionContext(), isUnevaluatedContext(), MarkExprReferenced(), RebuildingImmediateInvocation, and RefsMinusAssignments.
Referenced by clang::SemaObjC::ActOnPropertyImplDecl(), BuildDeclRefExpr(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), and CreateFunctionRefExpr().
|
static |
Marks all of the template parameters that will be deduced by a call to the given function template.
Definition at line 6970 of file SemaTemplateDeduction.cpp.
References clang::Function, FunctionTemplate, clang::TemplateParameterList::getDepth(), MarkUsedTemplateParameters(), and clang::TemplateParameterList::size().
|
inline |
Definition at line 12487 of file Sema.h.
References Context, FunctionTemplate, and MarkDeducedTemplateParameters().
Referenced by CheckDeductionGuideTemplate(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), and MarkDeducedTemplateParameters().
void Sema::MarkExpressionAsImmediateEscalating | ( | Expr * | E | ) |
Definition at line 17490 of file SemaExpr.cpp.
References clang::Call, clang::CPlusPlus20, E, ExprEvalContexts, getCurFunction(), getLangOpts(), and clang::Expr::IgnoreImplicit().
Referenced by CheckForImmediateInvocation(), and HandleImmediateInvocations().
void Sema::MarkFunctionParmPackReferenced | ( | FunctionParmPackExpr * | E | ) |
Perform reference-marking and odr-use handling for a FunctionParmPackExpr.
Definition at line 20056 of file SemaExpr.cpp.
References E, MarkExprReferenced(), and RefsMinusAssignments.
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 18085 of file SemaExpr.cpp.
References clang::SemaCUDA::CheckCall(), CheckCompleteDestructorVariant(), CheckCompleteParameterTypesForMangler(), checkSpecializationReachability(), CodeSynthesisContexts, Consumer, Context, CUDA(), clang::ASTContext::CUDAImplicitHostDeviceFunUsedByDevice, CurContext, DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), clang::Destructor, clang::Func, funcHasParameterSizeMangling(), getASTContext(), clang::TargetInfo::getCXXABI(), getDefaultedComparisonKind(), clang::FunctionProtoType::getExceptionSpecType(), getLangOpts(), getPrintingPolicy(), clang::ASTContext::getTargetInfo(), clang::ASTConsumer::HandleCXXImplicitFunctionInstantiation(), ImmediateFunctionContext, clang::Init, InstantiateFunctionDefinition(), isExternalWithNoLinkageType(), isImplicitlyDefinableConstexprFunction(), clang::SourceLocation::isInvalid(), clang::CXXConversionDecl::isLambdaToBlockPointerConversion(), clang::TargetCXXABI::isMicrosoft(), isOdrUseContext(), isPotentiallyConstantEvaluatedContext(), clang::isUnresolvedExceptionSpec(), LangOpts, Loc, MarkFunctionReferenced(), MarkVTableUsed(), None, OS, Parent, PendingInstantiations, PendingLocalImplicitInstantiations, PotentiallyEvaluated, clang::SemaCUDA::RecordImplicitHostDeviceFuncUsedByDevice(), ResolveExceptionSpec(), runWithSufficientStackSpace(), clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, and UndefinedButUsed.
Referenced by ActOnCXXDelete(), ActOnDecltypeExpression(), clang::SemaCUDA::ActOnExecConfigExpr(), BuildCXXConstructExpr(), BuildCXXNew(), CheckCXXThrowOperand(), CheckDestructor(), checkDestructorReference(), CheckParmsForFunctionDef(), DeduceTemplateSpecializationFromInitializer(), DefineImplicitLambdaToFunctionPointerConversion(), DefineInheritingConstructor(), FinalizeVarWithDestructor(), findDeleteForPromise(), MarkAnyDeclReferenced(), MarkBaseAndMemberDestructorsReferenced(), MarkFunctionReferenced(), MarkVirtualBaseDestructorsReferenced(), MarkVirtualMembersReferenced(), MarkVTableUsed(), MaybeBindToTemporary(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), ReferenceDllExportedMembers(), SetDelegatingInitializer(), clang::SemaObjC::SetIvarInitializers(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
void Sema::MarkMemberReferenced | ( | MemberExpr * | E | ) |
Perform reference-marking and odr-use handling for a MemberExpr.
Definition at line 20037 of file SemaExpr.cpp.
References E, clang::Stmt::getBeginLoc(), getLangOpts(), Loc, MarkExprReferenced(), and RefsMinusAssignments.
Referenced by BuildMemberExpr().
void Sema::MarkThisReferenced | ( | CXXThisExpr * | This | ) |
Definition at line 1461 of file SemaExprCXX.cpp.
References CheckCXXThisCapture(), CurContext, FunctionScopes, clang::FunctionProtoType::getParamType(), and clang::Type::isDependentType().
Referenced by BuildCXXThisExpr().
void Sema::MarkTypoCorrectedFunctionDefinition | ( | const NamedDecl * | F | ) |
Definition at line 9079 of file SemaDecl.cpp.
References TypoCorrectedFunctionDefinitions.
Referenced by DiagnoseInvalidRedeclaration().
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 1895 of file SemaDecl.cpp.
References D, clang::First, clang::LazyVector< T, Source, Loader, LoadedStorage, LocalStorage >::push_back(), ShouldWarnIfUnusedFileScopedDecl(), and UnusedFileScopedDecls.
Referenced by ActOnFunctionDeclarator(), CheckFunctionTemplateSpecialization(), and FinalizeDeclaration().
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 6947 of file SemaTemplateDeduction.cpp.
References Context, E, MarkUsedTemplateParameters(), and Used.
Referenced by checkTemplatePartialSpecialization(), MarkDeducedTemplateParameters(), MarkUsedTemplateParameters(), and substituteParameterMappings().
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 6954 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgumentList::asArray(), Context, 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 19915 of file SemaExpr.cpp.
References DoMarkVarDeclReferenced(), Loc, and RefsMinusAssignments.
Referenced by clang::SemaOpenMP::ActOnOpenMPRegionEnd(), CheckComparisonCategoryType(), MarkAnyDeclReferenced(), ReferenceDllExportedMembers(), 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 5798 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(), clang::SemaBase::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 18654 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 18661 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), E, clang::RecordType::getDecl(), clang::CXXRecordDecl::getFinalOverriders(), clang::CXXRecordDecl::getNumVBases(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isPureVirtual(), Loc, MarkFunctionReferenced(), and MarkVirtualMembersReferenced().
Referenced by DefineUsedVTables(), InstantiateClass(), MarkVirtualMembersReferenced(), 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 18498 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 ActOnExplicitInstantiation(), ActOnFinishFunctionBody(), ActOnTagFinishDefinition(), BuildCXXTypeId(), CheckCompletedCXXClass(), CheckCXXThrowOperand(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), InstantiateClass(), InstantiateClassMembers(), MarkFunctionReferenced(), and ReferenceDllExportedMembers().
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 2698 of file SemaTemplate.cpp.
References CheckTemplateParameterList(), computeDeclContext(), Context, clang::TemplateParameterList::Create(), clang::FixItHint::CreateInsertion(), DependsOnTemplateParameters(), clang::SemaBase::Diag(), E, clang::Enum, clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::NestedNameSpecifier::getAsType(), getRangeOfTypeInNestedNameSpecifier(), clang::CXXScopeSpec::getScopeRep(), clang::ASTContext::getTypeDeclType(), clang::Invalid, clang::Type::isDependentType(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, Parent, Range, clang::TemplateIdAnnotation::RAngleLoc, clang::T, TemplateParameterListsAreEqual(), TPC_ClassTemplateMember, TPL_TemplateMatch, and clang::TSK_ExplicitSpecialization.
Referenced by ActOnClassTemplateSpecialization(), ActOnFunctionDeclarator(), ActOnStartFunctionDeclarationDeclarator(), ActOnTag(), ActOnTemplatedFriendTag(), and ActOnVariableDeclarator().
void clang::Sema::maybeAddDeclWithEffects | ( | const Decl * | D, |
const FunctionEffectsRef & | FX | ||
) |
Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
Definition at line 1445 of file SemaFunctionEffects.cpp.
References addDeclWithEffects(), D, Diags, clang::Decl::getAsFunction(), clang::DiagnosticsEngine::getIgnoreAllWarnings(), clang::Decl::getLocation(), clang::DiagnosticsEngine::getSuppressSystemWarnings(), clang::Decl::hasBody(), hasUncompilableErrorOccurred(), clang::SourceManager::isInSystemHeader(), SourceMgr, and clang::FunctionDecl::willHaveBody().
|
inline |
Inline checks from the start of maybeAddDeclWithEffects, to minimize performance impact on code not using effects.
Definition at line 15160 of file Sema.h.
References Context, D, clang::ASTContext::hasAnyFunctionEffects(), and maybeAddDeclWithEffects().
Referenced by ActOnBlockStmtExpr(), ActOnStartOfFunctionDef(), BuildLambdaExpr(), maybeAddDeclWithEffects(), and MergeFunctionDecl().
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 7639 of file SemaExprCXX.cpp.
References clang::Bind, clang::ASTContext::BoundMemberTy, clang::Call, clang::Type::castAs(), CheckDestructorAccess(), Cleanup, Context, clang::CPlusPlus, clang::CXXTemporary::Create(), clang::CXXBindTemporaryExpr::Create(), clang::ImplicitCastExpr::Create(), D, clang::Destructor, DiagnoseUseOfDecl(), clang::QualType::DK_nontrivial_c_struct, E, 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::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, clang::SemaBase::PDiag(), clang::CleanupInfo::setExprNeedsCleanups(), clang::T, and clang::VK_PRValue.
Referenced by clang::SemaObjC::BuildClassMessage(), BuildCompoundLiteralExpr(), BuildCXXCastArgument(), clang::SemaObjC::BuildInstanceMessage(), BuildLambdaExpr(), clang::SemaObjC::BuildObjCArrayLiteral(), clang::SemaObjC::BuildObjCBoxedExpr(), clang::SemaObjC::BuildObjCNumericLiteral(), BuildResolvedCallExpr(), BuildStmtExpr(), CopyObject(), clang::InitializationSequence::Perform(), and PerformConstructorInitialization().
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 7893 of file SemaExpr.cpp.
References ActOnBinOp(), ActOnParenExpr(), E, clang::ExprError(), clang::Expr::getExprLoc(), and clang::Result.
Referenced by ActOnArraySubscriptExpr(), ActOnCastExpr(), clang::SemaObjC::ActOnInstanceMessage(), ActOnMemberAccessExpr(), ActOnPostfixUnaryOp(), ActOnStartCXXMemberReference(), and BuildCallExpr().
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 7810 of file SemaExprCXX.cpp.
References Cleanup, clang::CleanupInfo::cleanupsHaveSideEffects(), CleanupVarDeclMarking(), Context, clang::ExprWithCleanups::Create(), DiscardCleanupsInEvaluationContext(), E, ExprCleanupObjects, ExprEvalContexts, and clang::CleanupInfo::exprNeedsCleanups().
Referenced by ActOnBlockStmtExpr(), ActOnFinishFullExpr(), clang::SemaObjC::ActOnPropertyImplDecl(), ActOnUninitializedDecl(), buildCoawaitCalls(), buildCoroutinePromise(), BuildExceptionDeclaration(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), checkEscapingByref(), ConvertParamDefaultArgument(), MaybeCreateExprWithCleanups(), MaybeCreateStmtWithCleanups(), maybeTailCall(), RemoveNestedImmediateInvocation(), and clang::SemaObjC::SetIvarInitializers().
ExprResult Sema::MaybeCreateExprWithCleanups | ( | ExprResult | SubExpr | ) |
Definition at line 7803 of file SemaExprCXX.cpp.
References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and MaybeCreateExprWithCleanups().
Definition at line 7832 of file SemaExprCXX.cpp.
References Cleanup, CleanupVarDeclMarking(), Context, clang::CompoundStmt::Create(), E, 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 1830 of file SemaConcept.cpp.
References clang::AtomicConstraint::ConstraintExpr, Context, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), getNormalizedAssociatedConstraints(), clang::Stmt::getSourceRange(), clang::AtomicConstraint::hasMatchingParameterMapping(), isSFINAEContext(), clang::makeCNF(), clang::makeDNF(), clang::Stmt::Profile(), clang::AtomicConstraint::subsumes(), and clang::subsumes().
Referenced by checkMoreSpecializedThanPrimary(), CheckTemplateTemplateArgument(), and MaybeDiagnoseAmbiguousConstraints().
void Sema::maybeExtendBlockObject | ( | ExprResult & | E | ) |
Do an explicit extend of the given block pointer if we're in ARC.
Definition at line 7279 of file SemaExpr.cpp.
References Cleanup, Context, clang::ImplicitCastExpr::Create(), E, getLangOpts(), clang::Expr::getType(), clang::Type::isBlockPointerType(), clang::Expr::isPRValue(), clang::CleanupInfo::setExprNeedsCleanups(), and clang::VK_PRValue.
Referenced by CheckAssignmentConstraints(), clang::SemaObjC::CheckMessageArgumentTypes(), DefaultVariadicArgumentPromotion(), clang::SemaObjC::PrepareCastToObjCObjectPointer(), and PrepareScalarCast().
void Sema::MaybeSuggestAddingStaticToDecl | ( | const FunctionDecl * | D | ) |
Definition at line 205 of file SemaExpr.cpp.
References clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::First, clang::Redeclarable< decl_type >::getFirstDecl(), and hasAnyExplicitStorageClass().
Referenced by ActOnVariableDeclarator(), and diagnoseUseOfInternalDeclInInlineFunction().
AlwaysInlineAttr * Sema::mergeAlwaysInlineAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
const IdentifierInfo * | Ident | ||
) |
Definition at line 4697 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), and clang::Decl::hasAttr().
Referenced by handleAlwaysInlineAttr(), and mergeDeclAttribute().
AvailabilityAttr * 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 | ||
) |
Definition at line 2128 of file SemaDeclAttr.cpp.
References AMK_None, AMK_OptionalProtocolImplementation, AMK_Override, AMK_ProtocolImplementation, AMK_Redeclaration, checkAvailabilityAttr(), Context, D, clang::SemaBase::Diag(), clang::Decl::getAttrs(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierInfo::getName(), clang::AttributeCommonInfo::getRange(), clang::Decl::hasAttrs(), clang::Implicit, Priority, and versionsMatch().
Referenced by handleAvailabilityAttr(), and mergeDeclAttribute().
BTFDeclTagAttr * Sema::mergeBTFDeclTagAttr | ( | Decl * | D, |
const BTFDeclTagAttr & | AL | ||
) |
Definition at line 5763 of file SemaDeclAttr.cpp.
References Context, D, and hasBTFDeclTagAttr().
Referenced by mergeDeclAttribute().
CodeSegAttr * Sema::mergeCodeSegAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | Name | ||
) |
Definition at line 2965 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), and clang::FunctionDecl::isFunctionTemplateSpecialization().
Referenced by handleCodeSegAttr(), and mergeDeclAttribute().
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 4316 of file SemaDecl.cpp.
References Context, clang::CPlusPlus, getLangOpts(), clang::Redeclarable< decl_type >::getMostRecentDecl(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::FunctionDecl::isPureVirtual(), clang::Decl::isUsed(), MergeCXXFunctionDecl(), mergeDeclAttributes(), mergeParamDeclAttributes(), mergeParamDeclTypes(), clang::ASTContext::mergeTypes(), clang::FunctionDecl::setIsPureVirtual(), clang::Decl::setIsUsed(), and clang::ValueDecl::setType().
Referenced by MergeFunctionDecl().
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 452 of file SemaDeclCXX.cpp.
References CheckForFunctionRedefinition(), clang::SemaBase::Diag(), clang::Decl::FOK_None, clang::Decl::FOK_Undeclared, functionDeclHasDefaultArgument(), clang::FunctionDecl::getConstexprKind(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::ParmVarDecl::getDefaultArgRange(), clang::CXXRecordDecl::getDescribedClassTemplate(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Decl::getFriendObjectKind(), clang::VarDecl::getInit(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::FunctionDecl::getMinRequiredArguments(), clang::Redeclarable< decl_type >::getMostRecentDecl(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::Redeclarable< decl_type >::getPreviousDecl(), getSpecialMember(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::ParmVarDecl::getUninstantiatedDefaultArg(), clang::ParmVarDecl::hasDefaultArg(), clang::ParmVarDecl::hasInheritedDefaultArg(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), clang::ParmVarDecl::hasUnparsedDefaultArg(), clang::Invalid, clang::NamedDecl::isCXXClassMember(), isDeclInScope(), clang::FunctionDecl::isDefined(), clang::DeclContext::isDependentContext(), clang::FunctionDecl::isFunctionTemplateSpecialization(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::Decl::isLocalExternDecl(), clang::FunctionDecl::isThisDeclarationInstantiatedFromAFriendDefinition(), isVisible(), clang::LookupResult::isVisible(), clang::ParmVarDecl::setDefaultArg(), clang::ParmVarDecl::setHasInheritedDefaultArg(), clang::ParmVarDecl::setUninstantiatedDefaultArg(), clang::ParmVarDecl::setUnparsedDefaultArg(), clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by MergeCompatibleFunctionDecls().
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 3095 of file SemaDecl.cpp.
References clang::Decl::addAttr(), AMK_None, AMK_OptionalProtocolImplementation, AMK_Override, AMK_ProtocolImplementation, AMK_Redeclaration, bool, checkNewAttributesAfterDef(), Context, clang::VarDecl::DeclarationOnly, clang::SemaBase::Diag(), diagnoseMissingConstinit(), clang::Decl::dropAttrs(), clang::Decl::getAttr(), clang::VarDecl::getInitializingDeclaration(), clang::Decl::getLocation(), clang::Decl::getMostRecentDecl(), getRange(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), clang::Decl::isUsed(), mergeAlignedAttrs(), mergeDeclAttribute(), clang::NewTag, clang::Decl::setAttrs(), and clang::Decl::specific_attrs().
Referenced by clang::SemaObjC::ActOnForwardClassDeclaration(), clang::SemaObjC::ActOnForwardProtocolDeclaration(), clang::SemaObjC::ActOnStartClassInterface(), clang::SemaObjC::ActOnStartProtocolInterface(), ActOnTag(), CheckClassTemplate(), findInheritingConstructor(), MergeCompatibleFunctionDecls(), mergeObjCMethodDecls(), MergeTypedefNameDecl(), MergeVarDecl(), and rewriteBuiltinFunctionDecl().
DLLExportAttr * Sema::mergeDLLExportAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI | ||
) |
Definition at line 5833 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::Decl::dropAttr(), clang::Decl::getAttr(), and clang::Decl::hasAttr().
Referenced by handleDLLAttr(), and mergeDeclAttribute().
DLLImportAttr * Sema::mergeDLLImportAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI | ||
) |
Definition at line 5820 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::Decl::hasAttr().
Referenced by handleDLLAttr(), and mergeDeclAttribute().
EnforceTCBAttr * Sema::mergeEnforceTCBAttr | ( | Decl * | D, |
const EnforceTCBAttr & | AL | ||
) |
EnforceTCBLeafAttr * Sema::mergeEnforceTCBLeafAttr | ( | Decl * | D, |
const EnforceTCBLeafAttr & | AL | ||
) |
ErrorAttr * Sema::mergeErrorAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | NewUserDiagnostic | ||
) |
Definition at line 3608 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::Decl::dropAttr(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), clang::AttributeCommonInfo::getNormalizedFullName(), and clang::AttributeCommonInfo::isRegularKeywordAttribute().
Referenced by handleErrorAttr(), and mergeDeclAttribute().
FormatAttr * Sema::mergeFormatAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
IdentifierInfo * | Format, | ||
int | FormatIdx, | ||
int | FirstArg | ||
) |
Definition at line 3633 of file SemaDeclAttr.cpp.
References Context, D, clang::AttributeCommonInfo::getRange(), and clang::Decl::specific_attrs().
Referenced by handleFormatAttr(), and mergeDeclAttribute().
bool Sema::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'.
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 3558 of file SemaDecl.cpp.
References clang::Decl::addAttr(), adjustDeclContextForDeclaratorDecl(), clang::ASTContext::adjustFunctionType(), BuiltinFunction, clang::ASTContext::BuiltinInfo, canFullyTypeCheckRedeclaration(), canRedefineFunction(), clang::Type::castAs(), CheckEquivalentExceptionSpec(), CheckRedeclarationInModule(), Context, clang::CPlusPlus, clang::ParmVarDecl::Create(), D, clang::SemaBase::Diag(), diagnoseFunctionEffectMergeConflicts(), clang::Decl::dropAttr(), clang::First, clang::Decl::FOK_None, clang::FunctionProtoType::ExtProtoInfo::FunctionEffects, clang::Type::getAs(), clang::Decl::getAsFunction(), getASTContext(), clang::Decl::getAttr(), clang::FunctionDecl::getBuiltinID(), getCallingConvAttributedType(), clang::FunctionDecl::getCanonicalDecl(), clang::ASTContext::getCanonicalType(), clang::FunctionType::ExtInfo::getCC(), clang::Type::getContainedAutoType(), clang::FunctionDecl::getDeclaredReturnType(), clang::NamedDecl::getDeclName(), clang::DeducedType::getDeducedType(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionType::getExtInfo(), clang::FunctionProtoType::getExtProtoInfo(), clang::Redeclarable< decl_type >::getFirstDecl(), clang::Decl::getFriendObjectKind(), clang::FunctionDecl::getFunctionEffects(), clang::ASTContext::getFunctionType(), clang::FunctionType::ExtInfo::getHasRegParm(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::FunctionType::getNameForCallConv(), clang::FunctionType::ExtInfo::getNoCallerSavedRegs(), clang::FunctionType::ExtInfo::getNoReturn(), getNoteDiagForInvalidRedeclaration(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionType::ExtInfo::getProducesResult(), clang::FunctionType::ExtInfo::getRegParm(), clang::FunctionType::getRegParmType(), clang::FunctionDecl::getReturnType(), clang::FunctionType::getReturnType(), clang::FunctionDecl::getReturnTypeSourceRange(), getSpecialMember(), clang::FunctionDecl::getStorageClass(), clang::FunctionDecl::getTemplateSpecializationInfo(), clang::ValueDecl::getType(), clang::FunctionEffectSet::getUnion(), clang::ASTContext::hasAnyFunctionEffects(), clang::Decl::hasAttr(), clang::NamedDecl::hasExternalFormalLinkage(), hasIdenticalPassObjectSizeAttrs(), clang::FunctionDecl::hasInheritedPrototype(), clang::FunctionDecl::hasPrototype(), clang::ASTContext::hasSameFunctionTypeIgnoringExceptionSpec(), clang::ASTContext::hasSameFunctionTypeIgnoringParamABI(), clang::ASTContext::hasSameFunctionTypeIgnoringPtrSizes(), clang::ASTContext::hasSameType(), clang::FunctionDecl::hasWrittenPrototype(), haveIncompatibleLanguageLinkages(), HLSL(), int, inTemplateInstantiation(), clang::QualType::isCanonical(), clang::NamedDecl::isCXXClassMember(), clang::DeducedType::isDeduced(), clang::FunctionDecl::isDefined(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::FunctionDecl::isExternC(), clang::FunctionDecl::isFunctionTemplateSpecialization(), clang::Decl::isImplicit(), clang::FunctionDecl::isInlined(), clang::Decl::isInvalidDecl(), IsInvalidSMECallConversion(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::FunctionDecl::isOutOfLine(), clang::Builtin::Context::isPredefinedLibFunction(), clang::DeclContext::isRecord(), clang::CXXMethodDecl::isStatic(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isTrivial(), clang::Decl::isUsed(), maybeAddDeclWithEffects(), MergeCompatibleFunctionDecls(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), notePreviousDefinition(), clang::Redeclarable< decl_type >::redecls(), clang::Redeclarable< decl_type >::redecls_end(), clang::SC_None, clang::SC_Static, clang::FunctionDecl::setHasInheritedPrototype(), clang::Decl::setImplicit(), clang::ParmVarDecl::setScopeInfo(), clang::FunctionDecl::setTrivial(), clang::ValueDecl::setType(), SubstAutoType(), SubstAutoTypeDependent(), clang::ASTContext::typesAreCompatible(), UndefinedButUsed, clang::FunctionType::ExtInfo::withCallingConv(), clang::FunctionType::ExtInfo::withNoCallerSavedRegs(), clang::FunctionType::ExtInfo::withNoReturn(), clang::FunctionType::ExtInfo::withProducesResult(), and clang::FunctionType::ExtInfo::withRegParm().
Referenced by CheckFunctionDeclaration().
InternalLinkageAttr * Sema::mergeInternalLinkageAttr | ( | Decl * | D, |
const InternalLinkageAttr & | AL | ||
) |
Definition at line 4734 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::ExpectedFunctionVariableOrClass, clang::ExpectedVariableOrFunction, and getLangOpts().
InternalLinkageAttr * Sema::mergeInternalLinkageAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 4712 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::ExpectedFunctionVariableOrClass, clang::ExpectedVariableOrFunction, getLangOpts(), clang::AttributeCommonInfo::getLoc(), and clang::AttributeCommonInfo::isRegularKeywordAttribute().
Referenced by handleInternalLinkageAttr(), and mergeDeclAttribute().
MinSizeAttr * Sema::mergeMinSizeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI | ||
) |
Definition at line 4755 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), and clang::Decl::hasAttr().
Referenced by handleMinSizeAttr(), and mergeDeclAttribute().
MSInheritanceAttr * Sema::mergeMSInheritanceAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
bool | BestCase, | ||
MSInheritanceModel | Model | ||
) |
Definition at line 5879 of file SemaDeclAttr.cpp.
References checkMSInheritanceAttrOnDefinition(), Context, D, clang::SemaBase::Diag(), clang::Decl::dropAttr(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), and clang::AttributeCommonInfo::getRange().
Referenced by handleMSInheritanceAttr(), and mergeDeclAttribute().
void Sema::mergeObjCMethodDecls | ( | ObjCMethodDecl * | New, |
ObjCMethodDecl * | Old | ||
) |
Definition at line 4352 of file SemaDecl.cpp.
References AMK_OptionalProtocolImplementation, AMK_Override, AMK_ProtocolImplementation, AMK_Redeclaration, clang::SemaObjC::CheckObjCMethodOverride(), clang::Decl::getDeclContext(), clang::ObjCMethodDecl::isOptional(), mergeDeclAttributes(), mergeParamDeclAttributes(), ObjC(), clang::ObjCMethodDecl::param_begin(), and clang::ObjCMethodDecl::param_end().
Referenced by clang::SemaObjC::CheckObjCMethodOverrides().
OptimizeNoneAttr * Sema::mergeOptimizeNoneAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI | ||
) |
Definition at line 4768 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::Decl::dropAttr(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), and clang::Decl::hasAttr().
Referenced by handleOptimizeNoneAttr(), and mergeDeclAttribute().
SectionAttr * Sema::mergeSectionAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | Name | ||
) |
Definition at line 2873 of file SemaDeclAttr.cpp.
References Context, D, clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getAttributeSpellingListIndex(), clang::AttributeCommonInfo::getLoc(), and clang::FunctionDecl::isFunctionTemplateSpecialization().
Referenced by handleSectionAttr(), and mergeDeclAttribute().
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 2471 of file SemaDecl.cpp.
References clang::C11, clang::Type::castAs(), Context, clang::CPlusPlus, CurContext, D, clang::SemaBase::Diag(), clang::TypedefNameDecl::getAnonDeclWithTypedefName(), clang::LookupResult::getAsSingle(), clang::NamedDecl::getDeclName(), getDiagnostics(), clang::NamedDecl::getIdentifier(), getLangOpts(), clang::Decl::getLocation(), getNonFieldDeclScope(), clang::ASTContext::getObjCClassType(), clang::ASTContext::getObjCIdType(), clang::ASTContext::getObjCSelType(), getPointeeType(), clang::LookupResult::getRepresentativeDecl(), clang::ASTContext::getSourceManager(), clang::QualType::getTypePtr(), clang::TypedefNameDecl::getUnderlyingType(), hasVisibleDefinition(), IdResolver, clang::Scope::isDeclScope(), clang::Decl::isImplicit(), isIncompatibleTypedef(), clang::SourceManager::isInSystemHeader(), clang::Decl::isInvalidDecl(), clang::Type::isPointerType(), clang::Type::isStructureType(), clang::SourceLocation::isValid(), clang::Type::isVoidPointerType(), makeMergedDefinitionVisible(), mergeDeclAttributes(), clang::NewTag, notePreviousDefinition(), ObjC(), clang::Scope::RemoveDecl(), clang::IdentifierResolver::RemoveDecl(), clang::Decl::setInvalidDecl(), clang::TypedefNameDecl::setModedTypeSourceInfo(), clang::ASTContext::setObjCClassRedefinitionType(), clang::ASTContext::setObjCIdRedefinitionType(), clang::ASTContext::setObjCSelRedefinitionType(), clang::Redeclarable< decl_type >::setPreviousDecl(), clang::TypeDecl::setTypeForDecl(), clang::TypedefNameDecl::setTypeSourceInfo(), and clang::T.
Referenced by ActOnTypedefNameDecl().
TypeVisibilityAttr * Sema::mergeTypeVisibilityAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
TypeVisibilityAttr::VisibilityType | Vis | ||
) |
Definition at line 2604 of file SemaDeclAttr.cpp.
References D.
Referenced by handleVisibilityAttr(), and mergeDeclAttribute().
UuidAttr * Sema::mergeUuidAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
StringRef | UuidAsWritten, | ||
MSGuidDecl * | GuidDecl | ||
) |
Definition at line 5586 of file SemaDeclAttr.cpp.
References Context, D, clang::declaresSameEntity(), clang::SemaBase::Diag(), clang::Decl::dropAttr(), clang::Decl::getAttr(), and clang::AttributeCommonInfo::getLoc().
Referenced by handleUuidAttr(), and mergeDeclAttribute().
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 4507 of file SemaDecl.cpp.
References adjustDeclContextForDeclaratorDecl(), CheckRedeclarationInModule(), checkVarDeclRedefinition(), clang::CPlusPlus, D, clang::VarDecl::DeclarationOnly, clang::VarDecl::Definition, clang::SemaBase::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(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::Redeclarable< decl_type >::getMostRecentDecl(), getNoteDiagForInvalidRedeclaration(), clang::Decl::getPreviousDecl(), 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(), mergeDeclAttributes(), mergeTypeWithPrevious(), MergeVarDeclTypes(), notePreviousDefinition(), Previous, clang::SC_Static, clang::Decl::setAccess(), clang::VarDecl::setImplicitlyInline(), clang::Decl::setInvalidDecl(), clang::Decl::setIsUsed(), clang::Redeclarable< decl_type >::setPreviousDecl(), TemplateParameterListsAreEqual(), clang::VarDecl::TLS_Dynamic, TPL_TemplateMatch, and UndefinedButUsed.
Referenced by CheckVariableDeclaration().
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 1589 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), CheckEquivalentExceptionSpec(), Context, clang::Type::getAs(), getLangOpts(), clang::Decl::getLocation(), clang::Type::getPointeeType(), getPointeeType(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::Type::isFunctionProtoType(), P, and clang::Decl::setInvalidDecl().
Referenced by MergeVarDeclTypes().
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 4391 of file SemaDecl.cpp.
References clang::Type::containsErrors(), Context, clang::CPlusPlus, clang::ASTContext::DependentTy, diagnoseVarDeclTypeMismatch(), clang::ASTContext::getAsArrayType(), clang::ArrayType::getElementType(), getLangOpts(), clang::Redeclarable< decl_type >::getMostRecentDecl(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::Type::isIncompleteArrayType(), clang::Decl::isInvalidDecl(), clang::VarDecl::isLocalVarDecl(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::Type::isUndeducedType(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), MergeVarDeclExceptionSpecs(), and clang::ValueDecl::setType().
Referenced by DeduceVariableDeclarationType(), and MergeVarDecl().
VisibilityAttr * Sema::mergeVisibilityAttr | ( | Decl * | D, |
const AttributeCommonInfo & | CI, | ||
VisibilityAttr::VisibilityType | Vis | ||
) |
Definition at line 2597 of file SemaDeclAttr.cpp.
References D.
Referenced by handleVisibilityAttr(), and mergeDeclAttribute().
|
inline |
Determine whether it's plausible that E was intended to be a template-name.
Definition at line 3389 of file Sema.h.
References clang::CPlusPlus, clang::Dependent, E, and getLangOpts().
|
inline |
Definition at line 1096 of file Sema.h.
Referenced by handleInterruptAttr().
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 1291 of file SemaAttr.cpp.
References AddOptnoneAttributeIfNoConflicts(), clang::DeclaratorDecl::getBeginLoc(), and MSPragmaOptimizeIsOn.
Referenced by ActOnFunctionDeclarator().
|
inline |
Definition at line 1101 of file Sema.h.
Referenced by handleInterruptAttr().
|
inline |
Definition at line 7789 of file Sema.h.
References currentEvaluationContext(), and clang::Sema::ExpressionEvaluationContextRecord::RebuildDefaultArgOrDefaultInit.
Referenced by BuildCXXDefaultArgExpr(), and BuildCXXDefaultInitExpr().
bool Sema::NeedToCaptureVariable | ( | ValueDecl * | Var, |
SourceLocation | Loc | ||
) |
Checks if the variable must be captured.
Definition at line 19255 of file SemaExpr.cpp.
References Loc, TryCapture_Implicit, and tryCaptureVariable().
Referenced by BuildDeclRefExpr().
void Sema::NoteAllFoundTemplates | ( | TemplateName | Name | ) |
Definition at line 3059 of file SemaTemplate.cpp.
References clang::SemaBase::Diag().
Referenced by ActOnCXXNestedNameSpecifier(), ActOnTypenameType(), and CheckTemplateIdType().
void Sema::NoteAllOverloadCandidates | ( | Expr * | E, |
QualType | DestType = QualType() , |
||
bool | TakingAddress = false |
||
) |
Definition at line 11216 of file SemaOverload.cpp.
References clang::CRK_None, clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::Expr::getType(), and clang::ASTContext::OverloadTy.
Referenced by DiagnoseAssignmentResult(), and handleCleanupAttr().
void Sema::NoteDeletedFunction | ( | FunctionDecl * | FD | ) |
Emit a note explaining that this function is deleted.
Definition at line 121 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), DiagnoseDeletedDefaultedFunction(), clang::Decl::getLocation(), clang::Decl::isImplicit(), and NoteDeletedInheritingConstructor().
Referenced by CheckCXX98CompatAccessibleCopy(), CopyObject(), DeduceTemplateSpecializationFromInitializer(), clang::InitializationSequence::Diagnose(), DiagnoseUseOfDecl(), and FindDeallocationFunction().
void Sema::NoteDeletedInheritingConstructor | ( | CXXConstructorDecl * | CD | ) |
Definition at line 14057 of file SemaDeclCXX.cpp.
References clang::DefaultConstructor, clang::CXXConstructorDecl::getInheritedConstructor(), clang::Decl::getLocation(), clang::InheritedConstructor::getShadowDecl(), and ShouldDeleteSpecialMember().
Referenced by NoteDeletedFunction().
void Sema::NoteHiddenVirtualMethods | ( | CXXMethodDecl * | MD, |
SmallVectorImpl< CXXMethodDecl * > & | OverloadedMethods | ||
) |
Definition at line 10317 of file SemaDeclCXX.cpp.
References clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::ValueDecl::getType(), HandleFunctionTypeMismatch(), and clang::SemaBase::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 11139 of file SemaOverload.cpp.
References checkAddressOfCandidateIsAvailable(), Diag(), clang::Found, and shouldSkipNotingLambdaConversionDecl().
Referenced by CheckFunctionTemplateSpecialization(), clang::ImplicitConversionSequence::DiagnoseAmbiguousConversion(), LookupLiteralOperator(), and NoteFunctionCandidate().
void Sema::notePreviousDefinition | ( | const NamedDecl * | Old, |
SourceLocation | New | ||
) |
Definition at line 4746 of file SemaDecl.cpp.
References clang::Module::DefinitionLoc, clang::SemaBase::Diag(), getCurrentModule(), clang::SourceManager::getDecomposedLoc(), clang::SourceManager::getFileEntryForID(), clang::SourceManager::getFileEntryRefForID(), clang::SourceManager::getFilename(), clang::Module::getFullModuleName(), clang::Preprocessor::getHeaderSearchInfo(), clang::SourceManager::getIncludeLoc(), clang::Decl::getLocation(), clang::Decl::getOwningModule(), getSourceManager(), clang::SourceManager::getSpellingLoc(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), and PP.
Referenced by ActOnEnumConstant(), ActOnTag(), CheckConceptRedefinition(), checkNewAttributesAfterDef(), checkVarDeclRedefinition(), isIncompatibleTypedef(), MergeFunctionDecl(), MergeTypedefNameDecl(), and MergeVarDecl().
void Sema::NoteTemplateLocation | ( | const NamedDecl & | Decl, |
std::optional< SourceRange > | ParamRange = {} |
||
) |
Definition at line 7436 of file SemaTemplate.cpp.
References clang::Decl::getLocation(), clang::SourceLocation::isValid(), and noteLocation().
Referenced by CheckDeductionGuideDeclarator(), checkMoreSpecializedThanPrimary(), CheckTemplateArgumentList(), CheckTypenameType(), DeduceTemplateSpecializationFromInitializer(), diagnoseMissingArgument(), diagnoseMissingTemplateArguments(), DiagnoseUninstantiableTemplate(), GetDeclSpecTypeForDeclarator(), and GetNameFromUnqualifiedId().
void Sema::NoteTemplateParameterLocation | ( | const NamedDecl & | Decl | ) |
Definition at line 7448 of file SemaTemplate.cpp.
References noteLocation().
Referenced by ActOnStartOfLambdaDefinition(), CheckNonTypeTemplatePartialSpecializationArgs(), CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentList(), CheckTemplateArgumentPointerToMember(), CheckTemplateTypeArgument(), DiagnoseTemplateParameterShadow(), and isNullPointerValueTemplateArgument().
|
inline |
Definition at line 1111 of file Sema.h.
Referenced by ActOnCastExpr(), ActOnCXXForRangeStmt(), ActOnDependentMemberExpr(), ActOnEndOfTranslationUnit(), ActOnFields(), ActOnFinishFunctionBody(), ActOnFunctionDeclarator(), ActOnIdExpression(), ActOnModuleImport(), ActOnNameClassifiedAsNonType(), ActOnPopScope(), ActOnVariableDeclarator(), AddClassMessageCompletions(), AddInitializerToDecl(), addMethodsToPool(), applyCocoaAPICheck(), attemptRecovery(), BuildExceptionDeclaration(), BuildFunctionType(), BuildLambdaExpr(), CheckAssignmentConstraints(), CheckAssignmentOperands(), clang::checkCollectionLiteralElement(), CheckCompareOperands(), CheckCompleteVariableDeclaration(), CheckConditionalOperands(), CheckFieldDecl(), CheckFunctionCall(), CheckImplicitConversion(), CheckKeyForObjCARCConversion(), CheckObjCCollectionLiteralElement(), CheckPlaceholderExpr(), CheckPropertyAgainstProtocol(), CheckSingleAssignmentConstraints(), clang::checkSwiftAsyncErrorBlock(), CheckTautologicalComparison(), checkUnsafeAssignLiteral(), ClassifyName(), classifyPointerDeclarator(), clang::SemaCodeCompletion::CodeCompleteObjCClassPropertyRefExpr(), clang::SemaCodeCompletion::CodeCompleteObjCInstanceMessage(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDeclSelector(), clang::SemaCodeCompletion::CodeCompleteObjCProtocolReferences(), clang::SemaCodeCompletion::CodeCompleteObjCSelector(), CreateBuiltinArraySubscriptExpr(), CXXCheckConditionalOperands(), DeduceVariableDeclarationType(), DefaultVariadicArgumentPromotion(), DiagnoseAssignmentAsCondition(), DiagnoseAssignmentResult(), DiagnoseCStringFormatDirectiveInObjCAPI(), DiagnoseFloatingImpCast(), DiagnoseMismatchedSelectors(), diagnoseObjCARCConversion(), diagnoseObjCLiteralComparison(), DiagnoseUnusedOfDecl(), emitBadConversionNotes(), FinishCXXForRangeStmt(), FinishForRangeVarDecl(), GatherArgumentsForCall(), clang::Parser::getObjCDeclContext(), GetTypeForDeclaratorCast(), handleFormatArgAttr(), handleFormatAttr(), handleFunctionTypeAttr(), hasIsEqualMethod(), HelperIsMethodInObjCType(), HelperToDiagnoseMismatchedMethodsInGlobalPool(), clang::InitializationSequence::InitializeFrom(), InstantiateAttrs(), clang::isErrorParameter(), isMethodDeclaredInRootProtocol(), IsStandardConversion(), clang::Parser::ObjCTypeParamListScope::leave(), LookupDirectMethodInGlobalPool(), LookupMemberExpr(), LookupMethodInReceiverType(), LookupObjCInterfaceDeclForLiteral(), mergeObjCMethodDecls(), MergeTypedefNameDecl(), moveMethodToBackOfGlobalList(), PerformImplicitConversion(), ProcessAPINotes(), ProcessDeclAttribute(), clang::ASTReader::ReadMethodPool(), clang::TreeTransform< Derived >::RebuildCXXForRangeStmt(), clang::TreeTransform< Derived >::RebuildObjCArrayLiteral(), clang::TreeTransform< Derived >::RebuildObjCAtCatchStmt(), clang::TreeTransform< Derived >::RebuildObjCAtFinallyStmt(), clang::TreeTransform< Derived >::RebuildObjCAtSynchronizedOperand(), clang::TreeTransform< Derived >::RebuildObjCAtSynchronizedStmt(), clang::TreeTransform< Derived >::RebuildObjCAtThrowStmt(), clang::TreeTransform< Derived >::RebuildObjCAtTryStmt(), clang::TreeTransform< Derived >::RebuildObjCAutoreleasePoolStmt(), clang::TreeTransform< Derived >::RebuildObjCBoxedExpr(), clang::TreeTransform< Derived >::RebuildObjCDictionaryLiteral(), clang::TreeTransform< Derived >::RebuildObjCEncodeExpr(), clang::TreeTransform< Derived >::RebuildObjCExceptionDecl(), clang::TreeTransform< Derived >::RebuildObjCForCollectionStmt(), clang::TreeTransform< Derived >::RebuildObjCMessageExpr(), clang::TreeTransform< Derived >::RebuildObjCObjectType(), clang::TreeTransform< Derived >::RebuildObjCSubscriptRefExpr(), clang::TreeTransform< Derived >::RebuildObjCTypeParamType(), Sema(), ShouldDiagnoseAvailabilityOfDecl(), tryObjCWritebackConversion(), and ValidateObjCLiteralInterfaceDecl().
|
inline |
Definition at line 1116 of file Sema.h.
Referenced by ActOnArraySubscriptExpr(), BuildCXXThrow(), clang::Parser::ParseOpenACCDirectiveStmt(), clang::TreeTransform< Derived >::RebuildArraySectionExpr(), clang::TreeTransform< Derived >::RebuildOpenACCAsteriskSizeExpr(), clang::TreeTransform< Derived >::RebuildOpenACCCombinedConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCComputeConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCDataConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCEnterDataConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCExitDataConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCHostDataConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCInitConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCLoopConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCSetConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCShutdownConstruct(), clang::TreeTransform< Derived >::RebuildOpenACCUpdateConstruct(), and clang::TreeTransform< Derived >::RebuildOpenACCWaitConstruct().
|
inline |
Definition at line 1121 of file Sema.h.
Referenced by ActOnCastExpr(), ActOnFunctionDeclarator(), ActOnNumericConstant(), ActOnParamDeclarator(), ActOnUninitializedDecl(), ActOnVariableDeclarator(), BuildArrayType(), BuildBlockPointerType(), BuildMemberPointerType(), BuildPointerType(), BuildReferenceType(), BuildVectorLiteral(), CheckAssignmentOperands(), CheckCompareOperands(), CheckCompleteVariableDeclaration(), CheckConditionalOperands(), CheckExtVectorCast(), CheckMain(), CheckParameter(), CheckVariableDeclarationType(), CheckVectorLogicalOperands(), CheckVectorOperands(), CompleteVarTemplateSpecializationDecl(), CreateBuiltinBinOp(), CreateBuiltinUnaryOp(), DeduceVariableDeclarationType(), DefaultLvalueConversion(), getDefaultCXXMethodAddrSpace(), Initialize(), LookupBuiltin(), and ProcessDeclAttribute().
|
inline |
Definition at line 1126 of file Sema.h.
Referenced by ActOnArraySubscriptExpr(), ActOnCallExpr(), ActOnDeclarator(), ActOnDecompositionDeclarator(), ActOnEndOfTranslationUnit(), actOnOMPReductionKindClause(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), BuildArrayType(), buildCapture(), buildCapturedStmtCaptureList(), BuildCXXForRangeStmt(), BuildFieldReferenceExpr(), buildImplicitMap(), BuildVAArgExpr(), captureInBlock(), captureInCapturedRegion(), CheckFunctionDeclaration(), DiagnoseUseOfDecl(), FinalizeDeclaratorGroup(), getEmissionStatus(), getNonOdrUseReasonInCurrentContext(), HandleDeclarator(), instantiateOMPDeclareSimdDeclAttr(), instantiateOMPDeclareVariantAttr(), isNonNegativeIntegerValue(), isOpenMPDeviceDelayedContext(), MarkExprReferenced(), MarkVarDeclODRUsed(), MarkVTableUsed(), ProcessDeclAttribute(), processImplicitMapsWithDefaultMappers(), ProcessOpenMPDoacrossClauseCommon(), clang::TreeTransform< Derived >::RebuildArraySectionExpr(), clang::TreeTransform< Derived >::RebuildOMPAffinityClause(), clang::TreeTransform< Derived >::RebuildOMPAlignClause(), clang::TreeTransform< Derived >::RebuildOMPAlignedClause(), clang::TreeTransform< Derived >::RebuildOMPAllocateClause(), clang::TreeTransform< Derived >::RebuildOMPAllocatorClause(), clang::TreeTransform< Derived >::RebuildOMPArrayShapingExpr(), clang::TreeTransform< Derived >::RebuildOMPAtClause(), clang::TreeTransform< Derived >::RebuildOMPBindClause(), clang::TreeTransform< Derived >::RebuildOMPCanonicalLoop(), clang::TreeTransform< Derived >::RebuildOMPCollapseClause(), clang::TreeTransform< Derived >::RebuildOMPCopyinClause(), clang::TreeTransform< Derived >::RebuildOMPCopyprivateClause(), clang::TreeTransform< Derived >::RebuildOMPDefaultClause(), clang::TreeTransform< Derived >::RebuildOMPDefaultmapClause(), clang::TreeTransform< Derived >::RebuildOMPDependClause(), clang::TreeTransform< Derived >::RebuildOMPDepobjClause(), clang::TreeTransform< Derived >::RebuildOMPDestroyClause(), clang::TreeTransform< Derived >::RebuildOMPDetachClause(), clang::TreeTransform< Derived >::RebuildOMPDeviceClause(), clang::TreeTransform< Derived >::RebuildOMPDistScheduleClause(), clang::TreeTransform< Derived >::RebuildOMPDoacrossClause(), clang::TreeTransform< Derived >::RebuildOMPExclusiveClause(), clang::TreeTransform< Derived >::RebuildOMPExecutableDirective(), clang::TreeTransform< Derived >::RebuildOMPFilterClause(), clang::TreeTransform< Derived >::RebuildOMPFinalClause(), clang::TreeTransform< Derived >::RebuildOMPFirstprivateClause(), clang::TreeTransform< Derived >::RebuildOMPFlushClause(), clang::TreeTransform< Derived >::RebuildOMPFromClause(), clang::TreeTransform< Derived >::RebuildOMPFullClause(), clang::TreeTransform< Derived >::RebuildOMPGrainsizeClause(), clang::TreeTransform< Derived >::RebuildOMPHasDeviceAddrClause(), clang::TreeTransform< Derived >::RebuildOMPHintClause(), clang::TreeTransform< Derived >::RebuildOMPHoldsClause(), clang::TreeTransform< Derived >::RebuildOMPIfClause(), clang::TreeTransform< Derived >::RebuildOMPInclusiveClause(), clang::TreeTransform< Derived >::RebuildOMPInformationalDirective(), clang::TreeTransform< Derived >::RebuildOMPInitClause(), clang::TreeTransform< Derived >::RebuildOMPInReductionClause(), clang::TreeTransform< Derived >::RebuildOMPIsDevicePtrClause(), clang::TreeTransform< Derived >::RebuildOMPIteratorExpr(), clang::TreeTransform< Derived >::RebuildOMPLastprivateClause(), clang::TreeTransform< Derived >::RebuildOMPLinearClause(), clang::TreeTransform< Derived >::RebuildOMPMapClause(), clang::TreeTransform< Derived >::RebuildOMPMessageClause(), clang::TreeTransform< Derived >::RebuildOMPNocontextClause(), clang::TreeTransform< Derived >::RebuildOMPNontemporalClause(), clang::TreeTransform< Derived >::RebuildOMPNovariantsClause(), clang::TreeTransform< Derived >::RebuildOMPNumTasksClause(), clang::TreeTransform< Derived >::RebuildOMPNumTeamsClause(), clang::TreeTransform< Derived >::RebuildOMPNumThreadsClause(), clang::TreeTransform< Derived >::RebuildOMPOrderClause(), clang::TreeTransform< Derived >::RebuildOMPOrderedClause(), clang::TreeTransform< Derived >::RebuildOMPPartialClause(), clang::TreeTransform< Derived >::RebuildOMPPermutationClause(), clang::TreeTransform< Derived >::RebuildOMPPriorityClause(), clang::TreeTransform< Derived >::RebuildOMPPrivateClause(), clang::TreeTransform< Derived >::RebuildOMPProcBindClause(), clang::TreeTransform< Derived >::RebuildOMPReductionClause(), clang::TreeTransform< Derived >::RebuildOMPSafelenClause(), clang::TreeTransform< Derived >::RebuildOMPScheduleClause(), clang::TreeTransform< Derived >::RebuildOMPSeverityClause(), clang::TreeTransform< Derived >::RebuildOMPSharedClause(), clang::TreeTransform< Derived >::RebuildOMPSimdlenClause(), clang::TreeTransform< Derived >::RebuildOMPSizesClause(), clang::TreeTransform< Derived >::RebuildOMPTaskReductionClause(), clang::TreeTransform< Derived >::RebuildOMPThreadLimitClause(), clang::TreeTransform< Derived >::RebuildOMPToClause(), clang::TreeTransform< Derived >::RebuildOMPUseClause(), clang::TreeTransform< Derived >::RebuildOMPUseDeviceAddrClause(), clang::TreeTransform< Derived >::RebuildOMPUseDevicePtrClause(), clang::TreeTransform< Derived >::RebuildOMPUsesAllocatorsClause(), clang::TreeTransform< Derived >::RebuildOMPXAttributeClause(), clang::TreeTransform< Derived >::RebuildOMPXBareClause(), clang::TreeTransform< Derived >::RebuildOMPXDynCGroupMemClause(), Sema(), setBranchProtectedScope(), tryCaptureVariable(), and ~Sema().
|
inline |
Definition at line 7816 of file Sema.h.
References ExprEvalContexts, and PotentiallyEvaluated.
Referenced by BuildCXXDefaultArgExpr(), and BuildCXXDefaultInitExpr().
|
inline |
Definition at line 6459 of file Sema.h.
References ExprEvalContexts.
Referenced by BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), DeduceTemplateArguments(), InstantiateVariableInitializer(), parentEvaluationContext(), PopExpressionEvaluationContext(), PushExpressionEvaluationContext(), and TransformToPotentiallyEvaluated().
|
inline |
Definition at line 6465 of file Sema.h.
References parentEvaluationContext().
Decl * Sema::ParsedFreeStandingDeclSpec | ( | Scope * | S, |
AccessSpecifier | AS, | ||
DeclSpec & | DS, | ||
const ParsedAttributesView & | DeclAttrs, | ||
MultiTemplateParamsArg | TemplateParams, | ||
bool | IsExplicitInstantiation, | ||
RecordDecl *& | AnonRecord, | ||
SourceLocation | EllipsisLoc = {} |
||
) |
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 5049 of file SemaDecl.cpp.
References ActOnDocumentableDecl(), ActOnFriendTypeDecl(), BuildAnonymousStructOrUnion(), BuildMicrosoftCAnonymousStruct(), Context, clang::CPlusPlus, clang::FixItHint::CreateRemoval(), CurContext, clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), clang::ParsedAttributesView::empty(), clang::Enum, clang::OpaquePtr< PtrTy >::get(), clang::Type::getAsStructureType(), clang::Type::getAsUnionType(), clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getAttributes(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getConstexprSpecifier(), clang::DeclSpec::getConstexprSpecLoc(), clang::DeclSpec::getConstSpecLoc(), GetDiagnosticTypeSpecifierID(), clang::DeclSpec::getInlineSpecLoc(), getLangOpts(), clang::DeclSpec::getModulePrivateSpecLoc(), clang::ASTContext::getPrintingPolicy(), clang::DeclSpec::getRepAsDecl(), clang::DeclSpec::getRepAsType(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getUnalignedSpecLoc(), handleTagNumbering(), clang::DeclSpec::hasConstexprSpecifier(), clang::DeclSpec::isExternInLinkageSpec(), clang::DeclSpec::isFriendSpecified(), clang::DeclContext::isFunctionOrMethod(), clang::DeclSpec::isInlineSpecified(), clang::SourceLocation::isInvalid(), clang::Decl::isInvalidDecl(), clang::DeclSpec::isMissingDeclaratorOk(), clang::DeclSpec::isModulePrivateSpecified(), clang::DeclContext::isRecord(), clang::DeclSpec::SCS_mutable, clang::DeclSpec::SCS_typedef, clang::DeclSpec::SCS_unspecified, clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, clang::DeclSpec::TQ_unaligned, clang::DeclSpec::TQ_volatile, clang::DeclSpec::TST_class, clang::DeclSpec::TST_enum, clang::DeclSpec::TST_error, clang::DeclSpec::TST_interface, clang::DeclSpec::TST_struct, clang::DeclSpec::TST_typename, and clang::DeclSpec::TST_union.
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 4824 of file SemaDecl.cpp.
References ParsedFreeStandingDeclSpec().
Referenced by ParsedFreeStandingDeclSpec().
LifetimeCaptureByAttr * Sema::ParseLifetimeCaptureByAttr | ( | const ParsedAttr & | AL, |
StringRef | ParamName | ||
) |
Definition at line 3906 of file SemaDeclAttr.cpp.
References Context, clang::SemaBase::Diag(), E, clang::ParsedAttr::getArgAsExpr(), clang::ParsedAttr::getArgAsIdent(), clang::Expr::getExprLoc(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierInfo::getName(), clang::ParsedAttr::getNumArgs(), clang::AttributeCommonInfo::getRange(), clang::IdentifierLoc::Ident, clang::ParsedAttr::isArgExpr(), clang::ParsedAttr::isArgIdent(), and clang::IdentifierLoc::Loc.
Referenced by handleLifetimeCaptureByAttr().
TypedefDecl * Sema::ParseTypedefDecl | ( | Scope * | S, |
Declarator & | D, | ||
QualType | T, | ||
TypeSourceInfo * | TInfo | ||
) |
Subroutines of ActOnDeclarator().
Definition at line 16804 of file SemaDecl.cpp.
References Context, clang::TypedefDecl::Create(), clang::FixItHint::CreateRemoval(), CurContext, D, clang::SemaBase::Diag(), clang::Decl::getBeginLoc(), clang::Decl::getLocation(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::DeclContext::isFunctionOrMethod(), clang::Decl::setInvalidDecl(), clang::NamedDecl::setModulePrivate(), setTagNameForLinkagePurposes(), clang::T, clang::TST_class, clang::TST_enum, clang::TST_interface, clang::TST_struct, and clang::TST_union.
Referenced by ActOnTypedefDeclarator().
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 6665 of file SemaOverload.cpp.
References clang::UnresolvedSetImpl::addDecl(), clang::OverloadCandidateSet::BestViableFunction(), collectViableConversionCandidates(), clang::CPlusPlus14, clang::OverloadCandidateSet::CSK_Normal, D, diagnoseAmbiguousConversion(), clang::Sema::ContextualImplicitConverter::diagnoseIncomplete(), clang::Sema::ContextualImplicitConverter::diagnoseNoMatch(), diagnoseNoViableConversion(), E, clang::ExprError(), finishContextualImplicitConversion(), clang::Found, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::CXXConversionDecl::getConversionType(), clang::RecordType::getDecl(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Expr::hasPlaceholderType(), clang::CXXConversionDecl::isExplicit(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), Loc, clang::DeclAccessPair::make(), clang::Sema::ContextualImplicitConverter::match(), clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, recordConversion(), clang::UnresolvedSetImpl::size(), clang::Sema::ContextualImplicitConverter::Suppress, and clang::T.
Referenced by ActOnCXXDelete(), clang::SemaOpenACC::ActOnIntExpr(), BuildCXXNew(), CheckSwitchCondition(), clang::SemaOpenMP::PerformOpenMPImplicitIntegerConversion(), and VerifyIntegerConstantExpression().
ExprResult Sema::PerformContextuallyConvertToBool | ( | Expr * | From | ) |
PerformContextuallyConvertToBool - Perform a contextual conversion of the expression From to bool (C++0x [conv]p3).
Definition at line 6059 of file SemaOverload.cpp.
References clang::ASTContext::BoolTy, checkPlaceholderForOverload(), clang::Converting, Diag(), clang::ExprError(), clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ImplicitConversionSequence::isBad(), and TryContextuallyConvertToBool().
Referenced by buildCoawaitCalls(), BuildCXXAssumeExpr(), BuildStaticAssertDeclaration(), CheckConstraintSatisfaction(), CheckCXXBooleanCondition(), checkFunctionConditionAttr(), CheckLogicalOperands(), and instantiateDependentFunctionAttrCondition().
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 6446 of file SemaOverload.cpp.
References checkPlaceholderForOverload(), clang::Converting, clang::ExprError(), clang::ASTContext::getObjCIdType(), clang::ImplicitConversionSequence::isBad(), and TryContextuallyConvertToObjCPointer().
Referenced by clang::SemaObjC::ActOnObjCAtSynchronizedOperand(), clang::SemaObjC::BuildInstanceMessage(), and clang::SemaCodeCompletion::CodeCompleteObjCInstanceMessage().
ExprResult Sema::PerformCopyInitialization | ( | const InitializedEntity & | Entity, |
SourceLocation | EqualLoc, | ||
ExprResult | Init, | ||
bool | TopLevelOfInitList = false , |
||
bool | AllowExplicit = false |
||
) |
Definition at line 9771 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::Init, clang::SourceLocation::isInvalid(), clang::InitializedEntity::isParameterKind(), clang::BadConversionSequence::no_conversion, clang::OR_No_Viable_Function, clang::ovl_fail_bad_conversion, clang::Result, clang::Seq, clang::InitializationSequence::SK_ConstructorInitialization, and clang::OverloadCandidate::Viable.
Referenced by ActOnBlockStmtExpr(), clang::SemaHLSL::ActOnOutParamExpr(), clang::SemaObjC::ActOnPropertyImplDecl(), ActOnStmtExprResult(), BuildAtomicExpr(), BuildBlockForLambdaConversion(), BuildConvertedConstantExpression(), clang::SemaObjC::BuildObjCBoxedExpr(), clang::SemaObjC::BuildObjCNumericLiteral(), BuildResolvedCallExpr(), BuildReturnStmt(), BuildVAArgExpr(), BuiltinAlignment(), BuiltinLaunder(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), checkBuiltinArgument(), clang::SemaRISCV::CheckBuiltinFunctionCall(), checkEscapingByref(), clang::SemaObjC::CheckMessageArgumentTypes(), CheckObjCCollectionLiteralElement(), checkUnknownAnyArg(), convertArgsForAvailabilityChecks(), convertArgumentToType(), CXXCheckConditionalOperands(), DefaultArgumentPromotion(), GatherArgumentsForCall(), InitializeExplicitObjectArgument(), makeLaunchBoundsArgExpr(), PerformMoveOrCopyInitialization(), and PrepareArgumentsForCallToObjectOfClassType().
void Sema::PerformDependentDiagnostics | ( | const DeclContext * | Pattern, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 6572 of file SemaTemplateInstantiateDecl.cpp.
References clang::DependentDiagnostic::Access, clang::DeclContext::ddiags(), and HandleDependentAccessCheck().
Referenced by InstantiateClass(), and InstantiateFunctionDefinition().
void clang::Sema::performFunctionEffectAnalysis | ( | TranslationUnitDecl * | TU | ) |
Definition at line 1486 of file SemaFunctionEffects.cpp.
References Diags, clang::DiagnosticsEngine::getIgnoreAllWarnings(), and hasUncompilableErrorOccurred().
Referenced by ActOnEndOfTranslationUnit().
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 1850 of file SemaOverload.cpp.
References checkPlaceholderForOverload(), clang::ExprError(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), clang::ObjC, clang::Passing, clang::Sending, 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 4224 of file SemaExprCXX.cpp.
References clang::UserDefinedConversionSequence::After, clang::ImplicitConversionSequence::AmbiguousConversion, clang::ImplicitConversionSequence::BadConversion, clang::UserDefinedConversionSequence::Before, BuildCXXCastArgument(), CheckAssignmentConstraints(), Compatible, Context, clang::UserDefinedConversionSequence::ConversionFunction, clang::Converting, 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(), clang::SemaBase::PDiag(), PerformImplicitConversion(), clang::ImplicitConversionSequence::Standard, clang::ImplicitConversionSequence::StandardConversion, clang::ImplicitConversionSequence::StaticObjectArgumentConversion, clang::ImplicitConversionSequence::UserDefined, and clang::ImplicitConversionSequence::UserDefinedConversion.
Referenced by ActOnCXXDelete(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPAllocateClause(), clang::SemaOpenMP::ActOnOpenMPAllocatorClause(), BuildConvertedConstantExpression(), buildCounterInit(), buildCounterUpdate(), BuildCXXNew(), CheckDestructor(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), checkOpenMPLoop(), CheckSingleAssignmentConstraints(), findOMPAllocatorHandleT(), clang::InitializationSequence::Perform(), PerformImplicitConversion(), 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 4338 of file SemaExprCXX.cpp.
References adjustVectorType(), clang::LangOptions::allowsNonTrivialObjCLifetimeQualifiers(), clang::Assigning, BuildCXXConstructExpr(), clang::Type::castAs(), clang::Casting, CheckDerivedToBaseConversion(), CheckExceptionSpecCompatibility(), CheckMemberPointerConversion(), clang::SemaObjC::CheckObjCConversion(), CheckPlaceholderExpr(), CheckPointerConversion(), CheckTransparentUnionArgumentConstraints(), Compatible, clang::Complete, CompleteConstructorCall(), Context, clang::Converting, clang::StandardConversionSequence::CopyConstructor, clang::CPlusPlus11, clang::ImplicitCastExpr::Create(), clang::CStyleCast, DefaultLvalueConversion(), clang::StandardConversionSequence::DeprecatedStringLiteralToCharPtr, clang::SemaBase::Diag(), diagnoseNullableToNonnullConversion(), DiagnoseUseOfDecl(), clang::StandardConversionSequence::Dimension, E, clang::SemaObjC::EmitRelatedResultTypeNote(), clang::ExprError(), clang::StandardConversionSequence::First, FixOverloadedFunctionReference(), clang::ASTContext::FloatTy, clang::Found, 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(), getASTContext(), clang::Stmt::getBeginLoc(), clang::ASTContext::getBlockPointerType(), clang::ArrayParameterType::getConstantArrayType(), clang::TargetInfo::getCXXABI(), clang::EnumType::getDecl(), clang::Expr::getExprLoc(), clang::ASTContext::getExtVectorType(), getLangOpts(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::ASTContext::getObjCObjectPointerType(), clang::Expr::getObjectKind(), clang::Type::getPointeeType(), 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::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Qualifiers::hasUnaligned(), HLSL(), 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_Splat, 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::Initializing, clang::Qualifiers::isAddressSpaceSupersetOf(), clang::Type::isArrayParameterType(), clang::Type::isBlockPointerType(), clang::Type::isBooleanType(), clang::Type::isBuiltinType(), isCast(), isCompleteType(), 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::Passing, clang::Passing_CFAudited, clang::SemaObjC::PrepareCastToObjCObjectPointer(), prepareVectorSplat(), clang::ASTContext::removeAddrSpaceQualType(), ResolveAddressOfOverloadedFunction(), clang::Returning, ScalarTypeToBooleanCastKind(), clang::StandardConversionSequence::Second, clang::Sending, 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 5939 of file SemaOverload.cpp.
References clang::ImplicitConversionSequence::Bad, clang::BadConversionSequence::bad_qualifiers, clang::Expr::Classify(), Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::Qualifiers::getCVRQualifiers(), clang::NamedDecl::getDeclName(), clang::CXXMethodDecl::getFunctionObjectParameterType(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::CXXMethodDecl::getRefQualifier(), clang::Stmt::getSourceRange(), clang::CXXMethodDecl::getThisType(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::ASTContext::hasSameType(), clang::ICK_Derived_To_Base, clang::ImplicitConversionSequence::isBad(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isPRValue(), clang::Expr::Classification::isRValue(), clang::BadConversionSequence::Kind, clang::BadConversionSequence::lvalue_ref_to_rvalue, clang::Expr::Classification::makeSimpleLValue(), clang::BadConversionSequence::no_conversion, clang::RQ_RValue, clang::BadConversionSequence::rvalue_ref_to_lvalue, clang::StandardConversionSequence::Second, clang::ImplicitConversionSequence::Standard, clang::BadConversionSequence::too_few_initializers, clang::BadConversionSequence::too_many_initializers, TryObjectArgumentInitialization(), and clang::BadConversionSequence::unrelated_class.
Referenced by convertArgsForAvailabilityChecks().
ExprResult Sema::PerformMemberExprBaseConversion | ( | Expr * | Base, |
bool | IsArrow | ||
) |
Perform conversions on the LHS of a member access expression.
Definition at line 1314 of file SemaExprMember.cpp.
References CheckPlaceholderExpr(), and DefaultFunctionArrayLvalueConversion().
Referenced by clang::SemaCodeCompletion::CodeCompleteMemberReferenceExpr(), LookupMemberExpr(), and clang::TreeTransform< Derived >::RebuildMemberExpr().
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 3464 of file SemaStmt.cpp.
References Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus23, clang::ImplicitCastExpr::Create(), clang::InitializationKind::CreateCopy(), getLangOpts(), clang::Value::getType(), clang::Sema::NamedReturnInfo::isMoveEligible(), clang::ImplicitCastExpr::OnStack, clang::OR_Deleted, clang::OR_Success, PerformCopyInitialization(), clang::Seq, VerifyInitializationSequenceCXX98(), and clang::VK_XValue.
Referenced by ActOnCapScopeReturnStmt(), BuildCXXThrow(), BuildReturnStmt(), and checkEscapingByref().
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 2969 of file SemaExpr.cpp.
References clang::Type::castAs(), CheckDerivedToBaseConversion(), Context, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::ASTContext::getAddrSpaceQualType(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::ASTContext::getCanonicalType(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getTypeDeclType(), clang::Expr::getValueKind(), clang::ASTContext::hasSameUnqualifiedType(), ImpCastExprToType(), clang::Type::isDependentType(), IsDerivedFrom(), clang::Type::isRecordType(), clang::Member, and clang::ASTContext::removeAddrSpaceQualType().
Referenced by BuildFieldReferenceExpr(), and clang::TreeTransform< Derived >::RebuildMemberExpr().
Performs template instantiation for all implicit template instantiations we have seen until this point.
Definition at line 6486 of file SemaTemplateInstantiateDecl.cpp.
References Context, clang::ASTContext::forEachMultiversionedFunctionVersion(), clang::Function, getASTContext(), clang::Redeclarable< decl_type >::getMostRecentDecl(), clang::VarDecl::getTemplateSpecializationKind(), clang::VarDecl::getTemplateSpecializationKindForInstantiation(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), clang::FunctionDecl::isDefined(), clang::Decl::isInvalidDecl(), clang::VarDecl::isStaticDataMember(), LangOpts, PendingInstantiations, PendingLocalImplicitInstantiations, clang::FunctionDecl::setInstantiationIsPending(), 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 7618 of file SemaInit.cpp.
References E, clang::QualType::getAddressSpace(), clang::Type::getPointeeType(), clang::Expr::getType(), ImpCastExprToType(), and clang::VK_PRValue.
Referenced by clang::InitializationSequence::Perform().
void Sema::popCodeSynthesisContext | ( | ) |
Definition at line 823 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContextLookupModules, CodeSynthesisContexts, InNonInstantiationSFINAEContext, LastEmittedCodeSynthesisContextDepth, LookupModulesCache, and NonInstantiationEntries.
Referenced by clang::Sema::InstantiatingTemplate::Clear(), DeclareImplicitEqualityComparison(), and ReferenceDllExportedMembers().
void Sema::PopCompoundScope | ( | ) |
Definition at line 2330 of file Sema.cpp.
References clang::sema::FunctionScopeInfo::CompoundScopes.
Referenced by ActOnFinishOfCompoundStmt(), and ActOnFinishTopLevelStmtDecl().
void Sema::PopDeclContext | ( | ) |
Definition at line 1317 of file SemaDecl.cpp.
References CurContext, and clang::DeclContext::getLexicalParent().
Referenced by ActOnBlockError(), ActOnBlockStmtExpr(), ActOnCapturedRegionEnd(), ActOnCapturedRegionError(), clang::SemaHLSL::ActOnFinishBuffer(), ActOnFinishDelayedMemberDeclarations(), ActOnFinishExportDecl(), ActOnFinishFunctionBody(), ActOnFinishLinkageSpecification(), ActOnFinishNamespaceDef(), ActOnFinishTopLevelStmtDecl(), ActOnLambdaError(), ActOnLambdaExpressionAfterIntroducer(), clang::SemaObjC::ActOnObjCContainerFinishDefinition(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd(), ActOnTagDefinitionError(), and ActOnTagFinishDefinition().
void Sema::PopExpressionEvaluationContext | ( | ) |
Definition at line 17827 of file SemaExpr.cpp.
References Cleanup, CleanupVarDeclMarking(), clang::CPlusPlus17, clang::CPlusPlus20, clang::CPlusPlus23, D, clang::SemaBase::Diag(), ExprCleanupObjects, clang::Sema::ExpressionEvaluationContextRecord::ExprContext, ExprEvalContexts, clang::Sema::ExpressionEvaluationContextRecord::ForRangeLifetimeExtendTemps, getLangOpts(), HandleImmediateInvocations(), clang::Sema::ExpressionEvaluationContextRecord::InLifetimeExtendingContext, clang::Sema::ExpressionEvaluationContextRecord::isConstantEvaluated(), clang::Sema::ExpressionEvaluationContextRecord::isUnevaluated(), clang::Sema::ExpressionEvaluationContextRecord::Lambdas, MaybeODRUseExprs, clang::CleanupInfo::mergeFrom(), clang::Sema::ExpressionEvaluationContextRecord::NumCleanupObjects, clang::Sema::ExpressionEvaluationContextRecord::NumTypos, clang::Sema::ExpressionEvaluationContextRecord::ParentCleanup, parentEvaluationContext(), clang::Sema::ExpressionEvaluationContextRecord::SavedMaybeODRUseExprs, clang::Sema::ExpressionEvaluationContextRecord::VolatileAssignmentLHSs, and WarnOnPendingNoDerefs().
Referenced by ActOnBlockError(), ActOnBlockStmtExpr(), ActOnCapturedRegionEnd(), ActOnCapturedRegionError(), ActOnCXXExitDeclInitializer(), ActOnLambdaError(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd(), clang::SemaOpenACC::ActOnStartDeclDirective(), clang::SemaOpenACC::ActOnStartStmtDirective(), ActOnStmtExprError(), BuildLambdaExpr(), BuildStmtExpr(), LookupInlineAsmIdentifier(), clang::EnterExpressionEvaluationContext::~EnterExpressionEvaluationContext(), and ExitFunctionBodyRAII::~ExitFunctionBodyRAII().
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 2292 of file Sema.cpp.
References D, clang::SemaBase::Diag(), and markEscapingByrefs().
Referenced by ActOnBlockError(), ActOnBlockStmtExpr(), ActOnCapturedRegionEnd(), ActOnCapturedRegionError(), ActOnFinishCXXInClassMemberInitializer(), ActOnFinishFunctionBody(), ActOnFinishTopLevelStmtDecl(), ActOnLambdaError(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerEnd(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerEnd(), and clang::Sema::FunctionScopeRAII::~FunctionScopeRAII().
|
inline |
Definition at line 6085 of file Sema.h.
References clang::Sema::DelayedDiagnostics::popUndelayed().
void Sema::PopParsingDeclaration | ( | ParsingDeclState | state, |
Decl * | decl | ||
) |
Definition at line 7754 of file SemaDeclAttr.cpp.
References clang::sema::DelayedDiagnostic::Access, clang::sema::DelayedDiagnostic::Availability, clang::ast_matchers::decl, clang::sema::DelayedDiagnostic::ForbiddenType, clang::Sema::DelayedDiagnostics::getCurrentPool(), clang::sema::DelayedDiagnosticPool::getParent(), HandleDelayedAccessCheck(), handleDelayedAvailabilityCheck(), handleDelayedForbiddenType(), clang::sema::DelayedDiagnostic::Kind, clang::sema::DelayedDiagnosticPool::pool_begin(), clang::sema::DelayedDiagnosticPool::pool_end(), clang::Sema::DelayedDiagnostics::popWithoutEmitting(), and clang::sema::DelayedDiagnostic::Triggered.
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 1480 of file SemaAttr.cpp.
References clang::SemaBase::Diag(), FreeVisContext(), NoVisibility, and VisContext.
Referenced by ActOnFinishNamespaceDef(), and ActOnPragmaVisibility().
|
inline |
Definition at line 1131 of file Sema.h.
Referenced by BuildCXXThrow(), checkCall(), CheckFieldDecl(), CheckFunctionDeclaration(), CheckParameter(), and CheckVariableDeclarationType().
|
inline |
Definition at line 7497 of file Sema.h.
References clang::ASTContext::BoolTy, Context, clang::ASTContext::IntTy, and Switch.
Referenced by ActOnCondition().
Definition at line 14600 of file SemaChecking.cpp.
References checkArgCount(), checkMathBuiltinElementType(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CallExpr::setArg(), clang::Expr::setType(), and UsualUnaryConversions().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
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 7292 of file SemaExpr.cpp.
References clang::Type::castAs(), Context, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::ComplexType::getElementType(), clang::Expr::getExprLoc(), clang::Type::getPointeeType(), clang::Type::getScalarTypeKind(), clang::Expr::getType(), clang::ASTContext::hasCvrSimilarType(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), ImpCastExprToType(), clang::Expr::isNullPointerConstant(), maybeExtendBlockObject(), clang::Expr::NPC_ValueDependentIsNull, 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 BuildVectorLiteral(), CheckAssignmentConstraints(), CheckConditionalOperands(), CXXCheckConditionalOperands(), and prepareVectorSplat().
ExprResult Sema::prepareVectorSplat | ( | QualType | VectorTy, |
Expr * | SplattedExpr | ||
) |
Prepare SplattedExpr
for a vector splat operation, adding implicit casts if necessary.
Definition at line 7669 of file SemaExpr.cpp.
References clang::Type::castAs(), Context, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), ImpCastExprToType(), clang::ASTContext::IntTy, clang::Type::isBooleanType(), clang::Type::isExtVectorType(), clang::Type::isFloatingType(), clang::Type::isIntegralOrEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and PrepareScalarCast().
Referenced by CheckAssignmentConstraints(), CheckExtVectorCast(), and PerformImplicitConversion().
|
inline |
Definition at line 13220 of file Sema.h.
References CodeSynthesisContexts, LastEmittedCodeSynthesisContextDepth, PragmaAttributeCurrentTargetDecl, PrintInstantiationStack(), and PrintPragmaAttributeInstantiationPoint().
Referenced by BuildStaticAssertDeclaration(), and EmitDiagnostic().
void Sema::PrintInstantiationStack | ( | ) |
Prints the current instantiation stack through a series of notes.
Definition at line 901 of file SemaTemplateInstantiate.cpp.
References clang::Sema::DefaultedFunctionKind::asComparison(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), clang::Sema::CodeSynthesisContext::BuildingBuiltinDumpStructCall, clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, CodeSynthesisContexts, clang::Sema::CodeSynthesisContext::ConstraintNormalization, clang::Sema::CodeSynthesisContext::ConstraintsCheck, clang::Sema::CodeSynthesisContext::ConstraintSubstitution, Context, convertCallArgsToString(), D, 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, Diags, clang::Sema::CodeSynthesisContext::ExceptionSpecEvaluation, clang::Sema::CodeSynthesisContext::ExceptionSpecInstantiation, clang::Sema::CodeSynthesisContext::ExplicitTemplateArgumentSubstitution, clang::Function, clang::Decl::getDeclContext(), getDefaultedFunctionKind(), getLangOpts(), clang::NamedDecl::getName(), getPrintingPolicy(), clang::ASTContext::getTagDeclType(), getTemplateArgumentBindingsText(), clang::DiagnosticsEngine::getTemplateBacktraceLimit(), clang::TemplateDecl::getTemplateParameters(), clang::Sema::CodeSynthesisContext::InitializingStructuredBinding, int, clang::Sema::DefaultedFunctionKind::isComparison(), clang::Sema::DefaultedFunctionKind::isSpecialMember(), clang::Sema::CodeSynthesisContext::LambdaExpressionSubstitution, clang::Sema::CodeSynthesisContext::MarkingClassDllexported, clang::Sema::CodeSynthesisContext::Memoization, clang::Sema::CodeSynthesisContext::NestedRequirementConstraintsCheck, OS, clang::Sema::CodeSynthesisContext::ParameterMappingSubstitution, clang::NamedDecl::printName(), clang::printTemplateArgumentList(), clang::Sema::CodeSynthesisContext::PriorTemplateArgumentSubstitution, clang::DiagnosticsEngine::Report(), clang::Sema::CodeSynthesisContext::RequirementInstantiation, clang::Sema::CodeSynthesisContext::RequirementParameterInstantiation, clang::Sema::CodeSynthesisContext::RewritingOperatorAsSpaceship, clang::Sema::CodeSynthesisContext::TemplateInstantiation, and clang::Sema::CodeSynthesisContext::TypeAliasTemplateInstantiation.
Referenced by PrintContextStack().
void Sema::PrintPragmaAttributeInstantiationPoint | ( | ) |
Definition at line 1220 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 608 of file Sema.cpp.
References AnalysisWarnings, BumpAlloc, NumSFINAEErrors, and clang::sema::AnalysisBasedWarnings::PrintStats().
bool Sema::ProcessAccessDeclAttributeList | ( | AccessSpecDecl * | ASDecl, |
const ParsedAttributesView & | AttrList | ||
) |
Annotation attributes are the only attributes allowed after an access specifier.
Definition at line 7496 of file SemaDeclAttr.cpp.
References clang::SemaBase::Diag(), and ProcessDeclAttribute().
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 894 of file SemaAPINotes.cpp.
References APINotes, Category, clang::Class, Context, D, clang::api_notes::APINotesManager::findAPINotes(), clang::Found, clang::QualType::getAsString(), getASTContext(), clang::Decl::getDeclContext(), clang::Lexer::getImmediateMacroName(), clang::Decl::getLocation(), clang::Selector::getNameForSlot(), clang::Selector::getNumArgs(), getPrintingPolicy(), clang::api_notes::ObjCSelectorRef::Identifiers, clang::Selector::isUnarySelector(), clang::ObjCPropertyAttribute::kind_class, LangOpts, LookupName(), clang::api_notes::ObjCSelectorRef::NumArgs, ProcessVersionedAPINotes(), clang::Property, clang::T, UnwindNamespaceContext(), and UnwindTagContext().
Referenced by ActOnAliasDeclaration(), ActOnClassTemplateSpecialization(), ActOnEnumBody(), ActOnEnumConstant(), ActOnExplicitInstantiation(), ActOnFields(), ActOnFinishDelayedAttribute(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaObjC::ActOnStartClassInterface(), ActOnStartNamespaceDef(), clang::SemaObjC::ActOnStartProtocolInterface(), ActOnUsingDirective(), ProcessDeclAttributes(), clang::SemaObjC::ProcessPropertyDecl(), and setTagNameForLinkagePurposes().
void Sema::ProcessDeclAttributeDelayed | ( | Decl * | D, |
const ParsedAttributesView & | AttrList | ||
) |
Helper for delayed processing TransparentUnion or BPFPreserveAccessIndexAttr attribute.
Definition at line 7482 of file SemaDeclAttr.cpp.
References BPF(), D, clang::SemaBPF::handlePreserveAIRecord(), handleTransparentUnionAttr(), and clang::Decl::hasAttr().
void Sema::ProcessDeclAttributeList | ( | Scope * | S, |
Decl * | D, | ||
const ParsedAttributesView & | AttrList, | ||
const ProcessDeclAttributeOptions & | Options = ProcessDeclAttributeOptions() |
||
) |
ProcessDeclAttributeList - Apply all the decl attributes in the specified attribute list to the specified decl, ignoring any type attributes.
Definition at line 7406 of file SemaDeclAttr.cpp.
References clang::ParsedAttributesView::begin(), Context, D, clang::SemaBase::Diag(), clang::Decl::dropAttr(), clang::ParsedAttributesView::empty(), clang::ExpectedKernelFunction, clang::Decl::getAttr(), clang::Decl::getLocation(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Decl::hasAttr(), isKernelDecl(), clang::OMF_init, ProcessDeclAttribute(), and clang::Decl::setInvalidDecl().
Referenced by ActOnAliasDeclaration(), ActOnClassTemplateSpecialization(), ActOnDecompositionDeclarator(), ActOnEmptyDeclaration(), ActOnEnumBody(), ActOnEnumConstant(), ActOnExplicitInstantiation(), ActOnFields(), ActOnFinishConceptDefinition(), ActOnFinishDelayedAttribute(), clang::SemaObjC::ActOnForwardProtocolDeclaration(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaObjC::ActOnMethodParmDeclaration(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartCategoryInterface(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), ActOnStartNamespaceDef(), clang::SemaObjC::ActOnStartProtocolInterface(), ActOnTag(), ActOnUsingDirective(), AddPragmaAttributes(), BuildUsingDeclaration(), CheckClassTemplate(), and ProcessDeclAttributes().
void Sema::ProcessDeclAttributes | ( | Scope * | S, |
Decl * | D, | ||
const Declarator & | PD | ||
) |
ProcessDeclAttributes - Given a declarator (PD) with attributes indicated in it, apply them to D.
This is a bit tricky because PD can have attributes specified in many different places, and we need to find and apply them all.
Definition at line 7633 of file SemaDeclAttr.cpp.
References clang::ParsedAttributesView::addAtEnd(), AddPragmaAttributes(), D, clang::DeclSpec::getAttributes(), clang::Declarator::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::Declarator::getDeclarationAttributes(), clang::Declarator::getDeclSpec(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), ProcessAPINotes(), and ProcessDeclAttributeList().
Referenced by ActOnBlockArguments(), ActOnExceptionDeclarator(), ActOnFunctionDeclarator(), clang::SemaObjC::ActOnIvar(), clang::SemaObjC::ActOnObjCExceptionDecl(), ActOnParamDeclarator(), ActOnStartOfLambdaDefinition(), ActOnTypedefDeclarator(), ActOnVariableDeclarator(), BuildAnonymousStructOrUnion(), CheckFieldDecl(), clang::SemaObjC::CreatePropertyDecl(), and HandleMSProperty().
Definition at line 7603 of file SemaDeclAttr.cpp.
References D, DeclApplyPragmaWeak(), clang::NamedDecl::getIdentifier(), Id, clang::FunctionDecl::isExternC(), LoadExternalWeakUndeclaredIdentifiers(), and WeakUndeclaredIdentifiers.
Referenced by ActOnFunctionDeclarator(), and ActOnVariableDeclarator().
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 702 of file SemaStmtAttr.cpp.
References CheckForIncompatibleAttributes(), ProcessStmtAttribute(), and clang::ParsedAttributesView::Range.
Referenced by ActOnAttributedStmt().
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 6550 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(), and dllExportImportClassTemplateSpecialization().
|
inline |
Definition at line 1136 of file Sema.h.
Referenced by BuildBinOp(), BuildUnaryOp(), CheckPlaceholderExpr(), and clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
Definition at line 2192 of file Sema.cpp.
References clang::Block, and clang::SemaBase::getDiagnostics().
Referenced by ActOnBlockStart().
void Sema::PushCapturedRegionScope | ( | Scope * | RegionScope, |
CapturedDecl * | CD, | ||
RecordDecl * | RD, | ||
CapturedRegionKind | K, | ||
unsigned | OpenMPCaptureLevel = 0 |
||
) |
Definition at line 2721 of file Sema.cpp.
References clang::CR_OpenMP, clang::CapturedDecl::getContextParam(), clang::SemaBase::getDiagnostics(), clang::SemaBase::getLangOpts(), and clang::ASTContext::VoidTy.
Referenced by ActOnCapturedRegionStart().
void Sema::pushCodeSynthesisContext | ( | CodeSynthesisContext | Ctx | ) |
Definition at line 809 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, InNonInstantiationSFINAEContext, clang::Sema::CodeSynthesisContext::isInstantiationRecord(), NonInstantiationEntries, clang::Sema::CodeSynthesisContext::PointOfInstantiation, clang::Sema::CodeSynthesisContext::SavedInNonInstantiationSFINAEContext, and clang::StackExhaustionHandler::warnOnStackNearlyExhausted().
Referenced by DeclareImplicitEqualityComparison(), and ReferenceDllExportedMembers().
void Sema::PushCompoundScope | ( | bool | IsStmtExpr | ) |
Definition at line 2325 of file Sema.cpp.
Referenced by ActOnStartOfCompoundStmt(), and ActOnStartTopLevelStmtDecl().
void Sema::PushDeclContext | ( | Scope * | S, |
DeclContext * | DC | ||
) |
Set the current declaration context until it gets popped.
Definition at line 1310 of file SemaDecl.cpp.
References CurContext, and clang::DeclContext::getLexicalParent().
Referenced by ActOnBlockStart(), ActOnCapturedRegionStart(), ActOnLambdaClosureParameters(), ActOnLambdaExpressionAfterIntroducer(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerStart(), clang::SemaHLSL::ActOnStartBuffer(), ActOnStartDelayedMemberDeclarations(), ActOnStartExportDecl(), ActOnStartLinkageSpecification(), ActOnStartNamespaceDef(), ActOnStartOfFunctionDef(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), ActOnStartRequiresExpr(), ActOnStartTopLevelStmtDecl(), ActOnTagStartDefinition(), and ActOnTranslationUnitScope().
void Sema::PushExpressionEvaluationContext | ( | ExpressionEvaluationContext | NewContext, |
Decl * | LambdaContextDecl = nullptr , |
||
ExpressionEvaluationContextRecord::ExpressionKind | Type = ExpressionEvaluationContextRecord::EK_Other |
||
) |
Definition at line 17394 of file SemaExpr.cpp.
References Cleanup, ExprCleanupObjects, ExprEvalContexts, clang::Sema::ExpressionEvaluationContextRecord::isDiscardedStatementContext(), MaybeODRUseExprs, parentEvaluationContext(), and clang::CleanupInfo::reset().
Referenced by ActOnBlockStart(), ActOnCapturedRegionStart(), clang::SemaOpenACC::ActOnConstruct(), ActOnCXXEnterDeclInitializer(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerStart(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), ActOnStartStmtExpr(), clang::EnterExpressionEvaluationContext::EnterExpressionEvaluationContext(), LookupInlineAsmIdentifier(), PushExpressionEvaluationContext(), and clang::SemaOpenMP::StartOpenMPDSABlock().
void Sema::PushExpressionEvaluationContext | ( | ExpressionEvaluationContext | NewContext, |
ReuseLambdaContextDecl_t | , | ||
ExpressionEvaluationContextRecord::ExpressionKind | Type = ExpressionEvaluationContextRecord::EK_Other |
||
) |
Definition at line 17423 of file SemaExpr.cpp.
References ExprEvalContexts, and PushExpressionEvaluationContext().
void Sema::PushFunctionScope | ( | ) |
Enter a new function scope.
Definition at line 2180 of file Sema.cpp.
References clang::SemaBase::getDiagnostics().
Referenced by clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerStart(), ActOnStartCXXInClassMemberInitializer(), ActOnStartOfFunctionDef(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), and ActOnStartTopLevelStmtDecl().
LambdaScopeInfo * Sema::PushLambdaScope | ( | ) |
Definition at line 2198 of file Sema.cpp.
References clang::SemaBase::getDiagnostics().
Referenced by RebuildLambdaScopeInfo().
void Sema::PushNamespaceVisibilityAttr | ( | const VisibilityAttr * | Attr, |
SourceLocation | Loc | ||
) |
PushNamespaceVisibilityAttr - Note that we've entered a namespace with a visibility attribute.
Definition at line 1471 of file SemaAttr.cpp.
References Loc, NoVisibility, and PushPragmaVisibility().
Referenced by ActOnStartNamespaceDef().
Add this decl to the scope shadowed decl chains.
Definition at line 1499 of file SemaDecl.cpp.
References clang::DeclContext::addDecl(), clang::IdentifierResolver::AddDecl(), clang::IdentifierResolver::begin(), clang::CPlusPlus, CurContext, D, clang::DeclContext::Encloses(), clang::IdentifierResolver::end(), getLangOpts(), clang::DeclContext::getRedeclContext(), IdResolver, clang::IdentifierResolver::InsertDeclAfter(), clang::Decl::isOutOfLine(), clang::IdentifierResolver::RemoveDecl(), and warnOnReservedIdentifier().
Referenced by ActOnAliasDeclaration(), ActOnBlockArguments(), clang::SemaObjC::ActOnCompatibilityAlias(), ActOnDecompositionDeclarator(), clang::SemaObjC::ActOnDefs(), ActOnEnumConstant(), ActOnExceptionDeclarator(), ActOnFinishConceptDefinition(), clang::SemaObjC::ActOnForwardClassDeclaration(), clang::SemaObjC::ActOnForwardProtocolDeclaration(), ActOnFriendFunctionDecl(), ActOnLambdaClosureParameters(), ActOnLambdaExpressionAfterIntroducer(), ActOnNamespaceAliasDef(), clang::SemaObjC::actOnObjCTypeParamList(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirectiveVarDecl(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionDirectiveEnd(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerStart(), clang::SemaHLSL::ActOnStartBuffer(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), ActOnStartConceptDefinition(), ActOnStartCXXMemberDeclarations(), ActOnStartNamespaceDef(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), clang::SemaObjC::ActOnStartProtocolInterface(), ActOnStartRequiresExpr(), ActOnStartTrailingRequiresClause(), ActOnTag(), ActOnUsingDeclaration(), ActOnUsingEnumDeclaration(), addImplicitTypedef(), buildImplicitMapper(), BuildUsingShadowDecl(), CheckClassTemplate(), DeclApplyPragmaWeak(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), HandleDeclarator(), HandleField(), HandleMSProperty(), ImplicitlyDefineFunction(), Initialize(), InjectAnonymousStructOrUnionMembers(), LazilyCreateBuiltin(), and LookupOrCreateLabel().
|
inline |
Definition at line 6081 of file Sema.h.
References clang::Sema::DelayedDiagnostics::pushUndelayed().
|
inline |
Definition at line 1034 of file Sema.h.
References clang::Sema::DelayedDiagnostics::push().
|
inline |
void Sema::PushUsingDirective | ( | Scope * | S, |
UsingDirectiveDecl * | UDir | ||
) |
Definition at line 12211 of file SemaDeclCXX.cpp.
References clang::DeclContext::addDecl(), clang::DeclContext::isFunctionOrMethod(), and PushUsingDirective().
Referenced by ActOnUsingDirective(), and PushUsingDirective().
ExprResult Sema::RebuildExprInCurrentInstantiation | ( | Expr * | E | ) |
Definition at line 11060 of file SemaTemplate.cpp.
References E, and clang::Expr::getExprLoc().
Referenced by RebuildDeclaratorInCurrentInstantiation().
LambdaScopeInfo * Sema::RebuildLambdaScopeInfo | ( | CXXMethodDecl * | CallOperator | ) |
Definition at line 15503 of file SemaDecl.cpp.
References clang::sema::CapturingScopeInfo::addCapture(), clang::sema::CapturingScopeInfo::addThisCapture(), clang::sema::CapturingScopeInfo::addVLATypeCapture(), clang::sema::LambdaScopeInfo::AfterParameterList, clang::C, clang::sema::LambdaScopeInfo::CallOperator, clang::CXXRecordDecl::captures(), CurContext, CurrentInstantiationScope, clang::sema::LambdaScopeInfo::ExplicitObjectParameter, clang::RecordDecl::field_begin(), clang::DeclarationNameInfo::getCXXOperatorNameRange(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::CXXRecordDecl::getLambdaCaptureDefault(), clang::FunctionDecl::getNameInfo(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::FunctionDecl::getReturnType(), clang::sema::LambdaScopeInfo::GLTemplateParameterList, clang::sema::CapturingScopeInfo::ImpCap_LambdaByref, clang::sema::CapturingScopeInfo::ImpCap_LambdaByval, clang::sema::CapturingScopeInfo::ImpCap_None, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::LocalInstantiationScope::InstantiatedLocal(), 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, PushLambdaScope(), and clang::sema::CapturingScopeInfo::ReturnType.
Referenced by ActOnStartOfFunctionDef(), and clang::Sema::LambdaScopeForCallOperatorInstantiationRAII::LambdaScopeForCallOperatorInstantiationRAII().
bool Sema::RebuildNestedNameSpecifierInCurrentInstantiation | ( | CXXScopeSpec & | SS | ) |
Definition at line 11066 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::Adopt(), Context, clang::SourceRange::getBegin(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getWithLocInContext(), and clang::CXXScopeSpec::isInvalid().
Referenced by ActOnCXXEnterDeclaratorScope(), and RebuildDeclaratorInCurrentInstantiation().
bool Sema::RebuildTemplateParamsInCurrentInstantiation | ( | TemplateParameterList * | Params | ) |
Rebuild the template parameters now that we know we're in a current instantiation.
Definition at line 11082 of file SemaTemplate.cpp.
References clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::TemplateParameterList::getParam(), clang::TypeSourceInfo::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Type::isUndeducedType(), RebuildTemplateParamsInCurrentInstantiation(), RebuildTypeInCurrentInstantiation(), clang::ValueDecl::setType(), clang::DeclaratorDecl::setTypeSourceInfo(), clang::TemplateParameterList::size(), and SubstAutoTypeSourceInfoDependent().
Referenced by ActOnClassTemplateSpecialization(), ActOnFunctionDeclarator(), ActOnVariableDeclarator(), CheckClassTemplate(), and RebuildTemplateParamsInCurrentInstantiation().
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 11050 of file SemaTemplate.cpp.
References clang::Type::isInstantiationDependentType(), Loc, and clang::T.
Referenced by RebuildDeclaratorInCurrentInstantiation(), and RebuildTemplateParamsInCurrentInstantiation().
void Sema::RecordParsingTemplateParameterDepth | ( | unsigned | Depth | ) |
void Sema::redelayDiagnostics | ( | sema::DelayedDiagnosticPool & | pool | ) |
Given a set of delayed diagnostics, re-emit them as if they had been delayed in the current context instead of in the given pool.
Essentially, this just moves them to the current pool.
Definition at line 7808 of file SemaDeclAttr.cpp.
References clang::Sema::DelayedDiagnostics::getCurrentPool(), and clang::sema::DelayedDiagnosticPool::steal().
void Sema::referenceDLLExportedClassMethods | ( | ) |
Definition at line 14305 of file SemaDeclCXX.cpp.
References clang::Class, DelayedDllExportClasses, and ReferenceDllExportedMembers().
Referenced by ActOnFinishCXXNonNestedClass(), and dllExportImportClassTemplateSpecialization().
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 14483 of file SemaChecking.cpp.
References clang::Type::castAs(), Context, E, clang::MemberExpr::getBase(), clang::DeclRefExpr::getDecl(), clang::ASTContext::getDeclAlign(), clang::ASTContext::getFieldOffset(), clang::FieldDecl::getParent(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), clang::TypeDecl::getTypeForDecl(), clang::Decl::hasAttr(), clang::Qualifiers::hasUnaligned(), clang::Expr::IgnoreParenImpCasts(), clang::MemberExpr::isArrow(), clang::Type::isDependentType(), clang::Decl::isInvalidDecl(), clang::CharUnits::isOne(), clang::Type::isReferenceType(), and clang::ASTContext::toCharUnitsFromBits().
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 6636 of file SemaDecl.cpp.
References Context, clang::CPlusPlus, clang::ASTContext::getExternCContextDecl(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::getRedeclContext(), clang::DeclContext::isTranslationUnit(), and clang::DeclContext::makeDeclVisibleInContext().
Referenced by ActOnFunctionDeclarator(), ActOnVariableDeclarator(), and LazilyCreateBuiltin().
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 14321 of file SemaChecking.cpp.
Referenced by FinalizeDeclaration().
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.
Referenced by InventTemplateParameter().
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 192 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 ActOnCXXEnterDeclaratorScope(), ActOnFriendFunctionDecl(), ActOnTag(), BuildCXXNestedNameSpecifier(), BuildUsingDeclaration(), CheckClassTemplate(), CheckTypenameType(), CheckUsingDeclQualifier(), clang::SemaCodeCompletion::CodeCompleteQualifiedId(), getConstructorName(), getDestructorName(), getTypeName(), HandleDeclarator(), LookupParsedName(), LookupTemplateName(), 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 234 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 BuildUsingEnumDeclaration(), and 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 9108 of file SemaType.cpp.
References E, getCompletedType(), clang::Expr::getExprLoc(), and RequireCompleteType().
Referenced by CheckConditionalOperand(), LookupInlineAsmIdentifier(), RequireCompleteExprType(), and RequireCompleteSizedExprType().
Definition at line 9114 of file SemaType.cpp.
References Default, E, and RequireCompleteExprType().
|
inline |
Definition at line 14869 of file Sema.h.
References Default, E, and RequireCompleteExprType().
|
inline |
Definition at line 7851 of file Sema.h.
References E, Normal, and RequireCompleteExprType().
Referenced by CheckUnaryExprOrTypeTraitOperand().
|
inline |
Definition at line 7844 of file Sema.h.
References Loc, Normal, RequireCompleteType(), and clang::T.
Referenced by ActOnFields(), ActOnUninitializedDecl(), BuildArrayType(), BuildCaptureField(), BuildCompoundLiteralExpr(), BuildMicrosoftCAnonymousStruct(), captureInLambda(), CheckAllocatedType(), checkArithmeticIncompletePointerType(), CheckFieldDecl(), CheckUnaryExprOrTypeTraitOperand(), CreateBuiltinArraySubscriptExpr(), and VerifyBitField().
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 9119 of file SemaType.cpp.
References Consumer, clang::Type::getAs(), clang::ASTConsumer::HandleTagDeclRequiredDefinition(), Loc, and clang::T.
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), ActOnCXXDelete(), ActOnEndOfTranslationUnit(), ActOnFields(), ActOnGCCAsmStmt(), ActOnInitializerError(), clang::SemaObjC::ActOnObjCAtSynchronizedOperand(), clang::SemaOpenMP::ActOnOMPArraySectionExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartCategoryInterface(), clang::SemaObjC::ActOnStartClassImplementation(), ActOnStartCXXMemberReference(), ActOnStartOfFunctionDef(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), ActOnUninitializedDecl(), clang::SemaHLSL::ActOnVariableDeclarator(), AddInitializerToDecl(), BuildAtomicExpr(), BuildAtomicType(), BuildBuiltinOffsetOf(), clang::SemaObjC::BuildClassMessage(), BuildCompoundLiteralExpr(), BuildCXXForRangeStmt(), BuildCXXTypeConstructExpr(), BuildCXXTypeId(), BuildExceptionDeclaration(), clang::SemaObjC::BuildInstanceMessage(), buildLambdaScopeReturnType(), clang::SemaObjC::BuildObjCEncodeExpression(), BuildResolvedCallExpr(), BuildVAArgExpr(), BuiltinDumpStruct(), BuiltinLaunder(), CheckAddressOfOperand(), CheckBaseSpecifier(), CheckCallReturnType(), CheckCommaOperands(), CheckComparisonCategoryType(), CheckCompleteParameterTypesForMangler(), CheckCXXThrowOperand(), CheckExplicitlyDefaultedComparison(), CheckFieldDecl(), CheckForModifiableLvalue(), checkIncorrectVTablePointerAuthenticationAttribute(), checkMemberDecomposition(), clang::SemaObjC::CheckMessageArgumentTypes(), clang::SemaObjC::CheckObjCForCollectionOperand(), clang::SemaOpenMP::CheckOMPThreadPrivateDecl(), clang::SemaOpenMP::CheckOpenMPLinearDecl(), CheckOverridingFunctionReturnType(), CheckParmsForFunctionDef(), CheckPointerToMemberOperands(), CheckSpecifiedExceptionType(), clang::SemaObjC::CheckSubscriptingKind(), checkTypeMappable(), CheckUnaryTypeTraitTypeCompleteness(), checkUnknownAnyCast(), ComputeDefaultedSpecialMemberExceptionSpec(), ConvertParamDefaultArgument(), CopyObject(), DefaultVariadicArgumentPromotion(), clang::InitializationSequence::Diagnose(), EvaluateBooleanTypeTrait(), FindInstantiatedDecl(), GatherArgumentsForCall(), clang::SemaObjC::HandleExprPropertyRefExpr(), handlePreferredTypeAttr(), clang::SemaHLSL::handleResourceBindingAttr(), clang::SemaHLSL::handleResourceTypeAttr(), IgnoredValueConversions(), lookupCoroutineHandleType(), LookupInlineAsmField(), LookupMemberExpr(), LookupMemberExprInRecord(), lookupPromiseType(), lookupStdTypeTraitMember(), RequireCompleteDeclContext(), RequireCompleteExprType(), RequireCompleteSizedType(), RequireCompleteType(), RequireLiteralType(), RequireStructuralType(), and TemporaryMaterializationConversion().
bool Sema::RequireCompleteType | ( | SourceLocation | Loc, |
QualType | T, | ||
CompleteTypeKind | Kind, | ||
unsigned | DiagID | ||
) |
Definition at line 9463 of file SemaType.cpp.
References Loc, RequireCompleteType(), and clang::T.
|
inline |
|
inline |
|
inline |
Definition at line 14983 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 9486 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(), CheckVariableDeclarationType(), RequireLiteralType(), and RequireStructuralType().
bool Sema::RequireLiteralType | ( | SourceLocation | Loc, |
QualType | T, | ||
unsigned | DiagID | ||
) |
Definition at line 9577 of file SemaType.cpp.
References Loc, RequireLiteralType(), and clang::T.
|
inline |
Definition at line 14939 of file Sema.h.
References Loc, RequireLiteralType(), and clang::T.
bool Sema::RequireNonAbstractType | ( | SourceLocation | Loc, |
QualType | T, | ||
TypeDiagnoser & | Diagnoser | ||
) |
Definition at line 5874 of file SemaDeclCXX.cpp.
References Context, clang::Sema::TypeDiagnoser::diagnose(), DiagnoseAbstractType(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), isAbstractType(), Loc, and clang::T.
Referenced by ActOnFields(), ActOnInitializerError(), clang::SemaObjC::ActOnPropertyImplDecl(), ActOnStartOfFunctionDef(), ActOnUninitializedDecl(), AddInitializerToDecl(), BuildArrayType(), BuildCXXCastArgument(), BuildExceptionDeclaration(), BuildVAArgExpr(), captureInLambda(), CheckAllocatedType(), CheckCXXThrowOperand(), CheckFieldDecl(), CheckParmsForFunctionDef(), clang::InitializationSequence::Perform(), and RequireNonAbstractType().
|
inline |
Definition at line 5772 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 1280 of file SemaTemplate.cpp.
References clang::AS_public, Context, clang::CPlusPlus20, clang::SemaBase::Diag(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), getLangOpts(), clang::Type::isDependentType(), clang::Type::isRecordType(), clang::Type::isRValueReferenceType(), clang::Type::isScalarType(), clang::Type::isStructuralType(), Loc, RequireCompleteType(), RequireLiteralType(), and clang::T.
Referenced by CheckNonTypeTemplateParameterType().
|
inline |
Definition at line 11039 of file Sema.h.
References CurFPFeatures, FpPragmaStack, clang::FPOptions::getChangesFrom(), and LangOpts.
FunctionDecl * Sema::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.
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 13298 of file SemaOverload.cpp.
References clang::Expr::getExprLoc(), clang::Expr::getType(), and clang::ASTContext::OverloadTy.
Referenced by CheckSingleAssignmentConstraints(), CheckTemplateArgument(), clang::InitializationSequence::Diagnose(), clang::InitializationSequence::InitializeFrom(), IsStandardConversion(), PerformImplicitConversion(), ResolveOverloadedFunctionForReferenceBinding(), TryListConversion(), and TryReferenceInit().
FunctionDecl * Sema::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.
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 13338 of file SemaOverload.cpp.
References checkAddressOfFunctionIsAvailable(), clang::CUDA, clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), E, clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), and clang::Result.
Referenced by ResolveOverloadForDeduction().
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 13423 of file SemaOverload.cpp.
References E, clang::Found, clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::ASTContext::OverloadTy.
Referenced by CheckPlaceholderExpr().
bool Sema::ResolveAndFixSingleFunctionTemplateSpecialization | ( | ExprResult & | SrcExpr, |
bool | DoFunctionPointerConversion = false , |
||
bool | Complain = false , |
||
SourceRange | OpRangeForComplaining = SourceRange() , |
||
QualType | DestTypeForComplaining = QualType() , |
||
unsigned | DiagIDForComplaining = 0 |
||
) |
Definition at line 13524 of file SemaOverload.cpp.
References Diag(), clang::ExprError(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), 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(), and clang::ASTContext::OverloadTy.
Referenced by CheckPlaceholderExpr().
bool Sema::resolveAssumedTemplateNameAsType | ( | Scope * | S, |
TemplateName & | Name, | ||
SourceLocation | NameLoc, | ||
bool | Diagnose = true |
||
) |
Definition at line 3706 of file SemaTemplate.cpp.
References Context, CorrectTypo(), CTK_ErrorRecovery, clang::SemaBase::Diag(), Diagnose, diagnoseTypo(), clang::getAsTypeTemplateDecl(), clang::TypoCorrection::getCorrectionDecl(), clang::TypoCorrection::getCorrectionDeclAs(), clang::AssumedTemplateStorage::getDeclName(), clang::TypoCorrection::getFoundDecl(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), clang::LookupResult::getLookupNameInfo(), clang::LookupResult::getNameLoc(), clang::ASTContext::getQualifiedTemplateName(), LookupOrdinaryName, and clang::SemaBase::PDiag().
Referenced by ActOnCXXNestedNameSpecifier(), ActOnTemplateIdType(), ActOnUndeclaredTypeTemplateName(), and CheckTemplateIdType().
const FunctionProtoType * clang::Sema::ResolveExceptionSpec | ( | SourceLocation | Loc, |
const FunctionProtoType * | FPT | ||
) |
Definition at line 206 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 ActOnStartOfFunctionDef(), BuildDeclRefExpr(), BuildMemberExpr(), clang::Sema::ImplicitExceptionSpecification::CalledDecl(), clang::CheckEquivalentExceptionSpecImpl(), checkEscapingByref(), CheckExceptionSpecSubset(), CheckFunctionTemplateSpecialization(), completeFunctionType(), CreateFunctionRefExpr(), DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), MarkFunctionReferenced(), and MarkVirtualMemberExceptionSpecsNeeded().
FunctionDecl * Sema::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.
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 13450 of file SemaOverload.cpp.
References clang::TemplateSpecCandidateSet::addCandidate(), completeFunctionType(), clang::OverloadExpr::copyTemplateArgumentsInto(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), DeduceTemplateArguments(), Diag(), E, clang::Expr::getExprLoc(), clang::OverloadExpr::getName(), clang::OverloadExpr::getNameLoc(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::OverloadExpr::hasExplicitTemplateArgs(), clang::MakeDeductionFailureInfo(), clang::Result, clang::TemplateSpecCandidate::set(), clang::Specialization, and clang::Success.
Referenced by CheckAddressOfOperand(), handleCleanupAttr(), and ResolveOverloadForDeduction().
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 963 of file SemaCXXScopeSpec.cpp.
References clang::CXXScopeSpec::Adopt(), and clang::CXXScopeSpec::SetInvalid().
|
inline |
Definition at line 1141 of file Sema.h.
Referenced by CheckVariableDeclarationType(), handleBuiltinAliasAttr(), handleInterruptAttr(), and LookupBuiltin().
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 564 of file Sema.cpp.
References Loc, and clang::StackExhaustionHandler::runWithSufficientStackSpace().
Referenced by BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), CheckCXXDefaultArgExpr(), CheckIfFunctionSpecializationIsImmediate(), completeExprArrayBound(), DeduceReturnType(), DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArgumentsFromType(), DoMarkVarDeclReferenced(), isAtLeastAsSpecializedAs(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), LookupConstructors(), LookupSpecialMember(), MarkFunctionReferenced(), PerformConstructorInitialization(), clang::ASTReader::runWithSufficientStackSpace(), SubstDecl(), and SubstDefaultArgument().
|
inline |
Definition at line 14320 of file Sema.h.
Referenced by DiagRecursiveConstraintEval().
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 949 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 784 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 CreateBuiltinUnaryOp(), and PerformImplicitConversion().
ObjCMethodDecl * Sema::SelectBestMethod | ( | Selector | Sel, |
MultiExprArg | Args, | ||
bool | IsInstance, | ||
SmallVectorImpl< ObjCMethodDecl * > & | Methods | ||
) |
Definition at line 7176 of file SemaOverload.cpp.
References b, 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(), clang::ObjC, clang::ObjCMethodDecl::param_size(), clang::ObjCMethodDecl::parameters(), clang::StandardConversionSequence::Second, clang::ImplicitConversionSequence::Standard, TryCopyInitialization(), and clang::ASTContext::UnknownAnyTy.
Referenced by clang::SemaObjC::BuildInstanceMessage().
bool Sema::SetCtorInitializers | ( | CXXConstructorDecl * | Constructor, |
bool | AnyErrors, | ||
ArrayRef< CXXCtorInitializer * > | Initializers = {} |
||
) |
Definition at line 5218 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), BuildImplicitBaseInitializer(), clang::C, 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 18034 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 InstantiateFunctionDefinition(), SetFunctionBodyKind(), and clang::TemplateDeclInstantiator::SubstDefaultedFunction().
void Sema::SetDeclDeleted | ( | Decl * | dcl, |
SourceLocation | DelLoc, | ||
StringLiteral * | Message = nullptr |
||
) |
Definition at line 17981 of file SemaDeclCXX.cpp.
References AdjustDeclIfTemplate(), clang::SemaBase::Diag(), clang::getDLLAttr(), and clang::TSK_ExplicitSpecialization.
Referenced by ActOnFields(), CheckExplicitlyDefaultedComparison(), CheckExplicitlyDefaultedSpecialMember(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), findInheritingConstructor(), SetFunctionBodyKind(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool Sema::SetDelegatingInitializer | ( | CXXConstructorDecl * | Constructor, |
CXXCtorInitializer * | Initializer | ||
) |
Definition at line 5197 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 1434 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 18144 of file SemaDeclCXX.cpp.
References D, Default, Delete, Loc, Other, SetDeclDefaulted(), and SetDeclDeleted().
void Sema::setFunctionHasBranchIntoScope | ( | ) |
Definition at line 2341 of file Sema.cpp.
Referenced by ActOnGCCAsmStmt(), ActOnGotoStmt(), and ActOnStartOfSwitchStmt().
void Sema::setFunctionHasBranchProtectedScope | ( | ) |
Definition at line 2346 of file Sema.cpp.
Referenced by ActOnBlockStmtExpr(), ActOnGotoStmt(), ActOnIndirectGotoStmt(), ActOnLabelStmt(), ActOnMSAsmStmt(), clang::SemaObjC::ActOnObjCAtSynchronizedStmt(), clang::SemaObjC::ActOnObjCAutoreleasePoolStmt(), clang::SemaObjC::ActOnObjCForCollectionStmt(), clang::SemaOpenMP::ActOnOpenMPAtomicDirective(), clang::SemaOpenMP::ActOnOpenMPCriticalDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerStart(), clang::SemaOpenMP::ActOnOpenMPDispatchDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedDirective(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMasterDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPOrderedDirective(), clang::SemaOpenMP::ActOnOpenMPParallelSectionsDirective(), clang::SemaOpenMP::ActOnOpenMPScopeDirective(), clang::SemaOpenMP::ActOnOpenMPSectionDirective(), clang::SemaOpenMP::ActOnOpenMPSectionsDirective(), clang::SemaOpenMP::ActOnOpenMPSingleDirective(), clang::SemaOpenMP::ActOnOpenMPTargetDataDirective(), clang::SemaOpenMP::ActOnOpenMPTaskgroupDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopDirective(), ActOnStartStmtExpr(), ActOnUninitializedDecl(), AddInitializerToDecl(), BuildIfStmt(), CheckCompleteVariableDeclaration(), CheckTypedefForVariablyModifiedType(), CheckVariableDeclarationType(), and setBranchProtectedScope().
void Sema::setFunctionHasIndirectGoto | ( | ) |
Definition at line 2351 of file Sema.cpp.
Referenced by ActOnIndirectGotoStmt().
void Sema::setFunctionHasMustTail | ( | ) |
Definition at line 2356 of file Sema.cpp.
Referenced by BuildAttributedStmt().
|
inline |
Definition at line 955 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 36 of file SemaAccess.cpp.
References clang::AS_none, clang::SemaBase::Diag(), clang::Decl::getAccess(), clang::Decl::getLocation(), and clang::Decl::setAccess().
Referenced by ActOnTag(), and CheckClassTemplate().
void Sema::SetParamDefaultArgument | ( | ParmVarDecl * | Param, |
Expr * | DefaultArg, | ||
SourceLocation | EqualLoc | ||
) |
Definition at line 308 of file SemaDeclCXX.cpp.
References clang::ParmVarDecl::setDefaultArg(), and UnparsedDefaultArgInstantiations.
Referenced by ActOnParamDefaultArgument().
void Sema::setTagNameForLinkagePurposes | ( | TagDecl * | TagFromDeclSpec, |
TypedefNameDecl * | NewTD | ||
) |
Definition at line 4954 of file SemaDecl.cpp.
References clang::ASTContext::addTypedefNameForUnnamedTagDecl(), Context, clang::CPlusPlus, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::NamedDecl::getIdentifier(), clang::TagDecl::getInnerLocStart(), getLangOpts(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::IdentifierInfo::getName(), getNonCLikeKindForAnonymousStruct(), clang::ASTContext::getTagDeclType(), clang::TypedefNameDecl::getUnderlyingType(), clang::NamedDecl::hasLinkageBeenComputed(), clang::TagDecl::hasNameForLinkage(), clang::ASTContext::hasSameType(), clang::Decl::isInvalidDecl(), clang::TagDecl::isThisDeclarationADefinition(), ProcessAPINotes(), and clang::TagDecl::setTypedefNameForAnonDecl().
Referenced by ActOnAliasDeclaration(), and ParseTypedefDecl().
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 9626 of file SemaDeclCXX.cpp.
References Context, clang::CopyAssignment, clang::CopyConstructor, clang::CXXRecordDecl::ctors(), CUDA(), clang::ASTContext::DeclarationNames, clang::DefaultConstructor, clang::Destructor, clang::SemaBase::Diag(), Diagnose, FindDeallocationFunction(), clang::DeclarationNameTable::getCXXOperatorName(), getLangOpts(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), getSpecialMember(), clang::CXXRecordDecl::hasUserDeclaredMoveAssignment(), clang::CXXRecordDecl::hasUserDeclaredMoveConstructor(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), 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 ActOnFields(), CheckExplicitlyDefaultedSpecialMember(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DiagnoseDeletedDefaultedFunction(), findInheritingConstructor(), and NoteDeletedInheritingConstructor().
bool Sema::ShouldEnterDeclaratorScope | ( | Scope * | S, |
const CXXScopeSpec & | SS | ||
) |
Definition at line 976 of file SemaCXXScopeSpec.cpp.
References CurContext, clang::DeclContext::getRedeclContext(), clang::CXXScopeSpec::getScopeRep(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::DeclContext::isFileContext(), clang::CXXScopeSpec::isSet(), clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
Referenced by clang::Parser::ParseUnqualifiedId().
bool Sema::shouldIgnoreInHostDeviceCheck | ( | FunctionDecl * | Callee | ) |
Definition at line 20439 of file SemaDecl.cpp.
References CUDA(), clang::Global, clang::SemaCUDA::IdentifyTarget(), and LangOpts.
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 11082 of file SemaDecl.cpp.
References canFullyTypeCheckRedeclaration(), D, clang::Decl::getDeclContext(), clang::Decl::getFriendObjectKind(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isDependentContext(), and clang::DeclContext::isFileContext().
Referenced by CheckFunctionDeclaration().
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 19743 of file SemaDecl.cpp.
References clang::CPlusPlus, forRedeclarationInCurContext(), clang::NamedDecl::getDeclName(), getLangOpts(), hasVisibleDefinition(), LookupOrdinaryName, LookupSingleName(), and clang::sema::Skip.
bool Sema::ShouldSplatAltivecScalarInCast | ( | const VectorType * | VecTy | ) |
Definition at line 2700 of file SemaCast.cpp.
References clang::AltiVecBool, clang::AltiVecPixel, clang::AltiVecVector, getLangOpts(), clang::VectorType::getVectorKind(), and clang::LangOptionsBase::XL.
Referenced by BuildVectorLiteral().
bool Sema::ShouldWarnIfUnusedFileScopedDecl | ( | const DeclaratorDecl * | D | ) | const |
Definition at line 1832 of file SemaDecl.cpp.
References Context, D, clang::ASTContext::DeclMustBeEmitted(), 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 MarkUnusedFileScopedDecl(), and 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 10059 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(), Diagnose, 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 CheckCompletedCXXClass(), checkTrivialSubobjectCall(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), and RequireLiteralType().
Substitute Replacement for auto
in TypeWithAuto
.
Definition at line 5336 of file SemaTemplateDeduction.cpp.
References Context, and clang::ASTContext::DependentTy.
Referenced by CheckExplicitlyDefaultedComparison(), DeduceTemplateArguments(), DeduceTemplateSpecializationFromInitializer(), and MergeFunctionDecl().
Definition at line 5350 of file SemaTemplateDeduction.cpp.
Referenced by BuildCXXForRangeStmt(), buildTypeForLambdaCallOperator(), CheckFunctionDeclaration(), DeduceTemplateArguments(), DeduceTemplateSpecializationFromInitializer(), and MergeFunctionDecl().
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.
Referenced by CheckNonTypeTemplateParameterType(), and RebuildTemplateParamsInCurrentInstantiation().
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 3518 of file SemaTemplateInstantiate.cpp.
References AttachBaseSpecifiers(), clang::CXXRecordDecl::bases(), CheckBaseSpecifier(), CheckParameterPacksForExpansion(), collectUnexpandedParameterPacks(), Context, clang::Invalid, clang::Decl::setInvalidDecl(), and SubstType().
Referenced by InstantiateClass().
ExprResult Sema::SubstConstraintExpr | ( | Expr * | E, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4508 of file SemaTemplateInstantiate.cpp.
References E, and SubstExpr().
Referenced by calculateConstraintSatisfaction().
ExprResult Sema::SubstConstraintExprWithoutSatisfaction | ( | Expr * | E, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4515 of file SemaTemplateInstantiate.cpp.
References E.
Referenced by SubstituteConstraintExpressionWithoutSatisfaction().
Decl * Sema::SubstDecl | ( | Decl * | D, |
DeclContext * | Owner, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4163 of file SemaTemplateInstantiateDecl.cpp.
References D, clang::Decl::getLocation(), clang::Decl::isInvalidDecl(), and runWithSufficientStackSpace().
Referenced by ConvertDeducedTemplateArgument(), FindInstantiatedDecl(), FinishTemplateArgumentDeduction(), InstantiateFunctionDeclaration(), and InstantiateVariableDefinition().
DeclarationNameInfo Sema::SubstDeclarationNameInfo | ( | const DeclarationNameInfo & | NameInfo, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Do template substitution on declaration name info.
Definition at line 4559 of file SemaTemplateInstantiate.cpp.
References clang::DeclarationNameInfo::getLoc(), and clang::DeclarationNameInfo::getName().
Referenced by FindInstantiatedDecl(), 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 3436 of file SemaTemplateInstantiate.cpp.
References ActOnFinishFullExpr(), Context, ConvertParamDefaultArgument(), clang::InitializationKind::CreateCopy(), clang::SemaBase::Diag(), clang::DeclaratorDecl::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::Decl::getDeclContext(), clang::MultiLevelTemplateArgumentList::getInnermost(), clang::Decl::getLocation(), clang::DeclaratorDecl::getOuterLocStart(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::ParmVarDecl::getUninstantiatedDefaultArg(), clang::InitializedEntity::InitializeParameter(), clang::Sema::InstantiatingTemplate::isAlreadyInstantiating(), clang::Sema::InstantiatingTemplate::isInvalid(), Loc, PotentiallyEvaluated, clang::Result, 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 5114 of file SemaTemplate.cpp.
References Context, clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), hasReachableDefaultArgument(), clang::TemplateName::isNull(), and SubstDefaultTemplateArgument().
Referenced by CheckTemplateArgumentList(), and ConvertDeducedTemplateArguments().
void Sema::SubstExceptionSpec | ( | FunctionDecl * | New, |
const FunctionProtoType * | Proto, | ||
const MultiLevelTemplateArgumentList & | Args | ||
) |
Definition at line 3048 of file SemaTemplateInstantiate.cpp.
References clang::EST_None, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::TypeLoc::getEndLoc(), clang::FunctionProtoType::getExtProtoInfo(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), SubstExceptionSpec(), clang::FunctionProtoType::ExceptionSpecInfo::Type, and UpdateExceptionSpec().
Referenced by clang::TemplateDeclInstantiator::InitFunctionInstantiation(), InstantiateExceptionSpec(), and SubstExceptionSpec().
bool Sema::SubstExceptionSpec | ( | SourceLocation | Loc, |
FunctionProtoType::ExceptionSpecInfo & | ESI, | ||
SmallVectorImpl< QualType > & | ExceptionStorage, | ||
const MultiLevelTemplateArgumentList & | Args | ||
) |
Definition at line 3038 of file SemaTemplateInstantiate.cpp.
References Loc.
ExprResult Sema::SubstExpr | ( | Expr * | E, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4497 of file SemaTemplateInstantiate.cpp.
References E.
Referenced by BuildExprRequirement(), instantiateDependentAlignedAttr(), instantiateDependentAlignValueAttr(), instantiateDependentAMDGPUFlatWorkGroupSizeAttr(), instantiateDependentAMDGPUMaxNumWorkGroupsAttr(), instantiateDependentAMDGPUWavesPerEUAttr(), instantiateDependentAssumeAlignedAttr(), instantiateDependentCUDALaunchBoundsAttr(), instantiateDependentFunctionAttrCondition(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), instantiateExplicitSpecifier(), instantiateOMPDeclareSimdDeclAttr(), instantiateOMPDeclareVariantAttr(), 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 4534 of file SemaTemplateInstantiate.cpp.
Referenced by instantiateDependentAnnotationAttr().
TypeSourceInfo * Sema::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.
Its purpose is solely to force the instantiation of default-argument expressions and to avoid instantiating an exception-specification.
Definition at line 2992 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, Context, clang::TypeLoc::getAs(), clang::TypeLoc::getFullDataSize(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::TypeLoc::IgnoreParens(), Loc, NeedsInstantiationAsFunctionType(), clang::TypeLocBuilder::reserve(), clang::Result, and clang::T.
Referenced by clang::TemplateDeclInstantiator::SubstFunctionType().
ExprResult Sema::SubstInitializer | ( | Expr * | E, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool | CXXDirectInit | ||
) |
Definition at line 4526 of file SemaTemplateInstantiate.cpp.
References clang::Init.
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 3527 of file SemaTemplateDeduction.cpp.
References clang::TemplateArgumentList::asArray(), BuildFunctionType(), CheckTemplateArgumentList(), Context, clang::CPlusPlus11, clang::TemplateArgumentList::CreateCopy(), CUDA(), CurrentInstantiationScope, clang::SemaBase::Diag(), clang::Sema::CodeSynthesisContext::ExplicitTemplateArgumentSubstitution, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::Function, FunctionTemplate, clang::TemplateArgumentList::get(), clang::getExpandedPackSize(), clang::FunctionProtoType::getExtParameterInfosOrNull(), clang::FunctionProtoType::getExtProtoInfo(), clang::TemplateArgument::getKind(), getLangOpts(), clang::sema::TemplateDeductionInfo::getLocation(), clang::TemplateParameterList::getParam(), clang::DeclContext::getParent(), clang::Sema::ExtParameterInfoBuilder::getPointerOrNull(), clang::FunctionType::getReturnType(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::FunctionProtoType::hasTrailingReturn(), clang::InstantiationDepth, clang::InvalidExplicitArguments, clang::Sema::InstantiatingTemplate::isInvalid(), clang::QualType::isNull(), clang::Type::isVoidType(), makeTemplateParameter(), P, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_size(), clang::sema::TemplateDeductionInfo::Param, clang::sema::TemplateDeductionInfo::setExplicitArgs(), clang::LocalInstantiationScope::SetPartiallySubstitutedPack(), clang::TemplateParameterList::size(), clang::TemplateArgumentList::size(), clang::TemplateArgumentListInfo::size(), clang::SubstitutionFailure, SubstParmTypes(), SubstType(), clang::Success, and Unevaluated.
NestedNameSpecifierLoc Sema::SubstNestedNameSpecifierLoc | ( | NestedNameSpecifierLoc | NNS, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4548 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 3419 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, and Loc.
Referenced by clang::TemplateDeclInstantiator::SubstFunctionType(), and SubstituteExplicitTemplateArguments().
ParmVarDecl * Sema::SubstParmVarDecl | ( | ParmVarDecl * | D, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
int | indexAdjustment, | ||
std::optional< unsigned > | NumExpansions, | ||
bool | ExpectParameterPack, | ||
bool | EvaluateConstraints = true |
||
) |
Definition at line 3298 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 4208 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::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
Referenced by DeclareImplicitEqualityComparison().
StmtResult Sema::SubstStmt | ( | Stmt * | S, |
const MultiLevelTemplateArgumentList & | TemplateArgs | ||
) |
Definition at line 4468 of file SemaTemplateInstantiate.cpp.
Referenced by InstantiateFunctionDefinition().
bool Sema::SubstTemplateArgument | ( | const TemplateArgumentLoc & | Input, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
TemplateArgumentLoc & | Output, | ||
SourceLocation | Loc = {} , |
||
const DeclarationName & | Entity = {} |
||
) |
Definition at line 4478 of file SemaTemplateInstantiate.cpp.
References Loc.
Referenced by SubstDefaultTemplateArgument().
bool Sema::SubstTemplateArguments | ( | ArrayRef< TemplateArgumentLoc > | Args, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
TemplateArgumentListInfo & | Outputs | ||
) |
Definition at line 4487 of file SemaTemplateInstantiate.cpp.
Referenced by FinishTemplateArgumentDeduction(), clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), substituteParameterMappings(), 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 4567 of file SemaTemplateInstantiate.cpp.
References clang::CXXScopeSpec::Adopt(), and Loc.
Referenced by SubstDefaultTemplateArgument().
TemplateParameterList * Sema::SubstTemplateParams | ( | TemplateParameterList * | Params, |
DeclContext * | Owner, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool | EvaluateConstraints = true |
||
) |
Definition at line 4280 of file SemaTemplateInstantiateDecl.cpp.
References clang::TemplateDeclInstantiator::setEvaluateConstraints(), and clang::TemplateDeclInstantiator::SubstTemplateParams().
Referenced by CheckTemplateArgument().
QualType Sema::SubstType | ( | QualType | T, |
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
SourceLocation | Loc, | ||
DeclarationName | Entity, | ||
bool * | IsIncompleteSubstitution = nullptr |
||
) |
Deprecated form of the above.
Definition at line 2948 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 2917 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(), clang::TypeLocBuilder::reserve(), and clang::Result.
TypeSourceInfo * Sema::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.
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. |
IsIncompleteSubstitution | If provided, the pointee will be set whenever substitution would perform a replacement with a null or non-existent template argument. |
Definition at line 2899 of file SemaTemplateInstantiate.cpp.
References CodeSynthesisContexts, clang::Type::isInstantiationDependentType(), clang::Type::isVariablyModifiedType(), Loc, and clang::T.
Referenced by CheckDeductionConsistency(), CheckTemplateArgument(), CheckTemplateIdType(), CompleteVarTemplateSpecializationDecl(), ConvertDeducedTemplateArgument(), FinishTemplateArgumentDeduction(), HandleDependentAccessCheck(), instantiateDependentAlignedAttr(), InstantiateMemInitializers(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), SubstBaseSpecifiers(), SubstituteExplicitTemplateArguments(), and SubstParmVarDecl().
bool Sema::SubstTypeConstraint | ( | TemplateTypeParmDecl * | Inst, |
const TypeConstraint * | TC, | ||
const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
bool | EvaluateConstraint | ||
) |
Definition at line 3212 of file SemaTemplateInstantiate.cpp.
References ArgumentPackSubstitutionIndex, clang::ASTTemplateArgumentListInfo::arguments(), AttachTypeConstraint(), Context, clang::TypeConstraint::getConceptNameInfo(), clang::TypeConstraint::getConceptReference(), clang::ConceptReference::getFoundDecl(), clang::TypeConstraint::getImmediatelyDeclaredConstraint(), clang::TypeConstraint::getNamedConcept(), clang::TypeConstraint::getNestedNameSpecifierLoc(), clang::TypeConstraint::getTemplateArgsAsWritten(), clang::ASTContext::getTypeDeclType(), clang::QualType::isNull(), 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 14347 of file Sema.h.
Referenced by clang::Sema::SatisfactionStackResetRAII::SatisfactionStackResetRAII(), and clang::Sema::SatisfactionStackResetRAII::~SatisfactionStackResetRAII().
|
inline |
Definition at line 1156 of file Sema.h.
Referenced by InstantiateAttrs(), mergeDeclAttribute(), ProcessAPINotes(), and ProcessDeclAttribute().
|
inline |
Definition at line 1151 of file Sema.h.
Referenced by ActOnLambdaExpr(), CheckFunctionDeclaration(), ProcessDeclAttribute(), and clang::TreeTransform< Derived >::RebuildSYCLUniqueStableNameExpr().
|
inline |
|
inline |
Definition at line 742 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 1963 of file Sema.cpp.
References clang::CUDA, clang::SemaBase::getLangOpts(), clang::SemaBase::SemaDiagnosticBuilder::K_Immediate, and Loc.
Referenced by ActOnCXXTryBlock(), ActOnGCCAsmStmt(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAllocateClause(), clang::SemaOpenMP::ActOnOpenMPAllocateDirective(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), ActOnVariableDeclarator(), BuildArrayType(), BuildCXXThrow(), BuildVAArgExpr(), DiagnoseUseOfDecl(), 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 7900 of file SemaTemplate.cpp.
References AreConstraintExpressionsEqual(), clang::TemplateParameterList::begin(), clang::SemaBase::Diag(), Diagnose, DiagnoseTemplateParameterListArityMismatch(), clang::TemplateParameterList::end(), clang::Stmt::getBeginLoc(), clang::TemplateParameterList::getRequiresClause(), clang::TemplateParameterList::getTemplateLoc(), MatchTemplateParameterKind(), clang::TemplateParameterList::size(), TPL_TemplateParamsEquivalent, and TPL_TemplateTemplateArgumentMatch.
Referenced by ActOnAliasDeclaration(), CheckClassTemplate(), CheckTemplateTemplateArgument(), getMoreSpecialized(), getMoreSpecializedTemplate(), IsOverloadOrOverrideImpl(), MatchTemplateParameterKind(), MatchTemplateParametersToScopeSpecifier(), MergeVarDecl(), and TemplateParameterListsAreEqual().
|
inline |
Definition at line 11892 of file Sema.h.
References Kind, and 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 7600 of file SemaInit.cpp.
References clang::CPlusPlus11, CreateMaterializeTemporaryExpr(), E, clang::ExprError(), clang::Expr::getExprLoc(), getLangOpts(), clang::Expr::getType(), clang::Expr::isPRValue(), RequireCompleteType(), and clang::T.
Referenced by ActOnConditionalOp(), BuildMemberReferenceExpr(), CheckPointerToMemberOperands(), CreateBuiltinArraySubscriptExpr(), EvaluateStaticAssertMessageAsString(), IgnoredValueConversions(), PerformImplicitConversion(), and clang::TreeTransform< Derived >::RebuildMemberExpr().
|
inlinestatic |
To be used for checking whether the arguments being passed to function exceeds the number of parameters expected for it.
Definition at line 7756 of file Sema.h.
Referenced by checkDirectCallValidity(), and clang::SemaCodeCompletion::ProduceCallSignatureHelp().
ExprResult Sema::TransformToPotentiallyEvaluated | ( | Expr * | E | ) |
Definition at line 17374 of file SemaExpr.cpp.
References E, ExprEvalContexts, and isUnevaluatedContext().
Referenced by BuildCXXTypeId(), CreateUnaryExprOrTypeTraitExpr(), and HandleExprEvaluationContextForTypeof().
TypeSourceInfo * Sema::TransformToPotentiallyEvaluated | ( | TypeSourceInfo * | TInfo | ) |
Definition at line 17384 of file SemaExpr.cpp.
References clang::Sema::ExpressionEvaluationContextRecord::Context, ExprEvalContexts, isUnevaluatedContext(), and parentEvaluationContext().
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 929 of file SemaTemplate.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::Last, and translateTemplateArgument().
Referenced by ActOnCXXNestedNameSpecifier(), ActOnExplicitInstantiation(), ActOnFunctionDeclarator(), ActOnTagTemplateIdType(), ActOnTemplateIdType(), ActOnTypenameType(), ConvertDeclSpecToType(), DecomposeUnqualifiedId(), InventTemplateParameter(), and makeTemplateArgumentListInfo().
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 18937 of file SemaExpr.cpp.
References clang::QualType::addConst(), clang::sema::LambdaScopeInfo::AfterParameterList, buildLambdaCaptureFixit(), clang::sema::LambdaScopeInfo::CallOperator, captureInBlock(), captureInCapturedRegion(), captureInLambda(), captureVariablyModifiedType(), CapturingFunctionScopes, Context, clang::CR_OpenMP, CurContext, clang::SemaBase::Diag(), diagnoseUncapturableValueReferenceOrBinding(), E, clang::DeclContext::Equals(), clang::Explicit, FunctionScopes, clang::TypeDecl::getBeginLoc(), clang::Decl::getCanonicalDecl(), clang::sema::CapturingScopeInfo::getCapture(), clang::Decl::getDeclContext(), clang::getLambdaAwareParentOfDeclContext(), getLangOpts(), clang::Decl::getLocation(), clang::ASTContext::getLValueReferenceType(), clang::QualType::getNonReferenceType(), clang::DeclContext::getParent(), getParentOfCapturingContextOrNull(), clang::ValueDecl::getPotentiallyDecomposedVarDecl(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::sema::CapturingScopeInfo::ImpCap_None, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::Invalid, clang::QualType::isConstQualified(), clang::DeclContext::isFunctionOrMethod(), clang::isGenericLambdaCallOperatorSpecialization(), clang::SemaOpenMP::isOpenMPGlobalCapturedDecl(), clang::SemaOpenMP::isOpenMPPrivateDecl(), clang::SemaOpenMP::isOpenMPTargetCapturedDecl(), clang::DeclContext::isRequiresExprBody(), isVariableAlreadyCapturedInScopeInfo(), isVariableCapturable(), clang::Type::isVariablyModifiedType(), clang::sema::LambdaScopeInfo::Lambda, LangOpts, clang::sema::Capture::markUsed(), OpenMP(), and TryCapture_Implicit.
Referenced by ActOnLambdaExpressionAfterIntroducer(), buildLoopVarFunc(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), DoMarkBindingDeclReferenced(), getCapturedDeclRefType(), clang::getStackIndexOfNearestEnclosingCaptureCapableLambda(), MarkVarDeclODRUsed(), NeedToCaptureVariable(), clang::SemaObjC::tryCaptureObjCSelf(), and tryCaptureVariable().
bool Sema::tryCaptureVariable | ( | ValueDecl * | Var, |
SourceLocation | Loc, | ||
TryCaptureKind | Kind = TryCapture_Implicit , |
||
SourceLocation | EllipsisLoc = SourceLocation() |
||
) |
Try to capture the given variable.
Definition at line 19246 of file SemaExpr.cpp.
References Loc, and tryCaptureVariable().
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 4998 of file SemaExpr.cpp.
References clang::InitializationKind::CreateCopy(), E, clang::Stmt::getBeginLoc(), clang::InitializedEntity::InitializeTemporary(), and clang::InitializationSequence::Perform().
Referenced by CheckMatrixElementwiseOperands().
bool Sema::tryExprAsCall | ( | Expr & | E, |
QualType & | ZeroArgCallReturnTy, | ||
UnresolvedSetImpl & | NonTemplateOverloads | ||
) |
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 2488 of file Sema.cpp.
References clang::UnresolvedSetImpl::addDecl(), clang::ASTContext::BoundMemberTy, clang::UnresolvedSetImpl::clear(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), E, clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Type::getPointeeType(), clang::FunctionType::getReturnType(), clang::Expr::getType(), clang::OverloadExpr::FindResult::HasFormOfMemberPointer, clang::Expr::IgnoreParens(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), and clang::ASTContext::OverloadTy.
Referenced by DiagnoseAlwaysNonNullPointer().
ImplicitConversionSequence Sema::TryImplicitConversion | ( | Expr * | From, |
QualType | ToType, | ||
bool | SuppressUserConversions, | ||
AllowedExplicit | AllowExplicit, | ||
bool | InOverloadResolution, | ||
bool | CStyle, | ||
bool | AllowObjCWritebackConversion | ||
) |
Definition at line 1838 of file SemaOverload.cpp.
Referenced by CheckC23ConstexprInitConversion(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), CheckSingleAssignmentConstraints(), clang::InitializationSequence::InitializeFrom(), and TryReferenceInitializationCore().
ValueDecl * Sema::tryLookupCtorInitMemberDecl | ( | CXXRecordDecl * | ClassDecl, |
CXXScopeSpec & | SS, | ||
ParsedType | TemplateTypeTy, | ||
IdentifierInfo * | MemberOrBase | ||
) |
Definition at line 4269 of file SemaDeclCXX.cpp.
References clang::CXXScopeSpec::getScopeRep(), and tryLookupUnambiguousFieldDecl().
Referenced by BuildMemInitializer(), and clang::SemaCodeCompletion::ProduceCtorInitMemberSignatureHelp().
ValueDecl * Sema::tryLookupUnambiguousFieldDecl | ( | RecordDecl * | ClassDecl, |
const IdentifierInfo * | MemberOrBase | ||
) |
Definition at line 4250 of file SemaDeclCXX.cpp.
References D, clang::Decl::getDeclContext(), getLangOpts(), 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 13703 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::Result, 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 6612 of file SemaDecl.cpp.
References Context, clang::SemaBase::Diag(), clang::TypeSourceInfo::getType(), Loc, clang::T, toString(), and TryToFixInvalidVariablyModifiedTypeSourceInfo().
Referenced by clang::SemaObjC::ActOnIvar(), ActOnVariableDeclarator(), BuildCompoundLiteralExpr(), and CheckFieldDecl().
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 2670 of file Sema.cpp.
References clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), E, clang::ExprError(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), clang::SourceLocation::getLocWithOffset(), clang::Stmt::getSourceRange(), IsCallableWithAppend(), IsCPUDispatchCPUSpecificMultiVersion(), clang::QualType::isNull(), Loc, notePlausibleOverloads(), and Range.
Referenced by CheckPlaceholderExpr(), and LookupMemberExpr().
Definition at line 792 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 ActOnFunctionDeclarator(), ActOnPragmaClangSection(), ActOnPragmaMSSection(), CheckCompleteVariableDeclaration(), and handleSectionAttr().
bool Sema::UnifySection | ( | StringRef | SectionName, |
int | SectionFlags, | ||
SourceLocation | PragmaSectionLocation | ||
) |
Definition at line 819 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 11185 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 904 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::addAttr(), clang::Decl::attrs(), getASTContext(), and clang::Decl::hasAttr().
Referenced by InstantiateFunctionDefinition().
void clang::Sema::UpdateExceptionSpec | ( | FunctionDecl * | FD, |
const FunctionProtoType::ExceptionSpecInfo & | ESI | ||
) |
Definition at line 239 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 3101 of file SemaExpr.cpp.
References clang::CPlusPlus, D, getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isFunctionOrMethod(), and clang::CXXScopeSpec::isNotEmpty().
Referenced by ActOnIdExpression(), ActOnNameClassifiedAsNonType(), and ClassifyName().
bool Sema::usesPartialOrExplicitSpecialization | ( | SourceLocation | Loc, |
ClassTemplateSpecializationDecl * | ClassTemplateSpec | ||
) |
Definition at line 4006 of file SemaTemplateInstantiate.cpp.
References clang::TemplateArgumentList::asArray(), DeduceTemplateArguments(), clang::ClassTemplateDecl::getMostRecentDecl(), clang::ClassTemplateDecl::getPartialSpecializations(), clang::ClassTemplateSpecializationDecl::getSpecializedTemplate(), clang::ClassTemplateSpecializationDecl::getTemplateArgs(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::RedeclarableTemplateDecl::isMemberSpecialization(), 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 1557 of file SemaExpr.cpp.
References ACK_CompAssign, checkEnumArithmeticConversions(), Context, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::ASTContext::getCommonSugaredType(), clang::ASTContext::getPromotedIntegerType(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), handleComplexConversion(), handleComplexIntConversion(), handleFixedPointConversion(), handleFloatConversion(), clang::ASTContext::hasSameType(), ImpCastExprToType(), clang::Type::isArithmeticType(), clang::Type::isComplexIntegerType(), clang::Type::isComplexType(), clang::Type::isFixedPointType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::ASTContext::isPromotableBitField(), clang::ASTContext::isPromotableIntegerType(), clang::Type::isRealFloatingType(), Loc, unsupportedTypeConversion(), and UsualUnaryConversions().
Referenced by BuiltinVectorMath(), CheckAdditionOperands(), checkArithmeticOrEnumeralCompare(), checkArithmeticOrEnumeralThreeWayCompare(), CheckBitwiseOperands(), CheckConditionalOperands(), CheckMultiplyDivideOperands(), CheckRemainderOperands(), CheckSizelessVectorConditionalTypes(), CheckSubtractionOperands(), 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 784 of file SemaExpr.cpp.
References Context, CurFPFeatures, DefaultFunctionArrayLvalueConversion(), clang::ASTContext::DoubleTy, E, clang::ExprError(), clang::LangOptionsBase::FEM_Double, clang::LangOptionsBase::FEM_Extended, clang::LangOptionsBase::FEM_Source, clang::LangOptionsBase::FEM_UnsetOnCommandLine, clang::ASTContext::FloatTy, clang::ActionResult< PtrTy, Compress >::get(), clang::ASTContext::getComplexType(), clang::ASTContext::getFloatingTypeOrder(), getLangOpts(), clang::Preprocessor::getLastFPEvalPragmaLocation(), clang::ASTContext::getPromotedIntegerType(), clang::Expr::getType(), ImpCastExprToType(), clang::Type::isComplexType(), clang::Type::isFloatingType(), clang::Type::isHalfType(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::ASTContext::isPromotableBitField(), clang::ASTContext::isPromotableIntegerType(), clang::SourceLocation::isValid(), clang::ASTContext::LongDoubleTy, and PP.
Referenced by ActOnConditionalOp(), clang::SemaObjC::BuildObjCBridgedCast(), BuildVAArgExpr(), BuiltinCallWithStaticChain(), BuiltinCountZeroBitsGeneric(), BuiltinElementwiseTernaryMath(), CheckConditionalOperands(), CheckIndirectionOperand(), CheckLogicalOperands(), CheckShiftOperands(), checkSizelessVectorShift(), CheckSwitchCondition(), checkVectorShift(), CreateBuiltinBinOp(), CreateBuiltinUnaryOp(), DefaultArgumentPromotion(), PrepareBuiltinElementwiseMathOneArgCall(), and UsualArithmeticConversions().
Returns true if the argument consists of one contiguous run of 1s with any number of 0s on either side.
The 1s are allowed to wrap from LSB to MSB, so 0x000FFF0, 0x0000FFFF, 0xFF0000FF, 0x0 are all runs. 0x0F0F0000 is not, since all 1s are not contiguous.
Definition at line 3003 of file SemaChecking.cpp.
References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.
Referenced by clang::SemaPPC::CheckPPCBuiltinFunctionCall().
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 18304 of file SemaDecl.cpp.
References AllowFold, bool, clang::Expr::containsErrors(), Context, clang::ConstantExpr::Create(), clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getASTContext(), clang::TargetInfo::getCXXABI(), clang::ASTContext::getIntWidth(), getLangOpts(), clang::ConstantArrayType::getMaxSizeBits(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeSize(), clang::Type::isBooleanType(), clang::Type::isDependentType(), clang::Type::isIntegralOrEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::TargetCXXABI::isMicrosoft(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), RequireCompleteSizedType(), toString(), UPPC_BitFieldWidth, and VerifyIntegerConstantExpression().
Referenced by clang::SemaObjC::ActOnIvar(), and CheckFieldDecl().
|
inline |
Definition at line 7260 of file Sema.h.
References E, and VerifyIntegerConstantExpression().
ExprResult Sema::VerifyIntegerConstantExpression | ( | Expr * | E, |
llvm::APSInt * | Result, | ||
unsigned | DiagID, | ||
AllowFoldKind | CanFold = NoFold |
||
) |
Definition at line 17121 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), E, Loc, clang::Result, and VerifyIntegerConstantExpression().
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 17152 of file SemaExpr.cpp.
References Context, clang::CPlusPlus, clang::CPlusPlus11, clang::ConstantExpr::Create(), DefaultLvalueConversion(), clang::Expr::EvalStatus::Diag, clang::SemaBase::Diag(), clang::Sema::VerifyICEDiagnoser::diagnoseFold(), clang::Sema::VerifyICEDiagnoser::diagnoseNotICE(), clang::Sema::VerifyICEDiagnoser::diagnoseNotICEType(), E, clang::Expr::EvaluateAsRValue(), clang::Expr::EvaluateKnownConstIntCheckOverflow(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::APValue::getInt(), getLangOpts(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::EvalStatus::HasSideEffects, clang::Expr::EvalStatus::HasUndefinedBehavior, clang::Type::isEnumeralType(), clang::APValue::isInt(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), Loc, clang::Note, PerformContextualImplicitConversion(), clang::Result, clang::Sema::VerifyICEDiagnoser::Suppress, clang::T, and clang::Expr::EvalResult::Val.
Referenced by ActOnCaseExpr(), ActOnChooseExpr(), ActOnCXXNew(), clang::SemaOpenMP::ActOnOpenMPDeclareSimdDirective(), clang::SemaOpenMP::ActOnOpenMPPermutationClause(), AddAlignedAttr(), AddAlignValueAttr(), BuildBitIntType(), BuildCodeAlignAttr(), BuildStaticAssertDeclaration(), clang::SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(), CheckArrayDesignatorExpr(), checkArraySize(), CheckCXXBooleanCondition(), CheckEnumConstant(), CheckLoopHintExpr(), CheckTemplateArgument(), isTupleLike(), VerifyBitField(), VerifyIntegerConstantExpression(), and clang::SemaOpenMP::VerifyPositiveIntegerConstantInClause().
ExprResult Sema::VerifyIntegerConstantExpression | ( | Expr * | E, |
llvm::APSInt * | Result = nullptr , |
||
AllowFoldKind | CanFold = NoFold |
||
) |
Definition at line 17103 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), E, LangOpts, Loc, clang::Result, clang::T, and VerifyIntegerConstantExpression().
void Sema::WarnOnPendingNoDerefs | ( | ExpressionEvaluationContextRecord & | Rec | ) |
Emit a warning for all pending noderef expressions that we recorded.
Definition at line 17459 of file SemaExpr.cpp.
References clang::SemaBase::Diag(), E, clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), and clang::Sema::ExpressionEvaluationContextRecord::PossibleDerefs.
Referenced by PopExpressionEvaluationContext().
void Sema::warnOnReservedIdentifier | ( | const NamedDecl * | D | ) |
Definition at line 6075 of file SemaDecl.cpp.
References Context, D, clang::SemaBase::Diag(), getLangOpts(), clang::Decl::getLocation(), clang::Decl::getPreviousDecl(), clang::ASTContext::getSourceManager(), isFromSystemHeader(), clang::Decl::isImplicit(), and clang::NotReserved.
Referenced by ActOnFriendFunctionDecl(), ActOnTemplateParameterList(), and PushOnScopeChains().
|
inline |
Definition at line 1166 of file Sema.h.
Referenced by mergeDeclAttribute(), and ProcessDeclAttribute().
|
inline |
WeakTopLevelDeclDecls - access to #pragma weak-generated Decls.
Definition at line 4463 of file Sema.h.
References WeakTopLevelDecl.
Referenced by clang::ParseAST().
|
inline |
Definition at line 1171 of file Sema.h.
Referenced by handleInterruptAttr(), and ProcessDeclAttribute().
|
friend |
|
friend |
bool clang::Sema::AccessCheckingSFINAE |
When true, access checking violations are treated as SFINAE failures rather than hard errors.
Definition at line 12081 of file Sema.h.
Referenced by EmitDiagnostic(), clang::Sema::SFINAETrap::SFINAETrap(), and clang::Sema::SFINAETrap::~SFINAETrap().
llvm::DenseMap<unsigned, CXXDeductionGuideDecl *> clang::Sema::AggregateDeductionCandidates |
Definition at line 8672 of file Sema.h.
Referenced by DeclareAggregateDeductionGuideFromInitList().
SmallVector<AlignPackIncludeState, 8> clang::Sema::AlignPackIncludeStack |
Definition at line 1653 of file Sema.h.
Referenced by AddAlignmentAttributesForRecord(), and DiagnoseNonDefaultPragmaAlignPack().
PragmaStack<AlignPackInfo> clang::Sema::AlignPackStack |
Definition at line 1646 of file Sema.h.
Referenced by ActOnPragmaOptionsAlign(), ActOnPragmaPack(), ActOnTagFinishDefinition(), AddAlignmentAttributesForRecord(), DiagnoseNonDefaultPragmaAlignPack(), and DiagnoseUnterminatedPragmaAlignPack().
FunctionEffectKindSet clang::Sema::AllEffectsToVerify |
The union of all effects present on DeclsWithEffectsToVerify.
Conditions are all null.
Definition at line 15141 of file Sema.h.
Referenced by addDeclWithEffects().
sema::AnalysisBasedWarnings clang::Sema::AnalysisWarnings |
Worker object for performing CFG-based warnings.
Definition at line 945 of file Sema.h.
Referenced by ActOnBlockStmtExpr(), ActOnEndOfTranslationUnit(), ActOnFinishFunctionBody(), and PrintStats().
api_notes::APINotesManager clang::Sema::APINotes |
Definition at line 913 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 13194 of file Sema.h.
Referenced by clang::TreeTransform< Derived >::AlwaysRebuild(), FindInstantiatedDecl(), getPackSubstitutedTemplateArgument(), and SubstTypeConstraint().
PragmaStack<StringLiteral *> clang::Sema::BSSSegStack |
Definition at line 1656 of file Sema.h.
Referenced by ActOnPragmaMSSeg(), CheckCompleteVariableDeclaration(), clang::Sema::PragmaStackSentinelRAII::PragmaStackSentinelRAII(), and clang::Sema::PragmaStackSentinelRAII::~PragmaStackSentinelRAII().
llvm::BumpPtrAllocator clang::Sema::BumpAlloc |
Definition at line 858 of file Sema.h.
Referenced by clang::SemaObjC::addMethodToGlobalList(), CreateParsedType(), LookupSpecialMember(), and PrintStats().
std::unique_ptr<sema::FunctionScopeInfo> clang::Sema::CachedFunctionScope |
unsigned clang::Sema::CapturingFunctionScopes = 0 |
Track the number of currently active capturing scopes.
Definition at line 856 of file Sema.h.
Referenced by tryCaptureVariable().
CleanupInfo clang::Sema::Cleanup |
Used to control the generation of ExprWithCleanups.
Definition at line 6480 of file Sema.h.
Referenced by ActOnBlockStmtExpr(), ActOnDecltypeExpression(), ActOnFinishFunctionBody(), BuildBlockForLambdaConversion(), buildCoawaitCalls(), BuildCompoundLiteralExpr(), BuildLambdaExpr(), clang::SemaObjC::BuildObjCBridgedCast(), BuildStmtExpr(), CheckCXXDefaultArgExpr(), CheckForImmediateInvocation(), checkIndirectCopyRestoreSource(), clang::SemaObjC::CheckObjCConversion(), CreateMaterializeTemporaryExpr(), DefaultLvalueConversion(), DiscardCleanupsInEvaluationContext(), MaybeBindToTemporary(), MaybeCreateExprWithCleanups(), MaybeCreateStmtWithCleanups(), maybeExtendBlockObject(), clang::InitializationSequence::Perform(), PopExpressionEvaluationContext(), and PushExpressionEvaluationContext().
PragmaStack<StringLiteral *> clang::Sema::CodeSegStack |
Definition at line 1658 of file Sema.h.
Referenced by ActOnFunctionDeclarator(), ActOnPragmaMSSeg(), getImplicitCodeSegAttrFromClass(), getImplicitCodeSegOrSectionAttrForFunction(), clang::Sema::PragmaStackSentinelRAII::PragmaStackSentinelRAII(), and clang::Sema::PragmaStackSentinelRAII::~PragmaStackSentinelRAII().
SmallVector<Module *, 16> clang::Sema::CodeSynthesisContextLookupModules |
Extra modules inspected when performing a lookup during a template instantiation.
Computed lazily.
Definition at line 13145 of file Sema.h.
Referenced by getLookupModules(), and 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 13134 of file Sema.h.
Referenced by BuildDecltypeType(), CheckTemplateTypeArgument(), clang::Sema::InstantiatingTemplate::Clear(), DiagnoseDependentMemberLookup(), diagnoseZeroToNullptrConversion(), FindInstantiatedDecl(), GetFullTypeForDeclarator(), getLookupModules(), getTopMostPointOfInstantiation(), hasAcceptableDefinition(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), inTemplateInstantiation(), isSFINAEContext(), MarkFunctionReferenced(), popCodeSynthesisContext(), PrintContextStack(), PrintInstantiationStack(), pushCodeSynthesisContext(), SubstFunctionDeclType(), SubstParmTypes(), SubstType(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
bool clang::Sema::CollectStats |
Flag indicating whether or not to collect detailed statistics.
Definition at line 843 of file Sema.h.
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings(), and clang::ParseAST().
PragmaStack<StringLiteral *> clang::Sema::ConstSegStack |
Definition at line 1657 of file Sema.h.
Referenced by ActOnPragmaMSSeg(), CheckCompleteVariableDeclaration(), clang::Sema::PragmaStackSentinelRAII::PragmaStackSentinelRAII(), and clang::Sema::PragmaStackSentinelRAII::~PragmaStackSentinelRAII().
ASTConsumer& clang::Sema::Consumer |
Definition at line 910 of file Sema.h.
Referenced by clang::SemaObjC::ActOnAtEnd(), ActOnEndOfTranslationUnit(), ActOnExplicitInstantiation(), ActOnFinishInlineFunctionDef(), ActOnPragmaDetectMismatch(), ActOnPragmaMSComment(), ActOnTagFinishDefinition(), assignInheritanceModel(), attemptRecovery(), BuildModuleInclude(), canSkipFunctionBody(), CorrectTypo(), CorrectTypoDelayed(), createImplicitModuleImportForErrorRecovery(), DefineUsedVTables(), getASTConsumer(), handleMSInheritanceAttr(), Initialize(), InstantiateClass(), InstantiateClassMembers(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), LookupVisibleDecls(), MarkFunctionReferenced(), mergeDeclAttribute(), clang::Sema::TypoExprState::operator=(), ReferenceDllExportedMembers(), RequireCompleteType(), and ~Sema().
ASTContext& clang::Sema::Context |
Definition at line 909 of file Sema.h.
Referenced by ActOnAccessSpecifier(), ActOnAddrLabel(), ActOnAliasDeclaration(), ActOnArraySubscriptExpr(), ActOnArrayTypeTrait(), ActOnBlockArguments(), ActOnBlockStart(), ActOnBlockStmtExpr(), ActOnBreakStmt(), ActOnBuiltinOffsetOf(), ActOnCapScopeReturnStmt(), ActOnCapturedRegionStart(), ActOnCaseStmt(), ActOnCharacterConstant(), ActOnChooseExpr(), ActOnClassTemplateSpecialization(), ActOnCompoundLiteral(), ActOnCompoundRequirement(), ActOnCompoundStmt(), ActOnConditionalOp(), ActOnContinueStmt(), ActOnConversionDeclarator(), ActOnCXXBoolLiteral(), ActOnCXXCatchBlock(), ActOnCXXDelete(), ActOnCXXExitDeclInitializer(), ActOnCXXFoldExpr(), ActOnCXXForRangeStmt(), ActOnCXXGlobalScopeSpecifier(), ActOnCXXMemberDeclarator(), ActOnCXXNestedNameSpecifier(), ActOnCXXNestedNameSpecifierDecltype(), ActOnCXXNestedNameSpecifierIndexedPack(), ActOnCXXNew(), ActOnCXXNullPtrLiteral(), ActOnCXXTryBlock(), ActOnCXXTypeConstructExpr(), ActOnCXXTypeid(), ActOnCXXUuidof(), ActOnDeclStmt(), ActOnDecltypeExpression(), ActOnDecompositionDeclarator(), ActOnDefaultStmt(), actOnDelayedExceptionSpecification(), ActOnDependentIdExpression(), ActOnDependentMemberExpr(), ActOnDependentTag(), ActOnDesignatedInitializer(), ActOnDocumentableDecls(), ActOnDoStmt(), ActOnEffectExpression(), ActOnEmbedExpr(), ActOnEmptyDeclaration(), ActOnEndOfTranslationUnit(), ActOnEnumBody(), ActOnExceptionDeclarator(), ActOnExplicitInstantiation(), ActOnFields(), ActOnFileScopeAsmDecl(), ActOnFinishFullExpr(), ActOnFinishFunctionBody(), ActOnFinishFunctionDeclarationDeclarator(), ActOnFinishKNRParamDeclarations(), ActOnFinishSEHFinallyBlock(), ActOnFinishSwitchStmt(), ActOnForStmt(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnGCCAsmStmt(), ActOnGlobalModuleFragmentDecl(), ActOnGNUNullExpr(), ActOnGotoStmt(), ActOnIdExpression(), ActOnIfStmt(), ActOnIndirectGotoStmt(), ActOnInitializerError(), ActOnIntegerConstant(), ActOnLabelStmt(), ActOnLambdaClosureQualifiers(), ActOnLastBitfield(), ActOnMemInitializer(), ActOnMemInitializers(), ActOnModuleDecl(), ActOnModuleImport(), ActOnMSAsmStmt(), ActOnMSDependentExistsStmt(), ActOnMSVCUnknownTypeName(), ActOnNamespaceAliasDef(), ActOnNoexceptSpec(), ActOnNonTypeTemplateParameter(), ActOnNullStmt(), ActOnNumericConstant(), actOnOMPReductionKindClause(), ActOnParamDeclarator(), ActOnParenExpr(), ActOnParenListExpr(), ActOnPragmaDetectMismatch(), ActOnPragmaMSComment(), ActOnPragmaMSSeg(), ActOnPragmaOptionsAlign(), ActOnPragmaPack(), ActOnPragmaRedefineExtname(), ActOnPragmaUnused(), ActOnPragmaWeakID(), ActOnPrivateModuleFragmentDecl(), ActOnPseudoDestructorExpr(), ActOnRequiresExpr(), ActOnSEHExceptBlock(), ActOnSEHLeaveStmt(), ActOnSEHTryBlock(), ActOnSizeofParameterPackExpr(), ActOnSourceLocExpr(), ActOnStartConceptDefinition(), ActOnStartCXXMemberDeclarations(), ActOnStartCXXMemberReference(), ActOnStartExportDecl(), ActOnStartLinkageSpecification(), ActOnStartNamespaceDef(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), ActOnStartOfSwitchStmt(), ActOnStartRequiresExpr(), ActOnStartTopLevelStmtDecl(), ActOnStringLiteral(), ActOnSuperScopeSpecifier(), ActOnTag(), ActOnTagFinishDefinition(), ActOnTagFinishSkippedDefinition(), ActOnTagTemplateIdType(), ActOnTemplatedFriendTag(), ActOnTemplateIdType(), ActOnTemplateName(), ActOnTemplateParameterList(), ActOnTemplateTemplateParameter(), ActOnTranslationUnitScope(), ActOnTypedefNameDecl(), ActOnTypenameType(), ActOnTypeParameter(), ActOnTypeRequirement(), ActOnTypeTrait(), ActOnUnevaluatedStringLiteral(), ActOnUninitializedDecl(), ActOnUsingDirective(), ActOnUsingEnumDeclaration(), ActOnVariableDeclarator(), ActOnVarTemplateSpecialization(), ActOnWhileStmt(), AddAlignedAttr(), AddAlignmentAttributesForRecord(), AddAlignValueAttr(), AddAllocAlignAttr(), AddAssumeAlignedAttr(), addBlockPointerConversion(), AddBuiltinAssignmentOperatorCandidates(), addFunctionPointerConversion(), addGslOwnerPointerAttributeIfNotExisting(), AddImplicitlyDeclaredMembersToClass(), AddImplicitMSFunctionNoBuiltinAttr(), addImplicitTypedef(), AddInitializerToDecl(), AddKnownFunctionAttributes(), AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), AddModeAttr(), AddMsStructLayoutForRecord(), AddOptnoneAttributeIfNoConflicts(), AddOverriddenMethods(), AddPropertyAttrs(), AddPushedVisibilityAttribute(), AddSectionMSAllocText(), AddSuperSendCompletion(), AddTemplateParametersToLambdaCallOperator(), addThisCompletion(), AdjustAddressSpaceForBuiltinOperandType(), adjustBlockReturnsToEnum(), adjustCCAndNoReturn(), AdjustDestructorExceptionSpec(), clang::TemplateDeclInstantiator::adjustForRewrite(), AdjustFunctionParmAndArgTypesForDeduction(), adjustMemberFunctionCC(), adjustVectorType(), AnalyzeBitFieldAssignment(), AnalyzeComparison(), AnalyzeImplicitConversions(), applyNullability(), clang::applyObjCTypeArgs(), applyOMPAllocateAttribute(), AreConstraintExpressionsEqual(), areMultiversionVariantFunctionsCompatible(), areVectorTypesSameSize(), AttachBaseSpecifiers(), AttachTypeConstraint(), attemptRecovery(), BuildAddressSpaceAttr(), BuildAddressSpaceIndex(), BuildAnonymousStructOrUnion(), BuildArrayType(), BuildArrayTypeTrait(), BuildAsTypeExpr(), BuildAtomicExpr(), BuildAtomicType(), BuildAttributedStmt(), BuildBaseInitializer(), BuildBinOp(), BuildBitIntType(), BuildBlockForLambdaConversion(), BuildBlockPointerType(), BuildBuiltinBitCastExpr(), BuildBuiltinCallExpr(), BuildBuiltinOffsetOf(), BuildCallExpr(), BuildCaptureField(), buildCoawaitCalls(), BuildCodeAlignAttr(), BuildCompoundLiteralExpr(), BuildConvertedConstantExpression(), BuildCookedLiteralOperatorCall(), BuildCoreturnStmt(), BuildCoroutineBodyStmt(), buildCoroutinePromise(), BuildCountAttributedArrayOrPointerType(), buildCounterInit(), buildCounterUpdate(), BuildCoyieldExpr(), BuildCStyleCastExpr(), BuildCXXAssumeExpr(), BuildCXXCastArgument(), BuildCXXConstructExpr(), BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), BuildCXXFoldExpr(), BuildCXXForRangeStmt(), BuildCXXFunctionalCastExpr(), BuildCXXNamedCast(), BuildCXXNestedNameSpecifier(), BuildCXXNew(), BuildCXXNoexceptExpr(), BuildCXXThisExpr(), BuildCXXThrow(), BuildCXXTypeConstructExpr(), BuildCXXTypeId(), BuildCXXUuidof(), BuildDeclarationNameExpr(), BuildDeclaratorGroup(), buildDeclareReductionRef(), buildDeclRefExpr(), BuildDeclRefExpr(), BuildDecltypeType(), BuildDelegatingInitializer(), BuildDependentDeclRefExpr(), BuildEmptyCXXFoldExpr(), BuildExceptionDeclaration(), BuildExpressionFromDeclTemplateArgument(), BuildExpressionFromIntegralTemplateArgumentValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), BuildExpressionTrait(), BuildExprRequirement(), BuildExtVectorType(), BuildFieldReferenceExpr(), BuildFloatingLiteral(), BuildFunctionType(), BuildIfStmt(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), BuildInitList(), BuildLambdaExpr(), buildLambdaInitCaptureInitialization(), BuildMatrixType(), BuildMemberExpr(), BuildMemberInitializer(), BuildMemberPointerType(), BuildMemberReferenceExpr(), buildMemcpyForAssignmentOp(), BuildMemInitializer(), BuildMicrosoftCAnonymousStruct(), BuildModuleInclude(), BuildMSDependentExistsStmt(), BuildMSPropertyRefExpr(), buildNamedType(), BuildNestedRequirement(), BuildOperatorCoawaitLookupExpr(), BuildPackIndexingExpr(), BuildPackIndexingType(), BuildParenType(), BuildParmVarDeclForTypedef(), BuildPointerType(), BuildPossibleImplicitMemberExpr(), buildPostUpdate(), BuildPredefinedExpr(), BuildPseudoDestructorExpr(), BuildQualifiedDeclarationNameExpr(), BuildQualifiedType(), BuildReadPipeType(), BuildReferenceType(), BuildResolvedCallExpr(), BuildResolvedCoawaitExpr(), BuildReturnStmt(), buildSingleCopyAssign(), buildSingleCopyAssignRecursively(), BuildSourceLocExpr(), BuildStaticAssertDeclaration(), BuildStdInitializerList(), BuildStmtExpr(), BuildTemplateIdExpr(), BuildTypeConstraint(), buildTypeForLambdaCallOperator(), BuildTypeofExprType(), BuildTypeRequirement(), BuildTypeTrait(), BuildUnaryTransformType(), BuildUnresolvedCoawaitExpr(), buildUserDefinedMapperRef(), BuildUsingDeclaration(), BuildUsingEnumDeclaration(), BuildUsingPackDecl(), BuildUsingShadowDecl(), BuildVAArgExpr(), buildVarDecl(), BuildVariableInstantiation(), BuildVectorLiteral(), BuildVectorType(), BuildWritePipeType(), BuiltinAlignment(), builtinAllocaAddrSpace(), BuiltinCallWithStaticChain(), BuiltinChangeCVRQualifiers(), BuiltinChangeSignedness(), builtinCommonTypeImpl(), BuiltinConstantArg(), BuiltinDecay(), BuiltinDumpStruct(), BuiltinIsWithinLifetime(), BuiltinLaunder(), BuiltinRemoveExtent(), BuiltinRemoveReference(), BuiltinShuffleVector(), calculateConstraintSatisfaction(), clang::Sema::ImplicitExceptionSpecification::CalledDecl(), CallExprUnaryConversions(), canCaptureVariableByCopy(), canConvertIntToOtherIntTy(), canConvertIntTyToFloatTy(), canPassInRegisters(), canThrow(), CaptureHasSideEffects(), captureInBlock(), captureInCapturedRegion(), captureInLambda(), castForMoving(), CastForMoving(), ChangeIntegralSignedness(), CheckAdditionOperands(), checkAddressOfFunctionIsAvailable(), CheckAddressOfMemberAccess(), CheckAddressOfOperand(), CheckAlignasUnderalignment(), CheckAllArgsHaveFloatRepresentation(), CheckAllocatedType(), CheckAllocationAccess(), checkAPINotesReplacementType(), checkARCPropertyImpl(), CheckArgTypeIsCorrect(), checkArithmeticOrEnumeralCompare(), checkArithmeticOrEnumeralThreeWayCompare(), clang::checkArmStreamingBuiltin(), checkArrayElementAlignment(), checkArraySize(), CheckAsmLValue(), clang::SemaPseudoObject::checkAssignment(), CheckAssignmentConstraints(), CheckAssignmentOperands(), CheckAttrTarget(), CheckBaseClassAccess(), CheckBaseSpecifier(), checkBlockPointerTypesForAssignment(), CheckBoolLikeConversion(), CheckBoolSelect(), checkBuiltinArgument(), clang::SemaHLSL::CheckBuiltinFunctionCall(), checkBuiltinTemplateIdType(), checkBuiltinVerboseTrap(), CheckC23ConstexprInitConversion(), CheckC23ConstexprInitStringLiteral(), CheckC23ConstexprVarType(), checkCall(), CheckCallingConvAttr(), CheckCaseExpression(), CheckCastAlign(), checkClassLevelDLLAttribute(), CheckClassTemplate(), CheckCompareOperands(), CheckComparisonCategoryType(), CheckCompatibleReinterpretCast(), CheckCompletedCoroutineBody(), CheckCompletedCXXClass(), CheckCompleteDecompositionDeclaration(), CheckCompleteDestructorVariant(), CheckCompleteVariableDeclaration(), checkComplexDecomposition(), CheckConceptRedefinition(), CheckConceptTemplateId(), checkConditionalBlockPointerCompatibility(), checkConditionalNullPointer(), checkConditionalObjectPointersCompatibility(), CheckConditionalOperands(), checkConditionalPointerCompatibility(), checkConstantPointerAuthKey(), CheckConstraintExpression(), CheckConstraintSatisfaction(), CheckConstructor(), CheckConstructorAccess(), CheckConstructorDeclarator(), CheckConversionDeclarator(), CheckCXXThrowOperand(), CheckDeducedArgumentConstraints(), CheckDeducedPlaceholderConstraints(), CheckDeductionConsistency(), CheckDeductionGuideDeclarator(), CheckDependentFunctionTemplateSpecialization(), CheckDerivedToBaseConversion(), CheckDestructorAccess(), CheckDestructorDeclarator(), checkDLLAttributeRedeclaration(), checkEnumArithmeticConversions(), CheckEnumConstant(), CheckEnumRedeclaration(), checkEnumTypesInSwitchStmt(), CheckEquivalentExceptionSpec(), clang::CheckEquivalentExceptionSpecImpl(), checkEscapingByref(), checkExceptionSpecification(), CheckExplicitlyDefaultedComparison(), CheckExplicitlyDefaultedSpecialMember(), CheckExtVectorCast(), CheckExtVectorComponent(), CheckFieldDecl(), CheckFloatComparison(), CheckFloatingOrIntRepresentation(), CheckFloatOrHalfRepresentations(), CheckForConstantInitializer(), CheckForIncompatibleAttributes(), CheckFormatString(), checkFormatStringExpr(), CheckForModifiableLvalue(), checkForMultipleExportedDefaultConstructors(), CheckForNullPointerDereference(), CheckForReference(), CheckFriendAccess(), CheckFunctionCall(), CheckFunctionDeclaration(), checkFunctionOrMethodParameterIndex(), CheckFunctionReturnType(), CheckFunctionTemplateSpecialization(), checkGlobalOrExternCConflict(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), CheckImplicitConversion(), clang::SemaPseudoObject::checkIncDec(), checkIncorrectVTablePointerAuthenticationAttribute(), checkIndirectCopyRestoreSource(), checkInheritableAttr(), clang::CheckInvalidVLENandLMUL(), CheckKeyForObjCARCConversion(), CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), CheckLiteralType(), CheckLogicalOperands(), CheckLookupAccess(), CheckMain(), CheckMatrixElementwiseOperands(), CheckMatrixMultiplyOperands(), CheckMemberAccess(), checkMemberDecomposition(), CheckMemberOperatorAccess(), CheckMemberSpecialization(), CheckMethodOverrideParam(), CheckMethodOverrideReturn(), CheckModifiableLValue(), CheckMoveOnConstruction(), CheckMSVCRTEntryPoint(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionValue(), CheckNoDoubleVectors(), CheckNonNullExpr(), CheckNontrivialField(), CheckNonTypeTemplateParameterType(), checkNullabilityConsistency(), CheckNullabilityTypeSpecifier(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), CheckObjCCollectionLiteralElement(), checkObjCKindOfType(), checkObjCPointerTypesForAssignment(), clang::checkOpenCLEnqueueLocalSizeArgs(), checkOpenMPLoop(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeclaration(), CheckOperatorNewDeleteTypes(), CheckOriginalCallArgDeduction(), CheckOverridingFunctionAttributes(), CheckOverridingFunctionReturnType(), CheckPackExpansion(), CheckParameter(), clang::checkPipePacketType(), CheckPlaceholderExpr(), checkPointerAuthKey(), checkPointerAuthValue(), CheckPointerToMemberOperands(), checkPointerTypesForAssignment(), checkPreviousOMPAllocateAttribute(), CheckProtocolMethodDefs(), CheckPtrComparisonWithNullChar(), CheckRealImagOperand(), CheckRegparmAttr(), clang::SemaRISCV::checkRVVTypeSupport(), CheckScalarOrVector(), checkSimdlenSafelenSpecified(), CheckSingleAssignmentConstraints(), CheckSizelessVectorConditionalTypes(), CheckSizelessVectorOperands(), checkSizelessVectorShift(), CheckSpecializationInstantiationRedecl(), CheckSpecifiedExceptionType(), clang::SemaSPIRV::CheckSPIRVBuiltinFunctionCall(), CheckStaticArrayArgument(), CheckStringInit(), CheckStructuredBindingMemberAccess(), CheckSubtractionOperands(), clang::checkSwiftAsyncErrorBlock(), checkTargetAttr(), checkTargetClonesAttrString(), checkTargetVersionAttr(), CheckTautologicalComparison(), CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentList(), CheckTemplateArgumentPointerToMember(), CheckTemplateIdType(), CheckTemplateParameterList(), CheckTemplateTypeArgument(), CheckThreadLocalForLargeAlignment(), checkThreeWayNarrowingConversion(), CheckTransparentUnionArgumentConstraints(), checkTrivialClassMembers(), checkTupleLikeDecomposition(), CheckTypedefForVariablyModifiedType(), checkTypeMappable(), CheckTypenameType(), checkTypeParamListConsistency(), checkUInt32Argument(), CheckUnaryExprOrTypeTraitOperand(), checkUnknownAnyArg(), CheckUnresolvedLookupAccess(), CheckUnresolvedMemberAccess(), CheckUnsignedIntRepresentation(), CheckUsingDeclRedeclaration(), CheckUsingShadowDecl(), CheckVariableDeclarationType(), CheckVarTemplateId(), checkVAStartABI(), CheckVectorCast(), CheckVectorCompareOperands(), CheckVectorConditionalTypes(), checkVectorDecomposition(), CheckVectorOperands(), checkVectorResult(), CheckVectorSelect(), checkVectorShift(), CheckWaveActive(), ClassifyName(), CloneDesignatedInitExpr(), CollectFieldInitializer(), compareConversionFunctions(), CompareDerivedToBaseConversions(), CompareImplicitConversionSequences(), CompareQualificationConversions(), CompareStandardConversionSequences(), clang::ConversionFixItGenerator::compareTypesSimple(), completeExprArrayBound(), computeDeclContext(), ComputeDefaultedComparisonExceptionSpec(), ComputeDefaultedSpecialMemberExceptionSpec(), ConstantFoldAttrArgs(), ConvertAPValueToString(), convertArgsForAvailabilityChecks(), ConvertArgumentsForCall(), convertArgumentToType(), convertCallArgsToString(), ConvertDeclSpecToType(), ConvertDeclToDeclGroup(), ConvertDeducedTemplateArgument(), ConvertDeducedTemplateArguments(), ConvertParamDefaultArgument(), convertVector(), ConvertVectorExpr(), copyAttrFromTypedefToDecl(), copyAttrIfPresent(), CopyObject(), CorrectDelayedTyposInBinOp(), CreateAnnotationAttr(), CreateBuiltin(), CreateBuiltinArraySubscriptExpr(), CreateBuiltinBinOp(), CreateBuiltinMatrixSubscriptExpr(), CreateBuiltinUnaryOp(), CreateCapturedStmtRecordDecl(), clang::CodeCompletionResult::CreateCodeCompletionString(), CreateFunctionRefExpr(), CreateGenericSelectionExpr(), CreateLambdaCallOperator(), createLambdaClosureType(), createLambdaInitCaptureVarDecl(), CreateLaunchBoundsAttr(), CreateMaterializeTemporaryExpr(), CreateNewFunctionDecl(), CreateRecoveryExpr(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), createSubstDiag(), createSubstDiagAt(), CreateUnaryExprOrTypeTraitExpr(), CXXCheckConditionalOperands(), CXXRecordMembersNamed(), clang::Sema::CXXThisScopeRAII::CXXThisScopeRAII(), DeclApplyPragmaWeak(), DeclareGlobalAllocationFunction(), DeclareGlobalNewDelete(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DecomposeUnqualifiedId(), DeduceAutoType(), deduceClosureReturnType(), DeduceFromInitializerList(), DeduceFunctionTypeFromReturnExpr(), DeduceNonTypeTemplateArgument(), DeduceNullPtrTemplateArgument(), deduceOpenCLAddressSpace(), DeduceReturnType(), DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateArgumentsFromType(), DeduceTemplateSpecArguments(), DeduceTemplateSpecializationFromInitializer(), deduceVarTypeFromInitializer(), DefaultArgumentPromotion(), defaultedSpecialMemberIsConstexpr(), DefaultFunctionArrayConversion(), DefaultLvalueConversion(), DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), DefineUsedVTables(), DelayDependentAccess(), clang::InitializationSequence::Diagnose(), DiagnoseAmbiguousLookup(), diagnoseArithmeticOnTwoFunctionPointers(), diagnoseArrayStarInParamType(), DiagnoseAssignmentEnum(), DiagnoseAssignmentResult(), DiagnoseAvailabilityOfDecl(), DiagnoseBadAccess(), DiagnoseBadConversion(), DiagnoseBadDeduction(), DiagnoseBadDivideOrRemainderValues(), DiagnoseBadShiftValues(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseCommaOperator(), DiagnoseConditionalForNull(), DiagnoseDirectIsaAccess(), DiagnoseDivisionSizeofPointerOrArray(), DiagnoseEmptyLookup(), DiagnoseEqualityWithExtraParens(), DiagnoseFloatingImpCast(), DiagnoseForRangeConstVariableCopies(), DiagnoseForRangeReferenceVariableCopies(), DiagnoseIntInBoolContext(), DiagnoseInvalidExplicitObjectParameterInLambda(), DiagnoseInvalidRedeclaration(), diagnoseListInit(), diagnoseMissingImport(), diagnoseMissingTemplateArguments(), DiagnoseNarrowingInInitList(), DiagnoseNontrivial(), diagnoseObjCARCConversion(), DiagnoseObjCImplementedDeprecations(), diagnoseOpenCLTypes(), diagnoseQualifiedDeclaration(), DiagnoseSentinelCalls(), DiagnoseSizeOfParametersAndReturnValue(), DiagnoseStaticAssertDetails(), diagnoseTautologicalComparison(), DiagnoseTwoPhaseOperatorLookup(), DiagnoseUninitializedUse(), DiagnoseUninstantiableTemplate(), DiagnoseUnknownTemplateName(), DiagnoseUnknownTypeName(), diagnoseUnsatisfiedRequirement(), DiagnoseUnusedDecl(), DiagnoseUseOfDecl(), diagnoseVarDeclTypeMismatch(), diagnoseWellFormedUnsatisfiedConstraintExpr(), diagOpenCLBuiltinTypeError(), DiagRecursiveConstraintEval(), DiscardMisalignedMemberAddress(), DoEmitAvailabilityWarning(), doesUsualArrayDeleteWantSize(), DoMarkPotentialCapture(), DoMarkVarDeclReferenced(), EmitDiagnostic(), emitReplacement(), EvaluateAndDiagnoseImmediateInvocation(), EvaluateBooleanTypeTrait(), EvaluateStaticAssertMessageAsString(), ExpandAnonymousFieldDesignator(), ExpandFunctionLocalPredefinedMacros(), FillInlineAsmIdentifierInfo(), FilterLookupForScope(), filterNonConflictingPreviousTypedefDecls(), FinalizeDeclaration(), FinalizeDeclaratorGroup(), FinalizeVarWithDestructor(), FindAllocationFunctions(), FindAssociatedClassesAndNamespaces(), FindBaseInitializer(), clang::findCapturingExpr(), FindCompositePointerType(), findConstantBaseAndOffset(), FindDeallocationFunction(), FindDeallocationFunctionForDestructor(), findDecomposableBaseClass(), findDeleteForPromise(), findFailedBooleanCondition(), findInheritingConstructor(), FindInstantiatedDecl(), findLocallyScopedExternCDecl(), FindUsualDeallocationFunction(), clang::DeclSpec::Finish(), FinishTemplateArgumentDeduction(), FinishTemplateArgumentDeduction(), fitsInto(), FormatStringHasSArg(), funcHasParameterSizeMangling(), GatherArgumentsForCall(), getAmbiguousPathsDisplayString(), getAndVerifyMatrixDimension(), getASTContext(), clang::SemaBase::getASTContext(), getBaseMessageSendResultType(), getCCForDeclaratorChunk(), getCompletionPrintingPolicy(), getConstructorName(), clang::TypoCorrectionConsumer::getContext(), getCopyElisionCandidate(), getCurrentMangleNumberContext(), getCurrentThisType(), GetDeclSpecTypeForDeclarator(), getDecltypeForExpr(), getDestructorName(), getDestructorTypeForDecltype(), GetDiagForGotoScopeDecl(), getDummyLambdaType(), getElaboratedType(), getFixedEnumPromtion(), GetFullTypeForDeclarator(), getGenericLambdaTemplateParameterList(), getIdentityTemplateArgumentLoc(), getImplicitMethodEPI(), getInheritingConstructorName(), GetKeyForBase(), GetKeyForMember(), getLambdaConversionFunctionCallConv(), getLambdaConversionFunctionResultType(), getLocationOfStringLiteralByte(), getMoreSpecialized(), getMoreSpecializedPartialSpecialization(), getMoreSpecializedTemplate(), getNamedReturnInfo(), GetNameFromUnqualifiedId(), getNonOdrUseReasonInCurrentContext(), getNormalizedAssociatedConstraints(), getNSNumberFactoryMethod(), getOpenCLEnumType(), getOpenCLKernelParameterType(), getOpenCLTypedefType(), GetOrCreateMSAsmLabel(), getOrCreateStdNamespace(), getParamType(), getPatternForClassTemplateSpecialization(), getPresumedAlignmentOfPointer(), getPrintingPolicy(), GetSignedSizelessVectorType(), GetSignedVectorType(), getStdAlignValT(), getStdBadAlloc(), getStdNamespace(), getTemplateArgumentPackExpansionPattern(), getTemplateInstantiationArgs(), getTrivialIntegralTemplateArgument(), getTrivialTemplateArgumentLoc(), getTupleLikeElementType(), GetTypeForDeclaratorCast(), getTypeName(), GetTypeOfFunction(), GetTypeSourceInfoForDeclarator(), getTypeSourceInfoForStdAlignValT(), getVariadicCallType(), handleAbiTagAttr(), handleAcquireCapabilityAttr(), handleAcquiredAfterAttr(), handleAcquiredBeforeAttr(), handleAcquireHandleAttr(), HandleAddressSpaceTypeAttribute(), handleAliasAttr(), handleAlignedAttr(), handleAllocSizeAttr(), handleAlwaysInlineAttr(), handleAnalyzerNoReturnAttr(), HandleAnnotateTypeAttr(), clang::SemaX86::handleAnyInterruptAttr(), handleAPINotedRetainCountAttribute(), handleArgumentWithTypeTagAttr(), HandleArmSveVectorBitsTypeAttr(), handleAssertCapabilityAttr(), handleAssertExclusiveLockAttr(), handleAssertSharedLockAttr(), handleAttrWithMessage(), handleAvailabilityAttr(), handleBTFDeclTagAttr(), HandleBTFTypeTagAttribute(), handleBuiltinAliasAttr(), handleCallableWhenAttr(), handleCallbackAttr(), handleCallConvAttr(), handleCalledOnceAttr(), handleCapabilityAttr(), handleCFGuardAttr(), handleCleanupAttr(), handleCodeModelAttr(), handleCommonAttr(), handleComplexConversion(), handleComplexFloatConversion(), handleComplexIntConversion(), handleConstantAttr(), handleConstructorAttr(), handleConsumableAttr(), handleCPUSpecificAttr(), handleCXXAssumeAttr(), handleDeclspecThreadAttr(), handleDelayedForbiddenType(), handleDependencyAttr(), HandleDependentAccessCheck(), handleDeprecatedAttr(), handleDestructorAttr(), handleDeviceAttr(), handleDiagnoseAsBuiltinAttr(), handleDiagnoseIfAttr(), handleDLLAttr(), handleEnableIfAttr(), handleEnforceTCBAttr(), handleEnumExtensibilityAttr(), handleExcludeFromExplicitInstantiationAttr(), handleExclusiveTrylockFunctionAttr(), handleExternalSourceSymbolAttr(), handleFallThroughAttr(), HandleField(), handleFixedPointConversion(), handleFloatConversion(), handleFormatArgAttr(), handleFormatAttr(), handleFunctionReturnThunksAttr(), handleFunctionTypeAttr(), handleGlobalAttr(), handleGNUInlineAttr(), handleGridConstantAttr(), handleGuardedByAttr(), handleHandleAttr(), handleHLSLControlFlowHint(), handleHLSLLoopHintAttr(), handleIFuncAttr(), HandleImmediateInvocations(), handleInitPriorityAttr(), handleIntegerConversion(), handleIntegerVectorBinOpConversion(), handleInterruptAttr(), handleIntToFloatConversion(), clang::SemaSYCL::handleKernelEntryPointAttr(), handleLambdaNumbering(), handleLayoutVersion(), handleLifetimeCategoryAttr(), handleLikely(), handleLockReturnedAttr(), handleLocksExcludedAttr(), handleLoopHintAttr(), handleManagedAttr(), handleMinVectorWidthAttr(), handleMSConstexprAttr(), handleMSPointerTypeQualifierAttr(), HandleMSProperty(), handleMustTailAttr(), handleNakedAttr(), HandleNeonVectorTypeAttr(), handleNoBuiltinAttr(), handleNoConvergentAttr(), handleNoDebugAttr(), handleNoEscapeAttr(), handleNoInlineAttr(), handleNoMergeAttr(), handleNonBlockingNonAllocatingTypeAttr(), handleNonNullAttr(), handleNonNullAttrParameter(), handleNoRandomizeLayoutAttr(), handleNoReturnAttr(), handleNoSanitizeAttr(), handleNoSanitizeSpecificAttr(), handleNoSpecializations(), handleNoUniqueAddressAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleOpenCLAccessAttr(), handleOpenCLUnrollHint(), handleOwnershipAttr(), handlePackedAttr(), handleParamTypestateAttr(), handlePassObjectSizeAttr(), handlePatchableFunctionEntryAttr(), handlePreferredName(), handlePreferredTypeAttr(), handlePtGuardedByAttr(), handlePtGuardedVarAttr(), handleRandomizeLayoutAttr(), handlerCanCatch(), handleReleaseCapabilityAttr(), handleRequiresCapabilityAttr(), handleRestrictAttr(), handleReturnsNonNullAttr(), handleReturnTypestateAttr(), HandleRISCVRVVVectorBitsTypeAttr(), handleSentinelAttr(), handleSetTypestateAttr(), handleSharedAttr(), handleSharedTrylockFunctionAttr(), handleStandardNoReturnAttr(), handleSuppressAttr(), HandleSwiftAttr(), handleTagNumbering(), handleTargetAttr(), handleTargetClonesAttr(), handleTargetVersionAttr(), handleTestTypestateAttr(), handleTLSModelAttr(), handleTransparentUnionAttr(), handleTryAcquireCapabilityAttr(), handleTypeTagForDatatypeAttr(), handleUninitializedAttr(), handleUnlikely(), handleUnsafeBufferUsage(), handleUnusedAttr(), handleUuidAttr(), handleVecReturnAttr(), handleVecTypeHint(), handleVisibilityAttr(), handleVTablePointerAuthentication(), handleWarnUnusedResult(), handleWeakImportAttr(), handleWeakRefAttr(), HandleWebAssemblyFuncrefAttr(), handleWorkGroupSize(), handleXRayLogArgsAttr(), handleZeroCallUsedRegsAttr(), hasAcceptableDefinition(), hasDeducibleTemplateParameters(), hasMergedDefinitionInCurrentModule(), HasNonDeletedDefaultedEqualityComparison(), hasUserDefinedMapper(), hasVisibleMergedDefinition(), IgnoredValueConversions(), ImpCastExprToType(), ImplicitlyDefineFunction(), inferARCLifetimeForPointee(), inferARCWriteback(), inferGslOwnerPointerAttribute(), inferGslPointerAttribute(), inferLifetimeBoundAttribute(), inferLifetimeCaptureByAttribute(), inferNullableClassAttribute(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), Initialize(), InitializeExplicitObjectArgument(), clang::InitializationSequence::InitializeFrom(), InjectAnonymousStructOrUnionMembers(), InsertOCLBuiltinDeclarationsFromTable(), InstantiateAttrs(), InstantiateAttrsForDecl(), InstantiateClass(), InstantiateClassMembers(), clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization(), InstantiateDefaultCtorDefaultArgs(), InstantiateEnum(), InstantiateFunctionDefinition(), InstantiateInClassInitializer(), instantiateOMPDeclareVariantAttr(), clang::TemplateDeclInstantiator::InstantiateTypeAliasTemplateDecl(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), InstantiateVariableDefinition(), clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization(), InventAbbreviatedTemplateParameterTypeName(), InventTemplateParameter(), clang::TreeTransform< Derived >::InventTypeSourceInfo(), isAbstractType(), isAcceptableNestedNameSpecifier(), isAllowableExplicitConversion(), isArithmeticArgumentPromotion(), IsAtLeastAsConstrained(), clang::isBetterOverloadCandidate(), isDeductionGuideName(), isDefaultStdCall(), IsEquivalentForUsingDecl(), IsFloatingPointConversion(), isForbiddenTypeAllowed(), isFunctionDefinitionDiscarded(), IsImplicitBoolFloatConversion(), isImplicitMapperNeeded(), isIncompatibleTypedef(), isIncompleteOrZeroLengthArrayType(), IsInvalidCmseNSCallConversion(), IsInvalidSMECallConversion(), isLaxVectorConversion(), isLibstdcxxEagerExceptionSpecHack(), isMemberAccessibleForDeletion(), isMicrosoftMissingTypename(), isMoreSpecializedThanPrimary(), isNonNegativeIntegerValue(), isNonPlacementDeallocationFunction(), isNullPointerValueTemplateArgument(), IsOverloadOrOverrideImpl(), isPermittedNeonBaseType(), isRelevantAttr(), isSameOrCompatibleFunctionType(), IsSimplyAccessible(), IsStandardConversion(), IsStringInit(), IsStringLiteralToNonConstPointerConversion(), isTemplateName(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), isTupleLike(), clang::SemaHLSL::IsTypedResourceElementCompatible(), IsUserDefinedConversion(), isValidInteropVariable(), isValidSectionSpecifier(), isValidVarArgType(), IsVectorConversion(), IsVectorElementConversion(), LazilyCreateBuiltin(), LookupBuiltin(), LookupConstructors(), lookupCoroutineHandleType(), LookupDirect(), LookupInlineAsmField(), LookupInlineAsmVarDeclField(), LookupInSuper(), LookupLiteralOperator(), LookupMemberExpr(), LookupMethodInReceiverType(), clang::LookupNamed(), clang::LookupNamespace(), LookupObjCInterfaceDeclForLiteral(), LookupOrCreateLabel(), LookupOverloadedOperatorName(), LookupPredefedObjCSuperType(), lookupPromiseType(), LookupQualifiedName(), LookupSpecialMember(), LookupStdSourceLocationImpl(), lookupStdTypeTraitMember(), makeLaunchBoundsArgExpr(), makeMergedDefinitionVisible(), makeQualifiedLValueReferenceType(), makeUnavailableInSystemHeader(), MarkBaseAndMemberDestructorsReferenced(), MarkDeducedTemplateParameters(), MarkFunctionReferenced(), markUsedForAliasOrIfunc(), MarkUsedTemplateParameters(), MarkVarDeclODRUsed(), MarkVirtualBaseDestructorsReferenced(), MarkVTableUsed(), MatchTemplateParameterKind(), MatchTemplateParametersToScopeSpecifier(), maybeAddDeclWithEffects(), MaybeAddOverrideCalls(), MaybeBindToTemporary(), MaybeCreateExprWithCleanups(), MaybeCreateStmtWithCleanups(), MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), maybeExtendBlockObject(), mergeAlignedAttrs(), mergeAlwaysInlineAttr(), mergeAvailabilityAttr(), mergeBTFDeclTagAttr(), mergeCodeSegAttr(), MergeCompatibleFunctionDecls(), mergeDeclAttribute(), mergeDeclAttributes(), mergeDLLExportAttr(), mergeDLLImportAttr(), mergeErrorAttr(), mergeFormatAttr(), MergeFunctionDecl(), mergeInterfaceMethodToImpl(), mergeInternalLinkageAttr(), mergeMinSizeAttr(), mergeMSInheritanceAttr(), mergeObjCDirectMembers(), mergeOptimizeNoneAttr(), mergeParamDeclTypes(), mergeSectionAttr(), MergeTypedefNameDecl(), mergeTypeNullabilityForRedecl(), mergeUuidAttr(), MergeVarDeclExceptionSpecs(), MergeVarDeclTypes(), mergeVisibilityAttr(), MightInstantiateTo(), NoteIndirectBases(), NoteSurrogateCandidate(), OpenCLArithmeticConversions(), OpenCLConvertScalarsToVectors(), ParsedFreeStandingDeclSpec(), ParseLifetimeCaptureByAttr(), parseModeAttrArg(), ParseTypedefDecl(), clang::SemaBase::PDiag(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), PerformImplicitConversion(), PerformMoveOrCopyInitialization(), PerformObjectMemberConversion(), PerformPendingInstantiations(), PointerAuthBlendDiscriminator(), PointerAuthSignGenericData(), PreferredConditionType(), PrepareArgumentsForCallToObjectOfClassType(), PrepareScalarCast(), prepareVectorSplat(), PrintInstantiationStack(), ProcessAPINotes(), ProcessAPINotes(), ProcessDeclAttribute(), ProcessDeclAttributeList(), processImplicitMapsWithDefaultMappers(), ProcessOpenMPDoacrossClauseCommon(), ProcessStmtAttribute(), propagateAttribute(), clang::TreeTransform< Derived >::RebuildArrayType(), clang::TreeTransform< Derived >::RebuildAutoType(), clang::TreeTransform< Derived >::RebuildBitIntType(), clang::TreeTransform< Derived >::RebuildConstantMatrixType(), clang::TreeTransform< Derived >::RebuildCXXInheritedCtorInitExpr(), clang::TreeTransform< Derived >::RebuildCXXPseudoDestructorExpr(), RebuildDeclaratorInCurrentInstantiation(), clang::TreeTransform< Derived >::RebuildDeducedTemplateSpecializationType(), clang::TreeTransform< Derived >::RebuildDependentNameType(), clang::TreeTransform< Derived >::RebuildDependentTemplateSpecializationType(), clang::TreeTransform< Derived >::RebuildElaboratedType(), clang::TreeTransform< Derived >::RebuildEnumType(), clang::TreeTransform< Derived >::RebuildExtVectorType(), clang::TreeTransform< Derived >::RebuildFunctionNoProtoType(), clang::TreeTransform< Derived >::RebuildImplicitValueInitExpr(), clang::TreeTransform< Derived >::RebuildMacroQualifiedType(), RebuildNestedNameSpecifierInCurrentInstantiation(), clang::TreeTransform< Derived >::RebuildObjCObjectPointerType(), clang::TreeTransform< Derived >::RebuildPackExpansion(), rebuildPotentialResultsAsNonOdrUsed(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::TreeTransform< Derived >::RebuildRecordType(), clang::TreeTransform< Derived >::RebuildRequiresExpr(), clang::TreeTransform< Derived >::RebuildShuffleVectorExpr(), clang::TreeTransform< Derived >::RebuildSizeOfPackExpr(), clang::TreeTransform< Derived >::RebuildTemplateName(), clang::TreeTransform< Derived >::RebuildTypedefType(), clang::TreeTransform< Derived >::RebuildTypeOfType(), clang::TreeTransform< Derived >::RebuildUnresolvedUsingType(), clang::TreeTransform< Derived >::RebuildUsingType(), clang::TreeTransform< Derived >::RebuildVectorType(), recordConversion(), recoverFromTypeInKnownDependentBase(), clang::SemaPseudoObject::recreateSyntacticForm(), ReferenceDllExportedMembers(), RefersToMemberWithReducedAlignment(), RegisterLocallyScopedExternCDecl(), RemoveAddressSpaceFromPtr(), repeatForLambdaConversionFunctionCallingConvs(), RequireCompleteDeclContext(), RequireLiteralType(), RequireNonAbstractType(), RequireStructuralType(), resolveAllocationOverload(), resolveAssumedTemplateNameAsType(), resolveBuiltinNewDeleteOverload(), ResolveConstructorOverload(), clang::LookupResult::resolveKind(), ResolveOverloadedFunctionForReferenceBinding(), ResolveOverloadForDeduction(), SaveNestedNameSpecifierAnnotation(), SelectPropertyForSynthesisFromProtocols(), Sema(), SetCtorInitializers(), SetDelegatingInitializer(), SetElementTypeAsReturnType(), SetEligibleMethods(), SetNestedNameSpecifier(), setTagNameForLinkagePurposes(), clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed(), shouldAddReversedEqEq(), ShouldDeleteSpecialMember(), ShouldDiagnoseAvailabilityInContext(), ShouldDiagnoseSwitchCaseNotInEnum(), ShouldRemoveFromUnused(), ShouldTryAgainWithRedefinitionType(), ShouldWarnIfUnusedFileScopedDecl(), SpecialMemberIsTrivial(), SubstAutoType(), SubstAutoTypeSourceInfo(), SubstBaseSpecifiers(), SubstDefaultArgument(), clang::TemplateDeclInstantiator::SubstDefaultedFunction(), SubstDefaultTemplateArgumentIfAvailable(), SubstFunctionDeclType(), SubstituteExplicitTemplateArguments(), substituteParameterMappings(), SubstParmVarDecl(), SubstSpaceshipAsEqualEqual(), clang::TemplateDeclInstantiator::SubstTemplateParams(), SubstType(), SubstTypeConstraint(), threadSafetyCheckIsSmartPointer(), transferARCOwnershipToDeclaratorChunk(), transferARCOwnershipToDeclSpec(), clang::TreeTransform< Derived >::TransformDeclarationNameInfo(), clang::TreeTransform< Derived >::TransformDependentTemplateSpecializationType(), clang::TreeTransform< Derived >::TransformExceptionSpec(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), clang::transformOMPMappableExprListClause(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::TreeTransform< Derived >::TransformType(), clang::TreeTransform< Derived >::TransformTypeWithDeducedTST(), translateTemplateArgument(), TryArrayCopy(), tryCaptureVariable(), TryConstructorInitialization(), TryContextuallyConvertToBool(), TryContextuallyConvertToObjCPointer(), TryDefaultInitialization(), TryDiagnoseProtectedAccess(), tryGCCVectorConvertAndSplat(), TryImplicitConversion(), TryInitializerListConstruction(), TryListConversion(), TryListInitialization(), tryObjCWritebackConversion(), TryObjectArgumentInitialization(), TryOCLSamplerInitialization(), TryOrBuildParenListInitialization(), TryReferenceInit(), TryReferenceInitialization(), TryReferenceInitializationCore(), TryReferenceListInitialization(), TryRefInitWithConversionFunction(), tryResolveExplicitSpecifier(), clang::ConversionFixItGenerator::tryToFixConversion(), tryToFixVariablyModifiedVarType(), TryUserDefinedConversion(), TryValueInitialization(), tryVectorConvertAndSplat(), UnifySection(), unsupportedTypeConversion(), UpdateExceptionSpec(), UsualArithmeticConversions(), UsualUnaryConversions(), VariableCanNeverBeAConstantExpression(), VerifyBitField(), VerifyIntegerConstantExpression(), verifyValidIntegerConstantExpr(), clang::TemplateDeclInstantiator::VisitBaseUsingDecls(), clang::UsedDeclVisitor< Derived >::VisitCXXDeleteExpr(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), warnOnReservedIdentifier(), widenIterationCount(), and ~Sema().
DeclContext* clang::Sema::CurContext |
CurContext - This is the current declaration context of parsing.
Definition at line 1044 of file Sema.h.
Referenced by ActOnAccessSpecifier(), ActOnAliasDeclaration(), ActOnAnnotModuleBegin(), ActOnAnnotModuleEnd(), ActOnAnnotModuleInclude(), clang::SemaObjC::ActOnAtEnd(), ActOnBlockStart(), ActOnCapScopeReturnStmt(), ActOnCapturedRegionStart(), ActOnClassTemplateSpecialization(), clang::SemaObjC::ActOnCompatibilityAlias(), ActOnCompoundRequirement(), ActOnCoroutineBodyStart(), ActOnCXXMemberDeclarator(), ActOnDecompositionDeclarator(), ActOnEmptyDeclaration(), ActOnEnumConstant(), ActOnExceptionDeclarator(), ActOnExitFunctionContext(), ActOnExplicitInstantiation(), ActOnFileScopeAsmDecl(), ActOnFinishConceptDefinition(), ActOnFinishCXXMemberDecls(), ActOnFinishFullExpr(), ActOnFinishRequiresExpr(), clang::SemaObjC::ActOnForwardClassDeclaration(), clang::SemaObjC::ActOnForwardProtocolDeclaration(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnIfStmt(), clang::SemaObjC::ActOnIvar(), ActOnLambdaExpressionAfterIntroducer(), ActOnLastBitfield(), clang::SemaObjC::ActOnMethodDeclaration(), ActOnModuleDecl(), ActOnModuleImport(), ActOnMSVCUnknownTypeName(), ActOnNamespaceAliasDef(), clang::SemaObjC::ActOnObjCContainerStartDefinition(), clang::SemaObjC::ActOnObjCTemporaryExitContainerContext(), clang::SemaObjC::actOnObjCTypeParam(), clang::SemaOpenMP::ActOnOMPIteratorExpr(), actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAllocateClause(), clang::SemaOpenMP::ActOnOpenMPAssumesDirective(), clang::SemaOpenMP::ActOnOpenMPAtomicDirective(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionCombinerStart(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionInitializerStart(), clang::SemaOpenMP::ActOnOpenMPDeviceClause(), clang::SemaOpenMP::ActOnOpenMPDispatchDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPDistScheduleClause(), clang::SemaOpenMP::ActOnOpenMPExecutableDirective(), clang::SemaOpenMP::ActOnOpenMPFilterClause(), clang::SemaOpenMP::ActOnOpenMPFinalClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPHasDeviceAddrClause(), clang::SemaOpenMP::ActOnOpenMPIfClause(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPLinearClause(), clang::SemaOpenMP::ActOnOpenMPMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPNocontextClause(), clang::SemaOpenMP::ActOnOpenMPNovariantsClause(), clang::SemaOpenMP::ActOnOpenMPNumTeamsClause(), clang::SemaOpenMP::ActOnOpenMPNumThreadsClause(), clang::SemaOpenMP::ActOnOpenMPParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMaskedTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPParallelMasterTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaOpenMP::ActOnOpenMPRegionStart(), clang::SemaOpenMP::ActOnOpenMPRequiresDirective(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPScheduleClause(), clang::SemaOpenMP::ActOnOpenMPSharedClause(), clang::SemaOpenMP::ActOnOpenMPTargetParallelGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTargetTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTaskLoopDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsDistributeParallelForDirective(), clang::SemaOpenMP::ActOnOpenMPTeamsGenericLoopDirective(), clang::SemaOpenMP::ActOnOpenMPThreadLimitClause(), clang::SemaOpenMP::ActOnOpenMPThreadprivateDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::SemaOpenMP::ActOnOpenMPUseDevicePtrClause(), clang::SemaOpenMP::ActOnOpenMPXDynCGroupMemClause(), ActOnPragmaFloatControl(), ActOnPragmaMSAllocText(), ActOnPragmaMSFunction(), ActOnPragmaMSOptimize(), clang::SemaObjC::ActOnProperty(), clang::SemaObjC::ActOnPropertyImplDecl(), ActOnReenterFunctionContext(), ActOnSEHTryBlock(), ActOnSourceLocExpr(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartCategoryInterface(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), ActOnStartConceptDefinition(), ActOnStartCXXMemberDeclarations(), ActOnStartCXXMemberReference(), ActOnStartExportDecl(), ActOnStartLinkageSpecification(), ActOnStartNamespaceDef(), clang::SemaObjC::ActOnStartProtocolInterface(), ActOnStartRequiresExpr(), ActOnStartTopLevelStmtDecl(), ActOnTag(), ActOnTagFinishSkippedDefinition(), ActOnTagStartSkippedDefinition(), ActOnTemplatedFriendTag(), ActOnTypedefDeclarator(), ActOnUsingDirective(), ActOnVariableDeclarator(), ActOnVarTemplateSpecialization(), AddClassMessageCompletions(), AddKeywordsToConsumer(), AddOrdinaryNameResults(), AddOverrideResults(), BuildBaseInitializer(), BuildBlockForLambdaConversion(), buildCapture(), BuildCompoundLiteralExpr(), buildCoroutineParameterMoves(), buildCoroutinePromise(), BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), BuildCXXNestedNameSpecifier(), buildDeclareReductionRef(), BuildDelegatingInitializer(), buildDistanceFunc(), BuildExceptionDeclaration(), BuildFieldReferenceExpr(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildIvarRefExpr(), BuildLambdaExpr(), buildLoopVarFunc(), BuildMicrosoftCAnonymousStruct(), clang::SemaObjC::BuildObjCExceptionDecl(), BuildPredefinedExpr(), BuildReturnStmt(), buildSingleCopyAssignRecursively(), BuildStaticAssertDeclaration(), buildUserDefinedMapperRef(), BuildUsingDeclaration(), BuildUsingEnumDeclaration(), BuildUsingPackDecl(), BuildUsingShadowDecl(), BuildVAArgExpr(), buildVarDecl(), CanUseDecl(), CheckAccess(), checkAllocateClauses(), checkAndRewriteMustTailAttr(), checkCall(), CheckClassTemplate(), CheckCompareOperands(), CheckConstructorAccess(), checkCoroutineContext(), CheckCXXThisType(), CheckDeductionGuideDeclarator(), CheckExplicitInstantiationScope(), CheckFriendAccess(), CheckFunctionDeclaration(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), CheckInheritingConstructorUsingDecl(), CheckMultiVersionAdditionalDecl(), CheckNakedParmReference(), checkNoThrow(), clang::SemaObjC::CheckObjCDeclScope(), checkOpenMPIterationSpace(), checkOpenMPLoop(), CheckTemplateArgument(), CheckTemplateIdType(), CheckTemplateSpecializationScope(), checkTypeMappable(), CheckUsingDeclQualifier(), CheckUsingDeclRedeclaration(), CheckUsingShadowDecl(), CheckVariableDeclarationType(), checkVAStartIsInVariadicFunction(), clang::SemaCodeCompletion::CodeCompleteAfterIf(), clang::SemaCodeCompletion::CodeCompleteCase(), clang::SemaCodeCompletion::CodeCompleteDeclSpec(), clang::SemaCodeCompletion::CodeCompleteDesignator(), clang::SemaCodeCompletion::CodeCompleteExpression(), clang::SemaCodeCompletion::CodeCompleteLambdaIntroducer(), clang::SemaCodeCompletion::CodeCompleteMemberReferenceExpr(), clang::SemaCodeCompletion::CodeCompleteNamespaceAliasDecl(), clang::SemaCodeCompletion::CodeCompleteNamespaceDecl(), clang::SemaCodeCompletion::CodeCompleteObjCAtDirective(), clang::SemaCodeCompletion::CodeCompleteObjCClassForwardDecl(), clang::SemaCodeCompletion::CodeCompleteObjCClassPropertyRefExpr(), clang::SemaCodeCompletion::CodeCompleteObjCImplementationCategory(), clang::SemaCodeCompletion::CodeCompleteObjCImplementationDecl(), clang::SemaCodeCompletion::CodeCompleteObjCInstanceMessage(), clang::SemaCodeCompletion::CodeCompleteObjCInterfaceCategory(), clang::SemaCodeCompletion::CodeCompleteObjCInterfaceDecl(), clang::SemaCodeCompletion::CodeCompleteObjCMessageReceiver(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDecl(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDeclSelector(), clang::SemaCodeCompletion::CodeCompleteObjCPassingType(), clang::SemaCodeCompletion::CodeCompleteObjCPropertyDefinition(), clang::SemaCodeCompletion::CodeCompleteObjCPropertyGetter(), clang::SemaCodeCompletion::CodeCompleteObjCPropertySetter(), clang::SemaCodeCompletion::CodeCompleteObjCPropertySynthesizeIvar(), clang::SemaCodeCompletion::CodeCompleteObjCProtocolDecl(), clang::SemaCodeCompletion::CodeCompleteObjCProtocolReferences(), clang::SemaCodeCompletion::CodeCompleteObjCSuperclass(), clang::SemaCodeCompletion::CodeCompleteOperatorName(), clang::SemaCodeCompletion::CodeCompleteOrdinaryName(), clang::SemaCodeCompletion::CodeCompleteTag(), clang::SemaCodeCompletion::CodeCompleteUsing(), clang::SemaCodeCompletion::CodeCompleteUsingDirective(), computeDeclContext(), ConvertDeducedTemplateArgument(), CreateCapturedStmtRecordDecl(), createLambdaClosureType(), CreateNewFunctionDecl(), clang::SemaCUDA::CurrentTarget(), DeclApplyPragmaWeak(), DeduceTemplateArguments(), clang::InitializationSequence::Diagnose(), DiagnoseDependentMemberLookup(), DiagnoseEmptyLookup(), diagnoseQualifiedDeclaration(), DiagnoseTwoPhaseLookup(), diagnoseUncapturableValueReferenceOrBinding(), DiagnoseUseOfDecl(), DoMarkPotentialCapture(), clang::SemaObjC::EmitRelatedResultTypeNoteForReturn(), EnterDeclaratorContext(), clang::PreferredTypeBuilder::enterReturn(), clang::IncrementalAction::ExecuteAction(), ExitDeclaratorContext(), ExpandFunctionLocalPredefinedMacros(), FilterUsingLookup(), FindInstantiatedDecl(), FinishForRangeVarDecl(), finishLinearClauses(), FixDependencyOfIdExpressionsInLambdaWithDependentObjectParameter(), forRedeclarationInCurContext(), getCurLexicalContext(), getCurrentClass(), getCurrentInstantiationOf(), getCurrentMangleNumberContext(), getCurrentThisType(), GetDeclSpecTypeForDeclarator(), getFunctionLevelDeclContext(), getFunctionStorageClass(), GetNameFromUnqualifiedId(), getNullabilityCompletenessCheckFileID(), clang::SemaObjC::getObjCContainerKind(), clang::SemaObjC::getObjCDeclContext(), HandleDeclarator(), clang::SemaObjC::HandlePropertyInClassExtension(), hasUncompilableErrorOccurred(), hasUserDefinedMapper(), InstantiateInClassInitializer(), InstantiateMemInitializers(), isCapturingReferenceToHostVarInCUDADeviceLambda(), isCurrentClassNameTypo(), IsInsideALocalClassWithinATemplateFunction(), isLibstdcxxEagerExceptionSpecHack(), isMicrosoftMissingTypename(), isNonNegativeIntegerValue(), isOdrUseContext(), clang::SemaOpenMP::isOpenMPCapturedDecl(), isReferenceToNonConstCapture(), clang::SemaObjC::isSelfExpr(), IsSimplyAccessible(), IsUsingDirectiveInToplevelContext(), isValidCoroutineContext(), LazilyCreateBuiltin(), LookupMethodInReceiverType(), LookupOrCreateLabel(), makeUnavailableInSystemHeader(), mapCodeCompletionContext(), MarkFunctionReferenced(), MarkThisReferenced(), MarkVarDeclODRUsed(), MarkVTableUsed(), MaybeAddOverrideCalls(), MergeTypedefNameDecl(), ParsedFreeStandingDeclSpec(), ParseTypedefDecl(), PopDeclContext(), ProcessOpenMPDoacrossClauseCommon(), PushDeclContext(), PushOnScopeChains(), clang::TreeTransform< Derived >::RebuildExceptionDecl(), RebuildLambdaScopeInfo(), recoverFromMSUnqualifiedLookup(), recoverFromTypeInKnownDependentBase(), ShouldEnterDeclaratorScope(), SubstParmVarDecl(), clang::SemaOpenMP::tryCaptureOpenMPLambdas(), tryCaptureVariable(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), TryTypoCorrectionForCall(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and warnAboutAmbiguousFunction().
FPOptions clang::Sema::CurFPFeatures |
Definition at line 905 of file Sema.h.
Referenced by ActOnParenExpr(), ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), applyFunctionAttributesBeforeParsingBody(), BuildFloatingLiteral(), getCurFPFeatures(), InstantiateFunctionDefinition(), isPreciseFPEnabled(), resetFPOptions(), Sema(), setExceptionMode(), UsualUnaryConversions(), and clang::Sema::FPFeaturesStateRAII::~FPFeaturesStateRAII().
StringLiteral* clang::Sema::CurInitSeg |
Last section used with #pragma init_seg.
Definition at line 1696 of file Sema.h.
Referenced by ActOnPragmaMSInitSeg(), and CheckCompleteVariableDeclaration().
SourceLocation clang::Sema::CurInitSegLoc |
Definition at line 1697 of file Sema.h.
Referenced by ActOnPragmaMSInitSeg(), and CheckCompleteVariableDeclaration().
LocalInstantiationScope* clang::Sema::CurrentInstantiationScope |
The current instantiation scope used to store local variables.
Definition at line 12643 of file Sema.h.
Referenced by ActOnCompoundStmt(), BuildVariableInstantiation(), CheckCXXDefaultArguments(), CheckParameterPacksForExpansion(), CheckTemplateArgumentList(), clang::LocalInstantiationScope::cloneScopes(), DiagnoseEmptyLoopBody(), DiagnoseEmptyStmtBody(), clang::TemplateDeclInstantiator::enableLateAttributeInstantiation(), clang::LocalInstantiationScope::Exit(), FindInstantiatedDecl(), FinishTemplateArgumentDeduction(), getNumArgumentsInExpansionFromUnexpanded(), InstantiateAttrs(), InstantiateClass(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::LocalInstantiationScope::LocalInstantiationScope(), RebuildLambdaScopeInfo(), clang::TemplateDeclInstantiator::SubstFunctionType(), SubstituteExplicitTemplateArguments(), 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 8669 of file Sema.h.
Referenced by PerformCopyInitialization().
SmallVector<Scope *, 2> clang::Sema::CurrentSEHFinally |
Stack of active SEH __finally scopes. Can be empty.
Definition at line 10657 of file Sema.h.
Referenced by ActOnAbortSEHFinallyBlock(), ActOnFinishSEHFinallyBlock(), ActOnStartSEHFinallyBlock(), and CheckJumpOutOfSEHFinally().
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 8044 of file Sema.h.
Referenced by ClassifyImplicitMemberAccess(), clang::Sema::CXXThisScopeRAII::CXXThisScopeRAII(), getCurrentThisType(), isThisOutsideMemberFunctionBody(), and clang::Sema::CXXThisScopeRAII::~CXXThisScopeRAII().
RecordDecl* clang::Sema::CXXTypeInfoDecl |
The C++ "type_info" declaration, which is defined in <typeinfo>.
Definition at line 7969 of file Sema.h.
Referenced by ActOnCXXTypeid().
PragmaStack<StringLiteral *> clang::Sema::DataSegStack |
Definition at line 1655 of file Sema.h.
Referenced by ActOnPragmaMSSeg(), CheckCompleteVariableDeclaration(), clang::Sema::PragmaStackSentinelRAII::PragmaStackSentinelRAII(), and clang::Sema::PragmaStackSentinelRAII::~PragmaStackSentinelRAII().
SmallVector<const Decl *> clang::Sema::DeclsWithEffectsToVerify |
All functions/lambdas/blocks which have bodies and which have a non-empty FunctionEffectsRef to be verified.
Definition at line 15137 of file Sema.h.
Referenced by addDeclWithEffects().
Whether deferrable diagnostics should be deferred.
Definition at line 9755 of file Sema.h.
Referenced by clang::SemaBase::Diag().
SmallVector<CXXRecordDecl *, 4> clang::Sema::DelayedDllExportClasses |
Definition at line 5809 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), checkClassLevelDLLAttribute(), dllExportImportClassTemplateSpecialization(), and referenceDLLExportedClassMethods().
SmallVector<CXXMethodDecl *, 4> clang::Sema::DelayedDllExportMemberFunctions |
Definition at line 5810 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnFinishCXXNonNestedClass(), and CheckCompletedCXXClass().
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 6136 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 6128 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 6051 of file Sema.h.
Referenced by CheckDelegatingCtorCycles(), and SetDelegatingInitializer().
llvm::MapVector<FieldDecl *, DeleteLocs> clang::Sema::DeleteExprs |
Delete-expressions to be analyzed at the end of translation unit.
This list contains class members, and locations of delete-expressions that could not be proven as to whether they mismatch with new-expression used in initializer of the field.
Definition at line 7980 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit().
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 1041 of file Sema.h.
Referenced by emitDeferredDiags(), and hasUncompilableErrorOccurred().
DiagnosticsEngine& clang::Sema::Diags |
Definition at line 911 of file Sema.h.
Referenced by ActOnCompoundStmt(), ActOnCXXMemberDeclarator(), ActOnDocumentableDecls(), ActOnDoStmt(), ActOnEndOfTranslationUnit(), ActOnForStmt(), ActOnFriendFunctionDecl(), ActOnIfStmt(), ActOnWhileStmt(), AddInitializerToDecl(), applyCocoaAPICheck(), BuildDeclRefExpr(), BuildResolvedCallExpr(), CheckAssignmentOperands(), CheckCompatibleReinterpretCast(), CheckConditionalOperator(), CheckConstexprFunctionBody(), CheckCXX98CompatAccessibleCopy(), CheckForDuplicateEnumValues(), checkPointerTypesForAssignment(), CheckProtocolMethodDefs(), CheckShadow(), checkUnsafeExprAssigns(), DiagnoseAbsenceOfOverrideControl(), DiagnoseAbstractType(), clang::ImplicitConversionSequence::DiagnoseAmbiguousConversion(), DiagnoseAssignmentEnum(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseEmptyLoopBody(), DiagnoseForRangeVariableCopies(), DiagnoseHiddenVirtualMethods(), DiagnoseMismatchedSelectors(), DiagnoseNullConversion(), DiagnoseSelfMove(), diagnoseSubtractionOnNullPointer(), diagnoseZeroToNullptrConversion(), emitCallStackNotes(), EmitDiagnostic(), EvaluateStaticAssertMessageAsString(), getDiagnostics(), clang::SemaBase::getDiagnostics(), getNullabilityCompletenessCheckFileID(), getShadowedDeclaration(), ImplicitlyDefineFunction(), LookupMemberExpr(), maybeAddDeclWithEffects(), clang::OverloadCandidateSet::NoteCandidates(), clang::TemplateSpecCandidateSet::NoteCandidates(), noteOverloads(), performFunctionEffectAnalysis(), PrintInstantiationStack(), PrintPragmaAttributeInstantiationPoint(), and Sema().
bool clang::Sema::DisableTypoCorrection |
Tracks whether we are in a context where typo correction is disabled.
Definition at line 8924 of file Sema.h.
Referenced by clang::Sema::TentativeAnalysisScope::TentativeAnalysisScope(), and clang::Sema::TentativeAnalysisScope::~TentativeAnalysisScope().
Definition at line 7930 of file Sema.h.
Referenced by DetectPrecisionLossInComplexDivision(), and DiagnosePrecisionLossInComplexDivision().
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 6484 of file Sema.h.
Referenced by ActOnBlockStmtExpr(), ActOnFinishFunctionBody(), BuildBlockForLambdaConversion(), BuildCompoundLiteralExpr(), DiscardCleanupsInEvaluationContext(), MaybeCreateExprWithCleanups(), PopExpressionEvaluationContext(), and PushExpressionEvaluationContext().
SmallVector<ExpressionEvaluationContextRecord, 8> clang::Sema::ExprEvalContexts |
A stack of expression evaluation contexts.
Definition at line 7917 of file Sema.h.
Referenced by ActOnCapScopeReturnStmt(), ActOnCapturedRegionStart(), ActOnCXXExitDeclInitializer(), ActOnDecltypeExpression(), ActOnFinishFunctionBody(), ActOnIfStmt(), ActOnReturnStmt(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), clang::SemaObjC::ActOnStartOfObjCMethodDef(), ActOnStartStmtExpr(), BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), BuildLambdaExpr(), BuildReturnStmt(), CheckAssignmentOperands(), CheckCallReturnType(), CheckCXXDefaultArgExpr(), CheckForImmediateInvocation(), CheckUnusedVolatileAssignment(), ClassifyImplicitMemberAccess(), CorrectDelayedTyposInExpr(), CorrectTypoDelayed(), CreateBuiltinUnaryOp(), currentEvaluationContext(), DiagIfReachable(), DiagRuntimeBehavior(), DiscardCleanupsInEvaluationContext(), getCurrentMangleNumberContext(), InnermostDeclarationWithDelayedImmediateInvocations(), InstantiateInClassInitializer(), isAttrContext(), isOdrUseContext(), isPotentiallyConstantEvaluatedContext(), MarkDeclRefReferenced(), MarkExpressionAsImmediateEscalating(), MaybeBindToTemporary(), MaybeCreateExprWithCleanups(), OutermostDeclarationWithDelayedImmediateInvocations(), parentEvaluationContext(), clang::Parser::ParseArrayBoundExpression(), clang::Parser::ParseConstantExpressionInExprEvalContext(), PopExpressionEvaluationContext(), PushExpressionEvaluationContext(), Sema(), and TransformToPotentiallyEvaluated().
SmallVector<DeclaratorDecl *, 4> clang::Sema::ExternalDeclarations |
All the external declarations encoutered and used in the TU.
Definition at line 3102 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnFunctionDeclarator(), and ActOnUninitializedDecl().
IntrusiveRefCntPtr<ExternalSemaSource> clang::Sema::ExternalSource |
Source of additional semantic information.
Definition at line 1177 of file Sema.h.
Referenced by clang::SemaCodeCompletion::CodeCompleteObjCInstanceMessage(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDeclSelector(), clang::SemaCodeCompletion::CodeCompleteObjCSelector(), clang::SemaObjC::CollectMultipleMethodsInGlobalPool(), clang::SemaObjC::DiagnoseUseOfUnimplementedSelectors(), clang::SemaObjC::ReadMethodPool(), and clang::SemaObjC::updateOutOfDateSelector().
llvm::DenseMap<IdentifierInfo *, AsmLabelAttr *> clang::Sema::ExtnameUndeclaredIdentifiers |
ExtnameUndeclaredIdentifiers - Identifiers contained in #pragma redefine_extname before declared.
Used in Solaris system headers to define functions that occur in multiple standards to call the version in the currently selected standard.
Definition at line 3080 of file Sema.h.
Referenced by ActOnFunctionDeclarator(), ActOnPragmaRedefineExtname(), and ActOnVariableDeclarator().
ExtVectorDeclsType clang::Sema::ExtVectorDecls |
ExtVectorDecls - This is a list all the extended vector types.
This allows us to associate a raw vector type with one of the ext_vector type names. This is only necessary for issuing pretty diagnostics.
Definition at line 4472 of file Sema.h.
Referenced by CheckExtVectorComponent(), and handleExtVectorTypeAttr().
llvm::SmallPtrSet<ConstantExpr *, 4> clang::Sema::FailedImmediateInvocations |
Definition at line 7920 of file Sema.h.
Referenced by EvaluateAndDiagnoseImmediateInvocation(), HandleImmediateInvocations(), and RemoveNestedImmediateInvocation().
std::unique_ptr<CXXFieldCollector> clang::Sema::FieldCollector |
FieldCollector - Collects CXXFieldDecls during parsing of C++ classes.
Definition at line 6032 of file Sema.h.
Referenced by ActOnCXXMemberDeclarator(), ActOnFinishCXXMemberSpecification(), ActOnStartCXXMemberDeclarations(), ActOnTagFinishDefinition(), BuildAnonymousStructOrUnion(), and Sema().
|
mutable |
A cache of the flags available in enumerations with the flag_bits attribute.
Definition at line 3059 of file Sema.h.
Referenced by IsValueInFlagEnum().
PragmaStack<FPOptionsOverride> clang::Sema::FpPragmaStack |
Definition at line 1664 of file Sema.h.
Referenced by ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), applyFunctionAttributesBeforeParsingBody(), CurFPFeatureOverrides(), InstantiateFunctionDefinition(), resetFPOptions(), setExceptionMode(), and clang::Sema::FPFeaturesStateRAII::~FPFeaturesStateRAII().
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 849 of file Sema.h.
Referenced by ActOnBlockStmtExpr(), ActOnCapScopeReturnStmt(), ActOnLambdaError(), ActOnLambdaExpr(), BuildReturnStmt(), CheckCXXThisCapture(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), CheckUnaryExprOrTypeTraitOperand(), CreateBuiltinArraySubscriptExpr(), DiagIfReachable(), DiagnoseUnexpandedParameterPacks(), FixDependencyOfIdExpressionsInLambdaWithDependentObjectParameter(), getCurFunction(), getCurFunctionAvailabilityContext(), getCurrentLambdaScopeUnsafe(), getCurrentThisType(), getFunctionScopes(), clang::SemaOpenMP::isOpenMPCapturedDecl(), isUnexpandedParameterPackPermitted(), MarkThisReferenced(), tryCaptureVariable(), and ~Sema().
unsigned clang::Sema::FunctionScopesStart = 0 |
The index of the first FunctionScope that corresponds to the current context.
Definition at line 853 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 1700 of file Sema.h.
Referenced by ActOnPragmaMSAllocText(), and AddSectionMSAllocText().
bool clang::Sema::GlobalNewDeleteDeclared |
A flag to remember whether the implicit forms of operator new and delete have been declared.
Definition at line 7973 of file Sema.h.
Referenced by DeclareGlobalNewDelete().
IdentifierResolver clang::Sema::IdResolver |
Definition at line 3003 of file Sema.h.
Referenced by ActOnDelayedCXXMethodParameter(), clang::SemaObjC::ActOnIvar(), clang::SemaObjC::ActOnMethodParmDeclaration(), ActOnNonTypeTemplateParameter(), clang::SemaObjC::ActOnObjCExceptionDecl(), ActOnParamDeclarator(), ActOnPopScope(), ActOnReenterCXXMethodParameter(), ActOnReenterFunctionContext(), ActOnReenterTemplateScope(), ActOnTemplateTemplateParameter(), ActOnTypeParameter(), addImplicitTypedef(), clang::IncrementalParser::CleanUpPTU(), DeclareGlobalAllocationFunction(), clang::ASTReader::getIdResolver(), HideUsingShadowDecl(), Initialize(), isDeclInScope(), LookupName(), MergeTypedefNameDecl(), clang::SemaObjC::popObjCTypeParamList(), and PushOnScopeChains().
llvm::SmallVector<std::pair<SourceLocation, const BlockDecl *>, 1> clang::Sema::ImplicitlyRetainedSelfLocs |
List of SourceLocations where 'self' is implicitly retained inside a block.
Definition at line 7925 of file Sema.h.
Referenced by clang::SemaObjC::ActOnStartOfObjCMethodDef(), and clang::SemaObjC::BuildIvarRefExpr().
SourceLocation clang::Sema::ImplicitMSInheritanceAttrLoc |
Source location for newly created implicit MSInheritanceAttrs.
Definition at line 1411 of file Sema.h.
Referenced by ActOnPragmaMSPointersToMembers(), and assignInheritanceModel().
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 13161 of file Sema.h.
Referenced by isSFINAEContext(), popCodeSynthesisContext(), pushCodeSynthesisContext(), clang::Sema::SFINAETrap::SFINAETrap(), and clang::Sema::SFINAETrap::~SFINAETrap().
llvm::DenseSet<QualType> clang::Sema::InstantiatedNonDependentTypes |
Specializations whose definitions are currently being instantiated.
Definition at line 13137 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 6029 of file Sema.h.
Referenced by ActOnFinishFunctionDeclarationDeclarator(), ActOnStartFunctionDeclarationDeclarator(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), and getInventedParameterInfos().
unsigned clang::Sema::InventedParameterInfosStart = 0 |
The index of the first InventedParameterInfo that refers to the current context.
Definition at line 3007 of file Sema.h.
Referenced by getInventedParameterInfos().
bool clang::Sema::IsBuildingRecoveryCallExpr |
Flag indicating if Sema is building a recovery call expression.
This flag is used to avoid building recovery call expressions if Sema is already doing so, which would cause infinite recursions.
Definition at line 9774 of file Sema.h.
Referenced by BuildRecoveryCallExpr().
Used to change context to isConstantEvaluated without pushing a heavy ExpressionEvaluationContextRecord object.
Definition at line 2149 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 972 of file Sema.h.
Referenced by clang::SemaBase::Diag(), clang::SemaCUDA::DiagIfDeviceCode(), and clang::SemaCUDA::DiagIfHostCode().
const LangOptions& clang::Sema::LangOpts |
Definition at line 907 of file Sema.h.
Referenced by ActOnBlockStart(), ActOnBlockStmtExpr(), ActOnCallExpr(), ActOnCaseStmt(), ActOnCXXDelete(), ActOnCXXTypeid(), ActOnDeclarator(), ActOnDefaultStmt(), ActOnEndOfTranslationUnit(), ActOnEnumBody(), ActOnExplicitInstantiation(), ActOnFields(), ActOnFinishFunctionBody(), ActOnGCCAsmStmt(), ActOnLastBitfield(), actOnOMPReductionKindClause(), ActOnPragmaAttributeAttribute(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), ActOnVariableDeclarator(), AddInitializerToDecl(), AnalyzeBitFieldAssignment(), applyCocoaAPICheck(), applyFunctionAttributesBeforeParsingBody(), BuildBuiltinOffsetOf(), BuildCompoundLiteralExpr(), BuildDelegatingInitializer(), BuildLambdaExpr(), BuildPredefinedExpr(), BuiltinAddReference(), BuiltinRemoveReference(), CheckAddressOfOperand(), checkArithmeticOnObjCPointer(), CheckCallingConvAttr(), CheckCompareOperands(), CheckConstexprDeclStmt(), checkDeclInTargetContext(), CheckExtensionTraitOperandType(), CheckFieldDecl(), CheckFunctionDeclaration(), CheckFunctionTemplateSpecialization(), checkMapConflicts(), checkNestingOfRegions(), CheckObjCTraitOperandConstraints(), checkOpenMPIterationSpace(), checkOpenMPLoop(), CheckOverloadedOperatorDeclaration(), CheckParmsForFunctionDef(), CheckShiftOperands(), CheckTemplateArgument(), CheckVariableDeclarationType(), checkVectorShift(), ComputeSelectedDestructor(), CreateBuiltinArraySubscriptExpr(), CreateGenericSelectionExpr(), DeclareGlobalAllocationFunction(), DefineImplicitCopyAssignment(), DefineImplicitMoveAssignment(), DiagnoseCommaOperator(), clang::Sema::VerifyICEDiagnoser::diagnoseFold(), diagnoseQualifiedDeclaration(), DiagnoseSizeOfParametersAndReturnValue(), DiagnoseUnimplementedAccessor(), DiagnoseUnterminatedPragmaAlignPack(), DiagnoseUseOfDecl(), emitDeferredDiags(), FinalizeDeclaration(), FinalizeDeclaratorGroup(), getEmissionStatus(), getFixItZeroInitializerForType(), getLangOpts(), clang::SemaBase::getLangOpts(), getLocationOfStringLiteralByte(), getLocForEndOfToken(), getScalarZeroExpressionForType(), handleCommonAttr(), handleGlobalAttr(), handleGNUInlineAttr(), handleMSInheritanceAttr(), handleUuidAttr(), ImplicitlyDefineFunction(), isNonNegativeIntegerValue(), isOpenMPDeviceDelayedContext(), IsOverloadOrOverrideImpl(), isVariableCapturable(), LazilyCreateBuiltin(), MarkFunctionReferenced(), MarkVarDeclODRUsed(), MarkVTableUsed(), PerformPendingInstantiations(), ProcessAPINotes(), clang::PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(), resetFPOptions(), ShouldDeleteSpecialMember(), shouldIgnoreInHostDeviceCheck(), tryCaptureVariable(), VerifyIntegerConstantExpression(), and warnAboutAmbiguousFunction().
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 13178 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 13530 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnEndOfTranslationUnitFragment(), and InstantiateFunctionDefinition().
LateParsedTemplateMapT clang::Sema::LateParsedTemplateMap |
Definition at line 11061 of file Sema.h.
Referenced by InstantiateFunctionDefinition(), and MarkAsLateParsedTemplate().
LateTemplateParserCB* clang::Sema::LateTemplateParser |
Definition at line 951 of file Sema.h.
Referenced by InstantiateFunctionDefinition(), and SetLateTemplateParser().
LateTemplateParserCleanupCB* clang::Sema::LateTemplateParserCleanup |
Definition at line 952 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), and SetLateTemplateParser().
SourceLocation clang::Sema::LocationOfExcessPrecisionNotSatisfied |
Definition at line 7931 of file Sema.h.
Referenced by DetectPrecisionLossInComplexDivision(), and DiagnosePrecisionLossInComplexDivision().
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 13150 of file Sema.h.
Referenced by getLookupModules(), and 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 |
Definition at line 840 of file Sema.h.
Referenced by AddAlignedAttr(), AddAssumeAlignedAttr(), and checkCall().
MaybeODRUseExprSet clang::Sema::MaybeODRUseExprs |
Definition at line 6287 of file Sema.h.
Referenced by ActOnFinishFunctionBody(), CleanupVarDeclMarking(), DiscardCleanupsInEvaluationContext(), DoMarkVarDeclReferenced(), PopExpressionEvaluationContext(), PushExpressionEvaluationContext(), and rebuildPotentialResultsAsNonOdrUsed().
llvm::SmallSetVector<StringRef, 4> clang::Sema::MSFunctionNoBuiltins |
Set of no-builtin functions listed by #pragma function.
Definition at line 1747 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 1406 of file Sema.h.
Referenced by ActOnPragmaMSPointersToMembers(), and assignInheritanceModel().
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 1744 of file Sema.h.
Referenced by ActOnPragmaMSOptimize(), and ModifyFnAttributesMSPragmaOptimize().
bool clang::Sema::MSStructPragmaOn |
Definition at line 1408 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 13170 of file Sema.h.
Referenced by inTemplateInstantiation(), popCodeSynthesisContext(), and pushCodeSynthesisContext().
FileNullabilityMap clang::Sema::NullabilityMap |
A mapping that describes the nullability we've seen in each header file.
Definition at line 14562 of file Sema.h.
Referenced by checkNullabilityConsistency(), and recordNullabilitySeen().
unsigned clang::Sema::NumSFINAEErrors |
The number of SFINAE diagnostics that have been trapped.
Definition at line 11051 of file Sema.h.
Referenced by CheckTemplateArgument(), EmitDiagnostic(), clang::Sema::SFINAETrap::hasErrorOccurred(), PrintStats(), and clang::Sema::SFINAETrap::~SFINAETrap().
void* clang::Sema::OpaqueParser |
Definition at line 953 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), InstantiateFunctionDefinition(), and SetLateTemplateParser().
OpenCLOptions clang::Sema::OpenCLFeatures |
Definition at line 904 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 1731 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 3106 of file Sema.h.
Referenced by ActOnDeclarator(), ActOnFunctionDeclarator(), 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 964 of file Sema.h.
Referenced by clang::Parser::Parser(), and ProcessAPINotes().
llvm::SmallPtrSet<const Decl *, 4> clang::Sema::ParsingInitForAutoVars |
ParsingInitForAutoVars - a set of declarations with auto types for which we are currently parsing the initializer.
Definition at line 4227 of file Sema.h.
Referenced by ActOnDecompositionDeclarator(), ActOnEndOfTranslationUnit(), ActOnVariableDeclarator(), CanUseDecl(), checkAttributesAfterMerging(), DiagnoseUseOfDecl(), and FinalizeDeclaration().
std::deque<PendingImplicitInstantiation> clang::Sema::PendingInstantiations |
The queue of implicit template instantiations that are required but have not yet been performed.
Definition at line 13526 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnEndOfTranslationUnitFragment(), DoMarkVarDeclReferenced(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), MarkFunctionReferenced(), 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 13543 of file Sema.h.
Referenced by InstantiateClassMembers(), MarkFunctionReferenced(), PerformPendingInstantiations(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
Preprocessor& clang::Sema::PP |
Definition at line 908 of file Sema.h.
Referenced by ActOnBlockStmtExpr(), ActOnCharacterConstant(), clang::SemaObjC::ActOnClassPropertyRefExpr(), ActOnCXXTypeid(), ActOnEndOfTranslationUnit(), ActOnFinishFunctionBody(), ActOnModuleDecl(), ActOnModuleImport(), ActOnNumericConstant(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), ActOnPopScope(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), ActOnPrivateModuleFragmentDecl(), ActOnStringLiteral(), ActOnUnevaluatedStringLiteral(), clang::SemaObjC::AddCFAuditedAttribute(), AddOrdinaryNameResults(), buildCoroutineHandle(), buildCoroutinePromise(), buildMemberCall(), BuildModuleInclude(), BuildNonArrayForRange(), buildStdNoThrowDeclRef(), buildVarDecl(), CheckCompleteVariableDeclaration(), checkLiteralOperatorId(), CheckPtrComparisonWithNullChar(), checkTupleLikeDecomposition(), clang::SemaCodeCompletion::CodeCompleteAfterIf(), clang::SemaCodeCompletion::CodeCompleteCase(), clang::SemaCodeCompletion::CodeCompleteConstructorInitializer(), clang::SemaCodeCompletion::CodeCompleteExpression(), clang::SemaCodeCompletion::CodeCompleteIncludedFile(), clang::SemaCodeCompletion::CodeCompleteModuleImport(), clang::SemaCodeCompletion::CodeCompleteObjCMessageReceiver(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDeclSelector(), clang::SemaCodeCompletion::CodeCompleteObjCPassingType(), clang::SemaCodeCompletion::CodeCompleteOrdinaryName(), clang::SemaCodeCompletion::CodeCompletePreprocessorExpression(), clang::SemaCodeCompletion::CodeCompletePreprocessorMacroName(), clang::CodeCompletionResult::CreateCodeCompletionString(), DeclareGlobalNewDelete(), DefaultVariadicArgumentPromotion(), DiagnoseCommaOperator(), diagnoseMissingConstinit(), diagnoseMissingImport(), DiagnoseSentinelCalls(), DiagnoseUseOfDecl(), EvaluateStaticAssertMessageAsString(), ExpandFunctionLocalPredefinedMacros(), findFailedBooleanCondition(), findOMPAllocatorHandleT(), findOMPAlloctraitT(), findOMPDependT(), findOMPEventHandleT(), clang::SemaCodeCompletion::GatherGlobalCodeCompletions(), getCompletionPrintingPolicy(), getDarwinSDKInfoForAvailabilityChecking(), GetFullTypeForDeclarator(), getModuleLoader(), clang::arcmt::trans::getNilString(), clang::SemaObjC::getNSErrorIdent(), getNullabilityKeyword(), GetOrCreateMSAsmLabel(), getOrCreateStdNamespace(), getPreprocessor(), getPrintingPolicy(), getTupleLikeElementType(), clang::SemaObjC::HandleExprPropertyRefExpr(), handleOwnershipAttr(), Initialize(), isMacroDefined(), isStdInitializerList(), isTupleLike(), LookupBuiltin(), lookupCoroutineHandleType(), lookupCoroutineTraits(), lookupMember(), LookupMemberExpr(), lookupPromiseType(), LookupStdInitializerList(), LookupStdSourceLocationImpl(), lookupStdTypeTraitMember(), notePreviousDefinition(), Sema(), UsualUnaryConversions(), and clang::Sema::FPFeaturesStateRAII::~FPFeaturesStateRAII().
const Decl* clang::Sema::PragmaAttributeCurrentTargetDecl |
The declaration that is currently receiving an attribute from the #pragma attribute stack.
Definition at line 1726 of file Sema.h.
Referenced by AddPragmaAttributes(), PrintContextStack(), and PrintPragmaAttributeInstantiationPoint().
SmallVector<PragmaAttributeGroup, 2> clang::Sema::PragmaAttributeStack |
Definition at line 1722 of file Sema.h.
Referenced by ActOnPragmaAttributeAttribute(), ActOnPragmaAttributeEmptyPush(), ActOnPragmaAttributePop(), AddPragmaAttributes(), and DiagnoseUnterminatedPragmaAttribute().
PragmaClangSection clang::Sema::PragmaClangBSSSection |
Definition at line 1431 of file Sema.h.
Referenced by ActOnPragmaClangSection(), and FinalizeDeclaration().
PragmaClangSection clang::Sema::PragmaClangDataSection |
Definition at line 1432 of file Sema.h.
Referenced by ActOnPragmaClangSection(), and FinalizeDeclaration().
PragmaClangSection clang::Sema::PragmaClangRelroSection |
Definition at line 1434 of file Sema.h.
Referenced by ActOnPragmaClangSection(), and FinalizeDeclaration().
PragmaClangSection clang::Sema::PragmaClangRodataSection |
Definition at line 1433 of file Sema.h.
Referenced by ActOnPragmaClangSection(), and FinalizeDeclaration().
PragmaClangSection clang::Sema::PragmaClangTextSection |
Definition at line 1435 of file Sema.h.
Referenced by ActOnFunctionDeclarator(), and 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 6043 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 7767 of file Sema.h.
Referenced by CheckForImmediateInvocation(), FindInstantiatedDecl(), HandleImmediateInvocations(), and MarkDeclRefReferenced().
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 6477 of file Sema.h.
Referenced by ActOnPopScope(), DiagnoseUnusedButSetDecl(), DoMarkVarDeclReferenced(), IgnoredValueConversions(), MarkDeclRefReferenced(), MarkExprReferenced(), MarkFunctionParmPackReferenced(), MarkMemberReferenced(), MarkVariableReferenced(), and MaybeDecrementCount().
SmallVector<std::deque<PendingImplicitInstantiation>, 8> clang::Sema::SavedPendingInstantiations |
Definition at line 13534 of file Sema.h.
Referenced by DoMarkVarDeclReferenced().
SmallVector<SmallVector<VTableUse, 16>, 8> clang::Sema::SavedVTableUses |
SourceManager& clang::Sema::SourceMgr |
Definition at line 912 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnModuleDecl(), ActOnUsingDirective(), AnalyzeBitFieldAssignment(), AnalyzeCompoundAssignment(), applyCocoaAPICheck(), CheckImplicitConversion(), CheckSimplerImplicitMovesMSVCWorkaround(), DiagnoseBadConversion(), DiagnoseEmptyLoopBody(), DiagnoseEmptyStmtBody(), diagnoseMissingImport(), DiagnoseNullConversion(), diagnoseSubtractionOnNullPointer(), DiagnoseUnterminatedPragmaAlignPack(), DiagnoseUnusedComparison(), diagnoseZeroToNullptrConversion(), fixItNullability(), GetFullTypeForDeclarator(), getLocForEndOfToken(), getNullabilityCompletenessCheckFileID(), getSourceManager(), InstantiateClass(), InstantiateFunctionDefinition(), isMainFileLoc(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), maybeAddDeclWithEffects(), clang::PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(), shouldIgnoreDueToReservedName(), and warnAboutAmbiguousFunction().
llvm::FoldingSet<SpecialMemberOverloadResultEntry> clang::Sema::SpecialMemberCache |
A cache of special member function overload resolution results for C++ records.
Definition at line 8970 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 7966 of file Sema.h.
Referenced by ActOnTag(), BuildCXXNew(), DeclareGlobalNewDelete(), and getStdAlignValT().
LazyDeclPtr clang::Sema::StdBadAlloc |
The C++ "std::bad_alloc" class, which is defined by the C++ standard library.
Definition at line 7962 of file Sema.h.
Referenced by ActOnTag(), DeclareGlobalAllocationFunction(), DeclareGlobalNewDelete(), and getStdBadAlloc().
ClassTemplateDecl* clang::Sema::StdCoroutineTraitsCache |
The C++ "std::coroutine_traits" template, which is defined in <coroutine_traits>
Definition at line 2683 of file Sema.h.
Referenced by lookupCoroutineTraits().
ClassTemplateDecl* clang::Sema::StdInitializerList |
The C++ "std::initializer_list" template, which is defined in <initializer_list>.
Definition at line 6058 of file Sema.h.
Referenced by BuildStdInitializerList(), and isStdInitializerList().
LazyDeclPtr clang::Sema::StdNamespace |
The C++ "std" namespace, where the standard library resides.
Definition at line 6054 of file Sema.h.
Referenced by ActOnStartNamespaceDef(), ActOnTag(), getOrCreateStdNamespace(), getStdNamespace(), and isStdInitializerList().
RecordDecl* clang::Sema::StdSourceLocationImplDecl |
The C++ "std::source_location::__impl" struct, defined in <source_location>.
Definition at line 7914 of file Sema.h.
Referenced by ActOnSourceLocExpr().
PragmaStack<bool> clang::Sema::StrictGuardStackCheckStack |
Definition at line 1661 of file Sema.h.
Referenced by ActOnFunctionDeclarator(), ActOnPragmaMSStrictGuardStackCheck(), clang::Sema::PragmaStackSentinelRAII::PragmaStackSentinelRAII(), and clang::Sema::PragmaStackSentinelRAII::~PragmaStackSentinelRAII().
SuppressedDiagnosticsMap clang::Sema::SuppressedDiagnostics |
Definition at line 12149 of file Sema.h.
Referenced by DiagnoseUseOfDecl(), and FinishTemplateArgumentDeduction().
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 13186 of file Sema.h.
Referenced by clang::Sema::InstantiatingTemplate::Clear(), clang::TemplightDumpAction::ExecuteAction(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), and clang::ParseAST().
TentativeDefinitionsType clang::Sema::TentativeDefinitions |
All the tentative definitions encountered in the TU.
Definition at line 3099 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), and ActOnUninitializedDecl().
threadSafety::BeforeSet* clang::Sema::ThreadSafetyDeclCache |
Definition at line 946 of file Sema.h.
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings(), and ~Sema().
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 867 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), BuildModuleInclude(), isMainFileLoc(), MarkVTableUsed(), PerformPendingInstantiations(), and Sema().
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 872 of file Sema.h.
Referenced by clang::SemaObjC::ActOnAtEnd(), clang::SemaObjC::ActOnCompatibilityAlias(), ActOnEndOfTranslationUnit(), clang::SemaObjC::ActOnForwardClassDeclaration(), clang::SemaObjC::ActOnForwardProtocolDeclaration(), clang::SemaObjC::ActOnMethodDeclaration(), clang::SemaObjC::ActOnMethodParmDeclaration(), clang::SemaOpenMP::ActOnOpenMPUsesAllocatorClause(), ActOnPragmaMSAllocText(), ActOnPragmaRedefineExtname(), ActOnPragmaWeakAlias(), ActOnPragmaWeakID(), clang::SemaObjC::ActOnStartCategoryImplementation(), clang::SemaObjC::ActOnStartCategoryInterface(), clang::SemaObjC::ActOnStartClassImplementation(), clang::SemaObjC::ActOnStartClassInterface(), clang::SemaObjC::ActOnStartProtocolInterface(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), ActOnTranslationUnitScope(), clang::SemaObjC::ActOnTypedefedProtocols(), addImplicitTypedef(), BuildBuiltinCallExpr(), buildMemcpyForAssignmentOp(), clang::SemaObjC::BuildObjCStringLiteral(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), clang::SemaObjC::checkObjCBridgeRelatedComponents(), clang::SemaCodeCompletion::CodeCompleteObjCImplementationCategory(), clang::SemaCodeCompletion::CodeCompleteObjCInterfaceCategory(), clang::SemaCodeCompletion::CodeCompleteObjCSuperclass(), CreateBuiltinBinOp(), DefaultLvalueConversion(), DefaultVariadicArgumentPromotion(), DiagnoseDirectIsaAccess(), findOMPAllocatorHandleT(), clang::SemaObjC::FindProtocolDeclaration(), clang::SemaObjC::getObjCInterfaceDecl(), getOpenCLEnumType(), getOpenCLTypedefType(), HandleMSProperty(), clang::SemaObjC::handleNSErrorDomain(), HasNonDeletedDefaultedEqualityComparison(), Initialize(), clang::SemaObjC::isKnownName(), isMethodDeclaredInRootProtocol(), LazilyCreateBuiltin(), LookupBuiltin(), clang::LookupNamed(), clang::LookupNamespace(), LookupObjCInterfaceDeclForLiteral(), clang::SemaObjC::LookupProtocol(), markUsedForAliasOrIfunc(), and Sema().
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.
Definition at line 3055 of file Sema.h.
Referenced by CheckForFunctionRedefinition(), and MarkTypoCorrectedFunctionDefinition().
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 6066 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), CheckImmediateEscalatingFunctionDefinition(), checkUndefinedButUsed(), getUndefinedButUsed(), MarkFunctionReferenced(), MarkVarDeclODRUsed(), MergeFunctionDecl(), and MergeVarDecl().
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 12655 of file Sema.h.
Referenced by SetParamDefaultArgument(), and SubstParmVarDecl().
llvm::DenseMap<ParmVarDecl *, SourceLocation> clang::Sema::UnparsedDefaultArgLocs |
Definition at line 6062 of file Sema.h.
Referenced by ActOnParamDefaultArgument(), ActOnParamDefaultArgumentError(), ActOnParamUnparsedDefaultArgument(), CheckCXXDefaultArgExpr(), 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 3092 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), and MarkUnusedFileScopedDecl().
llvm::SmallSetVector<const TypedefNameDecl *, 4> clang::Sema::UnusedLocalTypedefNameCandidates |
Set containing all typedefs that are likely unused.
Definition at line 3084 of file Sema.h.
Referenced by DiagnoseUnusedDecl(), and emitAndClearUnusedLocalTypedefWarnings().
NamedDeclSetType clang::Sema::UnusedPrivateFields |
Set containing all declared private fields that are not used.
Definition at line 6036 of file Sema.h.
Referenced by ActOnCXXMemberDeclarator(), ActOnEndOfTranslationUnit(), BuildDeclRefExpr(), BuildFieldReferenceExpr(), and CheckExplicitlyDefaultedFunction().
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 968 of file Sema.h.
Referenced by Initialize().
void* clang::Sema::VisContext |
VisContext - Manages the stack for #pragma GCC visibility.
Definition at line 1703 of file Sema.h.
Referenced by AddPushedVisibilityAttribute(), FreeVisContext(), PopPragmaVisibility(), PushPragmaVisibility(), and ~Sema().
Map from the most recent declaration of a namespace to the most recent visible declaration of that namespace.
Definition at line 13154 of file Sema.h.
Referenced by ActOnAnnotModuleEnd().
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 5402 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 5396 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 1645 of file Sema.h.
Referenced by ActOnPragmaMSVtorDisp(), AddMsStructLayoutForRecord(), clang::Sema::PragmaStackSentinelRAII::PragmaStackSentinelRAII(), and clang::Sema::PragmaStackSentinelRAII::~PragmaStackSentinelRAII().
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 4460 of file Sema.h.
Referenced by DeclApplyPragmaWeak(), and 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 3074 of file Sema.h.
Referenced by ActOnEndOfTranslationUnit(), ActOnPragmaWeakAlias(), ActOnPragmaWeakID(), LoadExternalWeakUndeclaredIdentifiers(), and ProcessPragmaWeak().