Home | History | Annotate | Download | only in AST

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);
390 llvm::PointerIntPair<APValue*, 1, bool> Value;
393 Cleanup(APValue *Val, bool IsLifetimeExtended)
398 *Value.getPointer() = APValue();
446 APValue::LValueBase EvaluatingDecl;
450 APValue *EvaluatingDeclValue;
518 void setEvaluatingDecl(APValue::LValueBase Base, APValue &Value) {
822 APValue *Arguments)
835 APValue &CallStackFrame::createTemporary(const void *Key,
837 APValue &Result = Temporaries[Key];
896 void moveInto(APValue &v) const {
898 v = APValue(FloatReal, FloatImag);
900 v = APValue(IntReal, IntImag);
902 void setFrom(const APValue &v) {
917 APValue::LValueBase Base;
922 const APValue::LValueBase getLValueBase() const { return Base; }
929 void moveInto(APValue &V) const {
931 V = APValue(Base, Offset, APValue::NoLValuePath(), CallIndex);
933 V = APValue(Base, Offset, Designator.Entries,
936 void setFrom(ASTContext &Ctx, const APValue &V) {
944 void set(APValue::LValueBase B, unsigned I = 0) {
1016 void moveInto(APValue &V) const {
1017 V = APValue(getDecl(), isDerivedMember(), Path);
1019 void setFrom(const APValue &V) {
1095 static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E);
1096 static bool EvaluateInPlace(APValue &Result, EvalInfo &Info,
1105 static bool EvaluateIntegerOrLValue(const Expr *E, APValue &Result,
1109 static bool EvaluateAtomic(const Expr *E, APValue &Result, EvalInfo &Info);
1126 APValue Val;
1141 const APValue &Arg = Frame->Arguments[ArgIndex];
1155 APValue Scratch;
1176 static bool IsGlobalLValue(APValue::LValueBase B) {
1232 static void NoteLValueLocation(EvalInfo &Info, APValue::LValueBase Base) {
1249 APValue::LValueBase Base = LVal.getLValueBase();
1348 QualType Type, const APValue &Value) {
1419 static bool EvalPointerValueAsBool(const APValue &Value, bool &Result) {
1434 static bool HandleConversionToBool(const APValue &Val, bool &Result) {
1436 case APValue::Uninitialized:
1438 case APValue::Int:
1441 case APValue::Float:
1444 case APValue::ComplexInt:
1448 case APValue::ComplexFloat:
1452 case APValue::LValue:
1454 case APValue::MemberPointer:
1457 case APValue::Vector:
1458 case APValue::Array:
1459 case APValue::Struct:
1460 case APValue::Union:
1461 case APValue::AddrLabelDiff:
1465 llvm_unreachable("unknown APValue kind");
1471 APValue Val;
1535 APValue &Value, const FieldDecl *FD) {
1557 APValue SVal;
1576 APValue &Elt = SVal.getVectorElt(i);
1928 APValue *&Result) {
2000 /// Get the base index of the given base class within an APValue representing
2035 APValue &Result) {
2044 Result = APValue(APValue::UninitArray(),
2049 Result.getArrayFiller() = APValue(Value);
2052 Result.getArrayInitializedElt(I) = APValue(Value);
2057 static void expandArray(APValue &Array, unsigned Index) {
2067 APValue NewValue(APValue::UninitArray(), NewElts, Size);
2089 APValue *Value;
2094 CompleteObject(APValue *Value, QualType Type)
2119 APValue *O = Obj.Value;
2163 // An array object is represented as either an Array APValue or as an
2265 APValue &Result;
2271 bool found(APValue &Subobj, QualType SubobjType) {
2276 Result = APValue(Value);
2280 Result = APValue(Value);
2283 bool foundString(APValue &Subobj, QualType SubobjType, uint64_t Character) {
2284 Result = APValue(extractStringLiteralCharacter(
2297 APValue &Result) {
2305 APValue &NewVal;
2321 bool found(APValue &Subobj, QualType SubobjType) {
2345 bool foundString(APValue &Subobj, QualType SubobjType, uint64_t Character) {
2357 APValue &NewVal) {
2452 APValue *BaseVal = nullptr;
2624 const LValue &LVal, APValue &RVal) {
2628 // Check for special cases where there is no existing APValue to look at.
2641 APValue Lit;
2650 APValue Str(Base, CharUnits::Zero(), APValue::NoLValuePath(), 0);
2662 QualType LValType, APValue &Val) {
2686 const APValue &RHS;
2702 bool found(APValue &Subobj, QualType SubobjType) {
2704 case APValue::Int:
2706 case APValue::Float:
2708 case APValue::ComplexInt:
2709 case APValue::ComplexFloat:
2713 case APValue::LValue:
2746 bool foundPointer(APValue &Subobj, QualType SubobjType) {
2771 bool foundString(APValue &Subobj, QualType SubobjType, uint64_t Character) {
2783 BinaryOperatorKind Opcode, const APValue &RVal) {
2803 APValue *Old;
2817 bool found(APValue &Subobj, QualType SubobjType) {
2826 case APValue::Int:
2828 case APValue::Float:
2830 case APValue::ComplexInt:
2834 case APValue::ComplexFloat:
2838 case APValue::LValue:
2857 if (Old) *Old = APValue(Value);
2895 if (Old) *Old = APValue(Value);
2904 bool foundPointer(APValue &Subobj, QualType SubobjType) {
2924 bool foundString(APValue &Subobj, QualType SubobjType, uint64_t Character) {
2932 QualType LValType, bool IsIncrement, APValue *Old) {
3137 APValue &Val = Info.CurrentCall->createTemporary(VD, true);
3143 Val = APValue();
3153 Val = APValue();
3170 static EvalStmtResult EvaluateStmt(APValue &Result, EvalInfo &Info,
3175 static EvalStmtResult EvaluateLoopBody(APValue &Result, EvalInfo &Info,
3194 static EvalStmtResult EvaluateSwitch(APValue &Result, EvalInfo &Info,
3251 static EvalStmtResult EvaluateStmt(APValue &Result, EvalInfo &Info,
3587 typedef SmallVector<APValue, 8> ArgVector;
3611 EvalInfo &Info, APValue &Result) {
3621 // For a trivial copy or move assignment, perform an APValue copy. This is
3630 APValue RHSValue;
3654 EvalInfo &Info, APValue &Result) {
3681 // For a trivial copy or move constructor, perform an APValue copy. This is
3695 Result = APValue(APValue::UninitStruct(), RD->getNumBases(),
3711 APValue *Value = &Result;
3733 Result = APValue(FD);
3752 *Value = APValue(FD);
3754 *Value = APValue(APValue::UninitStruct(), CD->getNumBases(),
3793 bool DerivedSuccess(const APValue &V, const Expr *E) {
3920 APValue Result;
3964 if (APValue *Value = Info.CurrentCall->getTemporary(E))
4052 APValue Result;
4086 APValue Val;
4102 APValue Result;
4113 APValue AtomicVal;
4127 APValue RVal;
4152 APValue RVal;
4180 APValue ReturnValue;
4214 bool Success(APValue::LValueBase B) {
4223 bool Success(const APValue &V, const Expr *E) {
4260 APValue RefValue;
4414 APValue *V;
4441 APValue *Value;
4444 *Value = APValue();
4458 *Value = APValue();
4587 APValue RHS;
4609 APValue NewVal;
4642 bool Success(const APValue &V, const Expr *E) {
4773 APValue Value;
4847 bool Success(const APValue &V, const Expr *E) {
4925 APValue &Result;
4928 RecordExprEvaluator(EvalInfo &info, const LValue &This, APValue &Result)
4931 bool Success(const APValue &V, const Expr *E) {
4953 const LValue &This, APValue &Result) {
4956 Result = APValue(APValue::UninitStruct(), CD ? CD->getNumBases() : 0,
5002 Result = APValue((const FieldDecl*)nullptr);
5009 Result = APValue(*I);
5032 APValue DerivedObject;
5039 APValue *Value = &DerivedObject;
5061 Result = APValue(Field);
5086 Result = APValue(APValue::UninitStruct(), 0,
5115 APValue &FieldVal = Result.getStructField(Field->getFieldIndex());
5195 Result = APValue(APValue::UninitStruct(), 0, 2);
5212 Result.getStructField(1) = APValue(APSInt(ArrayType->getSize()));
5223 APValue &Result, EvalInfo &Info) {
5284 APValue &Result;
5287 VectorExprEvaluator(EvalInfo &info, APValue &Result)
5290 bool Success(const ArrayRef<APValue> &V, const Expr *E) {
5292 // FIXME: remove this APValue copy.
5293 Result = APValue(V.data(), V.size());
5296 bool Success(const APValue &V, const Expr *E) {
5314 static bool EvaluateVector(const Expr* E, APValue& Result, EvalInfo &Info) {
5328 APValue Val = APValue();
5333 Val = APValue(IntResult);
5338 Val = APValue(F);
5343 // Splat and create vector APValue.
5344 SmallVector<APValue, 4> Elts(NElts, Val);
5356 SmallVector<APValue, 4> Elts;
5368 Elts.push_back(APValue(APFloat(Sem, Elt)));
5377 Elts.push_back(APValue(APSInt(Elt, EltTy->isSignedIntegerType())));
5396 SmallVector<APValue, 4> Elements;
5407 APValue v;
5421 Elements.push_back(APValue(sInt));
5430 Elements.push_back(APValue(f));
5442 APValue ZeroElement;
5444 ZeroElement = APValue(Info.Ctx.MakeIntValue(0, EltTy));
5447 APValue(APFloat::getZero(Info.Ctx.getFloatTypeSemantics(EltTy)));
5449 SmallVector<APValue, 4> Elements(VT->getNumElements(), ZeroElement);
5466 APValue &Result;
5469 ArrayExprEvaluator(EvalInfo &Info, const LValue &This, APValue &Result)
5472 bool Success(const APValue &V, const Expr *E) {
5485 Result = APValue(APValue::UninitArray(), 0,
5500 APValue *Value, QualType Type);
5505 APValue &Result, EvalInfo &Info) {
5521 APValue Val;
5530 APValue Filler;
5543 Result = APValue(APValue::UninitArray(), NumEltsToInit, NumElts);
5585 APValue *Value,
5593 APValue Filler =
5595 : APValue();
5597 *Value = APValue(APValue::UninitArray(), N, N);
5654 // either as an integer-valued APValue, or as an lvalue-valued APValue.
5660 APValue &Result;
5662 IntExprEvaluator(EvalInfo &info, APValue &result)
5665 bool Success(const llvm::APSInt &SI, const Expr *E, APValue &Result) {
5672 Result = APValue(SI);
5679 bool Success(const llvm::APInt &I, const Expr *E, APValue &Result) {
5684 Result = APValue(APSInt(I));
5693 bool Success(uint64_t Value, const Expr *E, APValue &Result) {
5696 Result = APValue(Info.Ctx.MakeIntValue(Value, E->getType()));
5707 bool Success(const APValue &V, const Expr *E) {
5786 static QualType GetObjectType(APValue::LValueBase B);
5800 static bool EvaluateIntegerOrLValue(const Expr *E, APValue &Result,
5807 APValue Val;
5936 APValue &V = Result.Val;
5937 if (V.getKind() == APValue::Int)
5959 QualType IntExprEvaluator::GetObjectType(APValue::LValueBase B) {
6206 APValue Char;
6293 APValue Val;
6330 APValue &FinalResult;
6333 DataRecursiveIntBinOpEvaluator(IntExprEvaluator &IntEval, APValue &Result)
6360 bool Success(uint64_t Value, const Expr *E, APValue &Result) {
6363 bool Success(const APSInt &Value, const Expr *E, APValue &Result) {
6382 const BinaryOperator *E, APValue &Result);
6387 Result.Val = APValue();
6449 const BinaryOperator *E, APValue &Result) {
6487 const APValue &LHSVal = LHSResult.Val;
6488 const APValue &RHSVal = RHSResult.Val;
6528 Result = APValue(LHSAddrExpr, RHSAddrExpr);
6710 Result = APValue(LHSAddrExpr, RHSAddrExpr);
7308 bool Success(const APValue &V, const Expr *e) {
7525 bool Success(const APValue &V, const Expr *e) {
7904 APValue &Result;
7906 AtomicExprEvaluator(EvalInfo &Info, APValue &Result)
7909 bool Success(const APValue &V, const Expr *E) {
7931 static bool EvaluateAtomic(const Expr *E, APValue &Result, EvalInfo &Info) {
7947 bool Success(const APValue &V, const Expr *e) { return true; }
7970 static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) {
7994 Result = APValue(F);
8009 APValue &Value = Info.CurrentCall->createTemporary(E, false);
8016 APValue &Value = Info.CurrentCall->createTemporary(E, false);
8040 /// EvaluateInPlace - Evaluate an expression in-place in an APValue. In some
8043 static bool EvaluateInPlace(APValue &Result, EvalInfo &Info, const LValue &This,
8065 static bool EvaluateAsRValue(EvalInfo &Info, const Expr *E, APValue &Result) {
8091 Result.Val = APValue(APSInt(L->getValue(),
8164 bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx,
8666 APValue Result;
8704 bool Expr::isCXX11ConstantExpr(const ASTContext &Ctx, APValue *Result,
8716 APValue Scratch;
8730 bool Expr::EvaluateWithSubstitution(APValue &Value, ASTContext &Ctx,
8741 ArgValues[I - Args.begin()] = APValue();
8780 APValue Scratch;
8812 APValue ResultScratch;