/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 "Boolean.h" |
17 | | #include "Floating.h" |
18 | | #include "Function.h" |
19 | | #include "FunctionPointer.h" |
20 | | #include "InterpFrame.h" |
21 | | #include "InterpStack.h" |
22 | | #include "InterpState.h" |
23 | | #include "Opcode.h" |
24 | | #include "PrimType.h" |
25 | | #include "Program.h" |
26 | | #include "State.h" |
27 | | #include "clang/AST/ASTContext.h" |
28 | | #include "clang/AST/ASTDiagnostic.h" |
29 | | #include "clang/AST/CXXInheritance.h" |
30 | | #include "clang/AST/Expr.h" |
31 | | #include "llvm/ADT/APFloat.h" |
32 | | #include "llvm/ADT/APSInt.h" |
33 | | #include "llvm/Support/Endian.h" |
34 | | #include <limits> |
35 | | #include <type_traits> |
36 | | |
37 | | namespace clang { |
38 | | namespace interp { |
39 | | |
40 | | using APInt = llvm::APInt; |
41 | | using APSInt = llvm::APSInt; |
42 | | |
43 | | /// Convert a value to an APValue. |
44 | 11.7k | template <typename T> bool ReturnValue(const T &V, APValue &R) { |
45 | 11.7k | R = V.toAPValue(); |
46 | 11.7k | return true; |
47 | 11.7k | } bool clang::interp::ReturnValue<clang::interp::Integral<8u, true> >(clang::interp::Integral<8u, true> const&, clang::APValue&) Line | Count | Source | 44 | 445 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 445 | R = V.toAPValue(); | 46 | 445 | return true; | 47 | 445 | } |
bool clang::interp::ReturnValue<clang::interp::Integral<8u, false> >(clang::interp::Integral<8u, false> const&, clang::APValue&) Line | Count | Source | 44 | 4 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 4 | R = V.toAPValue(); | 46 | 4 | return true; | 47 | 4 | } |
bool clang::interp::ReturnValue<clang::interp::Integral<16u, true> >(clang::interp::Integral<16u, true> const&, clang::APValue&) Line | Count | Source | 44 | 217 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 217 | R = V.toAPValue(); | 46 | 217 | return true; | 47 | 217 | } |
bool clang::interp::ReturnValue<clang::interp::Integral<16u, false> >(clang::interp::Integral<16u, false> const&, clang::APValue&) Line | Count | Source | 44 | 32 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 32 | R = V.toAPValue(); | 46 | 32 | return true; | 47 | 32 | } |
bool clang::interp::ReturnValue<clang::interp::Integral<32u, true> >(clang::interp::Integral<32u, true> const&, clang::APValue&) Line | Count | Source | 44 | 5.18k | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 5.18k | R = V.toAPValue(); | 46 | 5.18k | return true; | 47 | 5.18k | } |
bool clang::interp::ReturnValue<clang::interp::Integral<32u, false> >(clang::interp::Integral<32u, false> const&, clang::APValue&) Line | Count | Source | 44 | 850 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 850 | R = V.toAPValue(); | 46 | 850 | return true; | 47 | 850 | } |
bool clang::interp::ReturnValue<clang::interp::Integral<64u, true> >(clang::interp::Integral<64u, true> const&, clang::APValue&) Line | Count | Source | 44 | 50 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 50 | R = V.toAPValue(); | 46 | 50 | return true; | 47 | 50 | } |
bool clang::interp::ReturnValue<clang::interp::Integral<64u, false> >(clang::interp::Integral<64u, false> const&, clang::APValue&) Line | Count | Source | 44 | 525 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 525 | R = V.toAPValue(); | 46 | 525 | return true; | 47 | 525 | } |
bool clang::interp::ReturnValue<clang::interp::IntegralAP<false> >(clang::interp::IntegralAP<false> const&, clang::APValue&) Line | Count | Source | 44 | 50 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 50 | R = V.toAPValue(); | 46 | 50 | return true; | 47 | 50 | } |
bool clang::interp::ReturnValue<clang::interp::IntegralAP<true> >(clang::interp::IntegralAP<true> const&, clang::APValue&) Line | Count | Source | 44 | 84 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 84 | R = V.toAPValue(); | 46 | 84 | return true; | 47 | 84 | } |
bool clang::interp::ReturnValue<clang::interp::Floating>(clang::interp::Floating const&, clang::APValue&) Line | Count | Source | 44 | 241 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 241 | R = V.toAPValue(); | 46 | 241 | return true; | 47 | 241 | } |
bool clang::interp::ReturnValue<clang::interp::Boolean>(clang::interp::Boolean const&, clang::APValue&) Line | Count | Source | 44 | 3.05k | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 3.05k | R = V.toAPValue(); | 46 | 3.05k | return true; | 47 | 3.05k | } |
bool clang::interp::ReturnValue<clang::interp::Pointer>(clang::interp::Pointer const&, clang::APValue&) Line | Count | Source | 44 | 954 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 954 | R = V.toAPValue(); | 46 | 954 | return true; | 47 | 954 | } |
bool clang::interp::ReturnValue<clang::interp::FunctionPointer>(clang::interp::FunctionPointer const&, clang::APValue&) Line | Count | Source | 44 | 31 | template <typename T> bool ReturnValue(const T &V, APValue &R) { | 45 | 31 | R = V.toAPValue(); | 46 | 31 | return true; | 47 | 31 | } |
|
48 | | |
49 | | /// Checks if the variable has externally defined storage. |
50 | | bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
51 | | |
52 | | /// Checks if the array is offsetable. |
53 | | bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
54 | | |
55 | | /// Checks if a pointer is live and accessible. |
56 | | bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
57 | | AccessKinds AK); |
58 | | |
59 | | /// Checks if a pointer is a dummy pointer. |
60 | | bool CheckDummy(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
61 | | |
62 | | /// Checks if a pointer is null. |
63 | | bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
64 | | CheckSubobjectKind CSK); |
65 | | |
66 | | /// Checks if a pointer is in range. |
67 | | bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
68 | | AccessKinds AK); |
69 | | |
70 | | /// Checks if a field from which a pointer is going to be derived is valid. |
71 | | bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
72 | | CheckSubobjectKind CSK); |
73 | | |
74 | | /// Checks if Ptr is a one-past-the-end pointer. |
75 | | bool CheckSubobject(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
76 | | CheckSubobjectKind CSK); |
77 | | |
78 | | /// Checks if a pointer points to const storage. |
79 | | bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
80 | | |
81 | | /// Checks if a pointer points to a mutable field. |
82 | | bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
83 | | |
84 | | /// Checks if a value can be loaded from a block. |
85 | | bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
86 | | |
87 | | bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
88 | | AccessKinds AK); |
89 | | |
90 | | /// Checks if a value can be stored in a block. |
91 | | bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
92 | | |
93 | | /// Checks if a method can be invoked on an object. |
94 | | bool CheckInvoke(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
95 | | |
96 | | /// Checks if a value can be initialized. |
97 | | bool CheckInit(InterpState &S, CodePtr OpPC, const Pointer &Ptr); |
98 | | |
99 | | /// Checks if a method can be called. |
100 | | bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F); |
101 | | |
102 | | /// Checks if calling the currently active function would exceed |
103 | | /// the allowed call depth. |
104 | | bool CheckCallDepth(InterpState &S, CodePtr OpPC); |
105 | | |
106 | | /// Checks the 'this' pointer. |
107 | | bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This); |
108 | | |
109 | | /// Checks if a method is pure virtual. |
110 | | bool CheckPure(InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD); |
111 | | |
112 | | /// Checks that all fields are initialized after a constructor call. |
113 | | bool CheckCtorCall(InterpState &S, CodePtr OpPC, const Pointer &This); |
114 | | |
115 | | /// Checks if reinterpret casts are legal in the current context. |
116 | | bool CheckPotentialReinterpretCast(InterpState &S, CodePtr OpPC, |
117 | | const Pointer &Ptr); |
118 | | |
119 | | /// Sets the given integral value to the pointer, which is of |
120 | | /// a std::{weak,partial,strong}_ordering type. |
121 | | bool SetThreeWayComparisonField(InterpState &S, CodePtr OpPC, |
122 | | const Pointer &Ptr, const APSInt &IntValue); |
123 | | |
124 | | /// Checks if the shift operation is legal. |
125 | | template <typename LT, typename RT> |
126 | | bool CheckShift(InterpState &S, CodePtr OpPC, const LT &LHS, const RT &RHS, |
127 | 110 | unsigned Bits) { |
128 | 110 | if (RHS.isNegative()) { |
129 | 10 | const SourceInfo &Loc = S.Current->getSource(OpPC); |
130 | 10 | S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); |
131 | 10 | return false; |
132 | 10 | } |
133 | | |
134 | | // C++11 [expr.shift]p1: Shift width must be less than the bit width of |
135 | | // the shifted type. |
136 | 100 | if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) { |
137 | 14 | const Expr *E = S.Current->getExpr(OpPC); |
138 | 14 | const APSInt Val = RHS.toAPSInt(); |
139 | 14 | QualType Ty = E->getType(); |
140 | 14 | S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits; |
141 | 14 | return false; |
142 | 14 | } |
143 | | |
144 | 86 | if (LHS.isSigned() && !S.getLangOpts().CPlusPlus2080 ) { |
145 | 32 | const Expr *E = S.Current->getExpr(OpPC); |
146 | | // C++11 [expr.shift]p2: A signed left shift must have a non-negative |
147 | | // operand, and must not overflow the corresponding unsigned type. |
148 | 32 | if (LHS.isNegative()) |
149 | 5 | S.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << LHS.toAPSInt(); |
150 | 27 | else if (LHS.toUnsigned().countLeadingZeros() < static_cast<unsigned>(RHS)) |
151 | 2 | S.CCEDiag(E, diag::note_constexpr_lshift_discards); |
152 | 32 | } |
153 | | |
154 | | // C++2a [expr.shift]p2: [P0907R4]: |
155 | | // E1 << E2 is the unique value congruent to |
156 | | // E1 x 2^E2 module 2^N. |
157 | 86 | return true; |
158 | 100 | } Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<16u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<32u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::IntegralAP<true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<16u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<32u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::IntegralAP<true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<32u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::IntegralAP<true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<32u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::IntegralAP<true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<16u, false> const&, unsigned int) bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, true> const&, unsigned int) Line | Count | Source | 127 | 92 | unsigned Bits) { | 128 | 92 | if (RHS.isNegative()) { | 129 | 10 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 130 | 10 | S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); | 131 | 10 | return false; | 132 | 10 | } | 133 | | | 134 | | // C++11 [expr.shift]p1: Shift width must be less than the bit width of | 135 | | // the shifted type. | 136 | 82 | if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) { | 137 | 8 | const Expr *E = S.Current->getExpr(OpPC); | 138 | 8 | const APSInt Val = RHS.toAPSInt(); | 139 | 8 | QualType Ty = E->getType(); | 140 | 8 | S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits; | 141 | 8 | return false; | 142 | 8 | } | 143 | | | 144 | 74 | if (LHS.isSigned() && !S.getLangOpts().CPlusPlus20) { | 145 | 29 | const Expr *E = S.Current->getExpr(OpPC); | 146 | | // C++11 [expr.shift]p2: A signed left shift must have a non-negative | 147 | | // operand, and must not overflow the corresponding unsigned type. | 148 | 29 | if (LHS.isNegative()) | 149 | 5 | S.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << LHS.toAPSInt(); | 150 | 24 | else if (LHS.toUnsigned().countLeadingZeros() < static_cast<unsigned>(RHS)) | 151 | 2 | S.CCEDiag(E, diag::note_constexpr_lshift_discards); | 152 | 29 | } | 153 | | | 154 | | // C++2a [expr.shift]p2: [P0907R4]: | 155 | | // E1 << E2 is the unique value congruent to | 156 | | // E1 x 2^E2 module 2^N. | 157 | 74 | return true; | 158 | 82 | } |
bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, false> const&, unsigned int) Line | Count | Source | 127 | 6 | unsigned Bits) { | 128 | 6 | if (RHS.isNegative()) { | 129 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 130 | 0 | S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); | 131 | 0 | return false; | 132 | 0 | } | 133 | | | 134 | | // C++11 [expr.shift]p1: Shift width must be less than the bit width of | 135 | | // the shifted type. | 136 | 6 | if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) { | 137 | 6 | const Expr *E = S.Current->getExpr(OpPC); | 138 | 6 | const APSInt Val = RHS.toAPSInt(); | 139 | 6 | QualType Ty = E->getType(); | 140 | 6 | S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits; | 141 | 6 | return false; | 142 | 6 | } | 143 | | | 144 | 0 | if (LHS.isSigned() && !S.getLangOpts().CPlusPlus20) { | 145 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 146 | | // C++11 [expr.shift]p2: A signed left shift must have a non-negative | 147 | | // operand, and must not overflow the corresponding unsigned type. | 148 | 0 | if (LHS.isNegative()) | 149 | 0 | S.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << LHS.toAPSInt(); | 150 | 0 | else if (LHS.toUnsigned().countLeadingZeros() < static_cast<unsigned>(RHS)) | 151 | 0 | S.CCEDiag(E, diag::note_constexpr_lshift_discards); | 152 | 0 | } | 153 | | | 154 | | // C++2a [expr.shift]p2: [P0907R4]: | 155 | | // E1 << E2 is the unique value congruent to | 156 | | // E1 x 2^E2 module 2^N. | 157 | 0 | return true; | 158 | 6 | } |
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, true>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::IntegralAP<true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<16u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<32u, false>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::IntegralAP<true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<16u, false> const&, unsigned int) bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<32u, true> const&, unsigned int) Line | Count | Source | 127 | 4 | unsigned Bits) { | 128 | 4 | if (RHS.isNegative()) { | 129 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 130 | 0 | S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); | 131 | 0 | return false; | 132 | 0 | } | 133 | | | 134 | | // C++11 [expr.shift]p1: Shift width must be less than the bit width of | 135 | | // the shifted type. | 136 | 4 | if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) { | 137 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 138 | 0 | const APSInt Val = RHS.toAPSInt(); | 139 | 0 | QualType Ty = E->getType(); | 140 | 0 | S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits; | 141 | 0 | return false; | 142 | 0 | } | 143 | | | 144 | 4 | if (LHS.isSigned() && !S.getLangOpts().CPlusPlus20) { | 145 | 2 | const Expr *E = S.Current->getExpr(OpPC); | 146 | | // C++11 [expr.shift]p2: A signed left shift must have a non-negative | 147 | | // operand, and must not overflow the corresponding unsigned type. | 148 | 2 | if (LHS.isNegative()) | 149 | 0 | S.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << LHS.toAPSInt(); | 150 | 2 | else if (LHS.toUnsigned().countLeadingZeros() < static_cast<unsigned>(RHS)) | 151 | 0 | S.CCEDiag(E, diag::note_constexpr_lshift_discards); | 152 | 2 | } | 153 | | | 154 | | // C++2a [expr.shift]p2: [P0907R4]: | 155 | | // E1 << E2 is the unique value congruent to | 156 | | // E1 x 2^E2 module 2^N. | 157 | 4 | return true; | 158 | 4 | } |
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::IntegralAP<true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<16u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<32u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::IntegralAP<true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::Integral<16u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::Integral<32u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::Integral<64u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::Integral<64u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::IntegralAP<false> const&, unsigned int) bool clang::interp::CheckShift<clang::interp::IntegralAP<false>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::IntegralAP<true> const&, unsigned int) Line | Count | Source | 127 | 6 | unsigned Bits) { | 128 | 6 | if (RHS.isNegative()) { | 129 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 130 | 0 | S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); | 131 | 0 | return false; | 132 | 0 | } | 133 | | | 134 | | // C++11 [expr.shift]p1: Shift width must be less than the bit width of | 135 | | // the shifted type. | 136 | 6 | if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) { | 137 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 138 | 0 | const APSInt Val = RHS.toAPSInt(); | 139 | 0 | QualType Ty = E->getType(); | 140 | 0 | S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits; | 141 | 0 | return false; | 142 | 0 | } | 143 | | | 144 | 6 | if (LHS.isSigned() && !S.getLangOpts().CPlusPlus200 ) { | 145 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 146 | | // C++11 [expr.shift]p2: A signed left shift must have a non-negative | 147 | | // operand, and must not overflow the corresponding unsigned type. | 148 | 0 | if (LHS.isNegative()) | 149 | 0 | S.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << LHS.toAPSInt(); | 150 | 0 | else if (LHS.toUnsigned().countLeadingZeros() < static_cast<unsigned>(RHS)) | 151 | 0 | S.CCEDiag(E, diag::note_constexpr_lshift_discards); | 152 | 0 | } | 153 | | | 154 | | // C++2a [expr.shift]p2: [P0907R4]: | 155 | | // E1 << E2 is the unique value congruent to | 156 | | // E1 x 2^E2 module 2^N. | 157 | 6 | return true; | 158 | 6 | } |
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::Integral<8u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::Integral<8u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::Integral<16u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::Integral<16u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::Integral<32u, true> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::Integral<32u, false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::Integral<64u, true> const&, unsigned int) bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::Integral<64u, false> const&, unsigned int) Line | Count | Source | 127 | 2 | unsigned Bits) { | 128 | 2 | if (RHS.isNegative()) { | 129 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 130 | 0 | S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt(); | 131 | 0 | return false; | 132 | 0 | } | 133 | | | 134 | | // C++11 [expr.shift]p1: Shift width must be less than the bit width of | 135 | | // the shifted type. | 136 | 2 | if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) { | 137 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 138 | 0 | const APSInt Val = RHS.toAPSInt(); | 139 | 0 | QualType Ty = E->getType(); | 140 | 0 | S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits; | 141 | 0 | return false; | 142 | 0 | } | 143 | | | 144 | 2 | if (LHS.isSigned() && !S.getLangOpts().CPlusPlus20) { | 145 | 1 | const Expr *E = S.Current->getExpr(OpPC); | 146 | | // C++11 [expr.shift]p2: A signed left shift must have a non-negative | 147 | | // operand, and must not overflow the corresponding unsigned type. | 148 | 1 | if (LHS.isNegative()) | 149 | 0 | S.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << LHS.toAPSInt(); | 150 | 1 | else if (LHS.toUnsigned().countLeadingZeros() < static_cast<unsigned>(RHS)) | 151 | 0 | S.CCEDiag(E, diag::note_constexpr_lshift_discards); | 152 | 1 | } | 153 | | | 154 | | // C++2a [expr.shift]p2: [P0907R4]: | 155 | | // E1 << E2 is the unique value congruent to | 156 | | // E1 x 2^E2 module 2^N. | 157 | 2 | return true; | 158 | 2 | } |
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::IntegralAP<false> const&, unsigned int) Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::IntegralAP<true>, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::IntegralAP<true> const&, unsigned int) |
159 | | |
160 | | /// Checks if Div/Rem operation on LHS and RHS is valid. |
161 | | template <typename T> |
162 | 214 | bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) { |
163 | 214 | if (RHS.isZero()) { |
164 | 92 | const auto *Op = cast<BinaryOperator>(S.Current->getExpr(OpPC)); |
165 | 92 | S.FFDiag(Op, diag::note_expr_divide_by_zero) |
166 | 92 | << Op->getRHS()->getSourceRange(); |
167 | 92 | return false; |
168 | 92 | } |
169 | | |
170 | 122 | if (LHS.isSigned() && LHS.isMin()113 && RHS.isNegative()10 && RHS.isMinusOne()10 ) { |
171 | 10 | APSInt LHSInt = LHS.toAPSInt(); |
172 | 10 | SmallString<32> Trunc; |
173 | 10 | (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10); |
174 | 10 | const SourceInfo &Loc = S.Current->getSource(OpPC); |
175 | 10 | const Expr *E = S.Current->getExpr(OpPC); |
176 | 10 | S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType(); |
177 | 10 | return false; |
178 | 10 | } |
179 | 112 | return true; |
180 | 122 | } bool clang::interp::CheckDivRem<clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Floating const&, clang::interp::Floating const&) Line | Count | Source | 162 | 27 | bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) { | 163 | 27 | if (RHS.isZero()) { | 164 | 1 | const auto *Op = cast<BinaryOperator>(S.Current->getExpr(OpPC)); | 165 | 1 | S.FFDiag(Op, diag::note_expr_divide_by_zero) | 166 | 1 | << Op->getRHS()->getSourceRange(); | 167 | 1 | return false; | 168 | 1 | } | 169 | | | 170 | 26 | if (LHS.isSigned() && LHS.isMin() && RHS.isNegative()0 && RHS.isMinusOne()0 ) { | 171 | 0 | APSInt LHSInt = LHS.toAPSInt(); | 172 | 0 | SmallString<32> Trunc; | 173 | 0 | (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10); | 174 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 175 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 176 | 0 | S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType(); | 177 | 0 | return false; | 178 | 0 | } | 179 | 26 | return true; | 180 | 26 | } |
Unexecuted instantiation: bool clang::interp::CheckDivRem<clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, true> const&) Unexecuted instantiation: bool clang::interp::CheckDivRem<clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, false> const&) Unexecuted instantiation: bool clang::interp::CheckDivRem<clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, true> const&) Unexecuted instantiation: bool clang::interp::CheckDivRem<clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, false> const&) bool clang::interp::CheckDivRem<clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, true> const&) Line | Count | Source | 162 | 178 | bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) { | 163 | 178 | if (RHS.isZero()) { | 164 | 91 | const auto *Op = cast<BinaryOperator>(S.Current->getExpr(OpPC)); | 165 | 91 | S.FFDiag(Op, diag::note_expr_divide_by_zero) | 166 | 91 | << Op->getRHS()->getSourceRange(); | 167 | 91 | return false; | 168 | 91 | } | 169 | | | 170 | 87 | if (LHS.isSigned() && LHS.isMin() && RHS.isNegative()10 && RHS.isMinusOne()10 ) { | 171 | 10 | APSInt LHSInt = LHS.toAPSInt(); | 172 | 10 | SmallString<32> Trunc; | 173 | 10 | (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10); | 174 | 10 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 175 | 10 | const Expr *E = S.Current->getExpr(OpPC); | 176 | 10 | S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType(); | 177 | 10 | return false; | 178 | 10 | } | 179 | 77 | return true; | 180 | 87 | } |
bool clang::interp::CheckDivRem<clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, false> const&) Line | Count | Source | 162 | 1 | bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) { | 163 | 1 | if (RHS.isZero()) { | 164 | 0 | const auto *Op = cast<BinaryOperator>(S.Current->getExpr(OpPC)); | 165 | 0 | S.FFDiag(Op, diag::note_expr_divide_by_zero) | 166 | 0 | << Op->getRHS()->getSourceRange(); | 167 | 0 | return false; | 168 | 0 | } | 169 | | | 170 | 1 | if (LHS.isSigned() && LHS.isMin()0 && RHS.isNegative()0 && RHS.isMinusOne()0 ) { | 171 | 0 | APSInt LHSInt = LHS.toAPSInt(); | 172 | 0 | SmallString<32> Trunc; | 173 | 0 | (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10); | 174 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 175 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 176 | 0 | S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType(); | 177 | 0 | return false; | 178 | 0 | } | 179 | 1 | return true; | 180 | 1 | } |
Unexecuted instantiation: bool clang::interp::CheckDivRem<clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, true> const&) bool clang::interp::CheckDivRem<clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, false> const&) Line | Count | Source | 162 | 8 | bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) { | 163 | 8 | if (RHS.isZero()) { | 164 | 0 | const auto *Op = cast<BinaryOperator>(S.Current->getExpr(OpPC)); | 165 | 0 | S.FFDiag(Op, diag::note_expr_divide_by_zero) | 166 | 0 | << Op->getRHS()->getSourceRange(); | 167 | 0 | return false; | 168 | 0 | } | 169 | | | 170 | 8 | if (LHS.isSigned() && LHS.isMin()0 && RHS.isNegative()0 && RHS.isMinusOne()0 ) { | 171 | 0 | APSInt LHSInt = LHS.toAPSInt(); | 172 | 0 | SmallString<32> Trunc; | 173 | 0 | (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10); | 174 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 175 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 176 | 0 | S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType(); | 177 | 0 | return false; | 178 | 0 | } | 179 | 8 | return true; | 180 | 8 | } |
Unexecuted instantiation: bool clang::interp::CheckDivRem<clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<false> const&, clang::interp::IntegralAP<false> const&) Unexecuted instantiation: bool clang::interp::CheckDivRem<clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::IntegralAP<true> const&, clang::interp::IntegralAP<true> const&) |
181 | | |
182 | | /// Checks if the result of a floating-point operation is valid |
183 | | /// in the current context. |
184 | | bool CheckFloatResult(InterpState &S, CodePtr OpPC, const Floating &Result, |
185 | | APFloat::opStatus Status); |
186 | | |
187 | | /// Checks why the given DeclRefExpr is invalid. |
188 | | bool CheckDeclRef(InterpState &S, CodePtr OpPC, const DeclRefExpr *DR); |
189 | | |
190 | | /// Interpreter entry point. |
191 | | bool Interpret(InterpState &S, APValue &Result); |
192 | | |
193 | | /// Interpret a builtin function. |
194 | | bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const Function *F, |
195 | | const CallExpr *Call); |
196 | | |
197 | | /// Interpret an offsetof operation. |
198 | | bool InterpretOffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E, |
199 | | llvm::ArrayRef<int64_t> ArrayIndices, int64_t &Result); |
200 | | |
201 | | enum class ArithOp { Add, Sub }; |
202 | | |
203 | | //===----------------------------------------------------------------------===// |
204 | | // Returning values |
205 | | //===----------------------------------------------------------------------===// |
206 | | |
207 | | void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC); |
208 | | |
209 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
210 | 4.56k | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { |
211 | 4.56k | const T &Ret = S.Stk.pop<T>(); |
212 | | |
213 | | // Make sure returned pointers are live. We might be trying to return a |
214 | | // pointer or reference to a local variable. |
215 | | // Just return false, since a diagnostic has already been emitted in Sema. |
216 | 4.56k | if constexpr (std::is_same_v<T, Pointer>) {0 |
217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics |
218 | | // seem a little weird, at least if the returned expression is of |
219 | | // pointer type. |
220 | | // Null pointers are considered live here. |
221 | 434 | if (!Ret.isZero() && !Ret.isLive()424 ) |
222 | 18 | return false; |
223 | 434 | } |
224 | | |
225 | 416 | assert(S.Current); |
226 | 4.55k | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); |
227 | 4.55k | if (!S.checkingPotentialConstantExpression() || S.Current->Caller263 ) |
228 | 4.29k | cleanupAfterFunctionCall(S, PC); |
229 | | |
230 | 4.55k | if (InterpFrame *Caller = S.Current->Caller) { |
231 | 4.29k | PC = S.Current->getRetPC(); |
232 | 4.29k | delete S.Current; |
233 | 4.29k | S.Current = Caller; |
234 | 4.29k | S.Stk.push<T>(Ret); |
235 | 4.29k | } else { |
236 | 254 | delete S.Current; |
237 | 254 | S.Current = nullptr; |
238 | 254 | if (!ReturnValue<T>(Ret, Result)) |
239 | 0 | return false; |
240 | 254 | } |
241 | 4.55k | return true; |
242 | 4.55k | } bool clang::interp::Ret<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 15 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 15 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 15 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 15 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 15 | return false; | 223 | 15 | } | 224 | | | 225 | 15 | assert(S.Current); | 226 | 15 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 15 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller0 ) | 228 | 15 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 15 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 15 | PC = S.Current->getRetPC(); | 232 | 15 | delete S.Current; | 233 | 15 | S.Current = Caller; | 234 | 15 | S.Stk.push<T>(Ret); | 235 | 15 | } else { | 236 | 0 | delete S.Current; | 237 | 0 | S.Current = nullptr; | 238 | 0 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 0 | } | 241 | 15 | return true; | 242 | 15 | } |
bool clang::interp::Ret<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 6 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 6 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 6 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 6 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 6 | return false; | 223 | 6 | } | 224 | | | 225 | 6 | assert(S.Current); | 226 | 6 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 6 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller0 ) | 228 | 6 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 6 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 6 | PC = S.Current->getRetPC(); | 232 | 6 | delete S.Current; | 233 | 6 | S.Current = Caller; | 234 | 6 | S.Stk.push<T>(Ret); | 235 | 6 | } else { | 236 | 0 | delete S.Current; | 237 | 0 | S.Current = nullptr; | 238 | 0 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 0 | } | 241 | 6 | return true; | 242 | 6 | } |
bool clang::interp::Ret<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 120 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 120 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 120 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 120 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 120 | return false; | 223 | 120 | } | 224 | | | 225 | 120 | assert(S.Current); | 226 | 120 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 120 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller2 ) | 228 | 118 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 120 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 118 | PC = S.Current->getRetPC(); | 232 | 118 | delete S.Current; | 233 | 118 | S.Current = Caller; | 234 | 118 | S.Stk.push<T>(Ret); | 235 | 118 | } else { | 236 | 2 | delete S.Current; | 237 | 2 | S.Current = nullptr; | 238 | 2 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 2 | } | 241 | 120 | return true; | 242 | 120 | } |
bool clang::interp::Ret<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 39 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 39 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 39 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 39 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 39 | return false; | 223 | 39 | } | 224 | | | 225 | 39 | assert(S.Current); | 226 | 39 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 39 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller0 ) | 228 | 39 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 39 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 39 | PC = S.Current->getRetPC(); | 232 | 39 | delete S.Current; | 233 | 39 | S.Current = Caller; | 234 | 39 | S.Stk.push<T>(Ret); | 235 | 39 | } else { | 236 | 0 | delete S.Current; | 237 | 0 | S.Current = nullptr; | 238 | 0 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 0 | } | 241 | 39 | return true; | 242 | 39 | } |
bool clang::interp::Ret<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 1.85k | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 1.85k | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 1.85k | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 1.85k | if (!Ret.isZero() && !Ret.isLive()) | 222 | 1.85k | return false; | 223 | 1.85k | } | 224 | | | 225 | 1.85k | assert(S.Current); | 226 | 1.85k | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 1.85k | if (!S.checkingPotentialConstantExpression() || S.Current->Caller184 ) | 228 | 1.67k | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 1.85k | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 1.67k | PC = S.Current->getRetPC(); | 232 | 1.67k | delete S.Current; | 233 | 1.67k | S.Current = Caller; | 234 | 1.67k | S.Stk.push<T>(Ret); | 235 | 1.67k | } else { | 236 | 180 | delete S.Current; | 237 | 180 | S.Current = nullptr; | 238 | 180 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 180 | } | 241 | 1.85k | return true; | 242 | 1.85k | } |
bool clang::interp::Ret<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 858 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 858 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 858 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 858 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 858 | return false; | 223 | 858 | } | 224 | | | 225 | 858 | assert(S.Current); | 226 | 858 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 858 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller0 ) | 228 | 858 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 858 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 858 | PC = S.Current->getRetPC(); | 232 | 858 | delete S.Current; | 233 | 858 | S.Current = Caller; | 234 | 858 | S.Stk.push<T>(Ret); | 235 | 858 | } else { | 236 | 0 | delete S.Current; | 237 | 0 | S.Current = nullptr; | 238 | 0 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 0 | } | 241 | 858 | return true; | 242 | 858 | } |
bool clang::interp::Ret<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 4 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 4 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 4 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 4 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 4 | return false; | 223 | 4 | } | 224 | | | 225 | 4 | assert(S.Current); | 226 | 4 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 4 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller0 ) | 228 | 4 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 4 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 4 | PC = S.Current->getRetPC(); | 232 | 4 | delete S.Current; | 233 | 4 | S.Current = Caller; | 234 | 4 | S.Stk.push<T>(Ret); | 235 | 4 | } else { | 236 | 0 | delete S.Current; | 237 | 0 | S.Current = nullptr; | 238 | 0 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 0 | } | 241 | 4 | return true; | 242 | 4 | } |
bool clang::interp::Ret<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 96 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 96 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 96 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 96 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 96 | return false; | 223 | 96 | } | 224 | | | 225 | 96 | assert(S.Current); | 226 | 96 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 96 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller0 ) | 228 | 96 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 96 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 96 | PC = S.Current->getRetPC(); | 232 | 96 | delete S.Current; | 233 | 96 | S.Current = Caller; | 234 | 96 | S.Stk.push<T>(Ret); | 235 | 96 | } else { | 236 | 0 | delete S.Current; | 237 | 0 | S.Current = nullptr; | 238 | 0 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 0 | } | 241 | 96 | return true; | 242 | 96 | } |
bool clang::interp::Ret<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 2 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 2 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 2 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 2 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 2 | return false; | 223 | 2 | } | 224 | | | 225 | 2 | assert(S.Current); | 226 | 2 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 2 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller0 ) | 228 | 2 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 2 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 2 | PC = S.Current->getRetPC(); | 232 | 2 | delete S.Current; | 233 | 2 | S.Current = Caller; | 234 | 2 | S.Stk.push<T>(Ret); | 235 | 2 | } else { | 236 | 0 | delete S.Current; | 237 | 0 | S.Current = nullptr; | 238 | 0 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 0 | } | 241 | 2 | return true; | 242 | 2 | } |
bool clang::interp::Ret<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 18 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 18 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 18 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 18 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 18 | return false; | 223 | 18 | } | 224 | | | 225 | 18 | assert(S.Current); | 226 | 18 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 18 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller0 ) | 228 | 18 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 18 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 18 | PC = S.Current->getRetPC(); | 232 | 18 | delete S.Current; | 233 | 18 | S.Current = Caller; | 234 | 18 | S.Stk.push<T>(Ret); | 235 | 18 | } else { | 236 | 0 | delete S.Current; | 237 | 0 | S.Current = nullptr; | 238 | 0 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 0 | } | 241 | 18 | return true; | 242 | 18 | } |
bool clang::interp::Ret<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 569 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 569 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 569 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 569 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 569 | return false; | 223 | 569 | } | 224 | | | 225 | 569 | assert(S.Current); | 226 | 569 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 569 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller38 ) | 228 | 533 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 569 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 533 | PC = S.Current->getRetPC(); | 232 | 533 | delete S.Current; | 233 | 533 | S.Current = Caller; | 234 | 533 | S.Stk.push<T>(Ret); | 235 | 533 | } else { | 236 | 36 | delete S.Current; | 237 | 36 | S.Current = nullptr; | 238 | 36 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 36 | } | 241 | 569 | return true; | 242 | 569 | } |
bool clang::interp::Ret<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 434 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 434 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 434 | if constexpr (std::is_same_v<T, Pointer>) { | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 434 | if (!Ret.isZero() && !Ret.isLive()424 ) | 222 | 18 | return false; | 223 | 434 | } | 224 | | | 225 | 416 | assert(S.Current); | 226 | 416 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 416 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller25 ) | 228 | 391 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 416 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 391 | PC = S.Current->getRetPC(); | 232 | 391 | delete S.Current; | 233 | 391 | S.Current = Caller; | 234 | 391 | S.Stk.push<T>(Ret); | 235 | 391 | } else { | 236 | 25 | delete S.Current; | 237 | 25 | S.Current = nullptr; | 238 | 25 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 25 | } | 241 | 416 | return true; | 242 | 416 | } |
bool clang::interp::Ret<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 35 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 35 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 35 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 35 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 35 | return false; | 223 | 35 | } | 224 | | | 225 | 35 | assert(S.Current); | 226 | 35 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 35 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller6 ) | 228 | 32 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 35 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 32 | PC = S.Current->getRetPC(); | 232 | 32 | delete S.Current; | 233 | 32 | S.Current = Caller; | 234 | 32 | S.Stk.push<T>(Ret); | 235 | 32 | } else { | 236 | 3 | delete S.Current; | 237 | 3 | S.Current = nullptr; | 238 | 3 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 3 | } | 241 | 35 | return true; | 242 | 35 | } |
bool clang::interp::Ret<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&) Line | Count | Source | 210 | 519 | bool Ret(InterpState &S, CodePtr &PC, APValue &Result) { | 211 | 519 | const T &Ret = S.Stk.pop<T>(); | 212 | | | 213 | | // Make sure returned pointers are live. We might be trying to return a | 214 | | // pointer or reference to a local variable. | 215 | | // Just return false, since a diagnostic has already been emitted in Sema. | 216 | 519 | if constexpr (std::is_same_v<T, Pointer>) {0 | 217 | | // FIXME: We could be calling isLive() here, but the emitted diagnostics | 218 | | // seem a little weird, at least if the returned expression is of | 219 | | // pointer type. | 220 | | // Null pointers are considered live here. | 221 | 519 | if (!Ret.isZero() && !Ret.isLive()) | 222 | 519 | return false; | 223 | 519 | } | 224 | | | 225 | 519 | assert(S.Current); | 226 | 519 | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); | 227 | 519 | if (!S.checkingPotentialConstantExpression() || S.Current->Caller8 ) | 228 | 511 | cleanupAfterFunctionCall(S, PC); | 229 | | | 230 | 519 | if (InterpFrame *Caller = S.Current->Caller) { | 231 | 511 | PC = S.Current->getRetPC(); | 232 | 511 | delete S.Current; | 233 | 511 | S.Current = Caller; | 234 | 511 | S.Stk.push<T>(Ret); | 235 | 511 | } else { | 236 | 8 | delete S.Current; | 237 | 8 | S.Current = nullptr; | 238 | 8 | if (!ReturnValue<T>(Ret, Result)) | 239 | 0 | return false; | 240 | 8 | } | 241 | 519 | return true; | 242 | 519 | } |
|
243 | | |
244 | 4.52k | inline bool RetVoid(InterpState &S, CodePtr &PC, APValue &Result) { |
245 | 4.52k | assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame"); |
246 | | |
247 | 4.52k | if (!S.checkingPotentialConstantExpression() || S.Current->Caller55 ) |
248 | 4.48k | cleanupAfterFunctionCall(S, PC); |
249 | | |
250 | 4.52k | if (InterpFrame *Caller = S.Current->Caller) { |
251 | 4.48k | PC = S.Current->getRetPC(); |
252 | 4.48k | delete S.Current; |
253 | 4.48k | S.Current = Caller; |
254 | 4.48k | } else { |
255 | 36 | delete S.Current; |
256 | 36 | S.Current = nullptr; |
257 | 36 | } |
258 | 4.52k | return true; |
259 | 4.52k | } |
260 | | |
261 | | //===----------------------------------------------------------------------===// |
262 | | // Add, Sub, Mul |
263 | | //===----------------------------------------------------------------------===// |
264 | | |
265 | | template <typename T, bool (*OpFW)(T, T, unsigned, T *), |
266 | | template <typename U> class OpAP> |
267 | | bool AddSubMulHelper(InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS, |
268 | 2.04k | const T &RHS) { |
269 | | // Fast path - add the numbers with fixed width. |
270 | 2.04k | T Result; |
271 | 2.04k | if (!OpFW(LHS, RHS, Bits, &Result)) { |
272 | 2.03k | S.Stk.push<T>(Result); |
273 | 2.03k | return true; |
274 | 2.03k | } |
275 | | |
276 | | // If for some reason evaluation continues, use the truncated results. |
277 | 13 | S.Stk.push<T>(Result); |
278 | | |
279 | | // Slow path - compute the result using another bit of precision. |
280 | 13 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); |
281 | | |
282 | | // Report undefined behaviour, stopping if required. |
283 | 13 | const Expr *E = S.Current->getExpr(OpPC); |
284 | 13 | QualType Type = E->getType(); |
285 | 13 | if (S.checkingForUndefinedBehavior()) { |
286 | 1 | SmallString<32> Trunc; |
287 | 1 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); |
288 | 1 | auto Loc = E->getExprLoc(); |
289 | 1 | S.report(Loc, diag::warn_integer_constant_overflow) |
290 | 1 | << Trunc << Type << E->getSourceRange(); |
291 | 1 | return true; |
292 | 12 | } else { |
293 | 12 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; |
294 | 12 | if (!S.noteUndefinedBehavior()) { |
295 | 6 | S.Stk.pop<T>(); |
296 | 6 | return false; |
297 | 6 | } |
298 | 6 | return true; |
299 | 12 | } |
300 | 13 | } Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj8ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj8ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj16ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj16ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj32ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 1.21k | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 1.21k | T Result; | 271 | 1.21k | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 1.20k | S.Stk.push<T>(Result); | 273 | 1.20k | return true; | 274 | 1.20k | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 5 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 5 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 5 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 5 | QualType Type = E->getType(); | 285 | 5 | if (S.checkingForUndefinedBehavior()) { | 286 | 1 | SmallString<32> Trunc; | 287 | 1 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 1 | auto Loc = E->getExprLoc(); | 289 | 1 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 1 | << Trunc << Type << E->getSourceRange(); | 291 | 1 | return true; | 292 | 4 | } else { | 293 | 4 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 4 | if (!S.noteUndefinedBehavior()) { | 295 | 2 | S.Stk.pop<T>(); | 296 | 2 | return false; | 297 | 2 | } | 298 | 2 | return true; | 299 | 4 | } | 300 | 5 | } |
_ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj32ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 260 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 260 | T Result; | 271 | 260 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 260 | S.Stk.push<T>(Result); | 273 | 260 | return true; | 274 | 260 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj64ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj64ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 27 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 27 | T Result; | 271 | 27 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 27 | S.Stk.push<T>(Result); | 273 | 27 | return true; | 274 | 27 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_10IntegralAPILb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ _ZN5clang6interp15AddSubMulHelperINS0_10IntegralAPILb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3addES3_S3_jPS3_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 4 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 4 | T Result; | 271 | 4 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 2 | S.Stk.push<T>(Result); | 273 | 2 | return true; | 274 | 2 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 2 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 2 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 2 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 2 | QualType Type = E->getType(); | 285 | 2 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 2 | } else { | 293 | 2 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 2 | if (!S.noteUndefinedBehavior()) { | 295 | 2 | S.Stk.pop<T>(); | 296 | 2 | return false; | 297 | 2 | } | 298 | 0 | return true; | 299 | 2 | } | 300 | 2 | } |
_ZN5clang6interp15AddSubMulHelperINS0_7BooleanETnPFbT_S3_jPS3_EXadL_ZNS2_3addES2_S2_jPS2_EENSt3__14plusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS3_SE_ Line | Count | Source | 268 | 2 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 2 | T Result; | 271 | 2 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 2 | S.Stk.push<T>(Result); | 273 | 2 | return true; | 274 | 2 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj8ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj8ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj16ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj16ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 10 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 10 | T Result; | 271 | 10 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 10 | S.Stk.push<T>(Result); | 273 | 10 | return true; | 274 | 10 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
_ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj32ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 53 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 53 | T Result; | 271 | 53 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 50 | S.Stk.push<T>(Result); | 273 | 50 | return true; | 274 | 50 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 3 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 3 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 3 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 3 | QualType Type = E->getType(); | 285 | 3 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 3 | } else { | 293 | 3 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 3 | if (!S.noteUndefinedBehavior()) { | 295 | 1 | S.Stk.pop<T>(); | 296 | 1 | return false; | 297 | 1 | } | 298 | 2 | return true; | 299 | 3 | } | 300 | 3 | } |
_ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj32ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 85 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 85 | T Result; | 271 | 85 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 85 | S.Stk.push<T>(Result); | 273 | 85 | return true; | 274 | 85 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj64ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj64ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 39 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 39 | T Result; | 271 | 39 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 39 | S.Stk.push<T>(Result); | 273 | 39 | return true; | 274 | 39 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_10IntegralAPILb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_10IntegralAPILb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3mulES3_S3_jPS3_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_7BooleanETnPFbT_S3_jPS3_EXadL_ZNS2_3mulES2_S2_jPS2_EENSt3__110multipliesEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS3_SE_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj8ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj8ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj16ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 5 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 5 | T Result; | 271 | 5 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 5 | S.Stk.push<T>(Result); | 273 | 5 | return true; | 274 | 5 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj16ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ _ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj32ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 274 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 274 | T Result; | 271 | 274 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 271 | S.Stk.push<T>(Result); | 273 | 271 | return true; | 274 | 271 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 3 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 3 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 3 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 3 | QualType Type = E->getType(); | 285 | 3 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 3 | } else { | 293 | 3 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 3 | if (!S.noteUndefinedBehavior()) { | 295 | 1 | S.Stk.pop<T>(); | 296 | 1 | return false; | 297 | 1 | } | 298 | 2 | return true; | 299 | 3 | } | 300 | 3 | } |
_ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj32ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 61 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 61 | T Result; | 271 | 61 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 61 | S.Stk.push<T>(Result); | 273 | 61 | return true; | 274 | 61 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
_ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj64ELb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 9 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 9 | T Result; | 271 | 9 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 9 | S.Stk.push<T>(Result); | 273 | 9 | return true; | 274 | 9 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
_ZN5clang6interp15AddSubMulHelperINS0_8IntegralILj64ELb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 6 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 6 | T Result; | 271 | 6 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 6 | S.Stk.push<T>(Result); | 273 | 6 | return true; | 274 | 6 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_10IntegralAPILb0EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ _ZN5clang6interp15AddSubMulHelperINS0_10IntegralAPILb1EEETnPFbT_S4_jPS4_EXadL_ZNS3_3subES3_S3_jPS3_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS4_SF_ Line | Count | Source | 268 | 4 | const T &RHS) { | 269 | | // Fast path - add the numbers with fixed width. | 270 | 4 | T Result; | 271 | 4 | if (!OpFW(LHS, RHS, Bits, &Result)) { | 272 | 4 | S.Stk.push<T>(Result); | 273 | 4 | return true; | 274 | 4 | } | 275 | | | 276 | | // If for some reason evaluation continues, use the truncated results. | 277 | 0 | S.Stk.push<T>(Result); | 278 | | | 279 | | // Slow path - compute the result using another bit of precision. | 280 | 0 | APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits)); | 281 | | | 282 | | // Report undefined behaviour, stopping if required. | 283 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 284 | 0 | QualType Type = E->getType(); | 285 | 0 | if (S.checkingForUndefinedBehavior()) { | 286 | 0 | SmallString<32> Trunc; | 287 | 0 | Value.trunc(Result.bitWidth()).toString(Trunc, 10); | 288 | 0 | auto Loc = E->getExprLoc(); | 289 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 290 | 0 | << Trunc << Type << E->getSourceRange(); | 291 | 0 | return true; | 292 | 0 | } else { | 293 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type; | 294 | 0 | if (!S.noteUndefinedBehavior()) { | 295 | 0 | S.Stk.pop<T>(); | 296 | 0 | return false; | 297 | 0 | } | 298 | 0 | return true; | 299 | 0 | } | 300 | 0 | } |
Unexecuted instantiation: _ZN5clang6interp15AddSubMulHelperINS0_7BooleanETnPFbT_S3_jPS3_EXadL_ZNS2_3subES2_S2_jPS2_EENSt3__15minusEEEbRNS0_11InterpStateENS0_7CodePtrEjRKS3_SE_ |
301 | | |
302 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
303 | 1.50k | bool Add(InterpState &S, CodePtr OpPC) { |
304 | 1.50k | const T &RHS = S.Stk.pop<T>(); |
305 | 1.50k | const T &LHS = S.Stk.pop<T>(); |
306 | 1.50k | const unsigned Bits = RHS.bitWidth() + 1; |
307 | 1.50k | return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS); |
308 | 1.50k | } 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) bool clang::interp::Add<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 303 | 1.21k | bool Add(InterpState &S, CodePtr OpPC) { | 304 | 1.21k | const T &RHS = S.Stk.pop<T>(); | 305 | 1.21k | const T &LHS = S.Stk.pop<T>(); | 306 | 1.21k | const unsigned Bits = RHS.bitWidth() + 1; | 307 | 1.21k | return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS); | 308 | 1.21k | } |
bool clang::interp::Add<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 303 | 260 | bool Add(InterpState &S, CodePtr OpPC) { | 304 | 260 | const T &RHS = S.Stk.pop<T>(); | 305 | 260 | const T &LHS = S.Stk.pop<T>(); | 306 | 260 | const unsigned Bits = RHS.bitWidth() + 1; | 307 | 260 | return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS); | 308 | 260 | } |
Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Add<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 303 | 27 | bool Add(InterpState &S, CodePtr OpPC) { | 304 | 27 | const T &RHS = S.Stk.pop<T>(); | 305 | 27 | const T &LHS = S.Stk.pop<T>(); | 306 | 27 | const unsigned Bits = RHS.bitWidth() + 1; | 307 | 27 | return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS); | 308 | 27 | } |
Unexecuted instantiation: bool clang::interp::Add<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Add<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 303 | 4 | bool Add(InterpState &S, CodePtr OpPC) { | 304 | 4 | const T &RHS = S.Stk.pop<T>(); | 305 | 4 | const T &LHS = S.Stk.pop<T>(); | 306 | 4 | const unsigned Bits = RHS.bitWidth() + 1; | 307 | 4 | return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS); | 308 | 4 | } |
bool clang::interp::Add<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 303 | 2 | bool Add(InterpState &S, CodePtr OpPC) { | 304 | 2 | const T &RHS = S.Stk.pop<T>(); | 305 | 2 | const T &LHS = S.Stk.pop<T>(); | 306 | 2 | const unsigned Bits = RHS.bitWidth() + 1; | 307 | 2 | return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS); | 308 | 2 | } |
|
309 | | |
310 | 97 | inline bool Addf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { |
311 | 97 | const Floating &RHS = S.Stk.pop<Floating>(); |
312 | 97 | const Floating &LHS = S.Stk.pop<Floating>(); |
313 | | |
314 | 97 | Floating Result; |
315 | 97 | auto Status = Floating::add(LHS, RHS, RM, &Result); |
316 | 97 | S.Stk.push<Floating>(Result); |
317 | 97 | return CheckFloatResult(S, OpPC, Result, Status); |
318 | 97 | } |
319 | | |
320 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
321 | 351 | bool Sub(InterpState &S, CodePtr OpPC) { |
322 | 351 | const T &RHS = S.Stk.pop<T>(); |
323 | 351 | const T &LHS = S.Stk.pop<T>(); |
324 | 351 | const unsigned Bits = RHS.bitWidth() + 1; |
325 | 351 | return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); |
326 | 351 | } 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) bool clang::interp::Sub<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 321 | 5 | bool Sub(InterpState &S, CodePtr OpPC) { | 322 | 5 | const T &RHS = S.Stk.pop<T>(); | 323 | 5 | const T &LHS = S.Stk.pop<T>(); | 324 | 5 | const unsigned Bits = RHS.bitWidth() + 1; | 325 | 5 | return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); | 326 | 5 | } |
Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Sub<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 321 | 274 | bool Sub(InterpState &S, CodePtr OpPC) { | 322 | 274 | const T &RHS = S.Stk.pop<T>(); | 323 | 274 | const T &LHS = S.Stk.pop<T>(); | 324 | 274 | const unsigned Bits = RHS.bitWidth() + 1; | 325 | 274 | return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); | 326 | 274 | } |
bool clang::interp::Sub<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 321 | 61 | bool Sub(InterpState &S, CodePtr OpPC) { | 322 | 61 | const T &RHS = S.Stk.pop<T>(); | 323 | 61 | const T &LHS = S.Stk.pop<T>(); | 324 | 61 | const unsigned Bits = RHS.bitWidth() + 1; | 325 | 61 | return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); | 326 | 61 | } |
bool clang::interp::Sub<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 321 | 1 | bool Sub(InterpState &S, CodePtr OpPC) { | 322 | 1 | const T &RHS = S.Stk.pop<T>(); | 323 | 1 | const T &LHS = S.Stk.pop<T>(); | 324 | 1 | const unsigned Bits = RHS.bitWidth() + 1; | 325 | 1 | return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); | 326 | 1 | } |
bool clang::interp::Sub<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 321 | 6 | bool Sub(InterpState &S, CodePtr OpPC) { | 322 | 6 | const T &RHS = S.Stk.pop<T>(); | 323 | 6 | const T &LHS = S.Stk.pop<T>(); | 324 | 6 | const unsigned Bits = RHS.bitWidth() + 1; | 325 | 6 | return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); | 326 | 6 | } |
Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Sub<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 321 | 4 | bool Sub(InterpState &S, CodePtr OpPC) { | 322 | 4 | const T &RHS = S.Stk.pop<T>(); | 323 | 4 | const T &LHS = S.Stk.pop<T>(); | 324 | 4 | const unsigned Bits = RHS.bitWidth() + 1; | 325 | 4 | return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS); | 326 | 4 | } |
Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
327 | | |
328 | 2 | inline bool Subf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { |
329 | 2 | const Floating &RHS = S.Stk.pop<Floating>(); |
330 | 2 | const Floating &LHS = S.Stk.pop<Floating>(); |
331 | | |
332 | 2 | Floating Result; |
333 | 2 | auto Status = Floating::sub(LHS, RHS, RM, &Result); |
334 | 2 | S.Stk.push<Floating>(Result); |
335 | 2 | return CheckFloatResult(S, OpPC, Result, Status); |
336 | 2 | } |
337 | | |
338 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
339 | 187 | bool Mul(InterpState &S, CodePtr OpPC) { |
340 | 187 | const T &RHS = S.Stk.pop<T>(); |
341 | 187 | const T &LHS = S.Stk.pop<T>(); |
342 | 187 | const unsigned Bits = RHS.bitWidth() * 2; |
343 | 187 | return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS); |
344 | 187 | } 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) bool clang::interp::Mul<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 339 | 10 | bool Mul(InterpState &S, CodePtr OpPC) { | 340 | 10 | const T &RHS = S.Stk.pop<T>(); | 341 | 10 | const T &LHS = S.Stk.pop<T>(); | 342 | 10 | const unsigned Bits = RHS.bitWidth() * 2; | 343 | 10 | return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS); | 344 | 10 | } |
bool clang::interp::Mul<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 339 | 53 | bool Mul(InterpState &S, CodePtr OpPC) { | 340 | 53 | const T &RHS = S.Stk.pop<T>(); | 341 | 53 | const T &LHS = S.Stk.pop<T>(); | 342 | 53 | const unsigned Bits = RHS.bitWidth() * 2; | 343 | 53 | return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS); | 344 | 53 | } |
bool clang::interp::Mul<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 339 | 85 | bool Mul(InterpState &S, CodePtr OpPC) { | 340 | 85 | const T &RHS = S.Stk.pop<T>(); | 341 | 85 | const T &LHS = S.Stk.pop<T>(); | 342 | 85 | const unsigned Bits = RHS.bitWidth() * 2; | 343 | 85 | return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS); | 344 | 85 | } |
Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Mul<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 339 | 39 | bool Mul(InterpState &S, CodePtr OpPC) { | 340 | 39 | const T &RHS = S.Stk.pop<T>(); | 341 | 39 | const T &LHS = S.Stk.pop<T>(); | 342 | 39 | const unsigned Bits = RHS.bitWidth() * 2; | 343 | 39 | return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS); | 344 | 39 | } |
Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) |
345 | | |
346 | 15 | inline bool Mulf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { |
347 | 15 | const Floating &RHS = S.Stk.pop<Floating>(); |
348 | 15 | const Floating &LHS = S.Stk.pop<Floating>(); |
349 | | |
350 | 15 | Floating Result; |
351 | 15 | auto Status = Floating::mul(LHS, RHS, RM, &Result); |
352 | 15 | S.Stk.push<Floating>(Result); |
353 | 15 | return CheckFloatResult(S, OpPC, Result, Status); |
354 | 15 | } |
355 | | /// 1) Pops the RHS from the stack. |
356 | | /// 2) Pops the LHS from the stack. |
357 | | /// 3) Pushes 'LHS & RHS' on the stack |
358 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
359 | 29 | bool BitAnd(InterpState &S, CodePtr OpPC) { |
360 | 29 | const T &RHS = S.Stk.pop<T>(); |
361 | 29 | const T &LHS = S.Stk.pop<T>(); |
362 | | |
363 | 29 | unsigned Bits = RHS.bitWidth(); |
364 | 29 | T Result; |
365 | 29 | if (!T::bitAnd(LHS, RHS, Bits, &Result)) { |
366 | 29 | S.Stk.push<T>(Result); |
367 | 29 | return true; |
368 | 29 | } |
369 | 0 | return false; |
370 | 29 | } Unexecuted instantiation: bool clang::interp::BitAnd<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitAnd<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitAnd<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitAnd<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::BitAnd<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 359 | 20 | bool BitAnd(InterpState &S, CodePtr OpPC) { | 360 | 20 | const T &RHS = S.Stk.pop<T>(); | 361 | 20 | const T &LHS = S.Stk.pop<T>(); | 362 | | | 363 | 20 | unsigned Bits = RHS.bitWidth(); | 364 | 20 | T Result; | 365 | 20 | if (!T::bitAnd(LHS, RHS, Bits, &Result)) { | 366 | 20 | S.Stk.push<T>(Result); | 367 | 20 | return true; | 368 | 20 | } | 369 | 0 | return false; | 370 | 20 | } |
bool clang::interp::BitAnd<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 359 | 9 | bool BitAnd(InterpState &S, CodePtr OpPC) { | 360 | 9 | const T &RHS = S.Stk.pop<T>(); | 361 | 9 | const T &LHS = S.Stk.pop<T>(); | 362 | | | 363 | 9 | unsigned Bits = RHS.bitWidth(); | 364 | 9 | T Result; | 365 | 9 | if (!T::bitAnd(LHS, RHS, Bits, &Result)) { | 366 | 9 | S.Stk.push<T>(Result); | 367 | 9 | return true; | 368 | 9 | } | 369 | 0 | return false; | 370 | 9 | } |
Unexecuted instantiation: bool clang::interp::BitAnd<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitAnd<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitAnd<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitAnd<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
371 | | |
372 | | /// 1) Pops the RHS from the stack. |
373 | | /// 2) Pops the LHS from the stack. |
374 | | /// 3) Pushes 'LHS | RHS' on the stack |
375 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
376 | 37 | bool BitOr(InterpState &S, CodePtr OpPC) { |
377 | 37 | const T &RHS = S.Stk.pop<T>(); |
378 | 37 | const T &LHS = S.Stk.pop<T>(); |
379 | | |
380 | 37 | unsigned Bits = RHS.bitWidth(); |
381 | 37 | T Result; |
382 | 37 | if (!T::bitOr(LHS, RHS, Bits, &Result)) { |
383 | 37 | S.Stk.push<T>(Result); |
384 | 37 | return true; |
385 | 37 | } |
386 | 0 | return false; |
387 | 37 | } Unexecuted instantiation: bool clang::interp::BitOr<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitOr<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitOr<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitOr<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::BitOr<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 376 | 28 | bool BitOr(InterpState &S, CodePtr OpPC) { | 377 | 28 | const T &RHS = S.Stk.pop<T>(); | 378 | 28 | const T &LHS = S.Stk.pop<T>(); | 379 | | | 380 | 28 | unsigned Bits = RHS.bitWidth(); | 381 | 28 | T Result; | 382 | 28 | if (!T::bitOr(LHS, RHS, Bits, &Result)) { | 383 | 28 | S.Stk.push<T>(Result); | 384 | 28 | return true; | 385 | 28 | } | 386 | 0 | return false; | 387 | 28 | } |
bool clang::interp::BitOr<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 376 | 9 | bool BitOr(InterpState &S, CodePtr OpPC) { | 377 | 9 | const T &RHS = S.Stk.pop<T>(); | 378 | 9 | const T &LHS = S.Stk.pop<T>(); | 379 | | | 380 | 9 | unsigned Bits = RHS.bitWidth(); | 381 | 9 | T Result; | 382 | 9 | if (!T::bitOr(LHS, RHS, Bits, &Result)) { | 383 | 9 | S.Stk.push<T>(Result); | 384 | 9 | return true; | 385 | 9 | } | 386 | 0 | return false; | 387 | 9 | } |
Unexecuted instantiation: bool clang::interp::BitOr<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitOr<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitOr<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitOr<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
388 | | |
389 | | /// 1) Pops the RHS from the stack. |
390 | | /// 2) Pops the LHS from the stack. |
391 | | /// 3) Pushes 'LHS ^ RHS' on the stack |
392 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
393 | 30 | bool BitXor(InterpState &S, CodePtr OpPC) { |
394 | 30 | const T &RHS = S.Stk.pop<T>(); |
395 | 30 | const T &LHS = S.Stk.pop<T>(); |
396 | | |
397 | 30 | unsigned Bits = RHS.bitWidth(); |
398 | 30 | T Result; |
399 | 30 | if (!T::bitXor(LHS, RHS, Bits, &Result)) { |
400 | 30 | S.Stk.push<T>(Result); |
401 | 30 | return true; |
402 | 30 | } |
403 | 0 | return false; |
404 | 30 | } Unexecuted instantiation: bool clang::interp::BitXor<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitXor<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitXor<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitXor<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::BitXor<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 393 | 24 | bool BitXor(InterpState &S, CodePtr OpPC) { | 394 | 24 | const T &RHS = S.Stk.pop<T>(); | 395 | 24 | const T &LHS = S.Stk.pop<T>(); | 396 | | | 397 | 24 | unsigned Bits = RHS.bitWidth(); | 398 | 24 | T Result; | 399 | 24 | if (!T::bitXor(LHS, RHS, Bits, &Result)) { | 400 | 24 | S.Stk.push<T>(Result); | 401 | 24 | return true; | 402 | 24 | } | 403 | 0 | return false; | 404 | 24 | } |
bool clang::interp::BitXor<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 393 | 6 | bool BitXor(InterpState &S, CodePtr OpPC) { | 394 | 6 | const T &RHS = S.Stk.pop<T>(); | 395 | 6 | const T &LHS = S.Stk.pop<T>(); | 396 | | | 397 | 6 | unsigned Bits = RHS.bitWidth(); | 398 | 6 | T Result; | 399 | 6 | if (!T::bitXor(LHS, RHS, Bits, &Result)) { | 400 | 6 | S.Stk.push<T>(Result); | 401 | 6 | return true; | 402 | 6 | } | 403 | 0 | return false; | 404 | 6 | } |
Unexecuted instantiation: bool clang::interp::BitXor<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitXor<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitXor<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::BitXor<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
405 | | |
406 | | /// 1) Pops the RHS from the stack. |
407 | | /// 2) Pops the LHS from the stack. |
408 | | /// 3) Pushes 'LHS % RHS' on the stack (the remainder of dividing LHS by RHS). |
409 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
410 | 67 | bool Rem(InterpState &S, CodePtr OpPC) { |
411 | 67 | const T &RHS = S.Stk.pop<T>(); |
412 | 67 | const T &LHS = S.Stk.pop<T>(); |
413 | | |
414 | 67 | if (!CheckDivRem(S, OpPC, LHS, RHS)) |
415 | 20 | return false; |
416 | | |
417 | 47 | const unsigned Bits = RHS.bitWidth() * 2; |
418 | 47 | T Result; |
419 | 47 | if (!T::rem(LHS, RHS, Bits, &Result)) { |
420 | 47 | S.Stk.push<T>(Result); |
421 | 47 | return true; |
422 | 47 | } |
423 | 0 | return false; |
424 | 47 | } Unexecuted instantiation: bool clang::interp::Rem<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Rem<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Rem<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Rem<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Rem<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 410 | 64 | bool Rem(InterpState &S, CodePtr OpPC) { | 411 | 64 | const T &RHS = S.Stk.pop<T>(); | 412 | 64 | const T &LHS = S.Stk.pop<T>(); | 413 | | | 414 | 64 | if (!CheckDivRem(S, OpPC, LHS, RHS)) | 415 | 20 | return false; | 416 | | | 417 | 44 | const unsigned Bits = RHS.bitWidth() * 2; | 418 | 44 | T Result; | 419 | 44 | if (!T::rem(LHS, RHS, Bits, &Result)) { | 420 | 44 | S.Stk.push<T>(Result); | 421 | 44 | return true; | 422 | 44 | } | 423 | 0 | return false; | 424 | 44 | } |
bool clang::interp::Rem<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 410 | 1 | bool Rem(InterpState &S, CodePtr OpPC) { | 411 | 1 | const T &RHS = S.Stk.pop<T>(); | 412 | 1 | const T &LHS = S.Stk.pop<T>(); | 413 | | | 414 | 1 | if (!CheckDivRem(S, OpPC, LHS, RHS)) | 415 | 0 | return false; | 416 | | | 417 | 1 | const unsigned Bits = RHS.bitWidth() * 2; | 418 | 1 | T Result; | 419 | 1 | if (!T::rem(LHS, RHS, Bits, &Result)) { | 420 | 1 | S.Stk.push<T>(Result); | 421 | 1 | return true; | 422 | 1 | } | 423 | 0 | return false; | 424 | 1 | } |
Unexecuted instantiation: bool clang::interp::Rem<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Rem<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 410 | 2 | bool Rem(InterpState &S, CodePtr OpPC) { | 411 | 2 | const T &RHS = S.Stk.pop<T>(); | 412 | 2 | const T &LHS = S.Stk.pop<T>(); | 413 | | | 414 | 2 | if (!CheckDivRem(S, OpPC, LHS, RHS)) | 415 | 0 | return false; | 416 | | | 417 | 2 | const unsigned Bits = RHS.bitWidth() * 2; | 418 | 2 | T Result; | 419 | 2 | if (!T::rem(LHS, RHS, Bits, &Result)) { | 420 | 2 | S.Stk.push<T>(Result); | 421 | 2 | return true; | 422 | 2 | } | 423 | 0 | return false; | 424 | 2 | } |
Unexecuted instantiation: bool clang::interp::Rem<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Rem<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
425 | | |
426 | | /// 1) Pops the RHS from the stack. |
427 | | /// 2) Pops the LHS from the stack. |
428 | | /// 3) Pushes 'LHS / RHS' on the stack |
429 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
430 | 120 | bool Div(InterpState &S, CodePtr OpPC) { |
431 | 120 | const T &RHS = S.Stk.pop<T>(); |
432 | 120 | const T &LHS = S.Stk.pop<T>(); |
433 | | |
434 | 120 | if (!CheckDivRem(S, OpPC, LHS, RHS)) |
435 | 81 | return false; |
436 | | |
437 | 39 | const unsigned Bits = RHS.bitWidth() * 2; |
438 | 39 | T Result; |
439 | 39 | if (!T::div(LHS, RHS, Bits, &Result)) { |
440 | 39 | S.Stk.push<T>(Result); |
441 | 39 | return true; |
442 | 39 | } |
443 | 0 | return false; |
444 | 39 | } Unexecuted instantiation: bool clang::interp::Div<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Div<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Div<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Div<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Div<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 430 | 114 | bool Div(InterpState &S, CodePtr OpPC) { | 431 | 114 | const T &RHS = S.Stk.pop<T>(); | 432 | 114 | const T &LHS = S.Stk.pop<T>(); | 433 | | | 434 | 114 | if (!CheckDivRem(S, OpPC, LHS, RHS)) | 435 | 81 | return false; | 436 | | | 437 | 33 | const unsigned Bits = RHS.bitWidth() * 2; | 438 | 33 | T Result; | 439 | 33 | if (!T::div(LHS, RHS, Bits, &Result)) { | 440 | 33 | S.Stk.push<T>(Result); | 441 | 33 | return true; | 442 | 33 | } | 443 | 0 | return false; | 444 | 33 | } |
Unexecuted instantiation: bool clang::interp::Div<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Div<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Div<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 430 | 6 | bool Div(InterpState &S, CodePtr OpPC) { | 431 | 6 | const T &RHS = S.Stk.pop<T>(); | 432 | 6 | const T &LHS = S.Stk.pop<T>(); | 433 | | | 434 | 6 | if (!CheckDivRem(S, OpPC, LHS, RHS)) | 435 | 0 | return false; | 436 | | | 437 | 6 | const unsigned Bits = RHS.bitWidth() * 2; | 438 | 6 | T Result; | 439 | 6 | if (!T::div(LHS, RHS, Bits, &Result)) { | 440 | 6 | S.Stk.push<T>(Result); | 441 | 6 | return true; | 442 | 6 | } | 443 | 0 | return false; | 444 | 6 | } |
Unexecuted instantiation: bool clang::interp::Div<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Div<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
445 | | |
446 | 27 | inline bool Divf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { |
447 | 27 | const Floating &RHS = S.Stk.pop<Floating>(); |
448 | 27 | const Floating &LHS = S.Stk.pop<Floating>(); |
449 | | |
450 | 27 | if (!CheckDivRem(S, OpPC, LHS, RHS)) |
451 | 1 | return false; |
452 | | |
453 | 26 | Floating Result; |
454 | 26 | auto Status = Floating::div(LHS, RHS, RM, &Result); |
455 | 26 | S.Stk.push<Floating>(Result); |
456 | 26 | return CheckFloatResult(S, OpPC, Result, Status); |
457 | 27 | } |
458 | | |
459 | | //===----------------------------------------------------------------------===// |
460 | | // Inv |
461 | | //===----------------------------------------------------------------------===// |
462 | | |
463 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
464 | 382 | bool Inv(InterpState &S, CodePtr OpPC) { |
465 | 382 | using BoolT = PrimConv<PT_Bool>::T; |
466 | 382 | const T &Val = S.Stk.pop<T>(); |
467 | 382 | const unsigned Bits = Val.bitWidth(); |
468 | 382 | Boolean R; |
469 | 382 | Boolean::inv(BoolT::from(Val, Bits), &R); |
470 | | |
471 | 382 | S.Stk.push<BoolT>(R); |
472 | 382 | return true; |
473 | 382 | } |
474 | | |
475 | | //===----------------------------------------------------------------------===// |
476 | | // Neg |
477 | | //===----------------------------------------------------------------------===// |
478 | | |
479 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
480 | 1.40k | bool Neg(InterpState &S, CodePtr OpPC) { |
481 | 1.40k | const T &Value = S.Stk.pop<T>(); |
482 | 1.40k | T Result; |
483 | | |
484 | 1.40k | if (!T::neg(Value, &Result)) { |
485 | 1.39k | S.Stk.push<T>(Result); |
486 | 1.39k | return true; |
487 | 1.39k | } |
488 | | |
489 | 4 | assert(isIntegralType(Name) && |
490 | 4 | "don't expect other types to fail at constexpr negation"); |
491 | 4 | S.Stk.push<T>(Result); |
492 | | |
493 | 4 | APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1); |
494 | 4 | const Expr *E = S.Current->getExpr(OpPC); |
495 | 4 | QualType Type = E->getType(); |
496 | | |
497 | 4 | if (S.checkingForUndefinedBehavior()) { |
498 | 1 | SmallString<32> Trunc; |
499 | 1 | NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10); |
500 | 1 | auto Loc = E->getExprLoc(); |
501 | 1 | S.report(Loc, diag::warn_integer_constant_overflow) |
502 | 1 | << Trunc << Type << E->getSourceRange(); |
503 | 1 | return true; |
504 | 1 | } |
505 | | |
506 | 3 | S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type; |
507 | 3 | return S.noteUndefinedBehavior(); |
508 | 4 | } Unexecuted instantiation: bool clang::interp::Neg<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Neg<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Neg<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 480 | 82 | bool Neg(InterpState &S, CodePtr OpPC) { | 481 | 82 | const T &Value = S.Stk.pop<T>(); | 482 | 82 | T Result; | 483 | | | 484 | 82 | if (!T::neg(Value, &Result)) { | 485 | 82 | S.Stk.push<T>(Result); | 486 | 82 | return true; | 487 | 82 | } | 488 | | | 489 | 0 | assert(isIntegralType(Name) && | 490 | 0 | "don't expect other types to fail at constexpr negation"); | 491 | 0 | S.Stk.push<T>(Result); | 492 | |
| 493 | 0 | APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1); | 494 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 495 | 0 | QualType Type = E->getType(); | 496 | |
| 497 | 0 | if (S.checkingForUndefinedBehavior()) { | 498 | 0 | SmallString<32> Trunc; | 499 | 0 | NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10); | 500 | 0 | auto Loc = E->getExprLoc(); | 501 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 502 | 0 | << Trunc << Type << E->getSourceRange(); | 503 | 0 | return true; | 504 | 0 | } | 505 | | | 506 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type; | 507 | 0 | return S.noteUndefinedBehavior(); | 508 | 0 | } |
Unexecuted instantiation: bool clang::interp::Neg<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Neg<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 480 | 1.04k | bool Neg(InterpState &S, CodePtr OpPC) { | 481 | 1.04k | const T &Value = S.Stk.pop<T>(); | 482 | 1.04k | T Result; | 483 | | | 484 | 1.04k | if (!T::neg(Value, &Result)) { | 485 | 1.04k | S.Stk.push<T>(Result); | 486 | 1.04k | return true; | 487 | 1.04k | } | 488 | | | 489 | 4 | assert(isIntegralType(Name) && | 490 | 4 | "don't expect other types to fail at constexpr negation"); | 491 | 4 | S.Stk.push<T>(Result); | 492 | | | 493 | 4 | APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1); | 494 | 4 | const Expr *E = S.Current->getExpr(OpPC); | 495 | 4 | QualType Type = E->getType(); | 496 | | | 497 | 4 | if (S.checkingForUndefinedBehavior()) { | 498 | 1 | SmallString<32> Trunc; | 499 | 1 | NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10); | 500 | 1 | auto Loc = E->getExprLoc(); | 501 | 1 | S.report(Loc, diag::warn_integer_constant_overflow) | 502 | 1 | << Trunc << Type << E->getSourceRange(); | 503 | 1 | return true; | 504 | 1 | } | 505 | | | 506 | 3 | S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type; | 507 | 3 | return S.noteUndefinedBehavior(); | 508 | 4 | } |
Unexecuted instantiation: bool clang::interp::Neg<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Neg<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 480 | 5 | bool Neg(InterpState &S, CodePtr OpPC) { | 481 | 5 | const T &Value = S.Stk.pop<T>(); | 482 | 5 | T Result; | 483 | | | 484 | 5 | if (!T::neg(Value, &Result)) { | 485 | 5 | S.Stk.push<T>(Result); | 486 | 5 | return true; | 487 | 5 | } | 488 | | | 489 | 0 | assert(isIntegralType(Name) && | 490 | 0 | "don't expect other types to fail at constexpr negation"); | 491 | 0 | S.Stk.push<T>(Result); | 492 | |
| 493 | 0 | APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1); | 494 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 495 | 0 | QualType Type = E->getType(); | 496 | |
| 497 | 0 | if (S.checkingForUndefinedBehavior()) { | 498 | 0 | SmallString<32> Trunc; | 499 | 0 | NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10); | 500 | 0 | auto Loc = E->getExprLoc(); | 501 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 502 | 0 | << Trunc << Type << E->getSourceRange(); | 503 | 0 | return true; | 504 | 0 | } | 505 | | | 506 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type; | 507 | 0 | return S.noteUndefinedBehavior(); | 508 | 0 | } |
Unexecuted instantiation: bool clang::interp::Neg<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Neg<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Neg<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 480 | 4 | bool Neg(InterpState &S, CodePtr OpPC) { | 481 | 4 | const T &Value = S.Stk.pop<T>(); | 482 | 4 | T Result; | 483 | | | 484 | 4 | if (!T::neg(Value, &Result)) { | 485 | 4 | S.Stk.push<T>(Result); | 486 | 4 | return true; | 487 | 4 | } | 488 | | | 489 | 0 | assert(isIntegralType(Name) && | 490 | 0 | "don't expect other types to fail at constexpr negation"); | 491 | 0 | S.Stk.push<T>(Result); | 492 | |
| 493 | 0 | APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1); | 494 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 495 | 0 | QualType Type = E->getType(); | 496 | |
| 497 | 0 | if (S.checkingForUndefinedBehavior()) { | 498 | 0 | SmallString<32> Trunc; | 499 | 0 | NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10); | 500 | 0 | auto Loc = E->getExprLoc(); | 501 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 502 | 0 | << Trunc << Type << E->getSourceRange(); | 503 | 0 | return true; | 504 | 0 | } | 505 | | | 506 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type; | 507 | 0 | return S.noteUndefinedBehavior(); | 508 | 0 | } |
Unexecuted instantiation: bool clang::interp::Neg<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Neg<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 480 | 266 | bool Neg(InterpState &S, CodePtr OpPC) { | 481 | 266 | const T &Value = S.Stk.pop<T>(); | 482 | 266 | T Result; | 483 | | | 484 | 266 | if (!T::neg(Value, &Result)) { | 485 | 266 | S.Stk.push<T>(Result); | 486 | 266 | return true; | 487 | 266 | } | 488 | | | 489 | 0 | assert(isIntegralType(Name) && | 490 | 0 | "don't expect other types to fail at constexpr negation"); | 491 | 0 | S.Stk.push<T>(Result); | 492 | |
| 493 | 0 | APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1); | 494 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 495 | 0 | QualType Type = E->getType(); | 496 | |
| 497 | 0 | if (S.checkingForUndefinedBehavior()) { | 498 | 0 | SmallString<32> Trunc; | 499 | 0 | NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10); | 500 | 0 | auto Loc = E->getExprLoc(); | 501 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 502 | 0 | << Trunc << Type << E->getSourceRange(); | 503 | 0 | return true; | 504 | 0 | } | 505 | | | 506 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type; | 507 | 0 | return S.noteUndefinedBehavior(); | 508 | 0 | } |
|
509 | | |
510 | | enum class PushVal : bool { |
511 | | No, |
512 | | Yes, |
513 | | }; |
514 | | enum class IncDecOp { |
515 | | Inc, |
516 | | Dec, |
517 | | }; |
518 | | |
519 | | template <typename T, IncDecOp Op, PushVal DoPush> |
520 | 178 | bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { |
521 | 178 | const T &Value = Ptr.deref<T>(); |
522 | 178 | T Result; |
523 | | |
524 | 178 | if constexpr (DoPush == PushVal::Yes) |
525 | 25 | S0 .Stk.push<T>(Value); |
526 | | |
527 | 178 | if constexpr (Op == IncDecOp::Inc) {0 |
528 | 152 | if (!T::increment(Value, &Result)) { |
529 | 148 | Ptr.deref<T>() = Result; |
530 | 148 | return true; |
531 | 148 | } |
532 | 152 | } else { |
533 | 26 | if (!T::decrement(Value, &Result)) { |
534 | 22 | Ptr.deref<T>() = Result; |
535 | 22 | return true; |
536 | 22 | } |
537 | 26 | } |
538 | | |
539 | | // Something went wrong with the previous operation. Compute the |
540 | | // result with another bit of precision. |
541 | 8 | unsigned Bits = Value.bitWidth() + 1; |
542 | 8 | APSInt APResult; |
543 | 8 | if constexpr (Op == IncDecOp::Inc) |
544 | 4 | APResult0 = ++Value.toAPSInt(Bits); |
545 | 4 | else |
546 | 4 | APResult = --Value.toAPSInt(Bits); |
547 | | |
548 | | // Report undefined behaviour, stopping if required. |
549 | 8 | const Expr *E = S.Current->getExpr(OpPC); |
550 | 8 | QualType Type = E->getType(); |
551 | 8 | if (S.checkingForUndefinedBehavior()) { |
552 | 0 | SmallString<32> Trunc; |
553 | 0 | APResult.trunc(Result.bitWidth()).toString(Trunc, 10); |
554 | 0 | auto Loc = E->getExprLoc(); |
555 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) |
556 | 0 | << Trunc << Type << E->getSourceRange(); |
557 | 0 | return true; |
558 | 0 | } |
559 | | |
560 | 8 | S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type; |
561 | 8 | return S.noteUndefinedBehavior(); |
562 | 8 | } Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<8u, true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<8u, false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<16u, true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<16u, false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) bool clang::interp::IncDecHelper<clang::interp::Integral<32u, true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Line | Count | Source | 520 | 6 | bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { | 521 | 6 | const T &Value = Ptr.deref<T>(); | 522 | 6 | T Result; | 523 | | | 524 | 6 | if constexpr (DoPush == PushVal::Yes) | 525 | 6 | S.Stk.push<T>(Value); | 526 | | | 527 | 6 | if constexpr (Op == IncDecOp::Inc) {0 | 528 | 6 | if (!T::increment(Value, &Result)) { | 529 | 6 | Ptr.deref<T>() = Result; | 530 | 6 | return true; | 531 | 6 | } | 532 | 6 | } else { | 533 | 6 | if (!T::decrement(Value, &Result)) { | 534 | 6 | Ptr.deref<T>() = Result; | 535 | 6 | return true; | 536 | 6 | } | 537 | 6 | } | 538 | | | 539 | | // Something went wrong with the previous operation. Compute the | 540 | | // result with another bit of precision. | 541 | 0 | unsigned Bits = Value.bitWidth() + 1; | 542 | 0 | APSInt APResult; | 543 | 0 | if constexpr (Op == IncDecOp::Inc) | 544 | 0 | APResult = ++Value.toAPSInt(Bits); | 545 | 0 | else | 546 | 0 | APResult = --Value.toAPSInt(Bits); | 547 | | | 548 | | // Report undefined behaviour, stopping if required. | 549 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 550 | 0 | QualType Type = E->getType(); | 551 | 0 | if (S.checkingForUndefinedBehavior()) { | 552 | 0 | SmallString<32> Trunc; | 553 | 0 | APResult.trunc(Result.bitWidth()).toString(Trunc, 10); | 554 | 0 | auto Loc = E->getExprLoc(); | 555 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 556 | 0 | << Trunc << Type << E->getSourceRange(); | 557 | 0 | return true; | 558 | 0 | } | 559 | | | 560 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type; | 561 | 0 | return S.noteUndefinedBehavior(); | 562 | 0 | } |
Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<32u, false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<64u, true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<64u, false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::IntegralAP<false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::IntegralAP<true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<8u, true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<8u, false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<16u, true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<16u, false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) bool clang::interp::IncDecHelper<clang::interp::Integral<32u, true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Line | Count | Source | 520 | 20 | bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { | 521 | 20 | const T &Value = Ptr.deref<T>(); | 522 | 20 | T Result; | 523 | | | 524 | 20 | if constexpr (DoPush == PushVal::Yes) | 525 | 0 | S.Stk.push<T>(Value); | 526 | | | 527 | 20 | if constexpr (Op == IncDecOp::Inc) {0 | 528 | 20 | if (!T::increment(Value, &Result)) { | 529 | 20 | Ptr.deref<T>() = Result; | 530 | 20 | return true; | 531 | 20 | } | 532 | 20 | } else { | 533 | 20 | if (!T::decrement(Value, &Result)) { | 534 | 16 | Ptr.deref<T>() = Result; | 535 | 16 | return true; | 536 | 16 | } | 537 | 20 | } | 538 | | | 539 | | // Something went wrong with the previous operation. Compute the | 540 | | // result with another bit of precision. | 541 | 4 | unsigned Bits = Value.bitWidth() + 1; | 542 | 4 | APSInt APResult; | 543 | 4 | if constexpr (Op == IncDecOp::Inc) | 544 | 0 | APResult = ++Value.toAPSInt(Bits); | 545 | 4 | else | 546 | 4 | APResult = --Value.toAPSInt(Bits); | 547 | | | 548 | | // Report undefined behaviour, stopping if required. | 549 | 4 | const Expr *E = S.Current->getExpr(OpPC); | 550 | 4 | QualType Type = E->getType(); | 551 | 4 | if (S.checkingForUndefinedBehavior()) { | 552 | 0 | SmallString<32> Trunc; | 553 | 0 | APResult.trunc(Result.bitWidth()).toString(Trunc, 10); | 554 | 0 | auto Loc = E->getExprLoc(); | 555 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 556 | 0 | << Trunc << Type << E->getSourceRange(); | 557 | 0 | return true; | 558 | 0 | } | 559 | | | 560 | 4 | S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type; | 561 | 4 | return S.noteUndefinedBehavior(); | 562 | 4 | } |
Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<32u, false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<64u, true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<64u, false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::IntegralAP<false>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::IntegralAP<true>, (clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<8u, true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<8u, false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<16u, true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<16u, false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) bool clang::interp::IncDecHelper<clang::interp::Integral<32u, true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Line | Count | Source | 520 | 19 | bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { | 521 | 19 | const T &Value = Ptr.deref<T>(); | 522 | 19 | T Result; | 523 | | | 524 | 19 | if constexpr (DoPush == PushVal::Yes) | 525 | 19 | S.Stk.push<T>(Value); | 526 | | | 527 | 19 | if constexpr (Op == IncDecOp::Inc) { | 528 | 19 | if (!T::increment(Value, &Result)) { | 529 | 19 | Ptr.deref<T>() = Result; | 530 | 19 | return true; | 531 | 19 | } | 532 | 19 | } else { | 533 | 0 | if (!T::decrement(Value, &Result)) { | 534 | 0 | Ptr.deref<T>() = Result; | 535 | 0 | return true; | 536 | 0 | } | 537 | 0 | } | 538 | | | 539 | | // Something went wrong with the previous operation. Compute the | 540 | | // result with another bit of precision. | 541 | 0 | unsigned Bits = Value.bitWidth() + 1; | 542 | 0 | APSInt APResult; | 543 | 0 | if constexpr (Op == IncDecOp::Inc) | 544 | 0 | APResult = ++Value.toAPSInt(Bits); | 545 | 0 | else | 546 | 0 | APResult = --Value.toAPSInt(Bits); | 547 | | | 548 | | // Report undefined behaviour, stopping if required. | 549 | 0 | const Expr *E = S.Current->getExpr(OpPC); | 550 | 0 | QualType Type = E->getType(); | 551 | 0 | if (S.checkingForUndefinedBehavior()) { | 552 | 0 | SmallString<32> Trunc; | 553 | 0 | APResult.trunc(Result.bitWidth()).toString(Trunc, 10); | 554 | 0 | auto Loc = E->getExprLoc(); | 555 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 556 | 0 | << Trunc << Type << E->getSourceRange(); | 557 | 0 | return true; | 558 | 0 | } | 559 | | | 560 | 0 | S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type; | 561 | 0 | return S.noteUndefinedBehavior(); | 562 | 0 | } |
Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<32u, false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<64u, true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<64u, false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::IntegralAP<false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::IntegralAP<true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<8u, true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<8u, false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<16u, true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<16u, false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) bool clang::interp::IncDecHelper<clang::interp::Integral<32u, true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Line | Count | Source | 520 | 133 | bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { | 521 | 133 | const T &Value = Ptr.deref<T>(); | 522 | 133 | T Result; | 523 | | | 524 | 133 | if constexpr (DoPush == PushVal::Yes) | 525 | 0 | S.Stk.push<T>(Value); | 526 | | | 527 | 133 | if constexpr (Op == IncDecOp::Inc) { | 528 | 133 | if (!T::increment(Value, &Result)) { | 529 | 129 | Ptr.deref<T>() = Result; | 530 | 129 | return true; | 531 | 129 | } | 532 | 133 | } else { | 533 | 4 | if (!T::decrement(Value, &Result)) { | 534 | 4 | Ptr.deref<T>() = Result; | 535 | 4 | return true; | 536 | 4 | } | 537 | 4 | } | 538 | | | 539 | | // Something went wrong with the previous operation. Compute the | 540 | | // result with another bit of precision. | 541 | 4 | unsigned Bits = Value.bitWidth() + 1; | 542 | 4 | APSInt APResult; | 543 | 4 | if constexpr (Op == IncDecOp::Inc) | 544 | 4 | APResult = ++Value.toAPSInt(Bits); | 545 | 4 | else | 546 | 4 | APResult = --Value.toAPSInt(Bits); | 547 | | | 548 | | // Report undefined behaviour, stopping if required. | 549 | 4 | const Expr *E = S.Current->getExpr(OpPC); | 550 | 4 | QualType Type = E->getType(); | 551 | 4 | if (S.checkingForUndefinedBehavior()) { | 552 | 0 | SmallString<32> Trunc; | 553 | 0 | APResult.trunc(Result.bitWidth()).toString(Trunc, 10); | 554 | 0 | auto Loc = E->getExprLoc(); | 555 | 0 | S.report(Loc, diag::warn_integer_constant_overflow) | 556 | 0 | << Trunc << Type << E->getSourceRange(); | 557 | 0 | return true; | 558 | 0 | } | 559 | | | 560 | 4 | S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type; | 561 | 4 | return S.noteUndefinedBehavior(); | 562 | 4 | } |
Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<32u, false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<64u, true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::Integral<64u, false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::IntegralAP<false>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) Unexecuted instantiation: bool clang::interp::IncDecHelper<clang::interp::IntegralAP<true>, (clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&) |
563 | | |
564 | | /// 1) Pops a pointer from the stack |
565 | | /// 2) Load the value from the pointer |
566 | | /// 3) Writes the value increased by one back to the pointer |
567 | | /// 4) Pushes the original (pre-inc) value on the stack. |
568 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
569 | 19 | bool Inc(InterpState &S, CodePtr OpPC) { |
570 | 19 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
571 | | |
572 | 19 | if (!CheckInitialized(S, OpPC, Ptr, AK_Increment)) |
573 | 0 | return false; |
574 | | |
575 | 19 | return IncDecHelper<T, IncDecOp::Inc, PushVal::Yes>(S, OpPC, Ptr); |
576 | 19 | } Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Inc<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 569 | 19 | bool Inc(InterpState &S, CodePtr OpPC) { | 570 | 19 | const Pointer &Ptr = S.Stk.pop<Pointer>(); | 571 | | | 572 | 19 | if (!CheckInitialized(S, OpPC, Ptr, AK_Increment)) | 573 | 0 | return false; | 574 | | | 575 | 19 | return IncDecHelper<T, IncDecOp::Inc, PushVal::Yes>(S, OpPC, Ptr); | 576 | 19 | } |
Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Inc<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
577 | | |
578 | | /// 1) Pops a pointer from the stack |
579 | | /// 2) Load the value from the pointer |
580 | | /// 3) Writes the value increased by one back to the pointer |
581 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
582 | 134 | bool IncPop(InterpState &S, CodePtr OpPC) { |
583 | 134 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
584 | | |
585 | 134 | if (!CheckInitialized(S, OpPC, Ptr, AK_Increment)) |
586 | 1 | return false; |
587 | | |
588 | 133 | return IncDecHelper<T, IncDecOp::Inc, PushVal::No>(S, OpPC, Ptr); |
589 | 134 | } Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::IncPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 582 | 134 | bool IncPop(InterpState &S, CodePtr OpPC) { | 583 | 134 | const Pointer &Ptr = S.Stk.pop<Pointer>(); | 584 | | | 585 | 134 | if (!CheckInitialized(S, OpPC, Ptr, AK_Increment)) | 586 | 1 | return false; | 587 | | | 588 | 133 | return IncDecHelper<T, IncDecOp::Inc, PushVal::No>(S, OpPC, Ptr); | 589 | 134 | } |
Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::IncPop<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
590 | | |
591 | | /// 1) Pops a pointer from the stack |
592 | | /// 2) Load the value from the pointer |
593 | | /// 3) Writes the value decreased by one back to the pointer |
594 | | /// 4) Pushes the original (pre-dec) value on the stack. |
595 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
596 | 6 | bool Dec(InterpState &S, CodePtr OpPC) { |
597 | 6 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
598 | | |
599 | 6 | if (!CheckInitialized(S, OpPC, Ptr, AK_Decrement)) |
600 | 0 | return false; |
601 | | |
602 | 6 | return IncDecHelper<T, IncDecOp::Dec, PushVal::Yes>(S, OpPC, Ptr); |
603 | 6 | } Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Dec<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 596 | 6 | bool Dec(InterpState &S, CodePtr OpPC) { | 597 | 6 | const Pointer &Ptr = S.Stk.pop<Pointer>(); | 598 | | | 599 | 6 | if (!CheckInitialized(S, OpPC, Ptr, AK_Decrement)) | 600 | 0 | return false; | 601 | | | 602 | 6 | return IncDecHelper<T, IncDecOp::Dec, PushVal::Yes>(S, OpPC, Ptr); | 603 | 6 | } |
Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dec<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
604 | | |
605 | | /// 1) Pops a pointer from the stack |
606 | | /// 2) Load the value from the pointer |
607 | | /// 3) Writes the value decreased by one back to the pointer |
608 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
609 | 21 | bool DecPop(InterpState &S, CodePtr OpPC) { |
610 | 21 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
611 | | |
612 | 21 | if (!CheckInitialized(S, OpPC, Ptr, AK_Decrement)) |
613 | 1 | return false; |
614 | | |
615 | 20 | return IncDecHelper<T, IncDecOp::Dec, PushVal::No>(S, OpPC, Ptr); |
616 | 21 | } Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::DecPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 609 | 21 | bool DecPop(InterpState &S, CodePtr OpPC) { | 610 | 21 | const Pointer &Ptr = S.Stk.pop<Pointer>(); | 611 | | | 612 | 21 | if (!CheckInitialized(S, OpPC, Ptr, AK_Decrement)) | 613 | 1 | return false; | 614 | | | 615 | 20 | return IncDecHelper<T, IncDecOp::Dec, PushVal::No>(S, OpPC, Ptr); | 616 | 21 | } |
Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::DecPop<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
617 | | |
618 | | template <IncDecOp Op, PushVal DoPush> |
619 | | bool IncDecFloatHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr, |
620 | 6 | llvm::RoundingMode RM) { |
621 | 6 | Floating Value = Ptr.deref<Floating>(); |
622 | 6 | Floating Result; |
623 | | |
624 | 6 | if constexpr (DoPush == PushVal::Yes) |
625 | 0 | S.Stk.push<Floating>(Value); |
626 | | |
627 | 6 | llvm::APFloat::opStatus Status; |
628 | 6 | if constexpr (Op == IncDecOp::Inc) |
629 | 4 | Status0 = Floating::increment(Value, RM, &Result); |
630 | 2 | else |
631 | 2 | Status = Floating::decrement(Value, RM, &Result); |
632 | | |
633 | 6 | Ptr.deref<Floating>() = Result; |
634 | | |
635 | 6 | return CheckFloatResult(S, OpPC, Result, Status); |
636 | 6 | } Unexecuted instantiation: bool clang::interp::IncDecFloatHelper<(clang::interp::IncDecOp)0, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&, llvm::RoundingMode) bool clang::interp::IncDecFloatHelper<(clang::interp::IncDecOp)0, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&, llvm::RoundingMode) Line | Count | Source | 620 | 4 | llvm::RoundingMode RM) { | 621 | 4 | Floating Value = Ptr.deref<Floating>(); | 622 | 4 | Floating Result; | 623 | | | 624 | 4 | if constexpr (DoPush == PushVal::Yes) | 625 | 0 | S.Stk.push<Floating>(Value); | 626 | | | 627 | 4 | llvm::APFloat::opStatus Status; | 628 | 4 | if constexpr (Op == IncDecOp::Inc) | 629 | 4 | Status = Floating::increment(Value, RM, &Result); | 630 | 4 | else | 631 | 4 | Status = Floating::decrement(Value, RM, &Result); | 632 | | | 633 | 4 | Ptr.deref<Floating>() = Result; | 634 | | | 635 | 4 | return CheckFloatResult(S, OpPC, Result, Status); | 636 | 4 | } |
Unexecuted instantiation: bool clang::interp::IncDecFloatHelper<(clang::interp::IncDecOp)1, (clang::interp::PushVal)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&, llvm::RoundingMode) bool clang::interp::IncDecFloatHelper<(clang::interp::IncDecOp)1, (clang::interp::PushVal)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&, llvm::RoundingMode) Line | Count | Source | 620 | 2 | llvm::RoundingMode RM) { | 621 | 2 | Floating Value = Ptr.deref<Floating>(); | 622 | 2 | Floating Result; | 623 | | | 624 | 2 | if constexpr (DoPush == PushVal::Yes) | 625 | 0 | S.Stk.push<Floating>(Value); | 626 | | | 627 | 2 | llvm::APFloat::opStatus Status; | 628 | 2 | if constexpr (Op == IncDecOp::Inc) | 629 | 0 | Status = Floating::increment(Value, RM, &Result); | 630 | 2 | else | 631 | 2 | Status = Floating::decrement(Value, RM, &Result); | 632 | | | 633 | 2 | Ptr.deref<Floating>() = Result; | 634 | | | 635 | 2 | return CheckFloatResult(S, OpPC, Result, Status); | 636 | 2 | } |
|
637 | | |
638 | 0 | inline bool Incf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { |
639 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
640 | |
|
641 | 0 | if (!CheckInitialized(S, OpPC, Ptr, AK_Increment)) |
642 | 0 | return false; |
643 | | |
644 | 0 | return IncDecFloatHelper<IncDecOp::Inc, PushVal::Yes>(S, OpPC, Ptr, RM); |
645 | 0 | } |
646 | | |
647 | 6 | inline bool IncfPop(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { |
648 | 6 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
649 | | |
650 | 6 | if (!CheckInitialized(S, OpPC, Ptr, AK_Increment)) |
651 | 2 | return false; |
652 | | |
653 | 4 | return IncDecFloatHelper<IncDecOp::Inc, PushVal::No>(S, OpPC, Ptr, RM); |
654 | 6 | } |
655 | | |
656 | 0 | inline bool Decf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { |
657 | 0 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
658 | |
|
659 | 0 | if (!CheckInitialized(S, OpPC, Ptr, AK_Decrement)) |
660 | 0 | return false; |
661 | | |
662 | 0 | return IncDecFloatHelper<IncDecOp::Dec, PushVal::Yes>(S, OpPC, Ptr, RM); |
663 | 0 | } |
664 | | |
665 | 4 | inline bool DecfPop(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) { |
666 | 4 | const Pointer &Ptr = S.Stk.pop<Pointer>(); |
667 | | |
668 | 4 | if (!CheckInitialized(S, OpPC, Ptr, AK_Decrement)) |
669 | 2 | return false; |
670 | | |
671 | 2 | return IncDecFloatHelper<IncDecOp::Dec, PushVal::No>(S, OpPC, Ptr, RM); |
672 | 4 | } |
673 | | |
674 | | /// 1) Pops the value from the stack. |
675 | | /// 2) Pushes the bitwise complemented value on the stack (~V). |
676 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
677 | 125 | bool Comp(InterpState &S, CodePtr OpPC) { |
678 | 125 | const T &Val = S.Stk.pop<T>(); |
679 | 125 | T Result; |
680 | 125 | if (!T::comp(Val, &Result)) { |
681 | 125 | S.Stk.push<T>(Result); |
682 | 125 | return true; |
683 | 125 | } |
684 | | |
685 | 0 | return false; |
686 | 125 | } Unexecuted instantiation: bool clang::interp::Comp<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Comp<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Comp<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 677 | 1 | bool Comp(InterpState &S, CodePtr OpPC) { | 678 | 1 | const T &Val = S.Stk.pop<T>(); | 679 | 1 | T Result; | 680 | 1 | if (!T::comp(Val, &Result)) { | 681 | 1 | S.Stk.push<T>(Result); | 682 | 1 | return true; | 683 | 1 | } | 684 | | | 685 | 0 | return false; | 686 | 1 | } |
bool clang::interp::Comp<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 677 | 3 | bool Comp(InterpState &S, CodePtr OpPC) { | 678 | 3 | const T &Val = S.Stk.pop<T>(); | 679 | 3 | T Result; | 680 | 3 | if (!T::comp(Val, &Result)) { | 681 | 3 | S.Stk.push<T>(Result); | 682 | 3 | return true; | 683 | 3 | } | 684 | | | 685 | 0 | return false; | 686 | 3 | } |
bool clang::interp::Comp<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 677 | 68 | bool Comp(InterpState &S, CodePtr OpPC) { | 678 | 68 | const T &Val = S.Stk.pop<T>(); | 679 | 68 | T Result; | 680 | 68 | if (!T::comp(Val, &Result)) { | 681 | 68 | S.Stk.push<T>(Result); | 682 | 68 | return true; | 683 | 68 | } | 684 | | | 685 | 0 | return false; | 686 | 68 | } |
bool clang::interp::Comp<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 677 | 21 | bool Comp(InterpState &S, CodePtr OpPC) { | 678 | 21 | const T &Val = S.Stk.pop<T>(); | 679 | 21 | T Result; | 680 | 21 | if (!T::comp(Val, &Result)) { | 681 | 21 | S.Stk.push<T>(Result); | 682 | 21 | return true; | 683 | 21 | } | 684 | | | 685 | 0 | return false; | 686 | 21 | } |
bool clang::interp::Comp<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 677 | 9 | bool Comp(InterpState &S, CodePtr OpPC) { | 678 | 9 | const T &Val = S.Stk.pop<T>(); | 679 | 9 | T Result; | 680 | 9 | if (!T::comp(Val, &Result)) { | 681 | 9 | S.Stk.push<T>(Result); | 682 | 9 | return true; | 683 | 9 | } | 684 | | | 685 | 0 | return false; | 686 | 9 | } |
bool clang::interp::Comp<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 677 | 21 | bool Comp(InterpState &S, CodePtr OpPC) { | 678 | 21 | const T &Val = S.Stk.pop<T>(); | 679 | 21 | T Result; | 680 | 21 | if (!T::comp(Val, &Result)) { | 681 | 21 | S.Stk.push<T>(Result); | 682 | 21 | return true; | 683 | 21 | } | 684 | | | 685 | 0 | return false; | 686 | 21 | } |
bool clang::interp::Comp<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 677 | 2 | bool Comp(InterpState &S, CodePtr OpPC) { | 678 | 2 | const T &Val = S.Stk.pop<T>(); | 679 | 2 | T Result; | 680 | 2 | if (!T::comp(Val, &Result)) { | 681 | 2 | S.Stk.push<T>(Result); | 682 | 2 | return true; | 683 | 2 | } | 684 | | | 685 | 0 | return false; | 686 | 2 | } |
Unexecuted instantiation: bool clang::interp::Comp<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) |
687 | | |
688 | | //===----------------------------------------------------------------------===// |
689 | | // EQ, NE, GT, GE, LT, LE |
690 | | //===----------------------------------------------------------------------===// |
691 | | |
692 | | using CompareFn = llvm::function_ref<bool(ComparisonCategoryResult)>; |
693 | | |
694 | | template <typename T> |
695 | 37.0k | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { |
696 | 37.0k | using BoolT = PrimConv<PT_Bool>::T; |
697 | 37.0k | const T &RHS = S.Stk.pop<T>(); |
698 | 37.0k | const T &LHS = S.Stk.pop<T>(); |
699 | 37.0k | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); |
700 | 37.0k | return true; |
701 | 37.0k | } 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)>) bool clang::interp::CmpHelper<clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 27 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 27 | using BoolT = PrimConv<PT_Bool>::T; | 697 | 27 | const T &RHS = S.Stk.pop<T>(); | 698 | 27 | const T &LHS = S.Stk.pop<T>(); | 699 | 27 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 27 | return true; | 701 | 27 | } |
bool clang::interp::CmpHelper<clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 39 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 39 | using BoolT = PrimConv<PT_Bool>::T; | 697 | 39 | const T &RHS = S.Stk.pop<T>(); | 698 | 39 | const T &LHS = S.Stk.pop<T>(); | 699 | 39 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 39 | return true; | 701 | 39 | } |
bool clang::interp::CmpHelper<clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 35.5k | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 35.5k | using BoolT = PrimConv<PT_Bool>::T; | 697 | 35.5k | const T &RHS = S.Stk.pop<T>(); | 698 | 35.5k | const T &LHS = S.Stk.pop<T>(); | 699 | 35.5k | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 35.5k | return true; | 701 | 35.5k | } |
bool clang::interp::CmpHelper<clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 588 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 588 | using BoolT = PrimConv<PT_Bool>::T; | 697 | 588 | const T &RHS = S.Stk.pop<T>(); | 698 | 588 | const T &LHS = S.Stk.pop<T>(); | 699 | 588 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 588 | return true; | 701 | 588 | } |
bool clang::interp::CmpHelper<clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 15 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 15 | using BoolT = PrimConv<PT_Bool>::T; | 697 | 15 | const T &RHS = S.Stk.pop<T>(); | 698 | 15 | const T &LHS = S.Stk.pop<T>(); | 699 | 15 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 15 | return true; | 701 | 15 | } |
bool clang::interp::CmpHelper<clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 618 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 618 | using BoolT = PrimConv<PT_Bool>::T; | 697 | 618 | const T &RHS = S.Stk.pop<T>(); | 698 | 618 | const T &LHS = S.Stk.pop<T>(); | 699 | 618 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 618 | return true; | 701 | 618 | } |
bool clang::interp::CmpHelper<clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 15 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 15 | using BoolT = PrimConv<PT_Bool>::T; | 697 | 15 | const T &RHS = S.Stk.pop<T>(); | 698 | 15 | const T &LHS = S.Stk.pop<T>(); | 699 | 15 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 15 | return true; | 701 | 15 | } |
bool clang::interp::CmpHelper<clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 29 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 29 | using BoolT = PrimConv<PT_Bool>::T; | 697 | 29 | const T &RHS = S.Stk.pop<T>(); | 698 | 29 | const T &LHS = S.Stk.pop<T>(); | 699 | 29 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 29 | return true; | 701 | 29 | } |
Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) bool clang::interp::CmpHelper<clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 695 | 254 | bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 696 | 254 | using BoolT = PrimConv<PT_Bool>::T; | 697 | 254 | const T &RHS = S.Stk.pop<T>(); | 698 | 254 | const T &LHS = S.Stk.pop<T>(); | 699 | 254 | S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS)))); | 700 | 254 | return true; | 701 | 254 | } |
|
702 | | |
703 | | template <typename T> |
704 | 36.9k | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { |
705 | 36.9k | return CmpHelper<T>(S, OpPC, Fn); |
706 | 36.9k | } 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)>) bool clang::interp::CmpHelperEQ<clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 27 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 27 | return CmpHelper<T>(S, OpPC, Fn); | 706 | 27 | } |
bool clang::interp::CmpHelperEQ<clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 39 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 39 | return CmpHelper<T>(S, OpPC, Fn); | 706 | 39 | } |
bool clang::interp::CmpHelperEQ<clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 35.3k | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 35.3k | return CmpHelper<T>(S, OpPC, Fn); | 706 | 35.3k | } |
bool clang::interp::CmpHelperEQ<clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 588 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 588 | return CmpHelper<T>(S, OpPC, Fn); | 706 | 588 | } |
bool clang::interp::CmpHelperEQ<clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 15 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 15 | return CmpHelper<T>(S, OpPC, Fn); | 706 | 15 | } |
bool clang::interp::CmpHelperEQ<clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 613 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 613 | return CmpHelper<T>(S, OpPC, Fn); | 706 | 613 | } |
bool clang::interp::CmpHelperEQ<clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 15 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 15 | return CmpHelper<T>(S, OpPC, Fn); | 706 | 15 | } |
bool clang::interp::CmpHelperEQ<clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 29 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 29 | return CmpHelper<T>(S, OpPC, Fn); | 706 | 29 | } |
Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) bool clang::interp::CmpHelperEQ<clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>) Line | Count | Source | 704 | 246 | bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) { | 705 | 246 | return CmpHelper<T>(S, OpPC, Fn); | 706 | 246 | } |
|
707 | | |
708 | | /// Function pointers cannot be compared in an ordered way. |
709 | | template <> |
710 | | inline bool CmpHelper<FunctionPointer>(InterpState &S, CodePtr OpPC, |
711 | 6 | CompareFn Fn) { |
712 | 6 | const auto &RHS = S.Stk.pop<FunctionPointer>(); |
713 | 6 | const auto &LHS = S.Stk.pop<FunctionPointer>(); |
714 | | |
715 | 6 | const SourceInfo &Loc = S.Current->getSource(OpPC); |
716 | 6 | S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified) |
717 | 6 | << LHS.toDiagnosticString(S.getCtx()) |
718 | 6 | << RHS.toDiagnosticString(S.getCtx()); |
719 | 6 | return false; |
720 | 6 | } |
721 | | |
722 | | template <> |
723 | | inline bool CmpHelperEQ<FunctionPointer>(InterpState &S, CodePtr OpPC, |
724 | 32 | CompareFn Fn) { |
725 | 32 | const auto &RHS = S.Stk.pop<FunctionPointer>(); |
726 | 32 | const auto &LHS = S.Stk.pop<FunctionPointer>(); |
727 | 32 | S.Stk.push<Boolean>(Boolean::from(Fn(LHS.compare(RHS)))); |
728 | 32 | return true; |
729 | 32 | } |
730 | | |
731 | | template <> |
732 | 12 | inline bool CmpHelper<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) { |
733 | 12 | using BoolT = PrimConv<PT_Bool>::T; |
734 | 12 | const Pointer &RHS = S.Stk.pop<Pointer>(); |
735 | 12 | const Pointer &LHS = S.Stk.pop<Pointer>(); |
736 | | |
737 | 12 | if (!Pointer::hasSameBase(LHS, RHS)) { |
738 | 4 | const SourceInfo &Loc = S.Current->getSource(OpPC); |
739 | 4 | S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified) |
740 | 4 | << LHS.toDiagnosticString(S.getCtx()) |
741 | 4 | << RHS.toDiagnosticString(S.getCtx()); |
742 | 4 | return false; |
743 | 8 | } else { |
744 | 8 | unsigned VL = LHS.getByteOffset(); |
745 | 8 | unsigned VR = RHS.getByteOffset(); |
746 | 8 | S.Stk.push<BoolT>(BoolT::from(Fn(Compare(VL, VR)))); |
747 | 8 | return true; |
748 | 8 | } |
749 | 12 | } |
750 | | |
751 | | template <> |
752 | 1.28k | inline bool CmpHelperEQ<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) { |
753 | 1.28k | using BoolT = PrimConv<PT_Bool>::T; |
754 | 1.28k | const Pointer &RHS = S.Stk.pop<Pointer>(); |
755 | 1.28k | const Pointer &LHS = S.Stk.pop<Pointer>(); |
756 | | |
757 | 1.28k | if (LHS.isZero() && RHS.isZero()119 ) { |
758 | 117 | S.Stk.push<BoolT>(BoolT::from(Fn(ComparisonCategoryResult::Equal))); |
759 | 117 | return true; |
760 | 117 | } |
761 | | |
762 | 1.16k | if (!Pointer::hasSameBase(LHS, RHS)) { |
763 | 969 | S.Stk.push<BoolT>(BoolT::from(Fn(ComparisonCategoryResult::Unordered))); |
764 | 969 | return true; |
765 | 969 | } else { |
766 | 200 | unsigned VL = LHS.getByteOffset(); |
767 | 200 | unsigned VR = RHS.getByteOffset(); |
768 | | |
769 | | // In our Pointer class, a pointer to an array and a pointer to the first |
770 | | // element in the same array are NOT equal. They have the same Base value, |
771 | | // but a different Offset. This is a pretty rare case, so we fix this here |
772 | | // by comparing pointers to the first elements. |
773 | 200 | if (LHS.inArray() && LHS.isRoot()186 ) |
774 | 4 | VL = LHS.atIndex(0).getByteOffset(); |
775 | 200 | if (RHS.inArray() && RHS.isRoot()186 ) |
776 | 6 | VR = RHS.atIndex(0).getByteOffset(); |
777 | | |
778 | 200 | S.Stk.push<BoolT>(BoolT::from(Fn(Compare(VL, VR)))); |
779 | 200 | return true; |
780 | 200 | } |
781 | 1.16k | } |
782 | | |
783 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
784 | 4.88k | bool EQ(InterpState &S, CodePtr OpPC) { |
785 | 4.88k | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { |
786 | 4.88k | return R == ComparisonCategoryResult::Equal; |
787 | 4.88k | }); 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 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 Line | Count | Source | 785 | 27 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 27 | return R == ComparisonCategoryResult::Equal; | 787 | 27 | }); |
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 Line | Count | Source | 785 | 39 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 39 | return R == ComparisonCategoryResult::Equal; | 787 | 39 | }); |
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 Line | Count | Source | 785 | 3.24k | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 3.24k | return R == ComparisonCategoryResult::Equal; | 787 | 3.24k | }); |
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 Line | Count | Source | 785 | 588 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 588 | return R == ComparisonCategoryResult::Equal; | 787 | 588 | }); |
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 Line | Count | Source | 785 | 15 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 15 | return R == ComparisonCategoryResult::Equal; | 787 | 15 | }); |
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 Line | Count | Source | 785 | 613 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 613 | return R == ComparisonCategoryResult::Equal; | 787 | 613 | }); |
bool clang::interp::EQ<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 785 | 15 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 15 | return R == ComparisonCategoryResult::Equal; | 787 | 15 | }); |
bool clang::interp::EQ<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 785 | 21 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 21 | return R == ComparisonCategoryResult::Equal; | 787 | 21 | }); |
Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const bool clang::interp::EQ<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 785 | 64 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 64 | return R == ComparisonCategoryResult::Equal; | 787 | 64 | }); |
bool clang::interp::EQ<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 785 | 17 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 17 | return R == ComparisonCategoryResult::Equal; | 787 | 17 | }); |
bool clang::interp::EQ<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 785 | 245 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 245 | return R == ComparisonCategoryResult::Equal; | 787 | 245 | }); |
|
788 | 4.88k | } 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) bool clang::interp::EQ<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 27 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 27 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 27 | return R == ComparisonCategoryResult::Equal; | 787 | 27 | }); | 788 | 27 | } |
bool clang::interp::EQ<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 39 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 39 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 39 | return R == ComparisonCategoryResult::Equal; | 787 | 39 | }); | 788 | 39 | } |
bool clang::interp::EQ<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 3.24k | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 3.24k | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 3.24k | return R == ComparisonCategoryResult::Equal; | 787 | 3.24k | }); | 788 | 3.24k | } |
bool clang::interp::EQ<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 588 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 588 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 588 | return R == ComparisonCategoryResult::Equal; | 787 | 588 | }); | 788 | 588 | } |
bool clang::interp::EQ<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 15 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 15 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 15 | return R == ComparisonCategoryResult::Equal; | 787 | 15 | }); | 788 | 15 | } |
bool clang::interp::EQ<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 613 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 613 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 613 | return R == ComparisonCategoryResult::Equal; | 787 | 613 | }); | 788 | 613 | } |
bool clang::interp::EQ<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 15 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 15 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 15 | return R == ComparisonCategoryResult::Equal; | 787 | 15 | }); | 788 | 15 | } |
bool clang::interp::EQ<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 21 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 21 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 21 | return R == ComparisonCategoryResult::Equal; | 787 | 21 | }); | 788 | 21 | } |
Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::EQ<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 64 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 64 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 64 | return R == ComparisonCategoryResult::Equal; | 787 | 64 | }); | 788 | 64 | } |
bool clang::interp::EQ<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 17 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 17 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 17 | return R == ComparisonCategoryResult::Equal; | 787 | 17 | }); | 788 | 17 | } |
bool clang::interp::EQ<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 784 | 245 | bool EQ(InterpState &S, CodePtr OpPC) { | 785 | 245 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 786 | 245 | return R == ComparisonCategoryResult::Equal; | 787 | 245 | }); | 788 | 245 | } |
|
789 | | |
790 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
791 | 10 | bool CMP3(InterpState &S, CodePtr OpPC, const ComparisonCategoryInfo *CmpInfo) { |
792 | 10 | const T &RHS = S.Stk.pop<T>(); |
793 | 10 | const T &LHS = S.Stk.pop<T>(); |
794 | 10 | const Pointer &P = S.Stk.peek<Pointer>(); |
795 | | |
796 | 10 | ComparisonCategoryResult CmpResult = LHS.compare(RHS); |
797 | 10 | if (CmpResult == ComparisonCategoryResult::Unordered) { |
798 | | // This should only happen with pointers. |
799 | 1 | const SourceInfo &Loc = S.Current->getSource(OpPC); |
800 | 1 | S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified) |
801 | 1 | << LHS.toDiagnosticString(S.getCtx()) |
802 | 1 | << RHS.toDiagnosticString(S.getCtx()); |
803 | 1 | return false; |
804 | 1 | } |
805 | | |
806 | 9 | assert(CmpInfo); |
807 | 9 | const auto *CmpValueInfo = CmpInfo->getValueInfo(CmpResult); |
808 | 9 | assert(CmpValueInfo); |
809 | 9 | assert(CmpValueInfo->hasValidIntValue()); |
810 | 9 | APSInt IntValue = CmpValueInfo->getIntValue(); |
811 | 9 | return SetThreeWayComparisonField(S, OpPC, P, IntValue); |
812 | 9 | } Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) bool clang::interp::CMP3<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Line | Count | Source | 791 | 3 | bool CMP3(InterpState &S, CodePtr OpPC, const ComparisonCategoryInfo *CmpInfo) { | 792 | 3 | const T &RHS = S.Stk.pop<T>(); | 793 | 3 | const T &LHS = S.Stk.pop<T>(); | 794 | 3 | const Pointer &P = S.Stk.peek<Pointer>(); | 795 | | | 796 | 3 | ComparisonCategoryResult CmpResult = LHS.compare(RHS); | 797 | 3 | if (CmpResult == ComparisonCategoryResult::Unordered) { | 798 | | // This should only happen with pointers. | 799 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 800 | 0 | S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified) | 801 | 0 | << LHS.toDiagnosticString(S.getCtx()) | 802 | 0 | << RHS.toDiagnosticString(S.getCtx()); | 803 | 0 | return false; | 804 | 0 | } | 805 | | | 806 | 3 | assert(CmpInfo); | 807 | 3 | const auto *CmpValueInfo = CmpInfo->getValueInfo(CmpResult); | 808 | 3 | assert(CmpValueInfo); | 809 | 3 | assert(CmpValueInfo->hasValidIntValue()); | 810 | 3 | APSInt IntValue = CmpValueInfo->getIntValue(); | 811 | 3 | return SetThreeWayComparisonField(S, OpPC, P, IntValue); | 812 | 3 | } |
Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) bool clang::interp::CMP3<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Line | Count | Source | 791 | 4 | bool CMP3(InterpState &S, CodePtr OpPC, const ComparisonCategoryInfo *CmpInfo) { | 792 | 4 | const T &RHS = S.Stk.pop<T>(); | 793 | 4 | const T &LHS = S.Stk.pop<T>(); | 794 | 4 | const Pointer &P = S.Stk.peek<Pointer>(); | 795 | | | 796 | 4 | ComparisonCategoryResult CmpResult = LHS.compare(RHS); | 797 | 4 | if (CmpResult == ComparisonCategoryResult::Unordered) { | 798 | | // This should only happen with pointers. | 799 | 1 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 800 | 1 | S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified) | 801 | 1 | << LHS.toDiagnosticString(S.getCtx()) | 802 | 1 | << RHS.toDiagnosticString(S.getCtx()); | 803 | 1 | return false; | 804 | 1 | } | 805 | | | 806 | 3 | assert(CmpInfo); | 807 | 3 | const auto *CmpValueInfo = CmpInfo->getValueInfo(CmpResult); | 808 | 3 | assert(CmpValueInfo); | 809 | 3 | assert(CmpValueInfo->hasValidIntValue()); | 810 | 3 | APSInt IntValue = CmpValueInfo->getIntValue(); | 811 | 3 | return SetThreeWayComparisonField(S, OpPC, P, IntValue); | 812 | 3 | } |
bool clang::interp::CMP3<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) Line | Count | Source | 791 | 3 | bool CMP3(InterpState &S, CodePtr OpPC, const ComparisonCategoryInfo *CmpInfo) { | 792 | 3 | const T &RHS = S.Stk.pop<T>(); | 793 | 3 | const T &LHS = S.Stk.pop<T>(); | 794 | 3 | const Pointer &P = S.Stk.peek<Pointer>(); | 795 | | | 796 | 3 | ComparisonCategoryResult CmpResult = LHS.compare(RHS); | 797 | 3 | if (CmpResult == ComparisonCategoryResult::Unordered) { | 798 | | // This should only happen with pointers. | 799 | 0 | const SourceInfo &Loc = S.Current->getSource(OpPC); | 800 | 0 | S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified) | 801 | 0 | << LHS.toDiagnosticString(S.getCtx()) | 802 | 0 | << RHS.toDiagnosticString(S.getCtx()); | 803 | 0 | return false; | 804 | 0 | } | 805 | | | 806 | 3 | assert(CmpInfo); | 807 | 3 | const auto *CmpValueInfo = CmpInfo->getValueInfo(CmpResult); | 808 | 3 | assert(CmpValueInfo); | 809 | 3 | assert(CmpValueInfo->hasValidIntValue()); | 810 | 3 | APSInt IntValue = CmpValueInfo->getIntValue(); | 811 | 3 | return SetThreeWayComparisonField(S, OpPC, P, IntValue); | 812 | 3 | } |
Unexecuted instantiation: bool clang::interp::CMP3<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, clang::ComparisonCategoryInfo const*) |
813 | | |
814 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
815 | 33.3k | bool NE(InterpState &S, CodePtr OpPC) { |
816 | 33.3k | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { |
817 | 33.3k | return R != ComparisonCategoryResult::Equal; |
818 | 33.3k | }); 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 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 Line | Count | Source | 816 | 32.1k | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 32.1k | return R != ComparisonCategoryResult::Equal; | 818 | 32.1k | }); |
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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const bool clang::interp::NE<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 816 | 8 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 8 | return R != ComparisonCategoryResult::Equal; | 818 | 8 | }); |
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const bool clang::interp::NE<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 816 | 1.22k | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 1.22k | return R != ComparisonCategoryResult::Equal; | 818 | 1.22k | }); |
bool clang::interp::NE<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 816 | 15 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 15 | return R != ComparisonCategoryResult::Equal; | 818 | 15 | }); |
bool clang::interp::NE<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 816 | 1 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 1 | return R != ComparisonCategoryResult::Equal; | 818 | 1 | }); |
|
819 | 33.3k | } 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) bool clang::interp::NE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 815 | 32.1k | bool NE(InterpState &S, CodePtr OpPC) { | 816 | 32.1k | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 32.1k | return R != ComparisonCategoryResult::Equal; | 818 | 32.1k | }); | 819 | 32.1k | } |
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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::NE<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 815 | 8 | bool NE(InterpState &S, CodePtr OpPC) { | 816 | 8 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 8 | return R != ComparisonCategoryResult::Equal; | 818 | 8 | }); | 819 | 8 | } |
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::NE<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 815 | 1.22k | bool NE(InterpState &S, CodePtr OpPC) { | 816 | 1.22k | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 1.22k | return R != ComparisonCategoryResult::Equal; | 818 | 1.22k | }); | 819 | 1.22k | } |
bool clang::interp::NE<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 815 | 15 | bool NE(InterpState &S, CodePtr OpPC) { | 816 | 15 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 15 | return R != ComparisonCategoryResult::Equal; | 818 | 15 | }); | 819 | 15 | } |
bool clang::interp::NE<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 815 | 1 | bool NE(InterpState &S, CodePtr OpPC) { | 816 | 1 | return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) { | 817 | 1 | return R != ComparisonCategoryResult::Equal; | 818 | 1 | }); | 819 | 1 | } |
|
820 | | |
821 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
822 | 108 | bool LT(InterpState &S, CodePtr OpPC) { |
823 | 108 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { |
824 | 100 | return R == ComparisonCategoryResult::Less; |
825 | 100 | }); 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 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 Line | Count | Source | 823 | 97 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 824 | 97 | return R == ComparisonCategoryResult::Less; | 825 | 97 | }); |
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::IntegralAP<false> >(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::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const bool clang::interp::LT<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 823 | 2 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 824 | 2 | return R == ComparisonCategoryResult::Less; | 825 | 2 | }); |
bool clang::interp::LT<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 823 | 1 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 824 | 1 | return R == ComparisonCategoryResult::Less; | 825 | 1 | }); |
Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
826 | 108 | } 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) bool clang::interp::LT<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 822 | 97 | bool LT(InterpState &S, CodePtr OpPC) { | 823 | 97 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 824 | 97 | return R == ComparisonCategoryResult::Less; | 825 | 97 | }); | 826 | 97 | } |
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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::LT<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 822 | 4 | bool LT(InterpState &S, CodePtr OpPC) { | 823 | 4 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 824 | 4 | return R == ComparisonCategoryResult::Less; | 825 | 4 | }); | 826 | 4 | } |
bool clang::interp::LT<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 822 | 1 | bool LT(InterpState &S, CodePtr OpPC) { | 823 | 1 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 824 | 1 | return R == ComparisonCategoryResult::Less; | 825 | 1 | }); | 826 | 1 | } |
bool clang::interp::LT<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 822 | 6 | bool LT(InterpState &S, CodePtr OpPC) { | 823 | 6 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 824 | 6 | return R == ComparisonCategoryResult::Less; | 825 | 6 | }); | 826 | 6 | } |
|
827 | | |
828 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
829 | 2 | bool LE(InterpState &S, CodePtr OpPC) { |
830 | 2 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { |
831 | 2 | return R == ComparisonCategoryResult::Less || |
832 | 2 | R == ComparisonCategoryResult::Equal; |
833 | 2 | }); 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::IntegralAP<false> >(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::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const bool clang::interp::LE<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 830 | 2 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 831 | 2 | return R == ComparisonCategoryResult::Less || | 832 | 2 | R == ComparisonCategoryResult::Equal; | 833 | 2 | }); |
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
834 | 2 | } 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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::LE<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 829 | 2 | bool LE(InterpState &S, CodePtr OpPC) { | 830 | 2 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 831 | 2 | return R == ComparisonCategoryResult::Less || | 832 | 2 | R == ComparisonCategoryResult::Equal; | 833 | 2 | }); | 834 | 2 | } |
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
835 | | |
836 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
837 | 44 | bool GT(InterpState &S, CodePtr OpPC) { |
838 | 44 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { |
839 | 42 | return R == ComparisonCategoryResult::Greater; |
840 | 42 | }); 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 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 Line | Count | Source | 838 | 28 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 839 | 28 | return R == ComparisonCategoryResult::Greater; | 840 | 28 | }); |
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 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 Line | Count | Source | 838 | 5 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 839 | 5 | return R == ComparisonCategoryResult::Greater; | 840 | 5 | }); |
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(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::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const bool clang::interp::GT<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 838 | 2 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 839 | 2 | return R == ComparisonCategoryResult::Greater; | 840 | 2 | }); |
bool clang::interp::GT<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 838 | 7 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 839 | 7 | return R == ComparisonCategoryResult::Greater; | 840 | 7 | }); |
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
841 | 44 | } 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) bool clang::interp::GT<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 837 | 28 | bool GT(InterpState &S, CodePtr OpPC) { | 838 | 28 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 839 | 28 | return R == ComparisonCategoryResult::Greater; | 840 | 28 | }); | 841 | 28 | } |
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) bool clang::interp::GT<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 837 | 5 | bool GT(InterpState &S, CodePtr OpPC) { | 838 | 5 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 839 | 5 | return R == ComparisonCategoryResult::Greater; | 840 | 5 | }); | 841 | 5 | } |
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::GT<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 837 | 4 | bool GT(InterpState &S, CodePtr OpPC) { | 838 | 4 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 839 | 4 | return R == ComparisonCategoryResult::Greater; | 840 | 4 | }); | 841 | 4 | } |
bool clang::interp::GT<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 837 | 7 | bool GT(InterpState &S, CodePtr OpPC) { | 838 | 7 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 839 | 7 | return R == ComparisonCategoryResult::Greater; | 840 | 7 | }); | 841 | 7 | } |
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
842 | | |
843 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
844 | 26 | bool GE(InterpState &S, CodePtr OpPC) { |
845 | 26 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { |
846 | 26 | return R == ComparisonCategoryResult::Greater || |
847 | 26 | R == ComparisonCategoryResult::Equal6 ; |
848 | 26 | }); 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 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 Line | Count | Source | 845 | 24 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 846 | 24 | return R == ComparisonCategoryResult::Greater || | 847 | 24 | R == ComparisonCategoryResult::Equal6 ; | 848 | 24 | }); |
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::IntegralAP<false> >(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::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const bool clang::interp::GE<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Line | Count | Source | 845 | 2 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 846 | 2 | return R == ComparisonCategoryResult::Greater || | 847 | 2 | R == ComparisonCategoryResult::Equal0 ; | 848 | 2 | }); |
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const |
849 | 26 | } 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) bool clang::interp::GE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 844 | 24 | bool GE(InterpState &S, CodePtr OpPC) { | 845 | 24 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 846 | 24 | return R == ComparisonCategoryResult::Greater || | 847 | 24 | R == ComparisonCategoryResult::Equal; | 848 | 24 | }); | 849 | 24 | } |
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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::GE<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 844 | 2 | bool GE(InterpState &S, CodePtr OpPC) { | 845 | 2 | return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) { | 846 | 2 | return R == ComparisonCategoryResult::Greater || | 847 | 2 | R == ComparisonCategoryResult::Equal; | 848 | 2 | }); | 849 | 2 | } |
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr) |
850 | | |
851 | | //===----------------------------------------------------------------------===// |
852 | | // InRange |
853 | | //===----------------------------------------------------------------------===// |
854 | | |
855 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
856 | | bool InRange(InterpState &S, CodePtr OpPC) { |
857 | | const T RHS = S.Stk.pop<T>(); |
858 | | const T LHS = S.Stk.pop<T>(); |
859 | | const T Value = S.Stk.pop<T>(); |
860 | | |
861 | | S.Stk.push<bool>(LHS <= Value && Value <= RHS); |
862 | | return true; |
863 | | } |
864 | | |
865 | | //===----------------------------------------------------------------------===// |
866 | | // Dup, Pop, Test |
867 | | //===----------------------------------------------------------------------===// |
868 | | |
869 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
870 | 5.43k | bool Dup(InterpState &S, CodePtr OpPC) { |
871 | 5.43k | S.Stk.push<T>(S.Stk.peek<T>()); |
872 | 5.43k | return true; |
873 | 5.43k | } 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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Dup<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 870 | 5.43k | bool Dup(InterpState &S, CodePtr OpPC) { | 871 | 5.43k | S.Stk.push<T>(S.Stk.peek<T>()); | 872 | 5.43k | return true; | 873 | 5.43k | } |
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) |
874 | | |
875 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
876 | 5.89k | bool Pop(InterpState &S, CodePtr OpPC) { |
877 | 5.89k | S.Stk.pop<T>(); |
878 | 5.89k | return true; |
879 | 5.89k | } 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) bool clang::interp::Pop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 876 | 22 | bool Pop(InterpState &S, CodePtr OpPC) { | 877 | 22 | S.Stk.pop<T>(); | 878 | 22 | return true; | 879 | 22 | } |
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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr) bool clang::interp::Pop<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 876 | 2 | bool Pop(InterpState &S, CodePtr OpPC) { | 877 | 2 | S.Stk.pop<T>(); | 878 | 2 | return true; | 879 | 2 | } |
bool clang::interp::Pop<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr) Line | Count | Source | 876 | 5.86k | bool Pop(InterpState &S, CodePtr OpPC) { | 877 | 5.86k | S.Stk.pop<T>(); | 878 | 5.86k | return true; | 879 | 5.86k | } |
Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr) Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr) |
880 | | |
881 | | //===----------------------------------------------------------------------===// |
882 | | // Const |
883 | | //===----------------------------------------------------------------------===// |
884 | | |
885 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
886 | 63.0k | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { |
887 | 63.0k | S.Stk.push<T>(Arg); |
888 | 63.0k | return true; |
889 | 63.0k | } bool clang::interp::Const<(clang::interp::PrimType)10, bool>(clang::interp::InterpState&, clang::interp::CodePtr, bool const&) Line | Count | Source | 886 | 1.32k | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 1.32k | S.Stk.push<T>(Arg); | 888 | 1.32k | return true; | 889 | 1.32k | } |
bool clang::interp::Const<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Floating const&) Line | Count | Source | 886 | 921 | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 921 | S.Stk.push<T>(Arg); | 888 | 921 | return true; | 889 | 921 | } |
bool clang::interp::Const<(clang::interp::PrimType)0, signed char>(clang::interp::InterpState&, clang::interp::CodePtr, signed char const&) Line | Count | Source | 886 | 556 | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 556 | S.Stk.push<T>(Arg); | 888 | 556 | return true; | 889 | 556 | } |
bool clang::interp::Const<(clang::interp::PrimType)2, short>(clang::interp::InterpState&, clang::interp::CodePtr, short const&) Line | Count | Source | 886 | 402 | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 402 | S.Stk.push<T>(Arg); | 888 | 402 | return true; | 889 | 402 | } |
bool clang::interp::Const<(clang::interp::PrimType)4, int>(clang::interp::InterpState&, clang::interp::CodePtr, int const&) Line | Count | Source | 886 | 34.8k | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 34.8k | S.Stk.push<T>(Arg); | 888 | 34.8k | return true; | 889 | 34.8k | } |
bool clang::interp::Const<(clang::interp::PrimType)6, long long>(clang::interp::InterpState&, clang::interp::CodePtr, long long const&) Line | Count | Source | 886 | 96 | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 96 | S.Stk.push<T>(Arg); | 888 | 96 | return true; | 889 | 96 | } |
bool clang::interp::Const<(clang::interp::PrimType)1, unsigned char>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned char const&) Line | Count | Source | 886 | 21.0k | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 21.0k | S.Stk.push<T>(Arg); | 888 | 21.0k | return true; | 889 | 21.0k | } |
bool clang::interp::Const<(clang::interp::PrimType)3, unsigned short>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned short const&) Line | Count | Source | 886 | 25 | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 25 | S.Stk.push<T>(Arg); | 888 | 25 | return true; | 889 | 25 | } |
bool clang::interp::Const<(clang::interp::PrimType)5, unsigned int>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int const&) Line | Count | Source | 886 | 2.72k | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 2.72k | S.Stk.push<T>(Arg); | 888 | 2.72k | return true; | 889 | 2.72k | } |
bool clang::interp::Const<(clang::interp::PrimType)7, unsigned long long>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned long long const&) Line | Count | Source | 886 | 1.12k | bool Const(InterpState &S, CodePtr OpPC, const T &Arg) { | 887 | 1.12k | S.Stk.push<T>(Arg); | 888 | 1.12k | return true; | 889 | 1.12k | } |
|
890 | | |
891 | | //===----------------------------------------------------------------------===// |
892 | | // Get/Set Local/Param/Global/This |
893 | | //===----------------------------------------------------------------------===// |
894 | | |
895 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
896 | 3.10k | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { |
897 | 3.10k | const Pointer &Ptr = S.Current->getLocalPointer(I); |
898 | 3.10k | if (!CheckLoad(S, OpPC, Ptr)) |
899 | 8 | return false; |
900 | 3.09k | S.Stk.push<T>(Ptr.deref<T>()); |
901 | 3.09k | return true; |
902 | 3.10k | } bool clang::interp::GetLocal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 6 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 6 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 6 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 6 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 6 | return true; | 902 | 6 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 6 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 6 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 6 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 6 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 6 | return true; | 902 | 6 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 2 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 2 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 2 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 2 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 2 | return true; | 902 | 2 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 6 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 6 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 6 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 6 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 6 | return true; | 902 | 6 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 1.85k | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 1.85k | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 1.85k | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 8 | return false; | 900 | 1.84k | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 1.84k | return true; | 902 | 1.85k | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 42 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 42 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 42 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 42 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 42 | return true; | 902 | 42 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 4 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 4 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 4 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 4 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 4 | return true; | 902 | 4 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 12 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 12 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 12 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 12 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 12 | return true; | 902 | 12 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 2 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 2 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 2 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 2 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 2 | return true; | 902 | 2 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 18 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 18 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 18 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 18 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 18 | return true; | 902 | 18 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 31 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 31 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 31 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 31 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 31 | return true; | 902 | 31 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 1.03k | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 1.03k | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 1.03k | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 1.03k | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 1.03k | return true; | 902 | 1.03k | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 32 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 32 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 32 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 32 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 32 | return true; | 902 | 32 | } |
bool clang::interp::GetLocal<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 896 | 57 | bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 897 | 57 | const Pointer &Ptr = S.Current->getLocalPointer(I); | 898 | 57 | if (!CheckLoad(S, OpPC, Ptr)) | 899 | 0 | return false; | 900 | 57 | S.Stk.push<T>(Ptr.deref<T>()); | 901 | 57 | return true; | 902 | 57 | } |
|
903 | | |
904 | | /// 1) Pops the value from the stack. |
905 | | /// 2) Writes the value to the local variable with the |
906 | | /// given offset. |
907 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
908 | 1.39k | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { |
909 | 1.39k | S.Current->setLocal<T>(I, S.Stk.pop<T>()); |
910 | 1.39k | return true; |
911 | 1.39k | } bool clang::interp::SetLocal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 6 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 6 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 6 | return true; | 911 | 6 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 6 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 6 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 6 | return true; | 911 | 6 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 2 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 2 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 2 | return true; | 911 | 2 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 6 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 6 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 6 | return true; | 911 | 6 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 700 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 700 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 700 | return true; | 911 | 700 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 26 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 26 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 26 | return true; | 911 | 26 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 4 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 4 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 4 | return true; | 911 | 4 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 4 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 4 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 4 | return true; | 911 | 4 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 2 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 2 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 2 | return true; | 911 | 2 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 18 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 18 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 18 | return true; | 911 | 18 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 16 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 16 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 16 | return true; | 911 | 16 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 523 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 523 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 523 | return true; | 911 | 523 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 30 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 30 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 30 | return true; | 911 | 30 | } |
bool clang::interp::SetLocal<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 908 | 52 | bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) { | 909 | 52 | S.Current->setLocal<T>(I, S.Stk.pop<T>()); | 910 | 52 | return true; | 911 | 52 | } |
|
912 | | |
913 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
914 | 56.4k | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { |
915 | 56.4k | if (S.checkingPotentialConstantExpression()) { |
916 | 323 | return false; |
917 | 323 | } |
918 | 56.1k | S.Stk.push<T>(S.Current->getParam<T>(I)); |
919 | 56.1k | return true; |
920 | 56.4k | } bool clang::interp::GetParam<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 2 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 2 | if (S.checkingPotentialConstantExpression()) { | 916 | 0 | return false; | 917 | 0 | } | 918 | 2 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 2 | return true; | 920 | 2 | } |
bool clang::interp::GetParam<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 2 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 2 | if (S.checkingPotentialConstantExpression()) { | 916 | 0 | return false; | 917 | 0 | } | 918 | 2 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 2 | return true; | 920 | 2 | } |
bool clang::interp::GetParam<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 2 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 2 | if (S.checkingPotentialConstantExpression()) { | 916 | 0 | return false; | 917 | 0 | } | 918 | 2 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 2 | return true; | 920 | 2 | } |
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 | 914 | 1.86k | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 1.86k | if (S.checkingPotentialConstantExpression()) { | 916 | 132 | return false; | 917 | 132 | } | 918 | 1.73k | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 1.73k | return true; | 920 | 1.86k | } |
bool clang::interp::GetParam<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 2.34k | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 2.34k | if (S.checkingPotentialConstantExpression()) { | 916 | 23 | return false; | 917 | 23 | } | 918 | 2.32k | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 2.32k | return true; | 920 | 2.34k | } |
bool clang::interp::GetParam<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 5 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 5 | if (S.checkingPotentialConstantExpression()) { | 916 | 0 | return false; | 917 | 0 | } | 918 | 5 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 5 | return true; | 920 | 5 | } |
bool clang::interp::GetParam<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 7 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 7 | if (S.checkingPotentialConstantExpression()) { | 916 | 1 | return false; | 917 | 1 | } | 918 | 6 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 6 | return true; | 920 | 7 | } |
Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::GetParam<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 33 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 33 | if (S.checkingPotentialConstantExpression()) { | 916 | 0 | return false; | 917 | 0 | } | 918 | 33 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 33 | return true; | 920 | 33 | } |
bool clang::interp::GetParam<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 899 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 899 | if (S.checkingPotentialConstantExpression()) { | 916 | 27 | return false; | 917 | 27 | } | 918 | 872 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 872 | return true; | 920 | 899 | } |
bool clang::interp::GetParam<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 51.2k | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 51.2k | if (S.checkingPotentialConstantExpression()) { | 916 | 133 | return false; | 917 | 133 | } | 918 | 51.1k | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 51.1k | return true; | 920 | 51.2k | } |
bool clang::interp::GetParam<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 21 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 21 | if (S.checkingPotentialConstantExpression()) { | 916 | 3 | return false; | 917 | 3 | } | 918 | 18 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 18 | return true; | 920 | 21 | } |
bool clang::interp::GetParam<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 914 | 20 | bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) { | 915 | 20 | if (S.checkingPotentialConstantExpression()) { | 916 | 4 | return false; | 917 | 4 | } | 918 | 16 | S.Stk.push<T>(S.Current->getParam<T>(I)); | 919 | 16 | return true; | 920 | 20 | } |
|
921 | | |
922 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
923 | 0 | bool SetParam(InterpState &S, CodePtr OpPC, uint32_t I) { |
924 | 0 | S.Current->setParam<T>(I, S.Stk.pop<T>()); |
925 | 0 | return true; |
926 | 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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
927 | | |
928 | | /// 1) Peeks a pointer on the stack |
929 | | /// 2) Pushes the value of the pointer's field on the stack |
930 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
931 | 0 | bool GetField(InterpState &S, CodePtr OpPC, uint32_t I) { |
932 | 0 | const Pointer &Obj = S.Stk.peek<Pointer>(); |
933 | 0 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) |
934 | 0 | return false; |
935 | 0 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) |
936 | 0 | return false; |
937 | 0 | const Pointer &Field = Obj.atField(I); |
938 | 0 | if (!CheckLoad(S, OpPC, Field)) |
939 | 0 | return false; |
940 | 0 | S.Stk.push<T>(Field.deref<T>()); |
941 | 0 | return true; |
942 | 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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
943 | | |
944 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
945 | 54 | bool SetField(InterpState &S, CodePtr OpPC, uint32_t I) { |
946 | 54 | const T &Value = S.Stk.pop<T>(); |
947 | 54 | const Pointer &Obj = S.Stk.peek<Pointer>(); |
948 | 54 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) |
949 | 0 | return false; |
950 | 54 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) |
951 | 0 | return false; |
952 | 54 | const Pointer &Field = Obj.atField(I); |
953 | 54 | if (!CheckStore(S, OpPC, Field)) |
954 | 0 | return false; |
955 | 54 | Field.initialize(); |
956 | 54 | Field.deref<T>() = Value; |
957 | 54 | return true; |
958 | 54 | } 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) bool clang::interp::SetField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 945 | 25 | bool SetField(InterpState &S, CodePtr OpPC, uint32_t I) { | 946 | 25 | const T &Value = S.Stk.pop<T>(); | 947 | 25 | const Pointer &Obj = S.Stk.peek<Pointer>(); | 948 | 25 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) | 949 | 0 | return false; | 950 | 25 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) | 951 | 0 | return false; | 952 | 25 | const Pointer &Field = Obj.atField(I); | 953 | 25 | if (!CheckStore(S, OpPC, Field)) | 954 | 0 | return false; | 955 | 25 | Field.initialize(); | 956 | 25 | Field.deref<T>() = Value; | 957 | 25 | return true; | 958 | 25 | } |
bool clang::interp::SetField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 945 | 20 | bool SetField(InterpState &S, CodePtr OpPC, uint32_t I) { | 946 | 20 | const T &Value = S.Stk.pop<T>(); | 947 | 20 | const Pointer &Obj = S.Stk.peek<Pointer>(); | 948 | 20 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) | 949 | 0 | return false; | 950 | 20 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) | 951 | 0 | return false; | 952 | 20 | const Pointer &Field = Obj.atField(I); | 953 | 20 | if (!CheckStore(S, OpPC, Field)) | 954 | 0 | return false; | 955 | 20 | Field.initialize(); | 956 | 20 | Field.deref<T>() = Value; | 957 | 20 | return true; | 958 | 20 | } |
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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::SetField<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 945 | 9 | bool SetField(InterpState &S, CodePtr OpPC, uint32_t I) { | 946 | 9 | const T &Value = S.Stk.pop<T>(); | 947 | 9 | const Pointer &Obj = S.Stk.peek<Pointer>(); | 948 | 9 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) | 949 | 0 | return false; | 950 | 9 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) | 951 | 0 | return false; | 952 | 9 | const Pointer &Field = Obj.atField(I); | 953 | 9 | if (!CheckStore(S, OpPC, Field)) | 954 | 0 | return false; | 955 | 9 | Field.initialize(); | 956 | 9 | Field.deref<T>() = Value; | 957 | 9 | return true; | 958 | 9 | } |
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
959 | | |
960 | | /// 1) Pops a pointer from the stack |
961 | | /// 2) Pushes the value of the pointer's field on the stack |
962 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
963 | 147 | bool GetFieldPop(InterpState &S, CodePtr OpPC, uint32_t I) { |
964 | 147 | const Pointer &Obj = S.Stk.pop<Pointer>(); |
965 | 147 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) |
966 | 0 | return false; |
967 | 147 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) |
968 | 0 | return false; |
969 | 147 | const Pointer &Field = Obj.atField(I); |
970 | 147 | if (!CheckLoad(S, OpPC, Field)) |
971 | 12 | return false; |
972 | 135 | S.Stk.push<T>(Field.deref<T>()); |
973 | 135 | return true; |
974 | 147 | } 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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::GetFieldPop<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 963 | 147 | bool GetFieldPop(InterpState &S, CodePtr OpPC, uint32_t I) { | 964 | 147 | const Pointer &Obj = S.Stk.pop<Pointer>(); | 965 | 147 | if (!CheckNull(S, OpPC, Obj, CSK_Field)) | 966 | 0 | return false; | 967 | 147 | if (!CheckRange(S, OpPC, Obj, CSK_Field)) | 968 | 0 | return false; | 969 | 147 | const Pointer &Field = Obj.atField(I); | 970 | 147 | if (!CheckLoad(S, OpPC, Field)) | 971 | 12 | return false; | 972 | 135 | S.Stk.push<T>(Field.deref<T>()); | 973 | 135 | return true; | 974 | 147 | } |
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
975 | | |
976 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
977 | 9 | bool GetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { |
978 | 9 | if (S.checkingPotentialConstantExpression()) |
979 | 0 | return false; |
980 | 9 | const Pointer &This = S.Current->getThis(); |
981 | 9 | if (!CheckThis(S, OpPC, This)) |
982 | 0 | return false; |
983 | 9 | const Pointer &Field = This.atField(I); |
984 | 9 | if (!CheckLoad(S, OpPC, Field)) |
985 | 0 | return false; |
986 | 9 | S.Stk.push<T>(Field.deref<T>()); |
987 | 9 | return true; |
988 | 9 | } 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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::GetThisField<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 977 | 9 | bool GetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { | 978 | 9 | if (S.checkingPotentialConstantExpression()) | 979 | 0 | return false; | 980 | 9 | const Pointer &This = S.Current->getThis(); | 981 | 9 | if (!CheckThis(S, OpPC, This)) | 982 | 0 | return false; | 983 | 9 | const Pointer &Field = This.atField(I); | 984 | 9 | if (!CheckLoad(S, OpPC, Field)) | 985 | 0 | return false; | 986 | 9 | S.Stk.push<T>(Field.deref<T>()); | 987 | 9 | return true; | 988 | 9 | } |
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
989 | | |
990 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
991 | 0 | bool SetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { |
992 | 0 | if (S.checkingPotentialConstantExpression()) |
993 | 0 | return false; |
994 | 0 | const T &Value = S.Stk.pop<T>(); |
995 | 0 | const Pointer &This = S.Current->getThis(); |
996 | 0 | if (!CheckThis(S, OpPC, This)) |
997 | 0 | return false; |
998 | 0 | const Pointer &Field = This.atField(I); |
999 | 0 | if (!CheckStore(S, OpPC, Field)) |
1000 | 0 | return false; |
1001 | 0 | Field.deref<T>() = Value; |
1002 | 0 | return true; |
1003 | 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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
1004 | | |
1005 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
1006 | 2.09k | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { |
1007 | 2.09k | auto *B = S.P.getGlobal(I); |
1008 | 2.09k | if (B->isExtern()) |
1009 | 0 | return false; |
1010 | 2.09k | S.Stk.push<T>(B->deref<T>()); |
1011 | 2.09k | return true; |
1012 | 2.09k | } bool clang::interp::GetGlobal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 22 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 22 | auto *B = S.P.getGlobal(I); | 1008 | 22 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 22 | S.Stk.push<T>(B->deref<T>()); | 1011 | 22 | return true; | 1012 | 22 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 6 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 6 | auto *B = S.P.getGlobal(I); | 1008 | 6 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 6 | S.Stk.push<T>(B->deref<T>()); | 1011 | 6 | return true; | 1012 | 6 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 16 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 16 | auto *B = S.P.getGlobal(I); | 1008 | 16 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 16 | S.Stk.push<T>(B->deref<T>()); | 1011 | 16 | return true; | 1012 | 16 | } |
Unexecuted instantiation: bool clang::interp::GetGlobal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::GetGlobal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 562 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 562 | auto *B = S.P.getGlobal(I); | 1008 | 562 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 562 | S.Stk.push<T>(B->deref<T>()); | 1011 | 562 | return true; | 1012 | 562 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 313 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 313 | auto *B = S.P.getGlobal(I); | 1008 | 313 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 313 | S.Stk.push<T>(B->deref<T>()); | 1011 | 313 | return true; | 1012 | 313 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 12 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 12 | auto *B = S.P.getGlobal(I); | 1008 | 12 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 12 | S.Stk.push<T>(B->deref<T>()); | 1011 | 12 | return true; | 1012 | 12 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 8 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 8 | auto *B = S.P.getGlobal(I); | 1008 | 8 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 8 | S.Stk.push<T>(B->deref<T>()); | 1011 | 8 | return true; | 1012 | 8 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 77 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 77 | auto *B = S.P.getGlobal(I); | 1008 | 77 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 77 | S.Stk.push<T>(B->deref<T>()); | 1011 | 77 | return true; | 1012 | 77 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 110 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 110 | auto *B = S.P.getGlobal(I); | 1008 | 110 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 110 | S.Stk.push<T>(B->deref<T>()); | 1011 | 110 | return true; | 1012 | 110 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 124 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 124 | auto *B = S.P.getGlobal(I); | 1008 | 124 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 124 | S.Stk.push<T>(B->deref<T>()); | 1011 | 124 | return true; | 1012 | 124 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 425 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 425 | auto *B = S.P.getGlobal(I); | 1008 | 425 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 425 | S.Stk.push<T>(B->deref<T>()); | 1011 | 425 | return true; | 1012 | 425 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 64 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 64 | auto *B = S.P.getGlobal(I); | 1008 | 64 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 64 | S.Stk.push<T>(B->deref<T>()); | 1011 | 64 | return true; | 1012 | 64 | } |
bool clang::interp::GetGlobal<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1006 | 357 | bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1007 | 357 | auto *B = S.P.getGlobal(I); | 1008 | 357 | if (B->isExtern()) | 1009 | 0 | return false; | 1010 | 357 | S.Stk.push<T>(B->deref<T>()); | 1011 | 357 | return true; | 1012 | 357 | } |
|
1013 | | |
1014 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
1015 | 0 | bool SetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { |
1016 | | // TODO: emit warning. |
1017 | 0 | return false; |
1018 | 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::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) |
1019 | | |
1020 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
1021 | 558 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { |
1022 | 558 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); |
1023 | 558 | return true; |
1024 | 558 | } bool clang::interp::InitGlobal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 14 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 14 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 14 | return true; | 1024 | 14 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 2 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 2 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 2 | return true; | 1024 | 2 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 3 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 3 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 3 | return true; | 1024 | 3 | } |
Unexecuted instantiation: bool clang::interp::InitGlobal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::InitGlobal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 173 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 173 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 173 | return true; | 1024 | 173 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 17 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 17 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 17 | return true; | 1024 | 17 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 6 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 6 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 6 | return true; | 1024 | 6 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 2 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 2 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 2 | return true; | 1024 | 2 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 14 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 14 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 14 | return true; | 1024 | 14 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 28 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 28 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 28 | return true; | 1024 | 28 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 66 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 66 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 66 | return true; | 1024 | 66 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 138 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 138 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 138 | return true; | 1024 | 138 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 19 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 19 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 19 | return true; | 1024 | 19 | } |
bool clang::interp::InitGlobal<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1021 | 76 | bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { | 1022 | 76 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1023 | 76 | return true; | 1024 | 76 | } |
|
1025 | | |
1026 | | /// 1) Converts the value on top of the stack to an APValue |
1027 | | /// 2) Sets that APValue on \Temp |
1028 | | /// 3) Initialized global with index \I with that |
1029 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
1030 | | bool InitGlobalTemp(InterpState &S, CodePtr OpPC, uint32_t I, |
1031 | 1 | const LifetimeExtendedTemporaryDecl *Temp) { |
1032 | 1 | assert(Temp); |
1033 | 1 | const T Value = S.Stk.peek<T>(); |
1034 | 1 | APValue APV = Value.toAPValue(); |
1035 | 1 | APValue *Cached = Temp->getOrCreateValue(true); |
1036 | 1 | *Cached = APV; |
1037 | | |
1038 | 1 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); |
1039 | 1 | return true; |
1040 | 1 | } Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Line | Count | Source | 1031 | 1 | const LifetimeExtendedTemporaryDecl *Temp) { | 1032 | 1 | assert(Temp); | 1033 | 1 | const T Value = S.Stk.peek<T>(); | 1034 | 1 | APValue APV = Value.toAPValue(); | 1035 | 1 | APValue *Cached = Temp->getOrCreateValue(true); | 1036 | 1 | *Cached = APV; | 1037 | | | 1038 | 1 | S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>(); | 1039 | 1 | return true; | 1040 | 1 | } |
Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)8, clang::interp::IntegralAP<false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)9, clang::interp::IntegralAP<true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)10, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)12, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)13, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)11, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*) |
1041 | | |
1042 | | /// 1) Converts the value on top of the stack to an APValue |
1043 | | /// 2) Sets that APValue on \Temp |
1044 | | /// 3) Initialized global with index \I with that |
1045 | | inline bool InitGlobalTempComp(InterpState &S, CodePtr OpPC, |
1046 | 8 | const LifetimeExtendedTemporaryDecl *Temp) { |
1047 | 8 | assert(Temp); |
1048 | 8 | const Pointer &P = S.Stk.peek<Pointer>(); |
1049 | 8 | APValue *Cached = Temp->getOrCreateValue(true); |
1050 | | |
1051 | 8 | *Cached = P.toRValue(S.getCtx()); |
1052 | 8 | return true; |
1053 | 8 | } |
1054 | | |
1055 | | template <PrimType Name, class T = typename PrimConv<Name>::T> |
1056 | 5.02k | bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) { |
1057 | 5.02k | if (S.checkingPotentialConstantExpression()) |
1058 | 30 | return false; |
1059 | 4.99k | const Pointer &This = S.Current->getThis(); |
1060 | 4.99k | if (!CheckThis(S, OpPC, This)) |
1061 | 0 | return false; |
1062 | 4.99k | const Pointer &Field = This.atField(I); |
1063 | 4.99k | Field.deref<T>() = S.Stk.pop<T>(); |
1064 | 4.99k | Field.initialize(); |
1065 | 4.99k | return true; |
1066 | 4.99k | } bool clang::interp::InitThisField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1056 | 8 | bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) { | 1057 | 8 | if (S.checkingPotentialConstantExpression()) | 1058 | 0 | return false; | 1059 | 8 | const Pointer &This = S.Current->getThis(); | 1060 | 8 | if (!CheckThis(S, OpPC, This)) | 1061 | 0 | return false; | 1062 | 8 | const Pointer &Field = This.atField(I); | 1063 | 8 | Field.deref<T>() = S.Stk.pop<T>(); | 1064 | 8 | Field.initialize(); | 1065 | 8 | return true; | 1066 | 8 | } |
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::InitThisField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1056 | 14 | bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) { | 1057 | 14 | if (S.checkingPotentialConstantExpression()) | 1058 | 0 | return false; | 1059 | 14 | const Pointer &This = S.Current->getThis(); | 1060 | 14 | if (!CheckThis(S, OpPC, This)) | 1061 | 0 | return false; | 1062 | 14 | const Pointer &Field = This.atField(I); | 1063 | 14 | Field.deref<T>() = S.Stk.pop<T>(); | 1064 | 14 | Field.initialize(); | 1065 | 14 | return true; | 1066 | 14 | } |
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) bool clang::interp::InitThisField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1056 | 544 | bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) { | 1057 | 544 | if (S.checkingPotentialConstantExpression()) | 1058 | 26 | return false; | 1059 | 518 | const Pointer &This = S.Current->getThis(); | 1060 | 518 | if (!CheckThis(S, OpPC, This)) | 1061 | 0 | return false; | 1062 | 518 | const Pointer &Field = This.atField(I); | 1063 | 518 | Field.deref<T>() = S.Stk.pop<T>(); | 1064 | 518 | Field.initialize(); | 1065 | 518 | return true; | 1066 | 518 | } |
bool clang::interp::InitThisField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int) Line | Count | Source | 1056 | 5<
|
|