#ifndef LLVM_CLANG_AST_INTERP_INTERP_H
#define LLVM_CLANG_AST_INTERP_INTERP_H
#include "../ExprConstShared.h"
#include "Boolean.h"
#include "DynamicAllocator.h"
#include "FixedPoint.h"
#include "Floating.h"
#include "Function.h"
#include "FunctionPointer.h"
#include "InterpFrame.h"
#include "InterpStack.h"
#include "InterpState.h"
#include "MemberPointer.h"
#include "Opcode.h"
#include "PrimType.h"
#include "Program.h"
#include "State.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Expr.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APSInt.h"
#include <type_traits>
namespace clang {
namespace interp {
APSInt;
FixedPointSemantics;
template <typename T>
bool ReturnValue(const InterpState &S, const T &V, APValue &R) { … }
bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
AccessKinds AK);
bool CheckDummy(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
AccessKinds AK);
bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
CheckSubobjectKind CSK);
bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
AccessKinds AK);
bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
CheckSubobjectKind CSK);
bool CheckSubobject(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
CheckSubobjectKind CSK);
bool CheckDowncast(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
uint32_t Offset);
bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckConstant(InterpState &S, CodePtr OpPC, const Descriptor *Desc);
bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
AccessKinds AK = AK_Read);
bool CheckFinalLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
AccessKinds AK);
bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckInvoke(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckInit(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F);
bool CheckCallDepth(InterpState &S, CodePtr OpPC);
bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This);
bool CheckPure(InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD);
bool CheckNonNullArgs(InterpState &S, CodePtr OpPC, const Function *F,
const CallExpr *CE, unsigned ArgSize);
bool CheckDynamicMemoryAllocation(InterpState &S, CodePtr OpPC);
bool CheckNewDeleteForms(InterpState &S, CodePtr OpPC,
DynamicAllocator::Form AllocForm,
DynamicAllocator::Form DeleteForm, const Descriptor *D,
const Expr *NewExpr);
bool CheckDeleteSource(InterpState &S, CodePtr OpPC, const Expr *Source,
const Pointer &Ptr);
bool SetThreeWayComparisonField(InterpState &S, CodePtr OpPC,
const Pointer &Ptr, const APSInt &IntValue);
bool DoMemcpy(InterpState &S, CodePtr OpPC, const Pointer &Src, Pointer &Dest);
bool CallVar(InterpState &S, CodePtr OpPC, const Function *Func,
uint32_t VarArgSize);
bool Call(InterpState &S, CodePtr OpPC, const Function *Func,
uint32_t VarArgSize);
bool CallVirt(InterpState &S, CodePtr OpPC, const Function *Func,
uint32_t VarArgSize);
bool CallBI(InterpState &S, CodePtr OpPC, const Function *Func,
const CallExpr *CE, uint32_t BuiltinID);
bool CallPtr(InterpState &S, CodePtr OpPC, uint32_t ArgSize,
const CallExpr *CE);
bool CheckLiteralType(InterpState &S, CodePtr OpPC, const Type *T);
bool InvalidShuffleVectorIndex(InterpState &S, CodePtr OpPC, uint32_t Index);
template <typename T>
static bool handleOverflow(InterpState &S, CodePtr OpPC, const T &SrcValue) { … }
bool handleFixedPointOverflow(InterpState &S, CodePtr OpPC,
const FixedPoint &FP);
enum class ShiftDir { … };
template <ShiftDir Dir, typename LT, typename RT>
bool CheckShift(InterpState &S, CodePtr OpPC, const LT &LHS, const RT &RHS,
unsigned Bits) { … }
template <typename T>
bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) { … }
template <typename SizeT>
bool CheckArraySize(InterpState &S, CodePtr OpPC, SizeT *NumElements,
unsigned ElemSize, bool IsNoThrow) { … }
bool CheckFloatResult(InterpState &S, CodePtr OpPC, const Floating &Result,
APFloat::opStatus Status, FPOptions FPO);
bool CheckDeclRef(InterpState &S, CodePtr OpPC, const DeclRefExpr *DR);
bool Interpret(InterpState &S, APValue &Result);
bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const Function *F,
const CallExpr *Call, uint32_t BuiltinID);
bool InterpretOffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E,
llvm::ArrayRef<int64_t> ArrayIndices, int64_t &Result);
inline bool Invalid(InterpState &S, CodePtr OpPC);
enum class ArithOp { … };
void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC,
const Function *Func);
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { … }
inline bool RetVoid(InterpState &S, CodePtr &PC, APValue &Result) { … }
template <typename T, bool (*OpFW)(T, T, unsigned, T *),
template <typename U> class OpAP>
bool AddSubMulHelper(InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS,
const T &RHS) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Add(InterpState &S, CodePtr OpPC) { … }
static inline llvm::RoundingMode getRoundingMode(FPOptions FPO) { … }
inline bool Addf(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Sub(InterpState &S, CodePtr OpPC) { … }
inline bool Subf(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Mul(InterpState &S, CodePtr OpPC) { … }
inline bool Mulf(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool Mulc(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool Divc(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool BitAnd(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool BitOr(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool BitXor(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Rem(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Div(InterpState &S, CodePtr OpPC) { … }
inline bool Divf(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
inline bool Inv(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Neg(InterpState &S, CodePtr OpPC) { … }
enum class PushVal : bool { … };
enum class IncDecOp { … };
template <typename T, IncDecOp Op, PushVal DoPush>
bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Inc(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool IncPop(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Dec(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool DecPop(InterpState &S, CodePtr OpPC) { … }
template <IncDecOp Op, PushVal DoPush>
bool IncDecFloatHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
uint32_t FPOI) { … }
inline bool Incf(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
inline bool IncfPop(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
inline bool Decf(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
inline bool DecfPop(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Comp(InterpState &S, CodePtr OpPC) { … }
CompareFn;
template <typename T>
bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { … }
template <typename T>
bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { … }
template <>
inline bool CmpHelper<FunctionPointer>(InterpState &S, CodePtr OpPC,
CompareFn Fn) { … }
template <>
inline bool CmpHelperEQ<FunctionPointer>(InterpState &S, CodePtr OpPC,
CompareFn Fn) { … }
template <>
inline bool CmpHelper<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) { … }
template <>
inline bool CmpHelperEQ<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) { … }
template <>
inline bool CmpHelperEQ<MemberPointer>(InterpState &S, CodePtr OpPC,
CompareFn Fn) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool EQ(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool CMP3(InterpState &S, CodePtr OpPC, const ComparisonCategoryInfo *CmpInfo) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool NE(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool LT(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool LE(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GT(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GE(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InRange(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Dup(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Pop(InterpState &S, CodePtr OpPC) { … }
template <PrimType TopName, PrimType BottomName>
bool Flip(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool SetParam(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GetField(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool SetField(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GetFieldPop(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool SetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool GetGlobalUnchecked(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool SetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitGlobalTemp(InterpState &S, CodePtr OpPC, uint32_t I,
const LifetimeExtendedTemporaryDecl *Temp) { … }
inline bool InitGlobalTempComp(InterpState &S, CodePtr OpPC,
const LifetimeExtendedTemporaryDecl *Temp) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitThisBitField(InterpState &S, CodePtr OpPC, const Record::Field *F,
uint32_t FieldOffset) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitBitField(InterpState &S, CodePtr OpPC, const Record::Field *F) { … }
inline bool GetPtrLocal(InterpState &S, CodePtr OpPC, uint32_t I) { … }
inline bool GetPtrParam(InterpState &S, CodePtr OpPC, uint32_t I) { … }
inline bool GetPtrGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { … }
inline bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool GetPtrFieldPop(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool GetPtrThisField(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool GetPtrActiveField(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool GetPtrActiveThisField(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool GetPtrDerivedPop(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool GetPtrBase(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool GetPtrBasePop(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool GetMemberPtrBasePop(InterpState &S, CodePtr OpPC, int32_t Off) { … }
inline bool GetPtrThisBase(InterpState &S, CodePtr OpPC, uint32_t Off) { … }
inline bool FinishInitPop(InterpState &S, CodePtr OpPC) { … }
inline bool FinishInit(InterpState &S, CodePtr OpPC) { … }
inline bool Dump(InterpState &S, CodePtr OpPC) { … }
inline bool VirtBaseHelper(InterpState &S, CodePtr OpPC, const RecordDecl *Decl,
const Pointer &Ptr) { … }
inline bool GetPtrVirtBasePop(InterpState &S, CodePtr OpPC,
const RecordDecl *D) { … }
inline bool GetPtrThisVirtBase(InterpState &S, CodePtr OpPC,
const RecordDecl *D) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Load(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool LoadPop(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Store(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool StorePop(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool StoreBitField(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool StoreBitFieldPop(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Init(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitPop(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool InitElemPop(InterpState &S, CodePtr OpPC, uint32_t Idx) { … }
inline bool Memcpy(InterpState &S, CodePtr OpPC) { … }
inline bool ToMemberPtr(InterpState &S, CodePtr OpPC) { … }
inline bool CastMemberPtrPtr(InterpState &S, CodePtr OpPC) { … }
template <class T, ArithOp Op>
bool OffsetHelper(InterpState &S, CodePtr OpPC, const T &Offset,
const Pointer &Ptr) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool AddOffset(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool SubOffset(InterpState &S, CodePtr OpPC) { … }
template <ArithOp Op>
static inline bool IncDecPtrHelper(InterpState &S, CodePtr OpPC,
const Pointer &Ptr) { … }
static inline bool IncPtr(InterpState &S, CodePtr OpPC) { … }
static inline bool DecPtr(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool SubPtr(InterpState &S, CodePtr OpPC) { … }
inline bool Destroy(InterpState &S, CodePtr OpPC, uint32_t I) { … }
inline bool InitScope(InterpState &S, CodePtr OpPC, uint32_t I) { … }
template <PrimType TIn, PrimType TOut> bool Cast(InterpState &S, CodePtr OpPC) { … }
inline bool CastFP(InterpState &S, CodePtr OpPC, const llvm::fltSemantics *Sem,
llvm::RoundingMode RM) { … }
inline bool CastFixedPoint(InterpState &S, CodePtr OpPC, uint32_t FPS) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool CastAP(InterpState &S, CodePtr OpPC, uint32_t BitWidth) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool CastAPS(InterpState &S, CodePtr OpPC, uint32_t BitWidth) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool CastIntegralFloating(InterpState &S, CodePtr OpPC,
const llvm::fltSemantics *Sem, uint32_t FPOI) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool CastFloatingIntegral(InterpState &S, CodePtr OpPC, uint32_t FPOI) { … }
static inline bool CastFloatingIntegralAP(InterpState &S, CodePtr OpPC,
uint32_t BitWidth, uint32_t FPOI) { … }
static inline bool CastFloatingIntegralAPS(InterpState &S, CodePtr OpPC,
uint32_t BitWidth, uint32_t FPOI) { … }
bool CheckPointerToIntegralCast(InterpState &S, CodePtr OpPC,
const Pointer &Ptr, unsigned BitWidth);
bool CastPointerIntegralAP(InterpState &S, CodePtr OpPC, uint32_t BitWidth);
bool CastPointerIntegralAPS(InterpState &S, CodePtr OpPC, uint32_t BitWidth);
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool CastPointerIntegral(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
static inline bool CastIntegralFixedPoint(InterpState &S, CodePtr OpPC,
uint32_t FPS) { … }
static inline bool CastFloatingFixedPoint(InterpState &S, CodePtr OpPC,
uint32_t FPS) { … }
static inline bool CastFixedPointFloating(InterpState &S, CodePtr OpPC,
const llvm::fltSemantics *Sem) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
static inline bool CastFixedPointIntegral(InterpState &S, CodePtr OpPC) { … }
static inline bool PtrPtrCast(InterpState &S, CodePtr OpPC, bool SrcIsVoidPtr) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool Zero(InterpState &S, CodePtr OpPC) { … }
static inline bool ZeroIntAP(InterpState &S, CodePtr OpPC, uint32_t BitWidth) { … }
static inline bool ZeroIntAPS(InterpState &S, CodePtr OpPC, uint32_t BitWidth) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool Null(InterpState &S, CodePtr OpPC, const Descriptor *Desc) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool IsNonNull(InterpState &S, CodePtr OpPC) { … }
inline bool This(InterpState &S, CodePtr OpPC) { … }
inline bool RVOPtr(InterpState &S, CodePtr OpPC) { … }
template <class LT, class RT, ShiftDir Dir>
inline bool DoShift(InterpState &S, CodePtr OpPC, LT &LHS, RT &RHS) { … }
template <PrimType NameL, PrimType NameR>
inline bool Shr(InterpState &S, CodePtr OpPC) { … }
template <PrimType NameL, PrimType NameR>
inline bool Shl(InterpState &S, CodePtr OpPC) { … }
static inline bool ShiftFixedPoint(InterpState &S, CodePtr OpPC, bool Left) { … }
inline bool NoRet(InterpState &S, CodePtr OpPC) { … }
inline bool NarrowPtr(InterpState &S, CodePtr OpPC) { … }
inline bool ExpandPtr(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool ArrayElemPtr(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool ArrayElemPtrPop(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool ArrayElem(InterpState &S, CodePtr OpPC, uint32_t Index) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool ArrayElemPop(InterpState &S, CodePtr OpPC, uint32_t Index) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool CopyArray(InterpState &S, CodePtr OpPC, uint32_t SrcIndex,
uint32_t DestIndex, uint32_t Size) { … }
inline bool ArrayDecay(InterpState &S, CodePtr OpPC) { … }
inline bool GetFnPtr(InterpState &S, CodePtr OpPC, const Function *Func) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool GetIntPtr(InterpState &S, CodePtr OpPC, const Descriptor *Desc) { … }
inline bool GetMemberPtr(InterpState &S, CodePtr OpPC, const ValueDecl *D) { … }
inline bool GetMemberPtrBase(InterpState &S, CodePtr OpPC) { … }
inline bool GetMemberPtrDecl(InterpState &S, CodePtr OpPC) { … }
inline bool Invalid(InterpState &S, CodePtr OpPC) { … }
inline bool Unsupported(InterpState &S, CodePtr OpPC) { … }
inline bool Error(InterpState &S, CodePtr OpPC) { … }
inline bool SideEffect(InterpState &S, CodePtr OpPC) { … }
inline bool InvalidCast(InterpState &S, CodePtr OpPC, CastKind Kind,
bool Fatal) { … }
inline bool InvalidDeclRef(InterpState &S, CodePtr OpPC,
const DeclRefExpr *DR) { … }
inline bool SizelessVectorElementSize(InterpState &S, CodePtr OpPC) { … }
inline bool Assume(InterpState &S, CodePtr OpPC) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool OffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E) { … }
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool CheckNonNullArg(InterpState &S, CodePtr OpPC) { … }
void diagnoseEnumValue(InterpState &S, CodePtr OpPC, const EnumDecl *ED,
const APSInt &Value);
template <PrimType Name, class T = typename PrimConv<Name>::T>
inline bool CheckEnumValue(InterpState &S, CodePtr OpPC, const EnumDecl *ED) { … }
template <PrimType TIn, PrimType TOut>
inline bool DecayPtr(InterpState &S, CodePtr OpPC) { … }
inline bool CheckDecl(InterpState &S, CodePtr OpPC, const VarDecl *VD) { … }
inline bool Alloc(InterpState &S, CodePtr OpPC, const Descriptor *Desc) { … }
template <PrimType Name, class SizeT = typename PrimConv<Name>::T>
inline bool AllocN(InterpState &S, CodePtr OpPC, PrimType T, const Expr *Source,
bool IsNoThrow) { … }
template <PrimType Name, class SizeT = typename PrimConv<Name>::T>
inline bool AllocCN(InterpState &S, CodePtr OpPC, const Descriptor *ElementDesc,
bool IsNoThrow) { … }
bool Free(InterpState &S, CodePtr OpPC, bool DeleteIsArrayForm,
bool IsGlobalDelete);
static inline bool IsConstantContext(InterpState &S, CodePtr OpPC) { … }
bool CheckNewTypeMismatch(InterpState &S, CodePtr OpPC, const Expr *E,
std::optional<uint64_t> ArraySize = std::nullopt);
template <PrimType Name, class T = typename PrimConv<Name>::T>
bool CheckNewTypeMismatchArray(InterpState &S, CodePtr OpPC, const Expr *E) { … }
bool InvalidNewDeleteExpr(InterpState &S, CodePtr OpPC, const Expr *E);
template <typename T> inline T ReadArg(InterpState &S, CodePtr &OpPC) { … }
template <> inline Floating ReadArg<Floating>(InterpState &S, CodePtr &OpPC) { … }
template <>
inline IntegralAP<false> ReadArg<IntegralAP<false>>(InterpState &S,
CodePtr &OpPC) { … }
template <>
inline IntegralAP<true> ReadArg<IntegralAP<true>>(InterpState &S,
CodePtr &OpPC) { … }
}
}
#endif