diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:31:57 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:33:27 +0900 |
commit | df025ebf872052c0761d44a3ef9b65e9675af8a8 (patch) | |
tree | 9b4e94583e2536546d6606270bcdf846c95e1ba2 /clang/lib/AST/ByteCode/Interp.h | |
parent | 4428c9d0b1344179f85a72e183a44796976521e3 (diff) | |
parent | bdcf47e4bcb92889665825654bb80a8bbe30379e (diff) | |
download | llvm-users/chapuni/cov/single/loop.zip llvm-users/chapuni/cov/single/loop.tar.gz llvm-users/chapuni/cov/single/loop.tar.bz2 |
Merge branch 'users/chapuni/cov/single/base' into users/chapuni/cov/single/loopusers/chapuni/cov/single/loop
Conflicts:
clang/lib/CodeGen/CoverageMappingGen.cpp
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 //===----------------------------------------------------------------------===// |