Lines Matching refs:APValue

36 #include "clang/AST/APValue.h"
55 static bool IsGlobalLValue(APValue::LValueBase B);
62 static QualType getType(APValue::LValueBase B) {
90 APValue::BaseOrMemberType getAsBaseOrMember(APValue::LValuePathEntry E) {
91 APValue::BaseOrMemberType Value;
98 static const FieldDecl *getAsField(APValue::LValuePathEntry E) {
103 static const CXXRecordDecl *getAsBaseClass(APValue::LValuePathEntry E) {
108 static bool isVirtualBaseClass(APValue::LValuePathEntry E) {
116 ArrayRef<APValue::LValuePathEntry> Path,
171 typedef APValue::LValuePathEntry PathEntry;
182 SubobjectDesignator(ASTContext &Ctx, const APValue &V)
237 APValue::BaseOrMemberType Value(D, Virtual);
307 APValue *Arguments;
311 typedef std::map<const void*, APValue> MapTy;
318 APValue *Arguments);
321 APValue *getTemporary(const void *Key) {
325 APValue &createTemporary(const void *Key, bool IsLifetimeExtended);
389 llvm::PointerIntPair<APValue*, 1, bool> Value;
392 Cleanup(APValue *Val, bool IsLifetimeExtended)
397 *Value.getPointer() = APValue();
445 APValue::LValueBase EvaluatingDecl;
449 APValue *EvaluatingDeclValue;
499 void setEvaluatingDecl(APValue::LValueBase Base, APValue &Value) {
795 APValue *Arguments)
808 APValue &CallStackFrame::createTemporary(const void *Key,
810 APValue &Result = Temporaries[Key];
869 void moveInto(APValue &v) const {
871 v = APValue(FloatReal, FloatImag);
873 v = APValue(IntReal, IntImag);
875 void setFrom(const APValue &v) {
890 APValue::LValueBase Base;
895 const APValue::LValueBase getLValueBase() const { return Base; }
902 void moveInto(APValue &V) const {
904 V = APValue(Base, Offset, APValue::NoLValuePath(), CallIndex);
906 V = APValue(Base, Offset, Designator.Entries,
909 void setFrom(ASTContext &Ctx, const APValue &V) {
917 void set(APValue::LValueBase B, unsigned I = 0) {
989 void moveInto(APValue &V) const {
990 V = APValue(getDecl(), isDerivedMember(), Path);
992 void setFrom(const APValue &V) {
1068 static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E);
1069 static bool EvaluateInPlace(APValue &Result, EvalInfo &Info,
1078 static bool EvaluateIntegerOrLValue(const Expr *E, APValue &Result,
1082 static bool EvaluateAtomic(const Expr *E, APValue &Result, EvalInfo &Info);
1099 APValue Val;
1114 const APValue &Arg = Frame->Arguments[ArgIndex];
1128 APValue Scratch;
1149 static bool IsGlobalLValue(APValue::LValueBase B) {
1205 static void NoteLValueLocation(EvalInfo &Info, APValue::LValueBase Base) {
1222 APValue::LValueBase Base = LVal.getLValueBase();
1303 QualType Type, const APValue &Value) {
1375 static bool EvalPointerValueAsBool(const APValue &Value, bool &Result) {
1390 static bool HandleConversionToBool(const APValue &Val, bool &Result) {
1392 case APValue::Uninitialized:
1394 case APValue::Int:
1397 case APValue::Float:
1400 case APValue::ComplexInt:
1404 case APValue::ComplexFloat:
1408 case APValue::LValue:
1410 case APValue::MemberPointer:
1413 case APValue::Vector:
1414 case APValue::Array:
1415 case APValue::Struct:
1416 case APValue::Union:
1417 case APValue::AddrLabelDiff:
1421 llvm_unreachable("unknown APValue kind");
1427 APValue Val;
1491 APValue &Value, const FieldDecl *FD) {
1513 APValue SVal;
1532 APValue &Elt = SVal.getVectorElt(i);
1885 APValue *&Result) {
1957 /// Get the base index of the given base class within an APValue representing
1992 APValue &Result) {
2001 Result = APValue(APValue::UninitArray(),
2006 Result.getArrayFiller() = APValue(Value);
2009 Result.getArrayInitializedElt(I) = APValue(Value);
2014 static void expandArray(APValue &Array, unsigned Index) {
2024 APValue NewValue(APValue::UninitArray(), NewElts, Size);
2046 APValue *Value;
2051 CompleteObject(APValue *Value, QualType Type)
2076 APValue *O = Obj.Value;
2120 // An array object is represented as either an Array APValue or as an
2222 APValue &Result;
2228 bool found(APValue &Subobj, QualType SubobjType) {
2233 Result = APValue(Value);
2237 Result = APValue(Value);
2240 bool foundString(APValue &Subobj, QualType SubobjType, uint64_t Character) {
2241 Result = APValue(extractStringLiteralCharacter(
2254 APValue &Result) {
2262 APValue &NewVal;
2278 bool found(APValue &Subobj, QualType SubobjType) {
2302 bool foundString(APValue &Subobj, QualType SubobjType, uint64_t Character) {
2314 APValue &NewVal) {
2409 APValue *BaseVal = 0;
2581 const LValue &LVal, APValue &RVal) {
2585 // Check for special cases where there is no existing APValue to look at.
2598 APValue Lit;
2607 APValue Str(Base, CharUnits::Zero(), APValue::NoLValuePath(), 0);
2619 QualType LValType, APValue &Val) {
2643 const APValue &RHS;
2659 bool found(APValue &Subobj, QualType SubobjType) {
2661 case APValue::Int:
2663 case APValue::Float:
2665 case APValue::ComplexInt:
2666 case APValue::ComplexFloat:
2670 case APValue::LValue:
2703 bool foundPointer(APValue &Subobj, QualType SubobjType) {
2728 bool foundString(APValue &Subobj, QualType SubobjType, uint64_t Character) {
2740 BinaryOperatorKind Opcode, const APValue &RVal) {
2760 APValue *Old;
2774 bool found(APValue &Subobj, QualType SubobjType) {
2783 case APValue::Int:
2785 case APValue::Float:
2787 case APValue::ComplexInt:
2791 case APValue::ComplexFloat:
2795 case APValue::LValue:
2814 if (Old) *Old = APValue(Value);
2852 if (Old) *Old = APValue(Value);
2861 bool foundPointer(APValue &Subobj, QualType SubobjType) {
2881 bool foundString(APValue &Subobj, QualType SubobjType, uint64_t Character) {
2889 QualType LValType, bool IsIncrement, APValue *Old) {
3093 APValue &Val = Info.CurrentCall->createTemporary(VD, true);
3098 Val = APValue();
3105 Val = APValue();
3122 static EvalStmtResult EvaluateStmt(APValue &Result, EvalInfo &Info,
3126 static EvalStmtResult EvaluateLoopBody(APValue &Result, EvalInfo &Info,
3145 static EvalStmtResult EvaluateSwitch(APValue &Result, EvalInfo &Info,
3202 static EvalStmtResult EvaluateStmt(APValue &Result, EvalInfo &Info,
3540 typedef SmallVector<APValue, 8> ArgVector;
3564 EvalInfo &Info, APValue &Result) {
3574 // For a trivial copy or move assignment, perform an APValue copy. This is
3583 APValue RHSValue;
3607 EvalInfo &Info, APValue &Result) {
3634 // For a trivial copy or move constructor, perform an APValue copy. This is
3648 Result = APValue(APValue::UninitStruct(), RD->getNumBases(),
3665 APValue *Value = &Result;
3687 Result = APValue(FD);
3708 *Value = APValue(FD);
3710 *Value = APValue(APValue::UninitStruct(), CD->getNumBases(),
3750 RetTy DerivedSuccess(const APValue &V, const Expr *E) {
3877 APValue Result;
3921 if (APValue *Value = Info.CurrentCall->getTemporary(E))
4009 APValue Result;
4043 APValue Val;
4059 APValue Result;
4070 APValue AtomicVal;
4084 APValue RVal;
4109 APValue RVal;
4137 APValue ReturnValue;
4171 bool Success(APValue::LValueBase B) {
4180 bool Success(const APValue &V, const Expr *E) {
4217 APValue RefValue;
4371 APValue *V;
4398 APValue *Value;
4401 *Value = APValue();
4415 *Value = APValue();
4544 APValue RHS;
4566 APValue NewVal;
4599 bool Success(const APValue &V, const Expr *E) {
4725 APValue Value;
4799 bool Success(const APValue &V, const Expr *E) {
4877 APValue &Result;
4880 RecordExprEvaluator(EvalInfo &info, const LValue &This, APValue &Result)
4883 bool Success(const APValue &V, const Expr *E) {
4905 const LValue &This, APValue &Result) {
4908 Result = APValue(APValue::UninitStruct(), CD ? CD->getNumBases() : 0,
4955 Result = APValue((const FieldDecl*)0);
4962 Result = APValue(*I);
4985 APValue DerivedObject;
4992 APValue *Value = &DerivedObject;
5014 Result = APValue(Field);
5039 Result = APValue(APValue::UninitStruct(), 0,
5069 APValue &FieldVal = Result.getStructField(Field->getFieldIndex());
5149 Result = APValue(APValue::UninitStruct(), 0, 2);
5166 Result.getStructField(1) = APValue(APSInt(ArrayType->getSize()));
5177 APValue &Result, EvalInfo &Info) {
5238 APValue &Result;
5241 VectorExprEvaluator(EvalInfo &info, APValue &Result)
5244 bool Success(const ArrayRef<APValue> &V, const Expr *E) {
5246 // FIXME: remove this APValue copy.
5247 Result = APValue(V.data(), V.size());
5250 bool Success(const APValue &V, const Expr *E) {
5268 static bool EvaluateVector(const Expr* E, APValue& Result, EvalInfo &Info) {
5282 APValue Val = APValue();
5287 Val = APValue(IntResult);
5292 Val = APValue(F);
5297 // Splat and create vector APValue.
5298 SmallVector<APValue, 4> Elts(NElts, Val);
5310 SmallVector<APValue, 4> Elts;
5322 Elts.push_back(APValue(APFloat(Sem, Elt)));
5331 Elts.push_back(APValue(APSInt(Elt, EltTy->isSignedIntegerType())));
5350 SmallVector<APValue, 4> Elements;
5361 APValue v;
5375 Elements.push_back(APValue(sInt));
5384 Elements.push_back(APValue(f));
5396 APValue ZeroElement;
5398 ZeroElement = APValue(Info.Ctx.MakeIntValue(0, EltTy));
5401 APValue(APFloat::getZero(Info.Ctx.getFloatTypeSemantics(EltTy)));
5403 SmallVector<APValue, 4> Elements(VT->getNumElements(), ZeroElement);
5420 APValue &Result;
5423 ArrayExprEvaluator(EvalInfo &Info, const LValue &This, APValue &Result)
5426 bool Success(const APValue &V, const Expr *E) {
5439 Result = APValue(APValue::UninitArray(), 0,
5454 APValue *Value, QualType Type);
5459 APValue &Result, EvalInfo &Info) {
5475 APValue Val;
5484 APValue Filler;
5497 Result = APValue(APValue::UninitArray(), NumEltsToInit, NumElts);
5539 APValue *Value,
5547 APValue Filler =
5549 : APValue();
5551 *Value = APValue(APValue::UninitArray(), N, N);
5608 // either as an integer-valued APValue, or as an lvalue-valued APValue.
5614 APValue &Result;
5616 IntExprEvaluator(EvalInfo &info, APValue &result)
5619 bool Success(const llvm::APSInt &SI, const Expr *E, APValue &Result) {
5626 Result = APValue(SI);
5633 bool Success(const llvm::APInt &I, const Expr *E, APValue &Result) {
5638 Result = APValue(APSInt(I));
5647 bool Success(uint64_t Value, const Expr *E, APValue &Result) {
5650 Result = APValue(Info.Ctx.MakeIntValue(Value, E->getType()));
5661 bool Success(const APValue &V, const Expr *E) {
5748 static QualType GetObjectType(APValue::LValueBase B);
5762 static bool EvaluateIntegerOrLValue(const Expr *E, APValue &Result,
5769 APValue Val;
5898 APValue &V = Result.Val;
5899 if (V.getKind() == APValue::Int)
5921 QualType IntExprEvaluator::GetObjectType(APValue::LValueBase B) {
6156 APValue Char;
6243 APValue Val;
6280 APValue &FinalResult;
6283 DataRecursiveIntBinOpEvaluator(IntExprEvaluator &IntEval, APValue &Result)
6310 bool Success(uint64_t Value, const Expr *E, APValue &Result) {
6313 bool Success(const APSInt &Value, const Expr *E, APValue &Result) {
6332 const BinaryOperator *E, APValue &Result);
6337 Result.Val = APValue();
6399 const BinaryOperator *E, APValue &Result) {
6437 const APValue &LHSVal = LHSResult.Val;
6438 const APValue &RHSVal = RHSResult.Val;
6478 Result = APValue(LHSAddrExpr, RHSAddrExpr);
6660 Result = APValue(LHSAddrExpr, RHSAddrExpr);
7256 bool Success(const APValue &V, const Expr *e) {
7473 bool Success(const APValue &V, const Expr *e) {
7851 APValue &Result;
7853 AtomicExprEvaluator(EvalInfo &Info, APValue &Result)
7856 bool Success(const APValue &V, const Expr *E) {
7878 static bool EvaluateAtomic(const Expr *E, APValue &Result, EvalInfo &Info) {
7894 bool Success(const APValue &V, const Expr *e) { return true; }
7917 static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) {
7941 Result = APValue(F);
7956 APValue &Value = Info.CurrentCall->createTemporary(E, false);
7963 APValue &Value = Info.CurrentCall->createTemporary(E, false);
7987 /// EvaluateInPlace - Evaluate an expression in-place in an APValue. In some
7990 static bool EvaluateInPlace(APValue &Result, EvalInfo &Info, const LValue &This,
8010 static bool EvaluateAsRValue(EvalInfo &Info, const Expr *E, APValue &Result) {
8033 Result.Val = APValue(APSInt(L->getValue(),
8099 bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx,
8593 APValue Result;
8631 bool Expr::isCXX11ConstantExpr(const ASTContext &Ctx, APValue *Result,
8643 APValue Scratch;
8685 APValue Scratch;