clang: include/clang/Sema/ScopeInfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_CLANG_SEMA_SCOPEINFO_H
15#define LLVM_CLANG_SEMA_SCOPEINFO_H
16
26#include "llvm/ADT/DenseMap.h"
27#include "llvm/ADT/DenseMapInfo.h"
28#include "llvm/ADT/MapVector.h"
29#include "llvm/ADT/PointerIntPair.h"
30#include "llvm/ADT/SmallPtrSet.h"
31#include "llvm/ADT/SmallSet.h"
32#include "llvm/ADT/SmallVector.h"
33#include "llvm/ADT/StringRef.h"
34#include "llvm/ADT/StringSwitch.h"
35#include "llvm/ADT/TinyPtrVector.h"
36#include "llvm/Support/Casting.h"
37#include "llvm/Support/ErrorHandling.h"
38#include
39#include
40#include
41
43
44class BlockDecl;
45class CapturedDecl;
46class CXXMethodDecl;
47class CXXRecordDecl;
48class ImplicitParamDecl;
49class NamedDecl;
50class ObjCIvarRefExpr;
51class ObjCMessageExpr;
52class ObjCPropertyDecl;
53class ObjCPropertyRefExpr;
54class ParmVarDecl;
55class RecordDecl;
56class ReturnStmt;
57class Scope;
58class Stmt;
59class SwitchStmt;
60class TemplateParameterList;
61class VarDecl;
62
63namespace sema {
64
65
66
68public:
69
70
72
73
74
76
77
78
80
83
86 }
87};
88
90public:
93 llvm::TinyPtrVector<const Stmt*> Stmts;
94
98};
99
101
102
103
105protected:
112
113public:
114
116
117
118
120
121
123
124
126
127
128
130
131
133
134
136
137
139
140
142
143
144
146
147
148
149
151
152
154
155
156
157
159
160
161
162
164
165
166
168
169
170
172
173
174
177
178
180
181
182
184
185
187
188
191
192
194
195
197
198private:
199
201
202public:
203
204
205 using SwitchInfo = llvm::PointerIntPair<SwitchStmt*, 1, bool>;
206
207
208
210
211
212
213
215
216
218
219
220
222
223
225
226
227
229
230
232
233
235
236
237
238
240
241
242
244
245
247
248public:
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
272
273
274
275
276
277
278 using BaseInfoTy = llvm::PointerIntPair<const NamedDecl *, 1, bool>;
279 BaseInfoTy Base;
280
281
282
283
284
285 const NamedDecl *Property = nullptr;
286
287
288 static BaseInfoTy getBaseInfo(const Expr *BaseE);
289
292
293 public:
298
301
302
303
304
305
306
307
308
309
310
311
312
314 return Base.getInt();
315 }
316
319 }
320
321
322
323
324
326 public:
329 }
330
332 return WeakObjectProfileTy::getSentinel();
333 }
334
336 using Pair = std::pair<BaseInfoTy, const NamedDecl *>;
337
338 return llvm::DenseMapInfo::getHashValue(Pair(Val.Base,
339 Val.Property));
340 }
341
344 return LHS == RHS;
345 }
346 };
347 };
348
349
350
351
352
353
354
356 llvm::PointerIntPair<const Expr *, 1, bool> Rep;
357
358 public:
359 WeakUseTy(const Expr *Use, bool IsRead) : Rep(Use, IsRead) {}
360
362 bool isUnsafe() const { return Rep.getInt(); }
364
366 return Rep == Other.Rep;
367 }
368 };
369
370
371
372
374
375
376
377
381
382private:
383
384
385
387
388protected:
390
391public:
401 ErrorTrap(Diag) {}
402
404
405
406
407
408
409
410
411
414 }
415
416
417
418
419 template
420 inline void recordUseOfWeak(const ExprT *E, bool IsRead = true);
421
424
425
426
427
428
430
432 return WeakObjectUses;
433 }
434
437 }
438
441 }
442
445 }
446
448
451 }
452
455 }
456
459 }
460
463 }
464
469 }
470
475 }
476
480 }
481
485 }
486
490 }
491
492
495 }
496
497
500 }
501
503
506 "first coroutine statement location already set");
509 llvm::StringSwitch(Keyword)
510 .Case("co_return",
512 .Case("co_await",
514 .Case("co_yield",
516 }
517
520 && "no coroutine statement available");
525 return "co_return";
527 return "co_await";
529 return "co_yield";
530 };
531 llvm_unreachable("FirstCoroutineStmtKind has an invalid value");
532 }
533
536 "we already have valid suspend points");
538 }
539
542 }
543
545 assert(Initial && Final && "suspend points cannot be null");
546 assert(CoroutineSuspends.first == nullptr && "suspend points already set");
550 }
551
552
553
555
557};
558
560
561
562
563
564
565
566
567
568
569
570
571
572
573 enum CaptureKind {
574 Cap_ByCopy, Cap_ByRef, Cap_Block, Cap_VLA
575 };
576
577 union {
578
580
581
583 };
584
585
587
588
590
591
592
594
595
596 LLVM_PREFERRED_TYPE(CaptureKind)
597 unsigned Kind : 2;
598
599
600
601 LLVM_PREFERRED_TYPE(bool)
602 unsigned Nested : 1;
603
604
605 LLVM_PREFERRED_TYPE(bool)
606 unsigned CapturesThis : 1;
607
608
609
610 LLVM_PREFERRED_TYPE(bool)
611 unsigned ODRUsed : 1;
612
613
614
615 LLVM_PREFERRED_TYPE(bool)
616 unsigned NonODRUsed : 1;
617
618
619
620 LLVM_PREFERRED_TYPE(bool)
621 unsigned Invalid : 1;
622
623public:
626 bool Invalid)
628 CaptureType(CaptureType), Kind(Block ? Cap_Block
629 : ByRef ? Cap_ByRef
630 : Cap_ByCopy),
631 Nested(IsNested), CapturesThis(false), ODRUsed(false),
632 NonODRUsed(false), Invalid(Invalid) {}
633
636 QualType CaptureType, const bool ByCopy, bool Invalid)
637 : Loc(Loc), CaptureType(CaptureType),
638 Kind(ByCopy ? Cap_ByCopy : Cap_ByRef), Nested(IsNested),
639 CapturesThis(true), ODRUsed(false), NonODRUsed(false),
640 Invalid(Invalid) {}
641
645 : CapturedVLA(VLA), Loc(Loc), CaptureType(CaptureType), Kind(Cap_VLA),
646 Nested(IsNested), CapturesThis(false), ODRUsed(false),
648
652 }
653
658
660
662
663
665
669 if (IsODRUse)
670 ODRUsed = true;
671 else
672 NonODRUsed = true;
673 }
674
678 }
679
683 }
684
685
687
688
689
691
692
693
694
696};
697
699protected:
701
702public:
707
709
712
713
714 llvm::DenseMap<ValueDecl *, unsigned> CaptureMap;
715
716
717
719
720
722
723
724
726
727
729
730
731
733
734
736
741 EllipsisLoc, CaptureType, Invalid));
743 }
744
748 false, Loc, CaptureType));
749 }
750
752 bool ByCopy);
753
754
756
757
761 }
762
763
765
766
768
769
770
772 assert(isCaptured(Var) && "Variable has not been captured");
774 }
775
777 llvm::DenseMap<ValueDecl *, unsigned>::const_iterator Known =
779 assert(Known != CaptureMap.end() && "Variable has not been captured");
780 return Captures[Known->second - 1];
781 }
782
786 }
787};
788
789
791public:
793
794
795
797
798
799
801
806 }
807
809
812 }
813};
814
815
817public:
818
820
821
823
824
826
827
829
830
832
835
845 }
846
848
849
853 return "default captured statement";
855 return "Objective-C @finally statement";
857 return "OpenMP region";
858 }
859 llvm_unreachable("Invalid captured region kind!");
860 }
861
864 }
865};
866
869public:
870
872
873
875
876
877
878
880
882
883
885
886
887
889
890
891
893
894
895
897
898
900
901
903
904
906
907
908
909
911
912
913
914
916
917
918
919
920
921
922
923
924
925
926
927
928
929
931
932
933
934
935
937
938
940
941
942
943
947 };
949
951
955 }
956
957
960 }
961
964 }
965
966
967
970 }
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
990 assert(isa(VarExpr) || isa(VarExpr) ||
991 isa(VarExpr));
993 }
994
997 }
998
1001 }
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1043 assert(isa(CapturingVarExpr) ||
1044 isa(CapturingVarExpr) ||
1045 isa(CapturingVarExpr));
1047 }
1049 assert(isa(CapturingVarExpr) ||
1050 isa(CapturingVarExpr) ||
1051 isa(CapturingVarExpr));
1053 }
1056 }
1060 }
1063 }
1064
1068 }
1069
1071 llvm::function_ref<void(ValueDecl *, Expr *)> Callback) const;
1072
1074};
1075
1076FunctionScopeInfo::WeakObjectProfileTy::WeakObjectProfileTy()
1078
1079FunctionScopeInfo::WeakObjectProfileTy
1080FunctionScopeInfo::WeakObjectProfileTy::getSentinel() {
1081 FunctionScopeInfo::WeakObjectProfileTy Result;
1082 Result.Base.setInt(true);
1084}
1085
1086template
1088 assert(E);
1090 Uses.push_back(WeakUseTy(E, IsRead));
1091}
1092
1096 bool ByCopy) {
1098 ByCopy, false));
1099 CXXThisCaptureIndex = Captures.size();
1100}
1101
1102}
1103
1104}
1105
1106#endif
Defines the clang::Expr interface and subclasses for C++ expressions.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
Represents the body of a CapturedStmt, and serves as its DeclContext.
A reference to a declared variable, function, enum, etc.
RAII class that determines when any errors have occurred between the time the instance was created an...
bool hasUnrecoverableErrorOccurred() const
Determine whether any unrecoverable errors have occurred since this object instance was created.
Concrete class used by the front-end to report problems and issues.
This represents one expression.
This represents a decl that may have a name.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
An expression that sends a message to the given Objective-C object or class.
Represents one property declaration in an Objective-C interface.
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Represents a parameter to a function.
A (possibly-)qualified type.
Represents a struct/union/class.
Scope - A scope is a transient data structure that is used while parsing the program.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
Represents a C array with a specified size that is not an integer-constant-expression.
Retains information about a block that is currently being parsed.
Scope * TheScope
TheScope - This is the scope for the block itself, which contains arguments etc.
BlockScopeInfo(DiagnosticsEngine &Diag, Scope *BlockScope, BlockDecl *Block)
static bool classof(const FunctionScopeInfo *FSI)
~BlockScopeInfo() override
QualType FunctionType
BlockType - The function type of the block, if one was given.
ValueDecl * getVariable() const
bool isVariableCapture() const
bool isBlockCapture() const
SourceLocation getLocation() const
Retrieve the location at which this variable was captured.
bool isNonODRUsed() const
Capture(IsThisCapture, bool IsNested, SourceLocation Loc, QualType CaptureType, const bool ByCopy, bool Invalid)
void markUsed(bool IsODRUse)
bool isInitCapture() const
Determine whether this capture is an init-capture.
ValueDecl * CapturedVar
Otherwise, the captured variable (if any).
bool isVLATypeCapture() const
SourceLocation getEllipsisLoc() const
Retrieve the source location of the ellipsis, whose presence indicates that the capture is a pack exp...
bool isThisCapture() const
QualType getCaptureType() const
Retrieve the capture type for this capture, which is effectively the type of the non-static data memb...
bool isCopyCapture() const
bool isReferenceCapture() const
Capture(IsVLACapture, const VariableArrayType *VLA, bool IsNested, SourceLocation Loc, QualType CaptureType)
Capture(ValueDecl *Var, bool Block, bool ByRef, bool IsNested, SourceLocation Loc, SourceLocation EllipsisLoc, QualType CaptureType, bool Invalid)
const VariableArrayType * getCapturedVLAType() const
const VariableArrayType * CapturedVLA
If Kind == Cap_VLA, the captured type.
Retains information about a captured region.
static bool classof(const FunctionScopeInfo *FSI)
~CapturedRegionScopeInfo() override
unsigned short OpenMPLevel
unsigned short CapRegionKind
The kind of captured region.
ImplicitParamDecl * ContextParam
The implicit parameter for the captured variables.
unsigned short OpenMPCaptureLevel
StringRef getRegionName() const
A descriptive name for the kind of captured region this is.
Scope * TheScope
This is the enclosing scope of the captured region.
CapturedRegionScopeInfo(DiagnosticsEngine &Diag, Scope *S, CapturedDecl *CD, RecordDecl *RD, ImplicitParamDecl *Context, CapturedRegionKind K, unsigned OpenMPLevel, unsigned OpenMPCaptureLevel)
RecordDecl * TheRecordDecl
The captured record type.
CapturedDecl * TheCapturedDecl
The CapturedDecl for this statement.
const Capture & getCapture(ValueDecl *Var) const
void addVLATypeCapture(SourceLocation Loc, const VariableArrayType *VLAType, QualType CaptureType)
QualType ReturnType
ReturnType - The target type of return statements in this context, or null if unknown.
bool isCaptured(ValueDecl *Var) const
Determine whether the given variable has been captured.
bool ContainsUnexpandedParameterPack
Whether this contains an unexpanded parameter pack.
SmallVector< Capture, 4 > Captures
Captures - The captures.
ImplicitCaptureStyle ImpCaptureStyle
unsigned CXXThisCaptureIndex
CXXThisCaptureIndex - The (index+1) of the capture of 'this'; zero if 'this' is not captured.
bool HasImplicitReturnType
Capture & getCXXThisCapture()
Retrieve the capture of C++ 'this', if it has been captured.
CapturingScopeInfo(const CapturingScopeInfo &)=default
llvm::DenseMap< ValueDecl *, unsigned > CaptureMap
CaptureMap - A map of captured variables to (index+1) into Captures.
static bool classof(const FunctionScopeInfo *FSI)
bool isCXXThisCaptured() const
Determine whether the C++ 'this' is captured.
SmallVector< NamedDecl *, 4 > LocalPacks
Packs introduced by this, if any.
void addThisCapture(bool isNested, SourceLocation Loc, QualType CaptureType, bool ByCopy)
CapturingScopeInfo(DiagnosticsEngine &Diag, ImplicitCaptureStyle Style)
bool isVLATypeCaptured(const VariableArrayType *VAT) const
Determine whether the given variable-array type has been captured.
void addCapture(ValueDecl *Var, bool isBlock, bool isByref, bool isNested, SourceLocation Loc, SourceLocation EllipsisLoc, QualType CaptureType, bool Invalid)
Capture & getCapture(ValueDecl *Var)
Retrieve the capture of the given variable, if it has been captured already.
Contains information about the compound statement currently being parsed.
FPOptions InitialFPFeatures
FP options at the beginning of the compound statement, prior to any pragma.
bool HasEmptyLoopBodies
Whether this compound statement contains ‘for’ or ‘while’ loops with empty bodies.
void setHasEmptyLoopBodies()
bool IsStmtExpr
Whether this compound statement corresponds to a GNU statement expression.
CompoundScopeInfo(bool IsStmtExpr, FPOptions FPO)
static WeakObjectProfileTy getEmptyKey()
static WeakObjectProfileTy getTombstoneKey()
static bool isEqual(const WeakObjectProfileTy &LHS, const WeakObjectProfileTy &RHS)
static unsigned getHashValue(const WeakObjectProfileTy &Val)
Represents a simple identification of a weak object.
bool isExactProfile() const
Returns true if the object base specifies a known object in memory, rather than, say,...
bool operator==(const WeakObjectProfileTy &Other) const
const NamedDecl * getBase() const
const NamedDecl * getProperty() const
Represents a single use of a weak object.
const Expr * getUseExpr() const
bool operator==(const WeakUseTy &Other) const
WeakUseTy(const Expr *Use, bool IsRead)
Retains information about a function, method, or block that is currently being parsed.
llvm::PointerIntPair< SwitchStmt *, 1, bool > SwitchInfo
A SwitchStmt, along with a flag indicating if its list of case statements is incomplete (because we d...
void setHasObjCTry(SourceLocation TryLoc)
llvm::SmallDenseMap< WeakObjectProfileTy, WeakUseVector, 8, WeakObjectProfileTy::DenseMapInfo > WeakObjectUseMap
Used to collect all uses of weak objects in a function body.
SmallVector< ReturnStmt *, 4 > Returns
The list of return statements that occur within the function or block, if there is any chance of appl...
FunctionScopeInfo(DiagnosticsEngine &Diag)
bool HasIndirectGoto
Whether this function contains any indirect gotos.
bool HasFallthroughStmt
Whether there is a fallthrough statement in this function.
SourceLocation FirstVLALoc
First use of a VLA within the current function.
SourceLocation FirstCXXOrObjCTryLoc
First C++ 'try' or ObjC @try statement in the current function.
bool UsesFPIntrin
Whether this function uses constrained floating point intrinsics.
void addByrefBlockVar(VarDecl *VD)
llvm::SmallMapVector< ParmVarDecl *, Stmt *, 4 > CoroutineParameterMoves
A mapping between the coroutine function parameters that were moved to the coroutine frame,...
void setFirstCoroutineStmt(SourceLocation Loc, StringRef Keyword)
void recordUseOfWeak(const ExprT *E, bool IsRead=true)
Record that a weak object was accessed.
unsigned char FirstCoroutineStmtKind
An enumeration representing the kind of the first coroutine statement in the function.
bool NeedsScopeChecking() const
bool HasDroppedStmt
Whether a statement was dropped because it was invalid.
void setNeedsCoroutineSuspends(bool value=true)
void markSafeWeakUse(const Expr *E)
Record that a given expression is a "safe" access of a weak object (e.g.
void setHasOMPDeclareReductionCombiner()
SourceLocation FirstCoroutineStmtLoc
First coroutine statement in the current function.
bool FoundImmediateEscalatingExpression
Whether we found an immediate-escalating expression.
void setHasIndirectGoto()
void setCoroutineSuspends(Stmt *Initial, Stmt *Final)
std::pair< Stmt *, Stmt * > CoroutineSuspends
The initial and final coroutine suspend points.
bool ObjCIsDesignatedInit
True when this is a method marked as a designated initializer.
void Clear()
Clear out the information in this function scope, making it suitable for reuse.
bool ObjCShouldCallSuper
A flag that is set when parsing a method that must call super's implementation, such as -dealloc,...
VarDecl * CoroutinePromise
The promise object for this coroutine, if any.
enum clang::sema::FunctionScopeInfo::@247 FirstTryType
void addBlock(const BlockDecl *BD)
SmallVector< WeakUseTy, 4 > WeakUseVector
Used to collect uses of a particular weak object in a function body.
ScopeKind Kind
What kind of scope we are describing.
bool hasInvalidCoroutineSuspends() const
bool HasBranchProtectedScope
Whether this function contains a VLA, @try, try, C++ initializer, or anything else that can't be jump...
bool hasUnrecoverableErrorOccurred() const
Determine whether an unrecoverable error has occurred within this function.
SmallVector< PossiblyUnreachableDiag, 4 > PossiblyUnreachableDiags
A list of PartialDiagnostics created but delayed within the current function scope.
FunctionScopeInfo(const FunctionScopeInfo &)=default
bool ObjCWarnForNoInitDelegation
This starts true for a secondary initializer method and will be set to false if there is an invocatio...
void setHasFallthroughStmt()
bool isPlainFunction() const
StringRef getFirstCoroutineStmtKeyword() const
bool HasPotentialAvailabilityViolations
Whether we make reference to a declaration that could be unavailable.
SourceLocation FirstReturnLoc
First 'return' statement in the current function.
bool HasBranchIntoScope
Whether this function contains any switches or direct gotos.
SourceLocation FirstSEHTryLoc
First SEH '__try' statement in the current function.
void setHasCXXTry(SourceLocation TryLoc)
SmallVector< CompoundScopeInfo, 4 > CompoundScopes
The stack of currently active compound statement scopes in the function.
const WeakObjectUseMap & getWeakObjectUses() const
llvm::SmallPtrSet< const BlockDecl *, 1 > Blocks
The set of blocks that are introduced in this function.
void setHasVLA(SourceLocation VLALoc)
void setHasBranchProtectedScope()
void setHasBranchIntoScope()
void setHasSEHTry(SourceLocation TryLoc)
bool ObjCIsSecondaryInit
True when this is an initializer method not marked as a designated initializer within a class that ha...
bool NeedsCoroutineSuspends
True only when this function has not already built, or attempted to build, the initial and final coro...
llvm::SmallVector< AddrLabelExpr *, 4 > AddrLabels
The set of GNU address of label extension "&&label".
llvm::TinyPtrVector< VarDecl * > ByrefBlockVars
The set of __block variables that are introduced in this function.
bool ObjCWarnForNoDesignatedInitChain
This starts true for a method marked as designated initializer and will be set to false if there is a...
SmallVector< SwitchInfo, 8 > SwitchStack
SwitchStack - This is the current set of active switch statements in the block.
bool HasMustTail
Whether this function contains any statement marked with [[clang::musttail]].
bool HasOMPDeclareReductionCombiner
True if current scope is for OpenMP declare reduction combiner.
virtual ~FunctionScopeInfo()
llvm::SmallPtrSet< const ParmVarDecl *, 8 > ModifiedNonNullParams
A list of parameters which have the nonnull attribute and are modified in the function.
SourceLocation PotentialThisCaptureLocation
void removePotentialCapture(Expr *E)
void finishedExplicitCaptures()
Note when all explicit captures have been added.
bool hasPotentialThisCapture() const
LambdaScopeInfo(DiagnosticsEngine &Diag)
CleanupInfo Cleanup
Whether any of the capture expressions requires cleanups.
SourceRange IntroducerRange
Source range covering the lambda introducer [...].
bool isGenericLambda() const
Is this scope known to be for a generic lambda? (This will be false until we parse a template paramet...
bool lambdaCaptureShouldBeConst() const
void clearPotentialCaptures()
bool ExplicitParams
Whether the (empty) parameter list is explicit.
TemplateParameterList * GLTemplateParameterList
If this is a generic lambda, and the template parameter list has been created (from the TemplateParam...
void addPotentialCapture(Expr *VarExpr)
Add a variable that might potentially be captured by the lambda and therefore the enclosing lambdas.
void markVariableExprAsNonODRUsed(Expr *CapturingVarExpr)
Mark a variable's reference in a lambda as non-odr using.
llvm::SmallSet< Expr *, 8 > NonODRUsedCapturingExprs
Contains all variable-referring-expressions that refer to local variables that are usable as constant...
void addPotentialThisCapture(SourceLocation Loc)
ParmVarDecl * ExplicitObjectParameter
llvm::SmallVector< ShadowedOuterDecl, 4 > ShadowingDecls
ExprResult RequiresClause
The requires-clause immediately following the explicit template parameter list, if any.
SourceRange ExplicitTemplateParamsRange
Source range covering the explicit template parameter list (if it exists).
bool hasPotentialCaptures() const
bool isVariableExprMarkedAsNonODRUsed(Expr *CapturingVarExpr) const
CXXRecordDecl * Lambda
The class that describes the lambda.
void visitPotentialCaptures(llvm::function_ref< void(ValueDecl *, Expr *)> Callback) const
unsigned getNumPotentialVariableCaptures() const
unsigned NumExplicitCaptures
The number of captures in the Captures list that are explicit captures.
SourceLocation CaptureDefaultLoc
Source location of the '&' or '=' specifying the default capture type, if any.
llvm::DenseMap< unsigned, SourceRange > ExplicitCaptureRanges
A map of explicit capture indices to their introducer source ranges.
static bool classof(const FunctionScopeInfo *FSI)
bool AfterParameterList
Indicate that we parsed the parameter list at which point the mutability of the lambda is known.
CXXMethodDecl * CallOperator
The lambda's compiler-generated operator().
bool Mutable
Whether this is a mutable lambda.
llvm::SmallVector< Expr *, 4 > PotentiallyCapturingExprs
Contains all variable-referring-expressions (i.e.
llvm::TinyPtrVector< const Stmt * > Stmts
PossiblyUnreachableDiag(const PartialDiagnostic &PD, SourceLocation Loc, ArrayRef< const Stmt * > Stmts)
The JSON file list parser is used to communicate input to InstallAPI.
CapturedRegionKind
The different kinds of captured statement.
@ Property
The type of a property.
@ Result
The result type of a method or function.
@ Other
Other implicit parameter.
SmallVector< NamedDecl *, 4 > TemplateParams
Store the list of the template parameters for a generic lambda or an abbreviated function template.
Contains all of the variables defined in this lambda that shadow variables that were defined in paren...
const NamedDecl * ShadowedDecl