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
125 /// This will look through a single cast.
200 // This only accepts LValueBases from APValues, and APValues don't support
271 /// This will always be 0 if the most-derived object is not an array
408 // This is a most-derived object.
415 /// elements of type T. This is an array of unknown size.
444 // This is technically a most-derived object, though in practice this
532 /// The callee at the point where the arguments were evaluated. This might
554 /// This - The binding for the this pointer in this call, if any.
555 const LValue *This;
613 const FunctionDecl *Callee, const LValue *This,
682 : Frame(Frame), OldThis(Frame.This) {
684 Frame.This = NewThis;
687 Frame.This = OldThis;
722 const LValue &This, QualType ThisType);
818 /// Get the kind of the allocation. This must match between allocation
834 /// EvalInfo - This is a private struct used by the evaluator to capture
865 /// to perform. This is essentially a limit for the number of statements
873 /// BottomFrame - The frame in which evaluation started. This must be
881 /// EvaluatingDecl - This is the declaration whose initializer is being
894 /// EvaluatingDeclValue - This is the value being constructed for the
1029 /*This=*/nullptr,
1204 // isn't a constant expression. This diagnostic is more important,
1295 /// directly depend on, and determine if we should keep evaluating. This
1427 // Push a new temporary version. This is needed to distinguish between
1516 const FunctionDecl *Callee, const LValue *This,
1518 : Info(Info), Caller(Info.CurrentCall), Callee(Callee), This(This),
1908 const LValue &This, const Expr *E,
1922 static bool EvaluateAtomic(const Expr *E, const LValue *This, APValue &Result,
2027 if (This && IsMemberCall) {
2044 This->moveInto(Val);
2047 Info.Ctx.getLValueReferenceType(This->Designator.MostDerivedType));
2211 // Determine whether two string literals potentially overlap. This will be the
2233 // This is the byte offset to the location of the first character of LHS
2464 // dynamic initialization. This means that we are permitted to
2491 // Allow address constant expressions to be past-the-end pointers. This is
2536 const LValue *This = nullptr) {
2557 if (This && Info.EvaluatingDecl == This->getLValueBase())
2718 // TODO: This function should produce notes if it fails.
3494 // FIXME: This diagnostic is bogus; we do support captures. Is this code
3559 // has a value-dependent initializer. This should only happen in
3683 // FIXME: This is inefficient; we should probably introduce something similar
3985 // cannot perform this read. (This only happens when performing a trivial
4329 // This is the object whose initializer we're evaluating, so its lifetime
4429 // This variable might end up being constexpr. Don't diagnose it yet.
4550 /// Perform an lvalue-to-rvalue conversion on the given glvalue. This
4622 // (This shouldn't show up in C/C++, but it could be triggered by a
4957 LValue &This) {
4959 return EvaluatePointer(Object, This, Info);
4962 return EvaluateLValue(Object, This, Info);
4965 return EvaluateTemporary(Object, This, Info);
4968 return EvaluateTemporary(Object, This, Info);
4981 /// the resulting LValue subobject designator. This is not possible when
5003 // This is a member of some derived class. Truncate LV appropriately.
5379 // This can only happen if the switch case is nested within a statement
5980 static bool checkDynamicType(EvalInfo &Info, const Expr *E, const LValue &This,
5988 if (This.allowConstexprUnknown())
5991 if (This.Designator.Invalid)
5994 CompleteObject Obj = findCompleteObject(Info, E, AK, This, QualType());
6003 if (This.Designator.isOnePastTheEnd() ||
6004 This.Designator.isMostDerivedAnUnsizedArray()) {
6005 Info.FFDiag(E, This.Designator.isOnePastTheEnd()
6014 This.moveInto(Val);
6016 Info.Ctx.getLValueReferenceType(This.Designator.getType(Info.Ctx));
6025 return Obj && findSubobject(Info, E, Obj, This.Designator, Handler);
6032 const LValue &This,
6035 Info, E, This,
6058 LValue &This,
6063 if (!checkDynamicType(Info, E, This, AK,
6069 if (This.Designator.Invalid)
6072 // Refuse to compute a dynamic type in the presence of virtual bases. This
6079 This.Designator.MostDerivedType->getAsCXXRecordDecl();
6089 ArrayRef<APValue::LValuePathEntry> Path = This.Designator.Entries;
6090 for (unsigned PathLength = This.Designator.MostDerivedPathLength;
6092 switch (Info.isEvaluatingCtorDtor(This.getLValueBase(),
6096 // We're constructing or destroying a base class. This is not the dynamic
6106 return DynamicType{getBaseClassType(This.Designator, PathLength),
6112 // 'This', so that object has not yet begun its period of construction and
6120 EvalInfo &Info, const Expr *E, LValue &This, const CXXMethodDecl *Found,
6123 Info, E, This,
6134 for (/**/; PathLength <= This.Designator.Entries.size(); ++PathLength) {
6135 const CXXRecordDecl *Class = getBaseClassType(This.Designator, PathLength);
6159 CovariantPathLength != This.Designator.Entries.size();
6162 getBaseClassType(This.Designator, CovariantPathLength);
6175 if (!CastToDerivedClass(Info, E, This, Callee->getParent(), PathLength))
6223 /// This implements the hard case of dynamic_cast, requiring a "runtime check"
6341 // This union member is already active. If it's also in-lifetime, there's
6561 const FunctionDecl *Callee, const LValue *This,
6568 CallStackFrame Frame(Info, E->getSourceRange(), Callee, This, E, Call);
6570 // For a trivial copy or move assignment, perform an APValue copy. This is
6581 assert(This &&
6587 if (!handleAssignment(Info, Args[0], *This, MD->getThisType(),
6590 This->moveInto(Result);
6615 static bool HandleConstructorCall(const Expr *E, const LValue &This,
6631 ObjectUnderConstruction{This.getLValueBase(), This.Designator.Entries},
6633 CallStackFrame Frame(Info, E->getSourceRange(), Definition, &This, E, Call);
6648 if (!EvaluateInPlace(Result, Info, This, (*I)->getInit()) ||
6655 // For a trivial copy or move constructor, perform an APValue copy. This is
6713 LValue Subobject = This;
6714 LValue SubobjectParent = This;
6750 // Switch the union field if it differs. This happens if we had
6760 // FIXME: This immediately starts the lifetime of all members of
6784 // Need to override This for implicit field initializers as in this case
6785 // This refers to innermost anonymous struct/union containing initializer,
6806 // This is the point at which the dynamic type of the object becomes this
6829 static bool HandleConstructorCall(const Expr *E, const LValue &This,
6838 return HandleConstructorCall(E, This, Call, Definition, Info, Result) &&
6843 const LValue &This, APValue &Value,
6851 This.moveInto(Printable);
6870 LValue ElemLV = This;
6943 CallStackFrame Frame(Info, CallRange, Definition, &This, /*CallExpr=*/nullptr,
6950 ObjectUnderConstruction{This.getLValueBase(), This.Designator.Entries});
6982 LValue Subobject = This;
7000 LValue Subobject = This;
7021 const LValue &This;
7027 return HandleDestructionImpl(Info, E->getSourceRange(), This, Subobj,
7044 const LValue &This, QualType ThisType) {
7045 CompleteObject Obj = findCompleteObject(Info, E, AK_Destroy, This, ThisType);
7046 DestroyObjectHandler Handler = {Info, E, This, AK_Destroy};
7047 return Obj && findSubobject(Info, E, Obj, This.Designator, Handler);
7071 // This is permitted only within a call to std::allocator<T>::allocate.
7104 // This likely indicates a bug in the implementation of 'std::allocator'.
7199 // This is permitted only within a call to std::allocator<T>::deallocate.
7545 // Work around floating point types that contain unused padding bytes. This
7999 /// Report an evaluation error. This should only be called when an error is
8125 // side-effects. This is an important GNU extension. See GCC PR38377
8209 LValue *This = nullptr, ThisVal;
8225 This = &ThisVal;
8236 This = &ThisVal;
8299 This = &ThisVal;
8367 if (This) {
8371 FD = HandleVirtualDispatch(Info, E, *This, NamedMember,
8379 if (!checkNonVirtualMemberCallThisPointer(Info, E, *This, NamedMember))
8386 assert(This && "no 'this' pointer for destructor call");
8387 return HandleDestruction(Info, E, *This,
8396 !HandleFunctionCall(E->getExprLoc(), Definition, This, E, Args, Call,
8490 // This does not need to be done in place even for class/array types:
8725 // This is used for evaluating lvalues (in C and C++), xvalues (in C++11),
8826 assert(Info.CurrentCall->This == nullptr &&
8827 "This should not be set for a static call operator");
8848 Result = *Info.CurrentCall->This;
8867 /// Evaluate an expression as an lvalue. This can be legitimately called on
9303 /// This expects the given CallExpr to be a call to a function with an
9469 if (!Info.CurrentCall->This) {
9474 Result = *Info.CurrentCall->This;
9483 if (IsExplicitLambda && !Info.CurrentCall->This) {
10157 // can give a more meaningful diagnostic. This implicitly also checks that
10216 static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This,
10219 static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This,
10544 const LValue &This;
10548 RecordExprEvaluator(EvalInfo &info, const LValue &This, APValue &Result)
10549 : ExprEvaluatorBaseTy(info), This(This), Result(Result) {}
10561 return handleCallExpr(E, Result, &This);
10588 const LValue &This, APValue &Result) {
10602 LValue Subobject = This;
10616 LValue Subobject = This;
10643 LValue Subobject = This;
10656 return HandleClassZeroInitialization(Info, E, RD, This, Result);
10707 ObjectUnderConstruction{This.getLValueBase(), This.Designator.Entries},
10733 LValue Subobject = This;
10737 // Temporarily override This, in case there's a CXXDefaultInitExpr in here.
10738 ThisOverrideRAII ThisOverride(*Info.CurrentCall, &This,
10763 LValue Subobject = This;
10786 LValue Subobject = This;
10804 // Bail out for now. This might sort of "work", but the rest of the
10812 // Temporarily override This, in case there's a CXXDefaultInitExpr in here.
10813 ThisOverrideRAII ThisOverride(*Info.CurrentCall, &This,
10858 // FIXME: This only handles the simplest case, where the source object
10860 // This should also handle stepping though implicit casts and
10875 return HandleConstructorCall(E, This, Args,
10897 return HandleConstructorCall(E, This, Info.CurrentCall->Arguments,
10980 LValue Subobject = This;
10995 static bool EvaluateRecord(const Expr *E, const LValue &This,
11000 return RecordExprEvaluator(Info, This, Result).Visit(E);
11288 // This is only valid for integral types anyway, so we don't have to handle
11323 // This result element type differs in the case of negating a floating point
11333 // FIXME: This vector evaluator someday needs to be changed to be LValue
11549 const LValue &This;
11553 ArrayExprEvaluator(EvalInfo &Info, const LValue &This, APValue &Result)
11554 : ExprEvaluatorBaseTy(Info), This(This), Result(Result) {}
11582 LValue Subobject = This;
11589 return handleCallExpr(E, Result, &This);
11611 static bool EvaluateArray(const Expr *E, const LValue &This,
11616 return ArrayExprEvaluator(Info, This, Result).Visit(E);
11619 static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This,
11625 return ArrayExprEvaluator(Info, This, Result)
11629 static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This,
11636 return ArrayExprEvaluator(Info, This, Result)
11637 .VisitCXXConstructExpr(CCE, This, &Result, AllocType);
11732 LValue Subobject = This;
11808 LValue Subobject = This;
11840 return VisitCXXConstructExpr(E, This, &Result, E->getType());
12075 // This should not be evaluated during constant expr evaluation, as it
12392 // If no argument was supplied, default to None. This isn't
12430 // This evaluation is not permitted to have side-effects, so evaluate it in
12495 /// tryEvaluateBuiltinObjectSize. This ignores some casts/parens that serve only
12634 // the array at the end was flexible, or if it had 0 or 1 elements. This
12713 // We want to evaluate the size of the entire object. This is a valid fallback
14416 // This makes the comparison result unspecified, so it's not a constant
14985 /// HandleCast - This is used to evaluate implicit or explicit casts where the
15124 // This corressponds to [expr.static.cast]p10 which says:
15131 // This was resolved as part of DR2338 which has CD5 status.
15508 // sNaN. This is now known as "legacy NaN" encoding.
16003 // This is an implementation of complex multiplication according to the
16059 // This is an implementation of complex division according to the
16169 // This is an implementation of complex multiplication according to the
16212 // This is an implementation of complex division according to the
16336 const LValue *This;
16339 AtomicExprEvaluator(EvalInfo &Info, const LValue *This, APValue &Result)
16340 : ExprEvaluatorBaseTy(Info), This(This), Result(Result) {}
16352 return This ? EvaluateInPlace(Result, Info, *This, &VIE)
16364 return This ? EvaluateInPlace(Result, Info, *This, E->getSubExpr())
16371 static bool EvaluateAtomic(const Expr *E, const LValue *This, APValue &Result,
16375 return AtomicExprEvaluator(Info, This, Result).Visit(E);
16447 // This is the only case where we need to produce an extension warning:
16487 // The element was already erased. This means the destructor call also
16489 // FIXME: This probably results in undefined behavior before we get this
16594 static bool EvaluateInPlace(APValue &Result, EvalInfo &Info, const LValue &This,
16598 if (!AllowNonLiteralTypes && !CheckLiteralType(Info, E, &This))
16606 return EvaluateArray(E, This, Result, Info);
16608 return EvaluateRecord(E, This, Result, Info);
16612 return EvaluateAtomic(E, &This, Result, Info);
16698 // This case should be rare, but we need to check it before we check on
17113 // CheckICE - This function does the fundamental ICE checking: the returned
17125 /// This expression is an ICE.
17127 /// This expression is not an ICE, but if it isn't evaluated, it's
17128 /// a legal subexpression for an ICE. This return value is used to handle
17131 /// This expression is not an ICE, and is not a legal subexpression for one.
17366 // "offsetof(struct s{int x[4];}, x[1.0])". This doesn't affect
17519 // expression, and it is fully evaluated. This is an important GNU
17671 // FIXME: This shouldn't happen.
17681 const Expr *This) const {
17699 if (This) {
17706 if (!This->isValueDependent() &&
17707 EvaluateObjectArgument(Info, This, ThisVal) &&
17711 // Ignore any side-effects from a failed evaluation. This is safe because
17731 // Ignore any side-effects from a failed evaluation. This is safe because
17742 CallStackFrame Frame(Info, Callee->getLocation(), Callee, ThisPtr, This,
17785 LValue This;
17787 This.set({&VIE, Info.CurrentCall->Index});
17795 Info.setEvaluatingDecl(This.getLValueBase(), Scratch);
17796 HandleConstructorCall(&VIE, This, Args, CD, Info, Scratch);
17800 Loc, FD, (MD && MD->isImplicitObjectMemberFunction()) ? &This : nullptr,
17824 CallStackFrame Frame(Info, SourceLocation(), FD, /*This=*/nullptr,