/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/AST/Interp/Interp.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===--- Interp.h - Interpreter for the constexpr VM ------------*- C++ -*-===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | // |
9 | | // Definition of the interpreter state and entry point. |
10 | | // |
11 | | //===----------------------------------------------------------------------===// |
12 | | |
13 | | #ifndef LLVM_CLANG_AST_INTERP_INTERP_H |
14 | | #define LLVM_CLANG_AST_INTERP_INTERP_H |
15 | | |
16 | | #include <limits> |
17 | | #include <vector> |
18 | | #include "Function.h" |
19 | | #include "InterpFrame.h" |
20 | | #include "InterpStack.h" |
21 | | #include "InterpState.h" |
22 | | #include "Opcode.h" |
23 | | #include "PrimType.h" |
24 | | #include "Program.h" |
25 | | #include "State.h" |
26 | | #include "clang/AST/ASTContext.h" |
27 | | #include "clang/AST/ASTDiagnostic.h" |
28 | | #include "clang/AST/CXXInheritance.h" |
29 | | #include "clang/AST/Expr.h" |
30 | | #include "llvm/ADT/APFloat.h" |
31 | | #include "llvm/ADT/APSInt.h" |
32 | | #include "llvm/Support/Endian.h" |
33 | | |
34 | | namespace clang { |
35 | | namespace interp { |
36 | | |
37 | | using APInt = llvm::APInt; |
38 | | using APSInt = llvm::APSInt; |
39 | | |
40 | | /// Convers a value to an APValue. |
41 | 0 | template <typename T> bool ReturnValue(const T &V, APValue &R) { |
42 | 0 | R = V.toAPValue(); |
43 | 0 | return true; |
44 | 0 | } Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<8u, true> >(clang::interp::Integral<8u, true> const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<8u, false> >(clang::interp::Integral<8u, false> const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<16u, true> >(clang::interp::Integral<16u, true> const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<16u, false> >(clang::interp::Integral<16u, false> const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<32u, true> >(clang::interp::Integral<32u, true> const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<32u, false> >(clang::interp::Integral<32u, false> const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<64u, true> >(clang::interp::Integral<64u, true> const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<64u, false> >(clang::interp::Integral<64u, false> const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Boolean>(clang::interp::Boolean const&, clang::APValue&) Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Pointer>(clang::interp::Pointer const&, clang::APValue&) |
45 | | |
46 | | /// Checks if the variable has externally defined storage. |
47 | | bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
48 | | |
49 | | /// Checks if the array is offsetable. |
50 | | bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
51 | | |
52 | | /// Checks if a pointer is live and accesible. |
53 | | bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
54 | | AccessKinds AK); |
55 | | /// Checks if a pointer is null. |
56 | | bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
57 | | CheckSubobjectKind CSK); |
58 | | |
59 | | /// Checks if a pointer is in range. |
60 | | bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
61 | | AccessKinds AK); |
62 | | |
63 | | /// Checks if a field from which a pointer is going to be derived is valid. |
64 | | bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
65 | | CheckSubobjectKind CSK); |
66 | | |
67 | | /// Checks if a pointer points to const storage. |
68 | | bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
69 | | |
70 | | /// Checks if a pointer points to a mutable field. |
71 | | bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
72 | | |
73 | | /// Checks if a value can be loaded from a block. |
74 | | bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
75 | | |
76 | | /// Checks if a value can be stored in a block. |
77 | | bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
78 | | |
79 | | /// Checks if a method can be invoked on an object. |
80 | | bool CheckInvoke(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
81 | | |
82 | | /// Checks if a value can be initialized. |
83 | | bool CheckInit(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
84 | | |
85 | | /// Checks if a method can be called. |
86 | | bool CheckCallable(InterpState &S, CodePtr OpPC, Function *F); |
87 | | |
88 | | /// Checks the 'this' pointer. |
89 | | bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This); |
90 | | |
91 | | /// Checks if a method is pure virtual. |
92 | | bool CheckPure(InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD); |
93 | | |
94 | | template <typename T> inline bool IsTrue(const T &V) { return !V.isZero(); } |
95 | | |
96 | | //===----------------------------------------------------------------------===// |
97 | | // Add, Sub, Mul |
98 | | //===----------------------------------------------------------------------===// |
99 | | |
100 | | template <typename T, bool (*OpFW)(T, T, unsigned, T *), |
101 | | template <typename U> class OpAP> |
102 | | bool AddSubMulHelper(InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS, |
103 | 0 | const T &RHS) { |
104 | | // Fast path - add the numbers with fixed width. |
105 | 0 | T Result; |
106 | 0 | if (!OpFW(LHS, RHS, Bits, &Result)) { |
107 | 0 | S.Stk.push<T>(Result); |
108 | 0 | return true; |
109 | 0 | } |
110 | | |
111 | | // If for some reason evaluation continues, use the truncated results. |
112 | 0 | S.Stk.push<T>(Result); |
113 | | |
114 | | // Slow path - compute the result using another bit of precision. |
115 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); |
116 | | |
117 | | // Report undefined behaviour, stopping if required. |
118 | 0 | const Expr *E = S.Current->getExpr(OpPC); |
119 | 0 | QualType Type = E->getType(); |
120 | 0 | if (S.checkingForUndefinedBehavior()) { |
121 | 0 | auto Trunc = Value.trunc(Result.bitWidth()).toString(10); |
122 | 0 | auto Loc = E->getExprLoc(); |
123 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type; |
124 | 0 | return true; |
125 | 0 | } else { |
126 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; |
127 | 0 | return S.noteUndefinedBehavior(); |
128 | 0 | } |
129 | 0 | } Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, true>, &(clang::interp::Integral<8u, true>::add(clang::interp::Integral<8u, true>, clang::interp::Integral<8u, true>, unsigned int, clang::interp::Integral<8u, true>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, false>, &(clang::interp::Integral<8u, false>::add(clang::interp::Integral<8u, false>, clang::interp::Integral<8u, false>, unsigned int, clang::interp::Integral<8u, false>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, true>, &(clang::interp::Integral<16u, true>::add(clang::interp::Integral<16u, true>, clang::interp::Integral<16u, true>, unsigned int, clang::interp::Integral<16u, true>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, false>, &(clang::interp::Integral<16u, false>::add(clang::interp::Integral<16u, false>, clang::interp::Integral<16u, false>, unsigned int, clang::interp::Integral<16u, false>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, true>, &(clang::interp::Integral<32u, true>::add(clang::interp::Integral<32u, true>, clang::interp::Integral<32u, true>, unsigned int, clang::interp::Integral<32u, true>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, false>, &(clang::interp::Integral<32u, false>::add(clang::interp::Integral<32u, false>, clang::interp::Integral<32u, false>, unsigned int, clang::interp::Integral<32u, false>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, true>, &(clang::interp::Integral<64u, true>::add(clang::interp::Integral<64u, true>, clang::interp::Integral<64u, true>, unsigned int, clang::interp::Integral<64u, true>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, false>, &(clang::interp::Integral<64u, false>::add(clang::interp::Integral<64u, false>, clang::interp::Integral<64u, false>, unsigned int, clang::interp::Integral<64u, false>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Boolean, &(clang::interp::Boolean::add(clang::interp::Boolean, clang::interp::Boolean, unsigned int, clang::interp::Boolean*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Boolean const&, clang::interp::Boolean const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, true>, &(clang::interp::Integral<8u, true>::mul(clang::interp::Integral<8u, true>, clang::interp::Integral<8u, true>, unsigned int, clang::interp::Integral<8u, true>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, false>, &(clang::interp::Integral<8u, false>::mul(clang::interp::Integral<8u, false>, clang::interp::Integral<8u, false>, unsigned int, clang::interp::Integral<8u, false>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, true>, &(clang::interp::Integral<16u, true>::mul(clang::interp::Integral<16u, true>, clang::interp::Integral<16u, true>, unsigned int, clang::interp::Integral<16u, true>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, false>, &(clang::interp::Integral<16u, false>::mul(clang::interp::Integral<16u, false>, clang::interp::Integral<16u, false>, unsigned int, clang::interp::Integral<16u, false>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, true>, &(clang::interp::Integral<32u, true>::mul(clang::interp::Integral<32u, true>, clang::interp::Integral<32u, true>, unsigned int, clang::interp::Integral<32u, true>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, false>, &(clang::interp::Integral<32u, false>::mul(clang::interp::Integral<32u, false>, clang::interp::Integral<32u, false>, unsigned int, clang::interp::Integral<32u, false>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, true>, &(clang::interp::Integral<64u, true>::mul(clang::interp::Integral<64u, true>, clang::interp::Integral<64u, true>, unsigned int, clang::interp::Integral<64u, true>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, false>, &(clang::interp::Integral<64u, false>::mul(clang::interp::Integral<64u, false>, clang::interp::Integral<64u, false>, unsigned int, clang::interp::Integral<64u, false>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Boolean, &(clang::interp::Boolean::mul(clang::interp::Boolean, clang::interp::Boolean, unsigned int, clang::interp::Boolean*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Boolean const&, clang::interp::Boolean const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, true>, &(clang::interp::Integral<8u, true>::sub(clang::interp::Integral<8u, true>, clang::interp::Integral<8u, true>, unsigned int, clang::interp::Integral<8u, true>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, false>, &(clang::interp::Integral<8u, false>::sub(clang::interp::Integral<8u, false>, clang::interp::Integral<8u, false>, unsigned int, clang::interp::Integral<8u, false>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, true>, &(clang::interp::Integral<16u, true>::sub(clang::interp::Integral<16u, true>, clang::interp::Integral<16u, true>, unsigned int, clang::interp::Integral<16u, true>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, false>, &(clang::interp::Integral<16u, false>::sub(clang::interp::Integral<16u, false>, clang::interp::Integral<16u, false>, unsigned int, clang::interp::Integral<16u, false>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, true>, &(clang::interp::Integral<32u, true>::sub(clang::interp::Integral<32u, true>, clang::interp::Integral<32u, true>, unsigned int, clang::interp::Integral<32u, true>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, false>, &(clang::interp::Integral<32u, false>::sub(clang::interp::Integral<32u, false>, clang::interp::Integral<32u, false>, unsigned int, clang::interp::Integral<32u, false>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, true>, &(clang::interp::Integral<64u, true>::sub(clang::interp::Integral<64u, true>, clang::interp::Integral<64u, true>, unsigned int, clang::interp::Integral<64u, true>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, true> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, false>, &(clang::interp::Integral<64u, false>::sub(clang::interp::Integral<64u, false>, clang::interp::Integral<64u, false>, unsigned int, clang::interp::Integral<64u, false>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, false> const&) Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Boolean, &(clang::interp::Boolean::sub(clang::interp::Boolean, clang::interp::Boolean, unsigned int, clang::interp::Boolean*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Boolean const&, clang::interp::Boolean const&) |
130 | | |
131 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
132 | 0 | bool Add(InterpState &S, CodePtr OpPC) { |
133 | 0 | const T &RHS = S.Stk.pop<T>(); |
134 | 0 | const T &LHS = S.Stk.pop<T>(); |
135 | 0 | const unsigned Bits = RHS.bitWidth() + 1; |
136 | 0 | return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS); |
137 | 0 | } Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
138 | | |
139 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
140 | 0 | bool Sub(InterpState &S, CodePtr OpPC) { |
141 | 0 | const T &RHS = S.Stk.pop<T>(); |
142 | 0 | const T &LHS = S.Stk.pop<T>(); |
143 | 0 | const unsigned Bits = RHS.bitWidth() + 1; |
144 | 0 | return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); |
145 | 0 | } Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
146 | | |
147 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
148 | 0 | bool Mul(InterpState &S, CodePtr OpPC) { |
149 | 0 | const T &RHS = S.Stk.pop<T>(); |
150 | 0 | const T &LHS = S.Stk.pop<T>(); |
151 | 0 | const unsigned Bits = RHS.bitWidth() * 2; |
152 | 0 | return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS); |
153 | 0 | } Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
154 | | |
155 | | //===----------------------------------------------------------------------===// |
156 | | // EQ, NE, GT, GE, LT, LE |
157 | | //===----------------------------------------------------------------------===// |
158 | | |
159 | | using CompareFn = llvm::function_ref<bool(ComparisonCategoryResult)>; |
160 | | |
161 | | template <typename T> |
162 | 0 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { |
163 | 0 | using BoolT = PrimConv<PT_Bool>::T; |
164 | 0 | const T &RHS = S.Stk.pop<T>(); |
165 | 0 | const T &LHS = S.Stk.pop<T>(); |
166 | 0 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); |
167 | 0 | return true; |
168 | 0 | } Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) |
169 | | |
170 | | template <typename T> |
171 | 0 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { |
172 | 0 | return CmpHelper<T>(S, OpPC, Fn); |
173 | 0 | } Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) |
174 | | |
175 | | template <> |
176 | 0 | inline bool CmpHelper<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) { |
177 | 0 | using BoolT = PrimConv<PT_Bool>::T; |
178 | 0 | const Pointer &RHS = S.Stk.pop<Pointer>(); |
179 | 0 | const Pointer &LHS = S.Stk.pop<Pointer>(); |
180 | |
|
181 | 0 | if (!Pointer::hasSameBase(LHS, RHS)) { |
182 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); |
183 | 0 | S.FFDiag(Loc, diag::note_invalid_subexpr_in_const_expr); |
184 | 0 | return false; |
185 | 0 | } else { |
186 | 0 | unsigned VL = LHS.getByteOffset(); |
187 | 0 | unsigned VR = RHS.getByteOffset(); |
188 | 0 | S.Stk.push<BoolT>(BoolT::from(Fn(Compare(VL, VR)))); |
189 | 0 | return true; |
190 | 0 | } |
191 | 0 | } |
192 | | |
193 | | template <> |
194 | 0 | inline bool CmpHelperEQ<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) { |
195 | 0 | using BoolT = PrimConv<PT_Bool>::T; |
196 | 0 | const Pointer &RHS = S.Stk.pop<Pointer>(); |
197 | 0 | const Pointer &LHS = S.Stk.pop<Pointer>(); |
198 | |
|
199 | 0 | if (LHS.isZero() && RHS.isZero()) { |
200 | 0 | S.Stk.push<BoolT>(BoolT::from(Fn(ComparisonCategoryResult::Equal))); |
201 | 0 | return true; |
202 | 0 | } |
203 | | |
204 | 0 | if (!Pointer::hasSameBase(LHS, RHS)) { |
205 | 0 | S.Stk.push<BoolT>(BoolT::from(Fn(ComparisonCategoryResult::Unordered))); |
206 | 0 | return true; |
207 | 0 | } else { |
208 | 0 | unsigned VL = LHS.getByteOffset(); |
209 | 0 | unsigned VR = RHS.getByteOffset(); |
210 | 0 | S.Stk.push<BoolT>(BoolT::from(Fn(Compare(VL, VR)))); |
211 | 0 | return true; |
212 | 0 | } |
213 | 0 | } |
214 | | |
215 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
216 | 0 | bool EQ(InterpState &S, CodePtr OpPC) { |
217 | 0 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { |
218 | 0 | return R == ComparisonCategoryResult::Equal; |
219 | 0 | }); Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
220 | 0 | } Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
221 | | |
222 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
223 | 0 | bool NE(InterpState &S, CodePtr OpPC) { |
224 | 0 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { |
225 | 0 | return R != ComparisonCategoryResult::Equal; |
226 | 0 | }); Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
227 | 0 | } Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
228 | | |
229 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
230 | 0 | bool LT(InterpState &S, CodePtr OpPC) { |
231 | 0 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { |
232 | 0 | return R == ComparisonCategoryResult::Less; |
233 | 0 | }); Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
234 | 0 | } Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
235 | | |
236 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
237 | 0 | bool LE(InterpState &S, CodePtr OpPC) { |
238 | 0 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { |
239 | 0 | return R == ComparisonCategoryResult::Less || |
240 | 0 | R == ComparisonCategoryResult::Equal; |
241 | 0 | }); Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
242 | 0 | } Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
243 | | |
244 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
245 | 0 | bool GT(InterpState &S, CodePtr OpPC) { |
246 | 0 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { |
247 | 0 | return R == ComparisonCategoryResult::Greater; |
248 | 0 | }); Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
249 | 0 | } Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
250 | | |
251 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
252 | 0 | bool GE(InterpState &S, CodePtr OpPC) { |
253 | 0 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { |
254 | 0 | return R == ComparisonCategoryResult::Greater || |
255 | 0 | R == ComparisonCategoryResult::Equal; |
256 | 0 | }); Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
257 | 0 | } Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
258 | | |
259 | | //===----------------------------------------------------------------------===// |
260 | | // InRange |
261 | | //===----------------------------------------------------------------------===// |
262 | | |
263 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
264 | | bool InRange(InterpState &S, CodePtr OpPC) { |
265 | | const T RHS = S.Stk.pop<T>(); |
266 | | const T LHS = S.Stk.pop<T>(); |
267 | | const T Value = S.Stk.pop<T>(); |
268 | | |
269 | | S.Stk.push<bool>(LHS <= Value && Value <= RHS); |
270 | | return true; |
271 | | } |
272 | | |
273 | | //===----------------------------------------------------------------------===// |
274 | | // Dup, Pop, Test |
275 | | //===----------------------------------------------------------------------===// |
276 | | |
277 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
278 | 0 | bool Dup(InterpState &S, CodePtr OpPC) { |
279 | 0 | S.Stk.push<T>(S.Stk.peek<T>()); |
280 | 0 | return true; |
281 | 0 | } Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
282 | | |
283 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
284 | 0 | bool Pop(InterpState &S, CodePtr OpPC) { |
285 | 0 | S.Stk.pop<T>(); |
286 | 0 | return true; |
287 | 0 | } Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
288 | | |
289 | | //===----------------------------------------------------------------------===// |
290 | | // Const |
291 | | //===----------------------------------------------------------------------===// |
292 | | |
293 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
294 | 0 | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { |
295 | 0 | S.Stk.push<T>(Arg); |
296 | 0 | return true; |
297 | 0 | } Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)8, bool>(clang::interp::InterpState&, clang::interp::CodePtr, bool const&) Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)2, short>(clang::interp::InterpState&, clang::interp::CodePtr, short const&) Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)4, int>(clang::interp::InterpState&, clang::interp::CodePtr, int const&) Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)6, long long>(clang::interp::InterpState&, clang::interp::CodePtr, long long const&) Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)0, signed char>(clang::interp::InterpState&, clang::interp::CodePtr, signed char const&) Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)3, unsigned short>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned short const&) Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)5, unsigned int>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int const&) Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)7, unsigned long long>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned long long const&) Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)1, unsigned char>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned char const&) |
298 | | |
299 | | //===----------------------------------------------------------------------===// |
300 | | // Get/Set Local/Param/Global/This |
301 | | //===----------------------------------------------------------------------===// |
302 | | |
303 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
304 | 0 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { |
305 | 0 | S.Stk.push<T>(S.Current->getLocal<T>(I)); |
306 | 0 | return true; |
307 | 0 | } Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
308 | | |
309 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
310 | 0 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { |
311 | 0 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); |
312 | 0 | return true; |
313 | 0 | } Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
314 | | |
315 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
316 | 1 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { |
317 | 1 | if (S.checkingPotentialConstantExpression()) { |
318 | 1 | return false; |
319 | 1 | } |
320 | 0 | S.Stk.push<T>(S.Current->getParam<T>(I)); |
321 | 0 | return true; |
322 | 0 | } Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::GetParam<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 316 | 1 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 317 | 1 | if (S.checkingPotentialConstantExpression()) { | 318 | 1 | return false; | 319 | 1 | } | 320 | 0 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 321 | 0 | return true; | 322 | 0 | } |
Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
323 | | |
324 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
325 | 0 | bool SetParam(InterpState &S, CodePtr OpPC, uint32_t I) { |
326 | 0 | S.Current->setParam<T>(I, S.Stk.pop<T>()); |
327 | 0 | return true; |
328 | 0 | } Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
329 | | |
330 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
331 | 0 | bool GetField(InterpState &S, CodePtr OpPC, uint32_t I) { |
332 | 0 | const Pointer &Obj = S.Stk.peek<Pointer>(); |
333 | 0 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) |
334 | 0 | return false; |
335 | 0 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) |
336 | 0 | return false; |
337 | 0 | const Pointer &Field = Obj.atField(I); |
338 | 0 | if (!CheckLoad(S, OpPC, Field)) |
339 | 0 | return false; |
340 | 0 | S.Stk.push<T>(Field.deref<T>()); |
341 | 0 | return true; |
342 | 0 | } Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
343 | | |
344 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
345 | 0 | bool SetField(InterpState &S, CodePtr OpPC, uint32_t I) { |
346 | 0 | const T &Value = S.Stk.pop<T>(); |
347 | 0 | const Pointer &Obj = S.Stk.peek<Pointer>(); |
348 | 0 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) |
349 | 0 | return false; |
350 | 0 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) |
351 | 0 | return false; |
352 | 0 | const Pointer &Field = Obj.atField(I); |
353 | 0 | if (!CheckStore(S, OpPC, Field)) |
354 | 0 | return false; |
355 | 0 | Field.deref<T>() = Value; |
356 | 0 | return true; |
357 | 0 | } Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
358 | | |
359 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
360 | 0 | bool GetFieldPop(InterpState &S, CodePtr OpPC, uint32_t I) { |
361 | 0 | const Pointer &Obj = S.Stk.pop<Pointer>(); |
362 | 0 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) |
363 | 0 | return false; |
364 | 0 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) |
365 | 0 | return false; |
366 | 0 | const Pointer &Field = Obj.atField(I); |
367 | 0 | if (!CheckLoad(S, OpPC, Field)) |
368 | 0 | return false; |
369 | 0 | S.Stk.push<T>(Field.deref<T>()); |
370 | 0 | return true; |
371 | 0 | } Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
372 | | |
373 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
374 | 0 | bool GetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { |
375 | 0 | if (S.checkingPotentialConstantExpression()) |
376 | 0 | return false; |
377 | 0 | const Pointer &This = S.Current->getThis(); |
378 | 0 | if (!CheckThis(S, OpPC, This)) |
379 | 0 | return false; |
380 | 0 | const Pointer &Field = This.atField(I); |
381 | 0 | if (!CheckLoad(S, OpPC, Field)) |
382 | 0 | return false; |
383 | 0 | S.Stk.push<T>(Field.deref<T>()); |
384 | 0 | return true; |
385 | 0 | } Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
386 | | |
387 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
388 | 0 | bool SetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { |
389 | 0 | if (S.checkingPotentialConstantExpression()) |
390 | 0 | return false; |
391 | 0 | const T &Value = S.Stk.pop<T>(); |
392 | 0 | const Pointer &This = S.Current->getThis(); |
393 | 0 | if (!CheckThis(S, OpPC, This)) |
394 | 0 | return false; |
395 | 0 | const Pointer &Field = This.atField(I); |
396 | 0 | if (!CheckStore(S, OpPC, Field)) |
397 | 0 | return false; |
398 | 0 | Field.deref<T>() = Value; |
399 | 0 | return true; |
400 | 0 | } Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
401 | | |
402 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
403 | 0 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { |
404 | 0 | auto *B = S.P.getGlobal(I); |
405 | 0 | if (B->isExtern()) |
406 | 0 | return false; |
407 | 0 | S.Stk.push<T>(B->deref<T>()); |
408 | 0 | return true; |
409 | 0 | } Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
410 | | |
411 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
412 | 0 | bool SetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { |
413 | | // TODO: emit warning. |
414 | 0 | return false; |
415 | 0 | } Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
416 | | |
417 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
418 | 0 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { |
419 | 0 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); |
420 | 0 | return true; |
421 | 0 | } Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
422 | | |
423 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
424 | 0 | bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) { |
425 | 0 | if (S.checkingPotentialConstantExpression()) |
426 | 0 | return false; |
427 | 0 | const Pointer &This = S.Current->getThis(); |
428 | 0 | if (!CheckThis(S, OpPC, This)) |
429 | 0 | return false; |
430 | 0 | const Pointer &Field = This.atField(I); |
431 | 0 | Field.deref<T>() = S.Stk.pop<T>(); |
432 | 0 | Field.initialize(); |
433 | 0 | return true; |
434 | 0 | } Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
435 | | |
436 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
437 | 0 | bool InitThisBitField(InterpState &S, CodePtr OpPC, const Record::Field *F) { |
438 | 0 | if (S.checkingPotentialConstantExpression()) |
439 | 0 | return false; |
440 | 0 | const Pointer &This = S.Current->getThis(); |
441 | 0 | if (!CheckThis(S, OpPC, This)) |
442 | 0 | return false; |
443 | 0 | const Pointer &Field = This.atField(F->Offset); |
444 | 0 | const auto &Value = S.Stk.pop<T>(); |
445 | 0 | Field.deref<T>() = Value.truncate(F->Decl->getBitWidthValue(S.getCtx())); |
446 | 0 | Field.initialize(); |
447 | 0 | return true; |
448 | 0 | } Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) |
449 | | |
450 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
451 | 0 | bool InitThisFieldActive(InterpState &S, CodePtr OpPC, uint32_t I) { |
452 | 0 | if (S.checkingPotentialConstantExpression()) |
453 | 0 | return false; |
454 | 0 | const Pointer &This = S.Current->getThis(); |
455 | 0 | if (!CheckThis(S, OpPC, This)) |
456 | 0 | return false; |
457 | 0 | const Pointer &Field = This.atField(I); |
458 | 0 | Field.deref<T>() = S.Stk.pop<T>(); |
459 | 0 | Field.activate(); |
460 | 0 | Field.initialize(); |
461 | 0 | return true; |
462 | 0 | } Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
463 | | |
464 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
465 | 0 | bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) { |
466 | 0 | const T &Value = S.Stk.pop<T>(); |
467 | 0 | const Pointer &Field = S.Stk.pop<Pointer>().atField(I); |
468 | 0 | Field.deref<T>() = Value; |
469 | 0 | Field.activate(); |
470 | 0 | Field.initialize(); |
471 | 0 | return true; |
472 | 0 | } Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
473 | | |
474 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
475 | 0 | bool InitBitField(InterpState &S, CodePtr OpPC, const Record::Field *F) { |
476 | 0 | const T &Value = S.Stk.pop<T>(); |
477 | 0 | const Pointer &Field = S.Stk.pop<Pointer>().atField(F->Offset); |
478 | 0 | Field.deref<T>() = Value.truncate(F->Decl->getBitWidthValue(S.getCtx())); |
479 | 0 | Field.activate(); |
480 | 0 | Field.initialize(); |
481 | 0 | return true; |
482 | 0 | } Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*) |
483 | | |
484 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
485 | 0 | bool InitFieldActive(InterpState &S, CodePtr OpPC, uint32_t I) { |
486 | 0 | const T &Value = S.Stk.pop<T>(); |
487 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
488 | 0 | const Pointer &Field = Ptr.atField(I); |
489 | 0 | Field.deref<T>() = Value; |
490 | 0 | Field.activate(); |
491 | 0 | Field.initialize(); |
492 | 0 | return true; |
493 | 0 | } Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
494 | | |
495 | | //===----------------------------------------------------------------------===// |
496 | | // GetPtr Local/Param/Global/Field/This |
497 | | //===----------------------------------------------------------------------===// |
498 | | |
499 | 0 | inline bool GetPtrLocal(InterpState &S, CodePtr OpPC, uint32_t I) { |
500 | 0 | S.Stk.push<Pointer>(S.Current->getLocalPointer(I)); |
501 | 0 | return true; |
502 | 0 | } |
503 | | |
504 | 0 | inline bool GetPtrParam(InterpState &S, CodePtr OpPC, uint32_t I) { |
505 | 0 | if (S.checkingPotentialConstantExpression()) { |
506 | 0 | return false; |
507 | 0 | } |
508 | 0 | S.Stk.push<Pointer>(S.Current->getParamPointer(I)); |
509 | 0 | return true; |
510 | 0 | } |
511 | | |
512 | 0 | inline bool GetPtrGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { |
513 | 0 | S.Stk.push<Pointer>(S.P.getPtrGlobal(I)); |
514 | 0 | return true; |
515 | 0 | } |
516 | | |
517 | 0 | inline bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off) { |
518 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
519 | 0 | if (!CheckNull(S, OpPC, Ptr, CSK_Field)) |
520 | 0 | return false; |
521 | 0 | if (!CheckExtern(S, OpPC, Ptr)) |
522 | 0 | return false; |
523 | 0 | if (!CheckRange(S, OpPC, Ptr, CSK_Field)) |
524 | 0 | return false; |
525 | 0 | S.Stk.push<Pointer>(Ptr.atField(Off)); |
526 | 0 | return true; |
527 | 0 | } |
528 | | |
529 | 0 | inline bool GetPtrThisField(InterpState &S, CodePtr OpPC, uint32_t Off) { |
530 | 0 | if (S.checkingPotentialConstantExpression()) |
531 | 0 | return false; |
532 | 0 | const Pointer &This = S.Current->getThis(); |
533 | 0 | if (!CheckThis(S, OpPC, This)) |
534 | 0 | return false; |
535 | 0 | S.Stk.push<Pointer>(This.atField(Off)); |
536 | 0 | return true; |
537 | 0 | } |
538 | | |
539 | 0 | inline bool GetPtrActiveField(InterpState &S, CodePtr OpPC, uint32_t Off) { |
540 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
541 | 0 | if (!CheckNull(S, OpPC, Ptr, CSK_Field)) |
542 | 0 | return false; |
543 | 0 | if (!CheckRange(S, OpPC, Ptr, CSK_Field)) |
544 | 0 | return false; |
545 | 0 | Pointer Field = Ptr.atField(Off); |
546 | 0 | Ptr.deactivate(); |
547 | 0 | Field.activate(); |
548 | 0 | S.Stk.push<Pointer>(std::move(Field)); |
549 | 0 | return true; |
550 | 0 | } |
551 | | |
552 | 0 | inline bool GetPtrActiveThisField(InterpState &S, CodePtr OpPC, uint32_t Off) { |
553 | 0 | if (S.checkingPotentialConstantExpression()) |
554 | 0 | return false; |
555 | 0 | const Pointer &This = S.Current->getThis(); |
556 | 0 | if (!CheckThis(S, OpPC, This)) |
557 | 0 | return false; |
558 | 0 | Pointer Field = This.atField(Off); |
559 | 0 | This.deactivate(); |
560 | 0 | Field.activate(); |
561 | 0 | S.Stk.push<Pointer>(std::move(Field)); |
562 | 0 | return true; |
563 | 0 | } |
564 | | |
565 | 0 | inline bool GetPtrBase(InterpState &S, CodePtr OpPC, uint32_t Off) { |
566 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
567 | 0 | if (!CheckNull(S, OpPC, Ptr, CSK_Base)) |
568 | 0 | return false; |
569 | 0 | S.Stk.push<Pointer>(Ptr.atField(Off)); |
570 | 0 | return true; |
571 | 0 | } |
572 | | |
573 | 0 | inline bool GetPtrThisBase(InterpState &S, CodePtr OpPC, uint32_t Off) { |
574 | 0 | if (S.checkingPotentialConstantExpression()) |
575 | 0 | return false; |
576 | 0 | const Pointer &This = S.Current->getThis(); |
577 | 0 | if (!CheckThis(S, OpPC, This)) |
578 | 0 | return false; |
579 | 0 | S.Stk.push<Pointer>(This.atField(Off)); |
580 | 0 | return true; |
581 | 0 | } |
582 | | |
583 | | inline bool VirtBaseHelper(InterpState &S, CodePtr OpPC, const RecordDecl *Decl, |
584 | 0 | const Pointer &Ptr) { |
585 | 0 | Pointer Base = Ptr; |
586 | 0 | while (Base.isBaseClass()) |
587 | 0 | Base = Base.getBase(); |
588 | |
|
589 | 0 | auto *Field = Base.getRecord()->getVirtualBase(Decl); |
590 | 0 | S.Stk.push<Pointer>(Base.atField(Field->Offset)); |
591 | 0 | return true; |
592 | 0 | } |
593 | | |
594 | 0 | inline bool GetPtrVirtBase(InterpState &S, CodePtr OpPC, const RecordDecl *D) { |
595 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
596 | 0 | if (!CheckNull(S, OpPC, Ptr, CSK_Base)) |
597 | 0 | return false; |
598 | 0 | return VirtBaseHelper(S, OpPC, D, Ptr); |
599 | 0 | } |
600 | | |
601 | | inline bool GetPtrThisVirtBase(InterpState &S, CodePtr OpPC, |
602 | 0 | const RecordDecl *D) { |
603 | 0 | if (S.checkingPotentialConstantExpression()) |
604 | 0 | return false; |
605 | 0 | const Pointer &This = S.Current->getThis(); |
606 | 0 | if (!CheckThis(S, OpPC, This)) |
607 | 0 | return false; |
608 | 0 | return VirtBaseHelper(S, OpPC, D, S.Current->getThis()); |
609 | 0 | } |
610 | | |
611 | | //===----------------------------------------------------------------------===// |
612 | | // Load, Store, Init |
613 | | //===----------------------------------------------------------------------===// |
614 | | |
615 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
616 | 0 | bool Load(InterpState &S, CodePtr OpPC) { |
617 | 0 | const Pointer &Ptr = S.Stk.peek<Pointer>(); |
618 | 0 | if (!CheckLoad(S, OpPC, Ptr)) |
619 | 0 | return false; |
620 | 0 | S.Stk.push<T>(Ptr.deref<T>()); |
621 | 0 | return true; |
622 | 0 | } Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
623 | | |
624 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
625 | 0 | bool LoadPop(InterpState &S, CodePtr OpPC) { |
626 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
627 | 0 | if (!CheckLoad(S, OpPC, Ptr)) |
628 | 0 | return false; |
629 | 0 | S.Stk.push<T>(Ptr.deref<T>()); |
630 | 0 | return true; |
631 | 0 | } Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
632 | | |
633 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
634 | 0 | bool Store(InterpState &S, CodePtr OpPC) { |
635 | 0 | const T &Value = S.Stk.pop<T>(); |
636 | 0 | const Pointer &Ptr = S.Stk.peek<Pointer>(); |
637 | 0 | if (!CheckStore(S, OpPC, Ptr)) |
638 | 0 | return false; |
639 | 0 | Ptr.deref<T>() = Value; |
640 | 0 | return true; |
641 | 0 | } Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
642 | | |
643 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
644 | 0 | bool StorePop(InterpState &S, CodePtr OpPC) { |
645 | 0 | const T &Value = S.Stk.pop<T>(); |
646 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
647 | 0 | if (!CheckStore(S, OpPC, Ptr)) |
648 | 0 | return false; |
649 | 0 | Ptr.deref<T>() = Value; |
650 | 0 | return true; |
651 | 0 | } Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
652 | | |
653 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
654 | 0 | bool StoreBitField(InterpState &S, CodePtr OpPC) { |
655 | 0 | const T &Value = S.Stk.pop<T>(); |
656 | 0 | const Pointer &Ptr = S.Stk.peek<Pointer>(); |
657 | 0 | if (!CheckStore(S, OpPC, Ptr)) |
658 | 0 | return false; |
659 | 0 | if (auto *FD = Ptr.getField()) { |
660 | 0 | Ptr.deref<T>() = Value.truncate(FD->getBitWidthValue(S.getCtx())); |
661 | 0 | } else { |
662 | 0 | Ptr.deref<T>() = Value; |
663 | 0 | } |
664 | 0 | return true; |
665 | 0 | } Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
666 | | |
667 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
668 | 0 | bool StoreBitFieldPop(InterpState &S, CodePtr OpPC) { |
669 | 0 | const T &Value = S.Stk.pop<T>(); |
670 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
671 | 0 | if (!CheckStore(S, OpPC, Ptr)) |
672 | 0 | return false; |
673 | 0 | if (auto *FD = Ptr.getField()) { |
674 | 0 | Ptr.deref<T>() = Value.truncate(FD->getBitWidthValue(S.getCtx())); |
675 | 0 | } else { |
676 | 0 | Ptr.deref<T>() = Value; |
677 | 0 | } |
678 | 0 | return true; |
679 | 0 | } Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
680 | | |
681 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
682 | 0 | bool InitPop(InterpState &S, CodePtr OpPC) { |
683 | 0 | const T &Value = S.Stk.pop<T>(); |
684 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
685 | 0 | if (!CheckInit(S, OpPC, Ptr)) |
686 | 0 | return false; |
687 | 0 | Ptr.initialize(); |
688 | 0 | new (&Ptr.deref<T>()) T(Value); |
689 | 0 | return true; |
690 | 0 | } Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
691 | | |
692 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
693 | 0 | bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) { |
694 | 0 | const T &Value = S.Stk.pop<T>(); |
695 | 0 | const Pointer &Ptr = S.Stk.peek<Pointer>().atIndex(Idx); |
696 | 0 | if (!CheckInit(S, OpPC, Ptr)) |
697 | 0 | return false; |
698 | 0 | Ptr.initialize(); |
699 | 0 | new (&Ptr.deref<T>()) T(Value); |
700 | 0 | return true; |
701 | 0 | } Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
702 | | |
703 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
704 | 0 | bool InitElemPop(InterpState &S, CodePtr OpPC, uint32_t Idx) { |
705 | 0 | const T &Value = S.Stk.pop<T>(); |
706 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>().atIndex(Idx); |
707 | 0 | if (!CheckInit(S, OpPC, Ptr)) |
708 | 0 | return false; |
709 | 0 | Ptr.initialize(); |
710 | 0 | new (&Ptr.deref<T>()) T(Value); |
711 | 0 | return true; |
712 | 0 | } Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)9, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
713 | | |
714 | | //===----------------------------------------------------------------------===// |
715 | | // AddOffset, SubOffset |
716 | | //===----------------------------------------------------------------------===// |
717 | | |
718 | 0 | template <class T, bool Add> bool OffsetHelper(InterpState &S, CodePtr OpPC) { |
719 | | // Fetch the pointer and the offset. |
720 | 0 | const T &Offset = S.Stk.pop<T>(); |
721 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
722 | 0 | if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex)) |
723 | 0 | return false; |
724 | 0 | if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer)) |
725 | 0 | return false; |
726 | | |
727 | | // Get a version of the index comparable to the type. |
728 | 0 | T Index = T::from(Ptr.getIndex(), Offset.bitWidth()); |
729 | | // A zero offset does not change the pointer, but in the case of an array |
730 | | // it has to be adjusted to point to the first element instead of the array. |
731 | 0 | if (Offset.isZero()) { |
732 | 0 | S.Stk.push<Pointer>(Index.isZero() ? Ptr.atIndex(0) : Ptr); |
733 | 0 | return true; |
734 | 0 | } |
735 | | // Arrays of unknown bounds cannot have pointers into them. |
736 | 0 | if (!CheckArray(S, OpPC, Ptr)) |
737 | 0 | return false; |
738 | | |
739 | | // Compute the largest index into the array. |
740 | 0 | unsigned MaxIndex = Ptr.getNumElems(); |
741 | | |
742 | | // Helper to report an invalid offset, computed as APSInt. |
743 | 0 | auto InvalidOffset = [&]() { |
744 | 0 | const unsigned Bits = Offset.bitWidth(); |
745 | 0 | APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false); |
746 | 0 | APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false); |
747 | 0 | APSInt NewIndex = Add ? (APIndex + APOffset) : (APIndex - APOffset); |
748 | 0 | S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index) |
749 | 0 | << NewIndex |
750 | 0 | << /*array*/ static_cast<int>(!Ptr.inArray()) |
751 | 0 | << static_cast<unsigned>(MaxIndex); |
752 | 0 | return false; |
753 | 0 | }; Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, true>, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, false>, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, true>, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, false>, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, true>, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, false>, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, true>, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, false>, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Boolean, true>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, true>, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, false>, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, true>, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, false>, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, true>, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, false>, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, true>, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, false>, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Boolean, false>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'()::operator()() const |
754 | | |
755 | | // If the new offset would be negative, bail out. |
756 | 0 | if (Add && Offset.isNegative() && (Offset.isMin() || -Offset > Index)) |
757 | 0 | return InvalidOffset(); |
758 | 0 | if (!Add && Offset.isPositive() && Index < Offset) |
759 | 0 | return InvalidOffset(); |
760 | | |
761 | | // If the new offset would be out of bounds, bail out. |
762 | 0 | unsigned MaxOffset = MaxIndex - Ptr.getIndex(); |
763 | 0 | if (Add && Offset.isPositive() && Offset > MaxOffset) |
764 | 0 | return InvalidOffset(); |
765 | 0 | if (!Add && Offset.isNegative() && (Offset.isMin() || -Offset > MaxOffset)) |
766 | 0 | return InvalidOffset(); |
767 | | |
768 | | // Offset is valid - compute it on unsigned. |
769 | 0 | int64_t WideIndex = static_cast<int64_t>(Index); |
770 | 0 | int64_t WideOffset = static_cast<int64_t>(Offset); |
771 | 0 | int64_t Result = Add ? (WideIndex + WideOffset) : (WideIndex - WideOffset); |
772 | 0 | S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result))); |
773 | 0 | return true; |
774 | 0 | } Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, true>, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, false>, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, true>, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, false>, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, true>, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, false>, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, true>, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, false>, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Boolean, true>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, true>, false>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, false>, false>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, true>, false>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, false>, false>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, true>, false>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, false>, false>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, true>, false>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, false>, false>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Boolean, false>(clang::interp::InterpState&, clang::interp::CodePtr) |
775 | | |
776 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
777 | 0 | bool AddOffset(InterpState &S, CodePtr OpPC) { |
778 | 0 | return OffsetHelper<T, true>(S, OpPC); |
779 | 0 | } Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
780 | | |
781 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
782 | 0 | bool SubOffset(InterpState &S, CodePtr OpPC) { |
783 | 0 | return OffsetHelper<T, false>(S, OpPC); |
784 | 0 | } Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::SubOffset<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
785 | | |
786 | | |
787 | | //===----------------------------------------------------------------------===// |
788 | | // Destroy |
789 | | //===----------------------------------------------------------------------===// |
790 | | |
791 | 0 | inline bool Destroy(InterpState &S, CodePtr OpPC, uint32_t I) { |
792 | 0 | S.Current->destroy(I); |
793 | 0 | return true; |
794 | 0 | } |
795 | | |
796 | | //===----------------------------------------------------------------------===// |
797 | | // Cast, CastFP |
798 | | //===----------------------------------------------------------------------===// |
799 | | |
800 | | template <PrimType TIn, PrimType TOut> bool Cast(InterpState &S, CodePtr OpPC) { |
801 | | using T = typename PrimConv<TIn>::T; |
802 | | using U = typename PrimConv<TOut>::T; |
803 | | S.Stk.push<U>(U::from(S.Stk.pop<T>())); |
804 | | return true; |
805 | | } |
806 | | |
807 | | //===----------------------------------------------------------------------===// |
808 | | // Zero, Nullptr |
809 | | //===----------------------------------------------------------------------===// |
810 | | |
811 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
812 | 0 | bool Zero(InterpState &S, CodePtr OpPC) { |
813 | 0 | S.Stk.push<T>(T::zero()); |
814 | 0 | return true; |
815 | 0 | } Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Zero<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
816 | | |
817 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
818 | 0 | inline bool Null(InterpState &S, CodePtr OpPC) { |
819 | 0 | S.Stk.push<T>(); |
820 | 0 | return true; |
821 | 0 | } |
822 | | |
823 | | //===----------------------------------------------------------------------===// |
824 | | // This, ImplicitThis |
825 | | //===----------------------------------------------------------------------===// |
826 | | |
827 | 0 | inline bool This(InterpState &S, CodePtr OpPC) { |
828 | | // Cannot read 'this' in this mode. |
829 | 0 | if (S.checkingPotentialConstantExpression()) { |
830 | 0 | return false; |
831 | 0 | } |
832 | | |
833 | 0 | const Pointer &This = S.Current->getThis(); |
834 | 0 | if (!CheckThis(S, OpPC, This)) |
835 | 0 | return false; |
836 | | |
837 | 0 | S.Stk.push<Pointer>(This); |
838 | 0 | return true; |
839 | 0 | } |
840 | | |
841 | | //===----------------------------------------------------------------------===// |
842 | | // Shr, Shl |
843 | | //===----------------------------------------------------------------------===// |
844 | | |
845 | | template <PrimType TR, PrimType TL, class T = typename PrimConv<TR>::T> |
846 | | unsigned Trunc(InterpState &S, CodePtr OpPC, unsigned Bits, const T &V) { |
847 | | // C++11 [expr.shift]p1: Shift width must be less than the bit width of |
848 | | // the shifted type. |
849 | | if (Bits > 1 && V >= T::from(Bits, V.bitWidth())) { |
850 | | const Expr *E = S.Current->getExpr(OpPC); |
851 | | const APSInt Val = V.toAPSInt(); |
852 | | QualType Ty = E->getType(); |
853 | | S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits; |
854 | | return Bits; |
855 | | } else { |
856 | | return static_cast<unsigned>(V); |
857 | | } |
858 | | } |
859 | | |
860 | | template <PrimType TL, PrimType TR, typename T = typename PrimConv<TL>::T> |
861 | | inline bool ShiftRight(InterpState &S, CodePtr OpPC, const T &V, unsigned RHS) { |
862 | | if (RHS >= V.bitWidth()) { |
863 | | S.Stk.push<T>(T::from(0, V.bitWidth())); |
864 | | } else { |
865 | | S.Stk.push<T>(T::from(V >> RHS, V.bitWidth())); |
866 | | } |
867 | | return true; |
868 | | } |
869 | | |
870 | | template <PrimType TL, PrimType TR, typename T = typename PrimConv<TL>::T> |
871 | | inline bool ShiftLeft(InterpState &S, CodePtr OpPC, const T &V, unsigned RHS) { |
872 | | if (V.isSigned() && !S.getLangOpts().CPlusPlus20) { |
873 | | // C++11 [expr.shift]p2: A signed left shift must have a non-negative |
874 | | // operand, and must not overflow the corresponding unsigned type. |
875 | | // C++2a [expr.shift]p2: E1 << E2 is the unique value congruent to |
876 | | // E1 x 2^E2 module 2^N. |
877 | | if (V.isNegative()) { |
878 | | const Expr *E = S.Current->getExpr(OpPC); |
879 | | S.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << V.toAPSInt(); |
880 | | } else if (V.countLeadingZeros() < RHS) { |
881 | | S.CCEDiag(S.Current->getExpr(OpPC), diag::note_constexpr_lshift_discards); |
882 | | } |
883 | | } |
884 | | |
885 | | if (V.bitWidth() == 1) { |
886 | | S.Stk.push<T>(V); |
887 | | } else if (RHS >= V.bitWidth()) { |
888 | | S.Stk.push<T>(T::from(0, V.bitWidth())); |
889 | | } else { |
890 | | S.Stk.push<T>(T::from(V.toUnsigned() << RHS, V.bitWidth())); |
891 | | } |
892 | | return true; |
893 | | } |
894 | | |
895 | | template <PrimType TL, PrimType TR> |
896 | | inline bool Shr(InterpState &S, CodePtr OpPC) { |
897 | | const auto &RHS = S.Stk.pop<typename PrimConv<TR>::T>(); |
898 | | const auto &LHS = S.Stk.pop<typename PrimConv<TL>::T>(); |
899 | | const unsigned Bits = LHS.bitWidth(); |
900 | | |
901 | | if (RHS.isSigned() && RHS.isNegative()) { |
902 | | const SourceInfo &Loc = S.Current->getSource(OpPC); |
903 | | S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); |
904 | | return ShiftLeft<TL, TR>(S, OpPC, LHS, Trunc<TR, TL>(S, OpPC, Bits, -RHS)); |
905 | | } else { |
906 | | return ShiftRight<TL, TR>(S, OpPC, LHS, Trunc<TR, TL>(S, OpPC, Bits, RHS)); |
907 | | } |
908 | | } |
909 | | |
910 | | template <PrimType TL, PrimType TR> |
911 | | inline bool Shl(InterpState &S, CodePtr OpPC) { |
912 | | const auto &RHS = S.Stk.pop<typename PrimConv<TR>::T>(); |
913 | | const auto &LHS = S.Stk.pop<typename PrimConv<TL>::T>(); |
914 | | const unsigned Bits = LHS.bitWidth(); |
915 | | |
916 | | if (RHS.isSigned() && RHS.isNegative()) { |
917 | | const SourceInfo &Loc = S.Current->getSource(OpPC); |
918 | | S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); |
919 | | return ShiftRight<TL, TR>(S, OpPC, LHS, Trunc<TR, TL>(S, OpPC, Bits, -RHS)); |
920 | | } else { |
921 | | return ShiftLeft<TL, TR>(S, OpPC, LHS, Trunc<TR, TL>(S, OpPC, Bits, RHS)); |
922 | | } |
923 | | } |
924 | | |
925 | | //===----------------------------------------------------------------------===// |
926 | | // NoRet |
927 | | //===----------------------------------------------------------------------===// |
928 | | |
929 | 0 | inline bool NoRet(InterpState &S, CodePtr OpPC) { |
930 | 0 | SourceLocation EndLoc = S.Current->getCallee()->getEndLoc(); |
931 | 0 | S.FFDiag(EndLoc, diag::note_constexpr_no_return); |
932 | 0 | return false; |
933 | 0 | } |
934 | | |
935 | | //===----------------------------------------------------------------------===// |
936 | | // NarrowPtr, ExpandPtr |
937 | | //===----------------------------------------------------------------------===// |
938 | | |
939 | 0 | inline bool NarrowPtr(InterpState &S, CodePtr OpPC) { |
940 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
941 | 0 | S.Stk.push<Pointer>(Ptr.narrow()); |
942 | 0 | return true; |
943 | 0 | } |
944 | | |
945 | 0 | inline bool ExpandPtr(InterpState &S, CodePtr OpPC) { |
946 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
947 | 0 | S.Stk.push<Pointer>(Ptr.expand()); |
948 | 0 | return true; |
949 | 0 | } |
950 | | |
951 | | /// Interpreter entry point. |
952 | | bool Interpret(InterpState &S, APValue &Result); |
953 | | |
954 | | } // namespace interp |
955 | | } // namespace clang |
956 | | |
957 | | #endif |