Lines Matching refs:OpPC

49 bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
52 bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
55 bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
59 bool CheckDummy(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
63 bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
67 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
71 bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
75 bool CheckSubobject(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
80 bool CheckDowncast(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
84 bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
87 bool CheckConstant(InterpState &S, CodePtr OpPC, const Descriptor *Desc);
90 bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
93 bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
96 bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
99 bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
102 bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
105 bool CheckInvoke(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
108 bool CheckInit(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
111 bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F);
115 bool CheckCallDepth(InterpState &S, CodePtr OpPC);
118 bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This);
121 bool CheckPure(InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD);
124 bool CheckNonNullArgs(InterpState &S, CodePtr OpPC, const Function *F,
129 bool CheckDynamicMemoryAllocation(InterpState &S, CodePtr OpPC);
132 bool CheckNewDeleteForms(InterpState &S, CodePtr OpPC, bool NewWasArray,
138 bool CheckDeleteSource(InterpState &S, CodePtr OpPC, const Expr *Source,
143 bool SetThreeWayComparisonField(InterpState &S, CodePtr OpPC,
147 bool DoMemcpy(InterpState &S, CodePtr OpPC, const Pointer &Src, Pointer &Dest);
151 bool CheckShift(InterpState &S, CodePtr OpPC, const LT &LHS, const RT &RHS, in CheckShift() argument
154 const SourceInfo &Loc = S.Current->getSource(OpPC); in CheckShift()
163 const Expr *E = S.Current->getExpr(OpPC); in CheckShift()
172 const Expr *E = S.Current->getExpr(OpPC); in CheckShift()
195 bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) { in CheckDivRem() argument
197 const auto *Op = cast<BinaryOperator>(S.Current->getExpr(OpPC)); in CheckDivRem()
213 const SourceInfo &Loc = S.Current->getSource(OpPC); in CheckDivRem()
214 const Expr *E = S.Current->getExpr(OpPC); in CheckDivRem()
222 bool CheckArraySize(InterpState &S, CodePtr OpPC, SizeT *NumElements, in CheckArraySize() argument
236 const SourceInfo &Loc = S.Current->getSource(OpPC); in CheckArraySize()
247 bool CheckFloatResult(InterpState &S, CodePtr OpPC, const Floating &Result,
251 bool CheckDeclRef(InterpState &S, CodePtr OpPC, const DeclRefExpr *DR);
257 bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const Function *F,
261 bool InterpretOffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E,
264 inline bool Invalid(InterpState &S, CodePtr OpPC);
272 void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC);
332 bool AddSubMulHelper(InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS, in AddSubMulHelper() argument
348 const Expr *E = S.Current->getExpr(OpPC); in AddSubMulHelper()
371 bool Add(InterpState &S, CodePtr OpPC) { in Add() argument
375 return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS); in Add()
378 inline bool Addf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { in Addf() argument
385 return CheckFloatResult(S, OpPC, Result, Status); in Addf()
389 bool Sub(InterpState &S, CodePtr OpPC) { in Sub() argument
393 return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); in Sub()
396 inline bool Subf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { in Subf() argument
403 return CheckFloatResult(S, OpPC, Result, Status); in Subf()
407 bool Mul(InterpState &S, CodePtr OpPC) { in Mul() argument
411 return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS); in Mul()
414 inline bool Mulf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { in Mulf() argument
421 return CheckFloatResult(S, OpPC, Result, Status); in Mulf()
425 inline bool Mulc(InterpState &S, CodePtr OpPC) { in Mulc() argument
480 inline bool Divc(InterpState &S, CodePtr OpPC) { in Divc() argument
512 const SourceInfo &E = S.Current->getSource(OpPC); in Divc()
555 bool BitAnd(InterpState &S, CodePtr OpPC) { in BitAnd() argument
572 bool BitOr(InterpState &S, CodePtr OpPC) { in BitOr() argument
589 bool BitXor(InterpState &S, CodePtr OpPC) { in BitXor() argument
606 bool Rem(InterpState &S, CodePtr OpPC) { in Rem() argument
610 if (!CheckDivRem(S, OpPC, LHS, RHS)) in Rem()
626 bool Div(InterpState &S, CodePtr OpPC) { in Div() argument
630 if (!CheckDivRem(S, OpPC, LHS, RHS)) in Div()
642 inline bool Divf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { in Divf() argument
646 if (!CheckDivRem(S, OpPC, LHS, RHS)) in Divf()
652 return CheckFloatResult(S, OpPC, Result, Status); in Divf()
660 bool Inv(InterpState &S, CodePtr OpPC) { in Inv() argument
676 bool Neg(InterpState &S, CodePtr OpPC) { in Neg() argument
690 const Expr *E = S.Current->getExpr(OpPC); in Neg()
718 bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { in IncDecHelper() argument
723 return Invalid(S, OpPC); in IncDecHelper()
754 const Expr *E = S.Current->getExpr(OpPC); in IncDecHelper()
776 bool Inc(InterpState &S, CodePtr OpPC) { in Inc() argument
778 if (!CheckLoad(S, OpPC, Ptr, AK_Increment)) in Inc()
781 return IncDecHelper<T, IncDecOp::Inc, PushVal::Yes>(S, OpPC, Ptr); in Inc()
788 bool IncPop(InterpState &S, CodePtr OpPC) { in IncPop() argument
790 if (!CheckLoad(S, OpPC, Ptr, AK_Increment)) in IncPop()
793 return IncDecHelper<T, IncDecOp::Inc, PushVal::No>(S, OpPC, Ptr); in IncPop()
801 bool Dec(InterpState &S, CodePtr OpPC) { in Dec() argument
803 if (!CheckLoad(S, OpPC, Ptr, AK_Decrement)) in Dec()
806 return IncDecHelper<T, IncDecOp::Dec, PushVal::Yes>(S, OpPC, Ptr); in Dec()
813 bool DecPop(InterpState &S, CodePtr OpPC) { in DecPop() argument
815 if (!CheckLoad(S, OpPC, Ptr, AK_Decrement)) in DecPop()
818 return IncDecHelper<T, IncDecOp::Dec, PushVal::No>(S, OpPC, Ptr); in DecPop()
822 bool IncDecFloatHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr, in IncDecFloatHelper() argument
838 return CheckFloatResult(S, OpPC, Result, Status); in IncDecFloatHelper()
841 inline bool Incf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { in Incf() argument
843 if (!CheckLoad(S, OpPC, Ptr, AK_Increment)) in Incf()
846 return IncDecFloatHelper<IncDecOp::Inc, PushVal::Yes>(S, OpPC, Ptr, RM); in Incf()
849 inline bool IncfPop(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { in IncfPop() argument
851 if (!CheckLoad(S, OpPC, Ptr, AK_Increment)) in IncfPop()
854 return IncDecFloatHelper<IncDecOp::Inc, PushVal::No>(S, OpPC, Ptr, RM); in IncfPop()
857 inline bool Decf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { in Decf() argument
859 if (!CheckLoad(S, OpPC, Ptr, AK_Decrement)) in Decf()
862 return IncDecFloatHelper<IncDecOp::Dec, PushVal::Yes>(S, OpPC, Ptr, RM); in Decf()
865 inline bool DecfPop(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { in DecfPop() argument
867 if (!CheckLoad(S, OpPC, Ptr, AK_Decrement)) in DecfPop()
870 return IncDecFloatHelper<IncDecOp::Dec, PushVal::No>(S, OpPC, Ptr, RM); in DecfPop()
876 bool Comp(InterpState &S, CodePtr OpPC) { in Comp() argument
894 bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { in CmpHelper() argument
906 bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { in CmpHelperEQ() argument
907 return CmpHelper<T>(S, OpPC, Fn); in CmpHelperEQ()
912 inline bool CmpHelper<FunctionPointer>(InterpState &S, CodePtr OpPC,
917 const SourceInfo &Loc = S.Current->getSource(OpPC);
925 inline bool CmpHelperEQ<FunctionPointer>(InterpState &S, CodePtr OpPC,
933 const SourceInfo &Loc = S.Current->getSource(OpPC);
945 inline bool CmpHelper<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) {
951 const SourceInfo &Loc = S.Current->getSource(OpPC);
965 inline bool CmpHelperEQ<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) {
980 const SourceInfo &Loc = S.Current->getSource(OpPC);
990 const SourceInfo &Loc = S.Current->getSource(OpPC);
996 const SourceInfo &Loc = S.Current->getSource(OpPC);
1023 inline bool CmpHelperEQ<MemberPointer>(InterpState &S, CodePtr OpPC,
1032 const SourceInfo &Loc = S.Current->getSource(OpPC);
1054 const SourceInfo &Loc = S.Current->getSource(OpPC);
1064 bool EQ(InterpState &S, CodePtr OpPC) { in EQ() argument
1065 return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { in EQ()
1071 bool CMP3(InterpState &S, CodePtr OpPC, const ComparisonCategoryInfo *CmpInfo) { in CMP3() argument
1079 const SourceInfo &Loc = S.Current->getSource(OpPC); in CMP3()
1091 return SetThreeWayComparisonField(S, OpPC, P, CmpValueInfo->getIntValue()); in CMP3()
1095 bool NE(InterpState &S, CodePtr OpPC) { in NE() argument
1096 return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { in NE()
1102 bool LT(InterpState &S, CodePtr OpPC) { in LT() argument
1103 return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { in LT()
1109 bool LE(InterpState &S, CodePtr OpPC) { in LE() argument
1110 return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { in LE()
1117 bool GT(InterpState &S, CodePtr OpPC) { in GT() argument
1118 return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { in GT()
1124 bool GE(InterpState &S, CodePtr OpPC) { in GE() argument
1125 return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { in GE()
1136 bool InRange(InterpState &S, CodePtr OpPC) { in InRange() argument
1150 bool Dup(InterpState &S, CodePtr OpPC) { in Dup() argument
1156 bool Pop(InterpState &S, CodePtr OpPC) { in Pop() argument
1166 bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { in Const() argument
1176 bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { in GetLocal() argument
1178 if (!CheckLoad(S, OpPC, Ptr)) in GetLocal()
1188 bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { in SetLocal() argument
1194 bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { in GetParam() argument
1203 bool SetParam(InterpState &S, CodePtr OpPC, uint32_t I) { in SetParam() argument
1211 bool GetField(InterpState &S, CodePtr OpPC, uint32_t I) { in GetField() argument
1213 if (!CheckNull(S, OpPC, Obj, CSK_Field)) in GetField()
1215 if (!CheckRange(S, OpPC, Obj, CSK_Field)) in GetField()
1218 if (!CheckLoad(S, OpPC, Field)) in GetField()
1225 bool SetField(InterpState &S, CodePtr OpPC, uint32_t I) { in SetField() argument
1228 if (!CheckNull(S, OpPC, Obj, CSK_Field)) in SetField()
1230 if (!CheckRange(S, OpPC, Obj, CSK_Field)) in SetField()
1233 if (!CheckStore(S, OpPC, Field)) in SetField()
1243 bool GetFieldPop(InterpState &S, CodePtr OpPC, uint32_t I) { in GetFieldPop() argument
1245 if (!CheckNull(S, OpPC, Obj, CSK_Field)) in GetFieldPop()
1247 if (!CheckRange(S, OpPC, Obj, CSK_Field)) in GetFieldPop()
1250 if (!CheckLoad(S, OpPC, Field)) in GetFieldPop()
1257 bool GetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { in GetThisField() argument
1261 if (!CheckThis(S, OpPC, This)) in GetThisField()
1264 if (!CheckLoad(S, OpPC, Field)) in GetThisField()
1271 bool SetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { in SetThisField() argument
1276 if (!CheckThis(S, OpPC, This)) in SetThisField()
1279 if (!CheckStore(S, OpPC, Field)) in SetThisField()
1286 bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { in GetGlobal() argument
1288 if (!CheckConstant(S, OpPC, Ptr.getFieldDesc())) in GetGlobal()
1295 if (!CheckGlobalInitialized(S, OpPC, Ptr)) in GetGlobal()
1304 bool GetGlobalUnchecked(InterpState &S, CodePtr OpPC, uint32_t I) { in GetGlobalUnchecked() argument
1313 bool SetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { in SetGlobal() argument
1319 bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { in InitGlobal() argument
1330 bool InitGlobalTemp(InterpState &S, CodePtr OpPC, uint32_t I, in InitGlobalTemp() argument
1352 inline bool InitGlobalTempComp(InterpState &S, CodePtr OpPC, in InitGlobalTempComp() argument
1371 bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) { in InitThisField() argument
1375 if (!CheckThis(S, OpPC, This)) in InitThisField()
1386 bool InitThisBitField(InterpState &S, CodePtr OpPC, const Record::Field *F, in InitThisBitField() argument
1392 if (!CheckThis(S, OpPC, This)) in InitThisBitField()
1402 bool InitThisFieldActive(InterpState &S, CodePtr OpPC, uint32_t I) { in InitThisFieldActive() argument
1406 if (!CheckThis(S, OpPC, This)) in InitThisFieldActive()
1419 bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) { in InitField() argument
1429 bool InitBitField(InterpState &S, CodePtr OpPC, const Record::Field *F) { in InitBitField() argument
1440 bool InitFieldActive(InterpState &S, CodePtr OpPC, uint32_t I) { in InitFieldActive() argument
1454 inline bool GetPtrLocal(InterpState &S, CodePtr OpPC, uint32_t I) { in GetPtrLocal() argument
1459 inline bool GetPtrParam(InterpState &S, CodePtr OpPC, uint32_t I) { in GetPtrParam() argument
1467 inline bool GetPtrGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { in GetPtrGlobal() argument
1474 inline bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrField() argument
1478 !CheckNull(S, OpPC, Ptr, CSK_Field)) in GetPtrField()
1481 if (!CheckExtern(S, OpPC, Ptr)) in GetPtrField()
1483 if (!CheckRange(S, OpPC, Ptr, CSK_Field)) in GetPtrField()
1485 if (!CheckArray(S, OpPC, Ptr)) in GetPtrField()
1487 if (!CheckSubobject(S, OpPC, Ptr, CSK_Field)) in GetPtrField()
1496 inline bool GetPtrFieldPop(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrFieldPop() argument
1500 !CheckNull(S, OpPC, Ptr, CSK_Field)) in GetPtrFieldPop()
1503 if (!CheckExtern(S, OpPC, Ptr)) in GetPtrFieldPop()
1505 if (!CheckRange(S, OpPC, Ptr, CSK_Field)) in GetPtrFieldPop()
1507 if (!CheckArray(S, OpPC, Ptr)) in GetPtrFieldPop()
1509 if (!CheckSubobject(S, OpPC, Ptr, CSK_Field)) in GetPtrFieldPop()
1519 inline bool GetPtrThisField(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrThisField() argument
1523 if (!CheckThis(S, OpPC, This)) in GetPtrThisField()
1529 inline bool GetPtrActiveField(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrActiveField() argument
1531 if (!CheckNull(S, OpPC, Ptr, CSK_Field)) in GetPtrActiveField()
1533 if (!CheckRange(S, OpPC, Ptr, CSK_Field)) in GetPtrActiveField()
1542 inline bool GetPtrActiveThisField(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrActiveThisField() argument
1546 if (!CheckThis(S, OpPC, This)) in GetPtrActiveThisField()
1555 inline bool GetPtrDerivedPop(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrDerivedPop() argument
1557 if (!CheckNull(S, OpPC, Ptr, CSK_Derived)) in GetPtrDerivedPop()
1559 if (!CheckSubobject(S, OpPC, Ptr, CSK_Derived)) in GetPtrDerivedPop()
1561 if (!CheckDowncast(S, OpPC, Ptr, Off)) in GetPtrDerivedPop()
1568 inline bool GetPtrBase(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrBase() argument
1570 if (!CheckNull(S, OpPC, Ptr, CSK_Base)) in GetPtrBase()
1572 if (!CheckSubobject(S, OpPC, Ptr, CSK_Base)) in GetPtrBase()
1578 inline bool GetPtrBasePop(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrBasePop() argument
1580 if (!CheckNull(S, OpPC, Ptr, CSK_Base)) in GetPtrBasePop()
1582 if (!CheckSubobject(S, OpPC, Ptr, CSK_Base)) in GetPtrBasePop()
1588 inline bool GetMemberPtrBasePop(InterpState &S, CodePtr OpPC, int32_t Off) { in GetMemberPtrBasePop() argument
1594 inline bool GetPtrThisBase(InterpState &S, CodePtr OpPC, uint32_t Off) { in GetPtrThisBase() argument
1598 if (!CheckThis(S, OpPC, This)) in GetPtrThisBase()
1604 inline bool FinishInitPop(InterpState &S, CodePtr OpPC) { in FinishInitPop() argument
1613 inline bool FinishInit(InterpState &S, CodePtr OpPC) { in FinishInit() argument
1622 inline bool Dump(InterpState &S, CodePtr OpPC) { in Dump() argument
1627 inline bool VirtBaseHelper(InterpState &S, CodePtr OpPC, const RecordDecl *Decl, in VirtBaseHelper() argument
1638 inline bool GetPtrVirtBasePop(InterpState &S, CodePtr OpPC, in GetPtrVirtBasePop() argument
1642 if (!CheckNull(S, OpPC, Ptr, CSK_Base)) in GetPtrVirtBasePop()
1644 return VirtBaseHelper(S, OpPC, D, Ptr); in GetPtrVirtBasePop()
1647 inline bool GetPtrThisVirtBase(InterpState &S, CodePtr OpPC, in GetPtrThisVirtBase() argument
1653 if (!CheckThis(S, OpPC, This)) in GetPtrThisVirtBase()
1655 return VirtBaseHelper(S, OpPC, D, S.Current->getThis()); in GetPtrThisVirtBase()
1663 bool Load(InterpState &S, CodePtr OpPC) { in Load() argument
1665 if (!CheckLoad(S, OpPC, Ptr)) in Load()
1674 bool LoadPop(InterpState &S, CodePtr OpPC) { in LoadPop() argument
1676 if (!CheckLoad(S, OpPC, Ptr)) in LoadPop()
1685 bool Store(InterpState &S, CodePtr OpPC) { in Store() argument
1688 if (!CheckStore(S, OpPC, Ptr)) in Store()
1697 bool StorePop(InterpState &S, CodePtr OpPC) { in StorePop() argument
1700 if (!CheckStore(S, OpPC, Ptr)) in StorePop()
1709 bool StoreBitField(InterpState &S, CodePtr OpPC) { in StoreBitField() argument
1712 if (!CheckStore(S, OpPC, Ptr)) in StoreBitField()
1724 bool StoreBitFieldPop(InterpState &S, CodePtr OpPC) { in StoreBitFieldPop() argument
1727 if (!CheckStore(S, OpPC, Ptr)) in StoreBitFieldPop()
1739 bool Init(InterpState &S, CodePtr OpPC) { in Init() argument
1742 if (!CheckInit(S, OpPC, Ptr)) { in Init()
1752 bool InitPop(InterpState &S, CodePtr OpPC) { in InitPop() argument
1755 if (!CheckInit(S, OpPC, Ptr)) in InitPop()
1766 bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) { in InitElem() argument
1771 if (!CheckInit(S, OpPC, Ptr)) in InitElem()
1780 bool InitElemPop(InterpState &S, CodePtr OpPC, uint32_t Idx) { in InitElemPop() argument
1785 if (!CheckInit(S, OpPC, Ptr)) in InitElemPop()
1792 inline bool Memcpy(InterpState &S, CodePtr OpPC) { in Memcpy() argument
1796 if (!CheckLoad(S, OpPC, Src)) in Memcpy()
1799 return DoMemcpy(S, OpPC, Src, Dest); in Memcpy()
1802 inline bool ToMemberPtr(InterpState &S, CodePtr OpPC) { in ToMemberPtr() argument
1810 inline bool CastMemberPtrPtr(InterpState &S, CodePtr OpPC) { in CastMemberPtrPtr() argument
1825 bool OffsetHelper(InterpState &S, CodePtr OpPC, const T &Offset, in OffsetHelper() argument
1833 if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex)) { in OffsetHelper()
1841 if (!CheckArray(S, OpPC, Ptr)) in OffsetHelper()
1860 S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index) in OffsetHelper()
1914 bool AddOffset(InterpState &S, CodePtr OpPC) { in AddOffset() argument
1917 return OffsetHelper<T, ArithOp::Add>(S, OpPC, Offset, Ptr); in AddOffset()
1921 bool SubOffset(InterpState &S, CodePtr OpPC) { in SubOffset() argument
1924 return OffsetHelper<T, ArithOp::Sub>(S, OpPC, Offset, Ptr); in SubOffset()
1928 static inline bool IncDecPtrHelper(InterpState &S, CodePtr OpPC, in IncDecPtrHelper() argument
1936 if (!CheckNull(S, OpPC, P, CSK_ArrayIndex)) in IncDecPtrHelper()
1944 if (!OffsetHelper<OneT, Op>(S, OpPC, One, P)) in IncDecPtrHelper()
1952 static inline bool IncPtr(InterpState &S, CodePtr OpPC) { in IncPtr() argument
1955 if (!CheckInitialized(S, OpPC, Ptr, AK_Increment)) in IncPtr()
1958 return IncDecPtrHelper<ArithOp::Add>(S, OpPC, Ptr); in IncPtr()
1961 static inline bool DecPtr(InterpState &S, CodePtr OpPC) { in DecPtr() argument
1964 if (!CheckInitialized(S, OpPC, Ptr, AK_Decrement)) in DecPtr()
1967 return IncDecPtrHelper<ArithOp::Sub>(S, OpPC, Ptr); in DecPtr()
1974 inline bool SubPtr(InterpState &S, CodePtr OpPC) { in SubPtr() argument
1997 return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, A.bitWidth(), A, B); in SubPtr()
2004 inline bool Destroy(InterpState &S, CodePtr OpPC, uint32_t I) { in Destroy() argument
2013 template <PrimType TIn, PrimType TOut> bool Cast(InterpState &S, CodePtr OpPC) { in Cast() argument
2022 inline bool CastFP(InterpState &S, CodePtr OpPC, const llvm::fltSemantics *Sem, in CastFP() argument
2033 bool CastAP(InterpState &S, CodePtr OpPC, uint32_t BitWidth) { in CastAP() argument
2040 bool CastAPS(InterpState &S, CodePtr OpPC, uint32_t BitWidth) { in CastAPS() argument
2047 bool CastIntegralFloating(InterpState &S, CodePtr OpPC, in CastIntegralFloating() argument
2057 return CheckFloatResult(S, OpPC, Result, Status); in CastIntegralFloating()
2061 bool CastFloatingIntegral(InterpState &S, CodePtr OpPC) { in CastFloatingIntegral() argument
2074 const Expr *E = S.Current->getExpr(OpPC); in CastFloatingIntegral()
2086 return CheckFloatResult(S, OpPC, F, Status); in CastFloatingIntegral()
2090 static inline bool CastFloatingIntegralAP(InterpState &S, CodePtr OpPC, in CastFloatingIntegralAP() argument
2099 const Expr *E = S.Current->getExpr(OpPC); in CastFloatingIntegralAP()
2107 return CheckFloatResult(S, OpPC, F, Status); in CastFloatingIntegralAP()
2110 static inline bool CastFloatingIntegralAPS(InterpState &S, CodePtr OpPC, in CastFloatingIntegralAPS() argument
2119 const Expr *E = S.Current->getExpr(OpPC); in CastFloatingIntegralAPS()
2127 return CheckFloatResult(S, OpPC, F, Status); in CastFloatingIntegralAPS()
2131 bool CastPointerIntegral(InterpState &S, CodePtr OpPC) { in CastPointerIntegral() argument
2137 const SourceInfo &E = S.Current->getSource(OpPC); in CastPointerIntegral()
2139 << 2 << S.getLangOpts().CPlusPlus << S.Current->getRange(OpPC); in CastPointerIntegral()
2145 static inline bool CastPointerIntegralAP(InterpState &S, CodePtr OpPC, in CastPointerIntegralAP() argument
2152 const SourceInfo &E = S.Current->getSource(OpPC); in CastPointerIntegralAP()
2154 << 2 << S.getLangOpts().CPlusPlus << S.Current->getRange(OpPC); in CastPointerIntegralAP()
2161 static inline bool CastPointerIntegralAPS(InterpState &S, CodePtr OpPC, in CastPointerIntegralAPS() argument
2168 const SourceInfo &E = S.Current->getSource(OpPC); in CastPointerIntegralAPS()
2170 << 2 << S.getLangOpts().CPlusPlus << S.Current->getRange(OpPC); in CastPointerIntegralAPS()
2177 static inline bool PtrPtrCast(InterpState &S, CodePtr OpPC, bool SrcIsVoidPtr) { in PtrPtrCast() argument
2186 const SourceInfo &E = S.Current->getSource(OpPC); in PtrPtrCast()
2188 << 3 << "'void *'" << S.Current->getRange(OpPC); in PtrPtrCast()
2191 const SourceInfo &E = S.Current->getSource(OpPC); in PtrPtrCast()
2193 << 2 << S.getLangOpts().CPlusPlus << S.Current->getRange(OpPC); in PtrPtrCast()
2204 bool Zero(InterpState &S, CodePtr OpPC) { in Zero() argument
2209 static inline bool ZeroIntAP(InterpState &S, CodePtr OpPC, uint32_t BitWidth) { in ZeroIntAP() argument
2214 static inline bool ZeroIntAPS(InterpState &S, CodePtr OpPC, uint32_t BitWidth) { in ZeroIntAPS() argument
2220 inline bool Null(InterpState &S, CodePtr OpPC, const Descriptor *Desc) { in Null() argument
2230 inline bool This(InterpState &S, CodePtr OpPC) { in This() argument
2237 if (!CheckThis(S, OpPC, This)) in This()
2253 inline bool RVOPtr(InterpState &S, CodePtr OpPC) { in RVOPtr() argument
2267 inline bool DoShift(InterpState &S, CodePtr OpPC, LT &LHS, RT &RHS) { in DoShift() argument
2278 const SourceInfo &Loc = S.Current->getSource(OpPC); in DoShift()
2285 : ShiftDir::Left > (S, OpPC, LHS, RHS); in DoShift()
2294 const SourceInfo &Loc = S.Current->getSource(OpPC); in DoShift()
2301 if (!CheckShift(S, OpPC, LHS, RHS, Bits)) in DoShift()
2329 inline bool Shr(InterpState &S, CodePtr OpPC) { in Shr() argument
2335 return DoShift<LT, RT, ShiftDir::Right>(S, OpPC, LHS, RHS); in Shr()
2339 inline bool Shl(InterpState &S, CodePtr OpPC) { in Shl() argument
2345 return DoShift<LT, RT, ShiftDir::Left>(S, OpPC, LHS, RHS); in Shl()
2352 inline bool NoRet(InterpState &S, CodePtr OpPC) { in NoRet() argument
2362 inline bool NarrowPtr(InterpState &S, CodePtr OpPC) { in NarrowPtr() argument
2368 inline bool ExpandPtr(InterpState &S, CodePtr OpPC) { in ExpandPtr() argument
2383 inline bool ArrayElemPtr(InterpState &S, CodePtr OpPC) { in ArrayElemPtr() argument
2388 if (!CheckArray(S, OpPC, Ptr)) in ArrayElemPtr()
2392 if (!OffsetHelper<T, ArithOp::Add>(S, OpPC, Offset, Ptr)) in ArrayElemPtr()
2395 return NarrowPtr(S, OpPC); in ArrayElemPtr()
2399 inline bool ArrayElemPtrPop(InterpState &S, CodePtr OpPC) { in ArrayElemPtrPop() argument
2404 if (!CheckArray(S, OpPC, Ptr)) in ArrayElemPtrPop()
2408 if (!OffsetHelper<T, ArithOp::Add>(S, OpPC, Offset, Ptr)) in ArrayElemPtrPop()
2411 return NarrowPtr(S, OpPC); in ArrayElemPtrPop()
2415 inline bool ArrayElem(InterpState &S, CodePtr OpPC, uint32_t Index) { in ArrayElem() argument
2418 if (!CheckLoad(S, OpPC, Ptr)) in ArrayElem()
2426 inline bool ArrayElemPop(InterpState &S, CodePtr OpPC, uint32_t Index) { in ArrayElemPop() argument
2429 if (!CheckLoad(S, OpPC, Ptr)) in ArrayElemPop()
2437 inline bool CopyArray(InterpState &S, CodePtr OpPC, uint32_t SrcIndex, uint32_t DestIndex, uint32_t… in CopyArray() argument
2444 if (!CheckLoad(S, OpPC, SP)) in CopyArray()
2456 inline bool ArrayDecay(InterpState &S, CodePtr OpPC) { in ArrayDecay() argument
2464 if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer)) in ArrayDecay()
2472 const SourceInfo &E = S.Current->getSource(OpPC); in ArrayDecay()
2478 inline bool CallVar(InterpState &S, CodePtr OpPC, const Function *Func, in CallVar() argument
2492 if (!CheckInvoke(S, OpPC, ThisPtr)) in CallVar()
2500 if (!CheckCallable(S, OpPC, Func)) in CallVar()
2503 if (!CheckCallDepth(S, OpPC)) in CallVar()
2506 auto NewFrame = std::make_unique<InterpFrame>(S, Func, OpPC, VarArgSize); in CallVar()
2528 inline bool Call(InterpState &S, CodePtr OpPC, const Function *Func, in Call() argument
2543 if (!CheckInvoke(S, OpPC, ThisPtr)) in Call()
2548 if (!CheckCallable(S, OpPC, Func)) in Call()
2554 if (!CheckCallDepth(S, OpPC)) in Call()
2557 auto NewFrame = std::make_unique<InterpFrame>(S, Func, OpPC, VarArgSize); in Call()
2577 inline bool CallVirt(InterpState &S, CodePtr OpPC, const Function *Func, in CallVirt() argument
2601 const Expr *E = S.Current->getExpr(OpPC); in CallVirt()
2617 return Call(S, OpPC, Func, VarArgSize); in CallVirt()
2635 inline bool CallPtr(InterpState &S, CodePtr OpPC, uint32_t ArgSize, in CallPtr() argument
2641 const Expr *E = S.Current->getExpr(OpPC); in CallPtr()
2660 if (!CheckNonNullArgs(S, OpPC, F, CE, ArgSize)) in CallPtr()
2673 return CallVirt(S, OpPC, F, VarArgSize); in CallPtr()
2675 return Call(S, OpPC, F, VarArgSize); in CallPtr()
2678 inline bool GetFnPtr(InterpState &S, CodePtr OpPC, const Function *Func) { in GetFnPtr() argument
2685 inline bool GetIntPtr(InterpState &S, CodePtr OpPC, const Descriptor *Desc) { in GetIntPtr() argument
2692 inline bool GetMemberPtr(InterpState &S, CodePtr OpPC, const Decl *D) { in GetMemberPtr() argument
2697 inline bool GetMemberPtrBase(InterpState &S, CodePtr OpPC) { in GetMemberPtrBase() argument
2704 inline bool GetMemberPtrDecl(InterpState &S, CodePtr OpPC) { in GetMemberPtrDecl() argument
2716 inline bool Invalid(InterpState &S, CodePtr OpPC) { in Invalid() argument
2717 const SourceLocation &Loc = S.Current->getLocation(OpPC); in Invalid()
2719 << S.Current->getRange(OpPC); in Invalid()
2723 inline bool Unsupported(InterpState &S, CodePtr OpPC) { in Unsupported() argument
2724 const SourceLocation &Loc = S.Current->getLocation(OpPC); in Unsupported()
2726 << S.Current->getRange(OpPC); in Unsupported()
2731 inline bool Error(InterpState &S, CodePtr OpPC) { return false; } in Error() argument
2734 inline bool InvalidCast(InterpState &S, CodePtr OpPC, CastKind Kind) { in InvalidCast() argument
2735 const SourceLocation &Loc = S.Current->getLocation(OpPC); in InvalidCast()
2740 << static_cast<unsigned>(Kind) << S.Current->getRange(OpPC); in InvalidCast()
2744 inline bool InvalidDeclRef(InterpState &S, CodePtr OpPC, in InvalidDeclRef() argument
2747 return CheckDeclRef(S, OpPC, DR); in InvalidDeclRef()
2750 inline bool SizelessVectorElementSize(InterpState &S, CodePtr OpPC) { in SizelessVectorElementSize() argument
2752 const SourceRange &ArgRange = S.Current->getRange(OpPC); in SizelessVectorElementSize()
2753 const Expr *E = S.Current->getExpr(OpPC); in SizelessVectorElementSize()
2759 inline bool Assume(InterpState &S, CodePtr OpPC) { in Assume() argument
2766 const SourceLocation &Loc = S.Current->getLocation(OpPC); in Assume()
2772 inline bool OffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E) { in OffsetOf() argument
2778 if (!InterpretOffsetOf(S, OpPC, E, ArrayIndices, Result)) in OffsetOf()
2787 inline bool CheckNonNullArg(InterpState &S, CodePtr OpPC) { in CheckNonNullArg() argument
2792 const SourceLocation &Loc = S.Current->getLocation(OpPC); in CheckNonNullArg()
2798 void diagnoseEnumValue(InterpState &S, CodePtr OpPC, const EnumDecl *ED,
2802 inline bool CheckEnumValue(InterpState &S, CodePtr OpPC, const EnumDecl *ED) { in CheckEnumValue() argument
2808 diagnoseEnumValue(S, OpPC, ED, Val); in CheckEnumValue()
2814 inline bool DecayPtr(InterpState &S, CodePtr OpPC) { in DecayPtr() argument
2824 inline bool CheckDecl(InterpState &S, CodePtr OpPC, const VarDecl *VD) { in CheckDecl() argument
2843 inline bool Alloc(InterpState &S, CodePtr OpPC, const Descriptor *Desc) { in Alloc() argument
2846 if (!CheckDynamicMemoryAllocation(S, OpPC)) in Alloc()
2859 inline bool AllocN(InterpState &S, CodePtr OpPC, PrimType T, const Expr *Source, in AllocN() argument
2861 if (!CheckDynamicMemoryAllocation(S, OpPC)) in AllocN()
2865 if (!CheckArraySize(S, OpPC, &NumElements, primSize(T), IsNoThrow)) { in AllocN()
2884 inline bool AllocCN(InterpState &S, CodePtr OpPC, const Descriptor *ElementDesc, in AllocCN() argument
2886 if (!CheckDynamicMemoryAllocation(S, OpPC)) in AllocCN()
2890 if (!CheckArraySize(S, OpPC, &NumElements, ElementDesc->getSize(), in AllocCN()
2910 bool RunDestructors(InterpState &S, CodePtr OpPC, const Block *B);
2911 static inline bool Free(InterpState &S, CodePtr OpPC, bool DeleteIsArrayForm) { in Free() argument
2912 if (!CheckDynamicMemoryAllocation(S, OpPC)) in Free()
2927 const SourceInfo &Loc = S.Current->getSource(OpPC); in Free()
2936 if (!CheckDeleteSource(S, OpPC, Source, Ptr)) in Free()
2943 if (!RunDestructors(S, OpPC, BlockToDelete)) in Free()
2952 const SourceInfo &Loc = S.Current->getSource(OpPC); in Free()
2956 return CheckNewDeleteForms(S, OpPC, WasArrayAlloc, DeleteIsArrayForm, in Free()
2964 template <typename T> inline T ReadArg(InterpState &S, CodePtr &OpPC) { in ReadArg() argument
2966 uint32_t ID = OpPC.read<uint32_t>(); in ReadArg()
2969 return OpPC.read<T>(); in ReadArg()
2973 template <> inline Floating ReadArg<Floating>(InterpState &S, CodePtr &OpPC) {
2974 Floating F = Floating::deserialize(*OpPC);
2975 OpPC += align(F.bytesToSerialize());
2981 CodePtr &OpPC) {
2982 IntegralAP<false> I = IntegralAP<false>::deserialize(*OpPC);
2983 OpPC += align(I.bytesToSerialize());
2989 CodePtr &OpPC) {
2990 IntegralAP<true> I = IntegralAP<true>::deserialize(*OpPC);
2991 OpPC += align(I.bytesToSerialize());