Lines Matching defs:This

9 // This file implements the Expr constant evaluator.
14 // This is the 'bool' return value used by most of the code in this file. A
123 /// This will look through a single cast.
198 // This only accepts LValueBases from APValues, and APValues don't support
264 /// This will always be 0 if the most-derived object is not an array
402 // This is a most-derived object.
409 /// elements of type T. This is an array of unknown size.
438 // This is technically a most-derived object, though in practice this
516 /// The callee at the point where the arguments were evaluated. This might
538 /// This - The binding for the this pointer in this call, if any.
539 const LValue *This;
596 const FunctionDecl *Callee, const LValue *This,
662 : Frame(Frame), OldThis(Frame.This) {
664 Frame.This = NewThis;
667 Frame.This = OldThis;
702 const LValue &This, QualType ThisType);
798 /// Get the kind of the allocation. This must match between allocation
814 /// EvalInfo - This is a private struct used by the evaluator to capture
845 /// to perform. This is essentially a limit for the number of statements
853 /// BottomFrame - The frame in which evaluation started. This must be
861 /// EvaluatingDecl - This is the declaration whose initializer is being
874 /// EvaluatingDeclValue - This is the value being constructed for the
1009 /*This=*/nullptr,
1183 // isn't a constant expression. This diagnostic is more important,
1274 /// directly depend on, and determine if we should keep evaluating. This
1406 // Push a new temporary version. This is needed to distinguish between
1495 const FunctionDecl *Callee, const LValue *This,
1497 : Info(Info), Caller(Info.CurrentCall), Callee(Callee), This(This),
1870 const LValue &This, const Expr *E,
1884 static bool EvaluateAtomic(const Expr *E, const LValue *This, APValue &Result,
1980 if (This && IsMemberCall) {
1997 This->moveInto(Val);
2000 Info.Ctx.getLValueReferenceType(This->Designator.MostDerivedType));
2331 // dynamic initialization. This means that we are permitted to
2358 // Allow address constant expressions to be past-the-end pointers. This is
2403 const LValue *This = nullptr) {
2420 if (This && Info.EvaluatingDecl == This->getLValueBase())
2581 // TODO: This function should produce notes if it fails.
3339 // FIXME: This diagnostic is bogus; we do support captures. Is this code
3392 // has a value-dependent initializer. This should only happen in
3490 // FIXME: This is inefficient; we should probably introduce something similar
3780 // cannot perform this read. (This only happens when performing a trivial
4100 // This is the object whose initializer we're evaluating, so its lifetime
4200 // This variable might end up being constexpr. Don't diagnose it yet.
4321 /// Perform an lvalue-to-rvalue conversion on the given glvalue. This
4393 // (This shouldn't show up in C/C++, but it could be triggered by a
4728 LValue &This) {
4730 return EvaluatePointer(Object, This, Info);
4733 return EvaluateLValue(Object, This, Info);
4736 return EvaluateTemporary(Object, This, Info);
4739 return EvaluateTemporary(Object, This, Info);
4752 /// the resulting LValue subobject designator. This is not possible when
4774 // This is a member of some derived class. Truncate LV appropriately.
5150 // This can only happen if the switch case is nested within a statement
5751 static bool checkDynamicType(EvalInfo &Info, const Expr *E, const LValue &This,
5753 if (This.Designator.Invalid)
5756 CompleteObject Obj = findCompleteObject(Info, E, AK, This, QualType());
5765 if (This.Designator.isOnePastTheEnd() ||
5766 This.Designator.isMostDerivedAnUnsizedArray()) {
5767 Info.FFDiag(E, This.Designator.isOnePastTheEnd()
5776 This.moveInto(Val);
5778 Info.Ctx.getLValueReferenceType(This.Designator.getType(Info.Ctx));
5787 return Obj && findSubobject(Info, E, Obj, This.Designator, Handler);
5794 const LValue &This,
5797 Info, E, This,
5820 LValue &This,
5825 if (!checkDynamicType(Info, E, This, AK, true))
5828 // Refuse to compute a dynamic type in the presence of virtual bases. This
5835 This.Designator.MostDerivedType->getAsCXXRecordDecl();
5845 ArrayRef<APValue::LValuePathEntry> Path = This.Designator.Entries;
5846 for (unsigned PathLength = This.Designator.MostDerivedPathLength;
5848 switch (Info.isEvaluatingCtorDtor(This.getLValueBase(),
5852 // We're constructing or destroying a base class. This is not the dynamic
5862 return DynamicType{getBaseClassType(This.Designator, PathLength),
5868 // 'This', so that object has not yet begun its period of construction and
5876 EvalInfo &Info, const Expr *E, LValue &This, const CXXMethodDecl *Found,
5879 Info, E, This,
5890 for (/**/; PathLength <= This.Designator.Entries.size(); ++PathLength) {
5891 const CXXRecordDecl *Class = getBaseClassType(This.Designator, PathLength);
5915 CovariantPathLength != This.Designator.Entries.size();
5918 getBaseClassType(This.Designator, CovariantPathLength);
5931 if (!CastToDerivedClass(Info, E, This, Callee->getParent(), PathLength))
5979 /// This implements the hard case of dynamic_cast, requiring a "runtime check"
6097 // This union member is already active. If it's also in-lifetime, there's
6317 const FunctionDecl *Callee, const LValue *This,
6324 CallStackFrame Frame(Info, E->getSourceRange(), Callee, This, E, Call);
6326 // For a trivial copy or move assignment, perform an APValue copy. This is
6337 assert(This &&
6343 if (!handleAssignment(Info, Args[0], *This, MD->getThisType(),
6346 This->moveInto(Result);
6371 static bool HandleConstructorCall(const Expr *E, const LValue &This,
6387 ObjectUnderConstruction{This.getLValueBase(), This.Designator.Entries},
6389 CallStackFrame Frame(Info, E->getSourceRange(), Definition, &This, E, Call);
6404 if (!EvaluateInPlace(Result, Info, This, (*I)->getInit()) ||
6411 // For a trivial copy or move constructor, perform an APValue copy. This is
6469 LValue Subobject = This;
6470 LValue SubobjectParent = This;
6506 // Switch the union field if it differs. This happens if we had
6516 // FIXME: This immediately starts the lifetime of all members of
6540 // Need to override This for implicit field initializers as in this case
6541 // This refers to innermost anonymous struct/union containing initializer,
6562 // This is the point at which the dynamic type of the object becomes this
6585 static bool HandleConstructorCall(const Expr *E, const LValue &This,
6594 return HandleConstructorCall(E, This, Call, Definition, Info, Result) &&
6599 const LValue &This, APValue &Value,
6607 This.moveInto(Printable);
6626 LValue ElemLV = This;
6697 CallStackFrame Frame(Info, CallRange, Definition, &This, /*CallExpr=*/nullptr,
6704 ObjectUnderConstruction{This.getLValueBase(), This.Designator.Entries});
6736 LValue Subobject = This;
6754 LValue Subobject = This;
6775 const LValue &This;
6781 return HandleDestructionImpl(Info, E->getSourceRange(), This, Subobj,
6798 const LValue &This, QualType ThisType) {
6799 CompleteObject Obj = findCompleteObject(Info, E, AK_Destroy, This, ThisType);
6800 DestroyObjectHandler Handler = {Info, E, This, AK_Destroy};
6801 return Obj && findSubobject(Info, E, Obj, This.Designator, Handler);
6825 // This is permitted only within a call to std::allocator<T>::allocate.
6858 // This likely indicates a bug in the implementation of 'std::allocator'.
6953 // This is permitted only within a call to std::allocator<T>::deallocate.
7298 // Work around floating point types that contain unused padding bytes. This
7731 /// Report an evaluation error. This should only be called when an error is
7857 // side-effects. This is an important GNU extension. See GCC PR38377
7941 LValue *This = nullptr, ThisVal;
7957 This = &ThisVal;
7968 This = &ThisVal;
8031 This = &ThisVal;
8099 if (This) {
8103 FD = HandleVirtualDispatch(Info, E, *This, NamedMember,
8111 if (!checkNonVirtualMemberCallThisPointer(Info, E, *This, NamedMember))
8118 assert(This && "no 'this' pointer for destructor call");
8119 return HandleDestruction(Info, E, *This,
8128 !HandleFunctionCall(E->getExprLoc(), Definition, This, E, Args, Call,
8222 // This does not need to be done in place even for class/array types:
8457 // This is used for evaluating lvalues (in C and C++), xvalues (in C++11),
8554 assert(Info.CurrentCall->This == nullptr &&
8555 "This should not be set for a static call operator");
8575 Result = *Info.CurrentCall->This;
8594 /// Evaluate an expression as an lvalue. This can be legitimately called on
8965 /// This expects the given CallExpr to be a call to a function with an
9131 if (!Info.CurrentCall->This) {
9136 Result = *Info.CurrentCall->This;
9145 if (IsExplicitLambda && !Info.CurrentCall->This) {
9824 // can give a more meaningful diagnostic. This implicitly also checks that
9883 static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This,
9886 static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This,
10194 const LValue &This;
10198 RecordExprEvaluator(EvalInfo &info, const LValue &This, APValue &Result)
10199 : ExprEvaluatorBaseTy(info), This(This), Result(Result) {}
10211 return handleCallExpr(E, Result, &This);
10238 const LValue &This, APValue &Result) {
10252 LValue Subobject = This;
10266 LValue Subobject = This;
10293 LValue Subobject = This;
10306 return HandleClassZeroInitialization(Info, E, RD, This, Result);
10357 ObjectUnderConstruction{This.getLValueBase(), This.Designator.Entries},
10383 LValue Subobject = This;
10387 // Temporarily override This, in case there's a CXXDefaultInitExpr in here.
10388 ThisOverrideRAII ThisOverride(*Info.CurrentCall, &This,
10413 LValue Subobject = This;
10436 LValue Subobject = This;
10454 // Bail out for now. This might sort of "work", but the rest of the
10462 // Temporarily override This, in case there's a CXXDefaultInitExpr in here.
10463 ThisOverrideRAII ThisOverride(*Info.CurrentCall, &This,
10508 // FIXME: This only handles the simplest case, where the source object
10510 // This should also handle stepping though implicit casts and
10525 return HandleConstructorCall(E, This, Args,
10547 return HandleConstructorCall(E, This, Info.CurrentCall->Arguments,
10630 LValue Subobject = This;
10645 static bool EvaluateRecord(const Expr *E, const LValue &This,
10650 return RecordExprEvaluator(Info, This, Result).Visit(E);
10928 // This is only valid for integral types anyway, so we don't have to handle
10963 // This result element type differs in the case of negating a floating point
10973 // FIXME: This vector evaluator someday needs to be changed to be LValue
11119 const LValue &This;
11123 ArrayExprEvaluator(EvalInfo &Info, const LValue &This, APValue &Result)
11124 : ExprEvaluatorBaseTy(Info), This(This), Result(Result) {}
11152 LValue Subobject = This;
11159 return handleCallExpr(E, Result, &This);
11181 static bool EvaluateArray(const Expr *E, const LValue &This,
11186 return ArrayExprEvaluator(Info, This, Result).Visit(E);
11189 static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This,
11195 return ArrayExprEvaluator(Info, This, Result)
11199 static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This,
11206 return ArrayExprEvaluator(Info, This, Result)
11207 .VisitCXXConstructExpr(CCE, This, &Result, AllocType);
11302 LValue Subobject = This;
11375 LValue Subobject = This;
11407 return VisitCXXConstructExpr(E, This, &Result, E->getType());
11943 // If no argument was supplied, default to None. This isn't
11981 // This evaluation is not permitted to have side-effects, so evaluate it in
12046 /// tryEvaluateBuiltinObjectSize. This ignores some casts/parens that serve only
12185 // the array at the end was flexible, or if it had 0 or 1 elements. This
12260 // We want to evaluate the size of the entire object. This is a valid fallback
14245 /// HandleCast - This is used to evaluate implicit or explicit casts where the
14385 // This corressponds to [expr.static.cast]p10 which says:
14392 // This was resolved as part of DR2338 which has CD5 status.
14765 // sNaN. This is now known as "legacy NaN" encoding.
15228 // This is an implementation of complex multiplication according to the
15284 // This is an implementation of complex division according to the
15394 // This is an implementation of complex multiplication according to the
15437 // This is an implementation of complex division according to the
15561 const LValue *This;
15564 AtomicExprEvaluator(EvalInfo &Info, const LValue *This, APValue &Result)
15565 : ExprEvaluatorBaseTy(Info), This(This), Result(Result) {}
15577 return This ? EvaluateInPlace(Result, Info, *This, &VIE)
15589 return This ? EvaluateInPlace(Result, Info, *This, E->getSubExpr())
15596 static bool EvaluateAtomic(const Expr *E, const LValue *This, APValue &Result,
15600 return AtomicExprEvaluator(Info, This, Result).Visit(E);
15672 // This is the only case where we need to produce an extension warning:
15712 // The element was already erased. This means the destructor call also
15714 // FIXME: This probably results in undefined behavior before we get this
15819 static bool EvaluateInPlace(APValue &Result, EvalInfo &Info, const LValue &This,
15823 if (!AllowNonLiteralTypes && !CheckLiteralType(Info, E, &This))
15831 return EvaluateArray(E, This, Result, Info);
15833 return EvaluateRecord(E, This, Result, Info);
15837 return EvaluateAtomic(E, &This, Result, Info);
15911 // This case should be rare, but we need to check it before we check on
16326 // CheckICE - This function does the fundamental ICE checking: the returned
16338 /// This expression is an ICE.
16340 /// This expression is not an ICE, but if it isn't evaluated, it's
16341 /// a legal subexpression for an ICE. This return value is used to handle
16344 /// This expression is not an ICE, and is not a legal subexpression for one.
16576 // "offsetof(struct s{int x[4];}, x[1.0])". This doesn't affect
16729 // expression, and it is fully evaluated. This is an important GNU
16881 // FIXME: This shouldn't happen.
16891 const Expr *This) const {
16909 if (This) {
16916 if (!This->isValueDependent() &&
16917 EvaluateObjectArgument(Info, This, ThisVal) &&
16921 // Ignore any side-effects from a failed evaluation. This is safe because
16941 // Ignore any side-effects from a failed evaluation. This is safe because
16952 CallStackFrame Frame(Info, Callee->getLocation(), Callee, ThisPtr, This,
16995 LValue This;
16997 This.set({&VIE, Info.CurrentCall->Index});
17005 Info.setEvaluatingDecl(This.getLValueBase(), Scratch);
17006 HandleConstructorCall(&VIE, This, Args, CD, Info, Scratch);
17010 Loc, FD, (MD && MD->isImplicitObjectMemberFunction()) ? &This : nullptr,
17034 CallStackFrame Frame(Info, SourceLocation(), FD, /*This=*/nullptr,