diff options
Diffstat (limited to 'clang/lib/AST/ByteCode/Interp.h')
-rw-r--r-- | clang/lib/AST/ByteCode/Interp.h | 63 |
1 files changed, 8 insertions, 55 deletions
diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h index 8461d1e..d2aec69 100644 --- a/clang/lib/AST/ByteCode/Interp.h +++ b/clang/lib/AST/ByteCode/Interp.h @@ -1526,61 +1526,8 @@ inline bool GetPtrGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { /// 1) Peeks a Pointer /// 2) Pushes Pointer.atField(Off) on the stack -inline bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off) { - const Pointer &Ptr = S.Stk.peek<Pointer>(); - - if (S.getLangOpts().CPlusPlus && S.inConstantContext() && - !CheckNull(S, OpPC, Ptr, CSK_Field)) - return false; - - if (!CheckExtern(S, OpPC, Ptr)) - return false; - if (!CheckRange(S, OpPC, Ptr, CSK_Field)) - return false; - if (!CheckArray(S, OpPC, Ptr)) - return false; - if (!CheckSubobject(S, OpPC, Ptr, CSK_Field)) - return false; - - if (Ptr.isBlockPointer() && Off > Ptr.block()->getSize()) - return false; - - if (Ptr.isIntegralPointer()) { - S.Stk.push<Pointer>(Ptr.asIntPointer().atOffset(S.getASTContext(), Off)); - return true; - } - - S.Stk.push<Pointer>(Ptr.atField(Off)); - return true; -} - -inline bool GetPtrFieldPop(InterpState &S, CodePtr OpPC, uint32_t Off) { - const Pointer &Ptr = S.Stk.pop<Pointer>(); - - if (S.getLangOpts().CPlusPlus && S.inConstantContext() && - !CheckNull(S, OpPC, Ptr, CSK_Field)) - return false; - - if (!CheckExtern(S, OpPC, Ptr)) - return false; - if (!CheckRange(S, OpPC, Ptr, CSK_Field)) - return false; - if (!CheckArray(S, OpPC, Ptr)) - return false; - if (!CheckSubobject(S, OpPC, Ptr, CSK_Field)) - return false; - - if (Ptr.isBlockPointer() && Off > Ptr.block()->getSize()) - return false; - - if (Ptr.isIntegralPointer()) { - S.Stk.push<Pointer>(Ptr.asIntPointer().atOffset(S.getASTContext(), Off)); - return true; - } - - S.Stk.push<Pointer>(Ptr.atField(Off)); - return true; -} +bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off); +bool GetPtrFieldPop(InterpState &S, CodePtr OpPC, uint32_t Off); inline bool GetPtrThisField(InterpState &S, CodePtr OpPC, uint32_t Off) { if (S.checkingPotentialConstantExpression()) @@ -3087,6 +3034,12 @@ inline bool BitCast(InterpState &S, CodePtr OpPC) { return true; } +/// Typeid support. +bool GetTypeid(InterpState &S, CodePtr OpPC, const Type *TypePtr, + const Type *TypeInfoType); +bool GetTypeidPtr(InterpState &S, CodePtr OpPC, const Type *TypeInfoType); +bool DiagTypeid(InterpState &S, CodePtr OpPC); + //===----------------------------------------------------------------------===// // Read opcode arguments //===----------------------------------------------------------------------===// |