57 WeakObjectUses.clear();
71FunctionScopeInfo::WeakObjectProfileTy::BaseInfoTy
72FunctionScopeInfo::WeakObjectProfileTy::getBaseInfo(
const Expr *
E) {
79 case Stmt::DeclRefExprClass:
80 D = cast<DeclRefExpr>(
E)->getDecl();
81 IsExact = isa<VarDecl>(
D);
83 case Stmt::MemberExprClass: {
89 case Stmt::ObjCIvarRefExprClass: {
95 case Stmt::PseudoObjectExprClass: {
104 if (
const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(DoubleBase))
105 DoubleBase = OVE->getSourceExpr();
116 return BaseInfoTy(
D, IsExact);
119FunctionScopeInfo::WeakObjectProfileTy::WeakObjectProfileTy(
126 Base = getBaseInfo(
E);
134FunctionScopeInfo::WeakObjectProfileTy::WeakObjectProfileTy(
const Expr *BaseE,
138 Base = getBaseInfo(BaseE);
142FunctionScopeInfo::WeakObjectProfileTy::WeakObjectProfileTy(
145 assert(isa<VarDecl>(Property));
148FunctionScopeInfo::WeakObjectProfileTy::WeakObjectProfileTy(
150 :
Base(getBaseInfo(IvarE->getBase())),
Property(IvarE->getDecl()) {
176 dyn_cast<BinaryConditionalOperator>(
E)) {
183 FunctionScopeInfo::WeakObjectUseMap::iterator Uses = WeakObjectUses.end();
185 if (!RefExpr->isObjectReceiver())
187 if (isa<OpaqueValueExpr>(RefExpr->getBase()))
196 else if (
const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(
E)) {
197 if (isa<VarDecl>(DRE->getDecl()))
211 if (Uses == WeakObjectUses.end())
215 FunctionScopeInfo::WeakUseVector::reverse_iterator ThisUse =
216 llvm::find(llvm::reverse(Uses->second),
WeakUseTy(
E,
true));
217 if (ThisUse == Uses->second.rend())
226 return !isNested() && isVariableCapture() && getVariable()->isInitCapture();
230 for (
auto &Cap : Captures)
231 if (Cap.isVLATypeCapture() && Cap.getCapturedVLAType() == VAT)
237 llvm::function_ref<
void(
ValueDecl *,
Expr *)> Callback)
const {
238 for (
Expr *
E : PotentiallyCapturingExprs) {
239 if (
auto *DRE = dyn_cast<DeclRefExpr>(
E)) {
240 Callback(cast<ValueDecl>(DRE->getFoundDecl()),
E);
241 }
else if (
auto *ME = dyn_cast<MemberExpr>(
E)) {
243 }
else if (
auto *FP = dyn_cast<FunctionParmPackExpr>(
E)) {
247 llvm_unreachable(
"unexpected expression in potential captures list");
253 if (ExplicitObjectParameter)
254 return ExplicitObjectParameter->getType()
255 .getNonReferenceType()
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the clang::Expr interface and subclasses for C++ expressions.
static const NamedDecl * getBestPropertyDecl(const ObjCPropertyRefExpr *PropE)
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
ConditionalOperator - The ?: ternary operator.
A reference to a declared variable, function, enum, etc.
void reset()
Set to initial state of "no errors occurred".
This represents one expression.
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
Expr * IgnoreParenImpCasts() LLVM_READONLY
Skip past any parentheses and implicit casts which might surround this expression until reaching a fi...
bool isObjCSelfExpr() const
Check if this expression is the ObjC 'self' implicit parameter.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
This represents a decl that may have a name.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
const Expr * getBase() const
An expression that sends a message to the given Objective-C object or class.
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
ObjCMethodDecl - Represents an instance or class method declaration.
Represents one property declaration in an Objective-C interface.
static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
Lookup a property by name in the specified DeclContext.
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
ObjCPropertyDecl * getExplicitProperty() const
ObjCMethodDecl * getImplicitPropertyGetter() const
const Expr * getBase() const
bool isObjectReceiver() const
bool isExplicitProperty() const
ObjCInterfaceDecl * getClassReceiver() const
bool isClassReceiver() const
bool isSuperReceiver() const
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Encodes a location in the source.
StmtClass getStmtClass() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a C array with a specified size that is not an integer-constant-expression.
~BlockScopeInfo() override
bool isInitCapture() const
Determine whether this capture is an init-capture.
~CapturedRegionScopeInfo() override
bool isVLATypeCaptured(const VariableArrayType *VAT) const
Determine whether the given variable-array type has been captured.
Represents a simple identification of a weak object.
Represents a single use of a weak object.
SmallVector< ReturnStmt *, 4 > Returns
The list of return statements that occur within the function or block, if there is any chance of appl...
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.
llvm::SmallMapVector< ParmVarDecl *, Stmt *, 4 > CoroutineParameterMoves
A mapping between the coroutine function parameters that were moved to the coroutine frame,...
void recordUseOfWeak(const ExprT *E, bool IsRead=true)
Record that a weak object was accessed.
bool HasDroppedStmt
Whether a statement was dropped because it was invalid.
void markSafeWeakUse(const Expr *E)
Record that a given expression is a "safe" access of a weak object (e.g.
SourceLocation FirstCoroutineStmtLoc
First coroutine statement in the current function.
bool FoundImmediateEscalatingExpression
Whether we found an immediate-escalating expression.
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.
bool HasBranchProtectedScope
Whether this function contains a VLA, @try, try, C++ initializer, or anything else that can't be jump...
SmallVector< PossiblyUnreachableDiag, 4 > PossiblyUnreachableDiags
A list of PartialDiagnostics created but delayed within the current function scope.
bool ObjCWarnForNoInitDelegation
This starts true for a secondary initializer method and will be set to false if there is an invocatio...
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.
llvm::SmallPtrSet< const BlockDecl *, 1 > Blocks
The set of blocks that are introduced in this function.
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 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.
bool lambdaCaptureShouldBeConst() const
void visitPotentialCaptures(llvm::function_ref< void(ValueDecl *, Expr *)> Callback) const
The JSON file list parser is used to communicate input to InstallAPI.
@ Property
The type of a property.