Coverage Report

Created: 2023-05-31 04:38

/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
4.18k
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
4.18k
  R = V.toAPValue();
46
4.18k
  return true;
47
4.18k
}
bool clang::interp::ReturnValue<clang::interp::Integral<8u, true> >(clang::interp::Integral<8u, true> const&, clang::APValue&)
Line
Count
Source
44
124
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
124
  R = V.toAPValue();
46
124
  return true;
47
124
}
bool clang::interp::ReturnValue<clang::interp::Integral<8u, false> >(clang::interp::Integral<8u, false> const&, clang::APValue&)
Line
Count
Source
44
2
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
2
  R = V.toAPValue();
46
2
  return true;
47
2
}
bool clang::interp::ReturnValue<clang::interp::Integral<16u, true> >(clang::interp::Integral<16u, true> const&, clang::APValue&)
Line
Count
Source
44
6
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
6
  R = V.toAPValue();
46
6
  return true;
47
6
}
Unexecuted instantiation: bool clang::interp::ReturnValue<clang::interp::Integral<16u, false> >(clang::interp::Integral<16u, false> const&, clang::APValue&)
bool clang::interp::ReturnValue<clang::interp::Integral<32u, true> >(clang::interp::Integral<32u, true> const&, clang::APValue&)
Line
Count
Source
44
2.17k
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
2.17k
  R = V.toAPValue();
46
2.17k
  return true;
47
2.17k
}
bool clang::interp::ReturnValue<clang::interp::Integral<32u, false> >(clang::interp::Integral<32u, false> const&, clang::APValue&)
Line
Count
Source
44
51
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
51
  R = V.toAPValue();
46
51
  return true;
47
51
}
bool clang::interp::ReturnValue<clang::interp::Integral<64u, true> >(clang::interp::Integral<64u, true> const&, clang::APValue&)
Line
Count
Source
44
28
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
28
  R = V.toAPValue();
46
28
  return true;
47
28
}
bool clang::interp::ReturnValue<clang::interp::Integral<64u, false> >(clang::interp::Integral<64u, false> const&, clang::APValue&)
Line
Count
Source
44
411
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
411
  R = V.toAPValue();
46
411
  return true;
47
411
}
bool clang::interp::ReturnValue<clang::interp::Floating>(clang::interp::Floating const&, clang::APValue&)
Line
Count
Source
44
58
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
58
  R = V.toAPValue();
46
58
  return true;
47
58
}
bool clang::interp::ReturnValue<clang::interp::Boolean>(clang::interp::Boolean const&, clang::APValue&)
Line
Count
Source
44
1.13k
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
1.13k
  R = V.toAPValue();
46
1.13k
  return true;
47
1.13k
}
bool clang::interp::ReturnValue<clang::interp::Pointer>(clang::interp::Pointer const&, clang::APValue&)
Line
Count
Source
44
197
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
197
  R = V.toAPValue();
46
197
  return true;
47
197
}
bool clang::interp::ReturnValue<clang::interp::FunctionPointer>(clang::interp::FunctionPointer const&, clang::APValue&)
Line
Count
Source
44
6
template <typename T> bool ReturnValue(const T &V, APValue &R) {
45
6
  R = V.toAPValue();
46
6
  return true;
47
6
}
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
/// Checks if a pointer is null.
59
bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
60
               CheckSubobjectKind CSK);
61
62
/// Checks if a pointer is in range.
63
bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
64
                AccessKinds AK);
65
66
/// Checks if a field from which a pointer is going to be derived is valid.
67
bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
68
                CheckSubobjectKind CSK);
69
70
/// Checks if a pointer points to const storage.
71
bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
72
73
/// Checks if a pointer points to a mutable field.
74
bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
75
76
/// Checks if a value can be loaded from a block.
77
bool CheckLoad(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
78
79
/// Checks if a value can be stored in a block.
80
bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
81
82
/// Checks if a method can be invoked on an object.
83
bool CheckInvoke(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
84
85
/// Checks if a value can be initialized.
86
bool CheckInit(InterpState &S, CodePtr OpPC, const Pointer &Ptr);
87
88
/// Checks if a method can be called.
89
bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F);
90
91
/// Checks the 'this' pointer.
92
bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This);
93
94
/// Checks if a method is pure virtual.
95
bool CheckPure(InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD);
96
97
/// Checks that all fields are initialized after a constructor call.
98
bool CheckCtorCall(InterpState &S, CodePtr OpPC, const Pointer &This);
99
100
/// Checks if the shift operation is legal.
101
template <typename RT>
102
68
bool CheckShift(InterpState &S, CodePtr OpPC, const RT &RHS, unsigned Bits) {
103
68
  if (RHS.isNegative()) {
104
10
    const SourceInfo &Loc = S.Current->getSource(OpPC);
105
10
    S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt();
106
10
    return false;
107
10
  }
108
109
  // C++11 [expr.shift]p1: Shift width must be less than the bit width of
110
  // the shifted type.
111
58
  if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) {
112
14
    const Expr *E = S.Current->getExpr(OpPC);
113
14
    const APSInt Val = RHS.toAPSInt();
114
14
    QualType Ty = E->getType();
115
14
    S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits;
116
14
    return false;
117
14
  }
118
44
  return true;
119
58
}
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, unsigned int)
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, unsigned int)
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, unsigned int)
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, unsigned int)
bool clang::interp::CheckShift<clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, unsigned int)
Line
Count
Source
102
62
bool CheckShift(InterpState &S, CodePtr OpPC, const RT &RHS, unsigned Bits) {
103
62
  if (RHS.isNegative()) {
104
10
    const SourceInfo &Loc = S.Current->getSource(OpPC);
105
10
    S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt();
106
10
    return false;
107
10
  }
108
109
  // C++11 [expr.shift]p1: Shift width must be less than the bit width of
110
  // the shifted type.
111
52
  if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) {
112
8
    const Expr *E = S.Current->getExpr(OpPC);
113
8
    const APSInt Val = RHS.toAPSInt();
114
8
    QualType Ty = E->getType();
115
8
    S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits;
116
8
    return false;
117
8
  }
118
44
  return true;
119
52
}
bool clang::interp::CheckShift<clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, unsigned int)
Line
Count
Source
102
6
bool CheckShift(InterpState &S, CodePtr OpPC, const RT &RHS, unsigned Bits) {
103
6
  if (RHS.isNegative()) {
104
0
    const SourceInfo &Loc = S.Current->getSource(OpPC);
105
0
    S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt();
106
0
    return false;
107
0
  }
108
109
  // C++11 [expr.shift]p1: Shift width must be less than the bit width of
110
  // the shifted type.
111
6
  if (Bits > 1 && RHS >= RT::from(Bits, RHS.bitWidth())) {
112
6
    const Expr *E = S.Current->getExpr(OpPC);
113
6
    const APSInt Val = RHS.toAPSInt();
114
6
    QualType Ty = E->getType();
115
6
    S.CCEDiag(E, diag::note_constexpr_large_shift) << Val << Ty << Bits;
116
6
    return false;
117
6
  }
118
0
  return true;
119
6
}
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, unsigned int)
Unexecuted instantiation: bool clang::interp::CheckShift<clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, unsigned int)
120
121
/// Checks if Div/Rem operation on LHS and RHS is valid.
122
template <typename T>
123
151
bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) {
124
151
  if (RHS.isZero()) {
125
38
    const SourceInfo &Loc = S.Current->getSource(OpPC);
126
38
    S.FFDiag(Loc, diag::note_expr_divide_by_zero);
127
38
    return false;
128
38
  }
129
130
113
  if (LHS.isSigned() && 
LHS.isMin()104
&&
RHS.isNegative()10
&&
RHS.isMinusOne()10
) {
131
10
    APSInt LHSInt = LHS.toAPSInt();
132
10
    SmallString<32> Trunc;
133
10
    (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10);
134
10
    const SourceInfo &Loc = S.Current->getSource(OpPC);
135
10
    const Expr *E = S.Current->getExpr(OpPC);
136
10
    S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType();
137
10
    return false;
138
10
  }
139
103
  return true;
140
113
}
bool clang::interp::CheckDivRem<clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Floating const&, clang::interp::Floating const&)
Line
Count
Source
123
26
bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) {
124
26
  if (RHS.isZero()) {
125
1
    const SourceInfo &Loc = S.Current->getSource(OpPC);
126
1
    S.FFDiag(Loc, diag::note_expr_divide_by_zero);
127
1
    return false;
128
1
  }
129
130
25
  if (LHS.isSigned() && LHS.isMin() && 
RHS.isNegative()0
&&
RHS.isMinusOne()0
) {
131
0
    APSInt LHSInt = LHS.toAPSInt();
132
0
    SmallString<32> Trunc;
133
0
    (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10);
134
0
    const SourceInfo &Loc = S.Current->getSource(OpPC);
135
0
    const Expr *E = S.Current->getExpr(OpPC);
136
0
    S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType();
137
0
    return false;
138
0
  }
139
25
  return true;
140
25
}
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
123
116
bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) {
124
116
  if (RHS.isZero()) {
125
37
    const SourceInfo &Loc = S.Current->getSource(OpPC);
126
37
    S.FFDiag(Loc, diag::note_expr_divide_by_zero);
127
37
    return false;
128
37
  }
129
130
79
  if (LHS.isSigned() && LHS.isMin() && 
RHS.isNegative()10
&&
RHS.isMinusOne()10
) {
131
10
    APSInt LHSInt = LHS.toAPSInt();
132
10
    SmallString<32> Trunc;
133
10
    (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10);
134
10
    const SourceInfo &Loc = S.Current->getSource(OpPC);
135
10
    const Expr *E = S.Current->getExpr(OpPC);
136
10
    S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType();
137
10
    return false;
138
10
  }
139
69
  return true;
140
79
}
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
123
1
bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) {
124
1
  if (RHS.isZero()) {
125
0
    const SourceInfo &Loc = S.Current->getSource(OpPC);
126
0
    S.FFDiag(Loc, diag::note_expr_divide_by_zero);
127
0
    return false;
128
0
  }
129
130
1
  if (LHS.isSigned() && 
LHS.isMin()0
&&
RHS.isNegative()0
&&
RHS.isMinusOne()0
) {
131
0
    APSInt LHSInt = LHS.toAPSInt();
132
0
    SmallString<32> Trunc;
133
0
    (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10);
134
0
    const SourceInfo &Loc = S.Current->getSource(OpPC);
135
0
    const Expr *E = S.Current->getExpr(OpPC);
136
0
    S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType();
137
0
    return false;
138
0
  }
139
1
  return true;
140
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
123
8
bool CheckDivRem(InterpState &S, CodePtr OpPC, const T &LHS, const T &RHS) {
124
8
  if (RHS.isZero()) {
125
0
    const SourceInfo &Loc = S.Current->getSource(OpPC);
126
0
    S.FFDiag(Loc, diag::note_expr_divide_by_zero);
127
0
    return false;
128
0
  }
129
130
8
  if (LHS.isSigned() && 
LHS.isMin()0
&&
RHS.isNegative()0
&&
RHS.isMinusOne()0
) {
131
0
    APSInt LHSInt = LHS.toAPSInt();
132
0
    SmallString<32> Trunc;
133
0
    (-LHSInt.extend(LHSInt.getBitWidth() + 1)).toString(Trunc, 10);
134
0
    const SourceInfo &Loc = S.Current->getSource(OpPC);
135
0
    const Expr *E = S.Current->getExpr(OpPC);
136
0
    S.CCEDiag(Loc, diag::note_constexpr_overflow) << Trunc << E->getType();
137
0
    return false;
138
0
  }
139
8
  return true;
140
8
}
141
142
/// Checks if the result is a floating-point operation is valid
143
/// in the current context.
144
bool CheckFloatResult(InterpState &S, CodePtr OpPC, APFloat::opStatus Status);
145
146
/// Interpreter entry point.
147
bool Interpret(InterpState &S, APValue &Result);
148
149
/// Interpret a builtin function.
150
bool InterpretBuiltin(InterpState &S, CodePtr &PC, unsigned BuiltinID);
151
152
enum class ArithOp { Add, Sub };
153
154
//===----------------------------------------------------------------------===//
155
// Returning values
156
//===----------------------------------------------------------------------===//
157
158
template <PrimType Name, bool Builtin = false,
159
          class T = typename PrimConv<Name>::T>
160
839
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
839
  S.CallStackDepth--;
162
839
  const T &Ret = S.Stk.pop<T>();
163
164
839
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
839
  if (Builtin || 
!S.checkingPotentialConstantExpression()831
)
166
709
    S.Current->popArgs();
167
168
839
  if (InterpFrame *Caller = S.Current->Caller) {
169
710
    PC = S.Current->getRetPC();
170
710
    delete S.Current;
171
710
    S.Current = Caller;
172
710
    S.Stk.push<T>(Ret);
173
710
  } else {
174
129
    delete S.Current;
175
129
    S.Current = nullptr;
176
129
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
129
  }
179
839
  return true;
180
839
}
bool clang::interp::Ret<(clang::interp::PrimType)8, true, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
160
8
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
8
  S.CallStackDepth--;
162
8
  const T &Ret = S.Stk.pop<T>();
163
164
8
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
8
  if (Builtin || 
!S.checkingPotentialConstantExpression()0
)
166
8
    S.Current->popArgs();
167
168
8
  if (InterpFrame *Caller = S.Current->Caller) {
169
8
    PC = S.Current->getRetPC();
170
8
    delete S.Current;
171
8
    S.Current = Caller;
172
8
    S.Stk.push<T>(Ret);
173
8
  } else {
174
0
    delete S.Current;
175
0
    S.Current = nullptr;
176
0
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
0
  }
179
8
  return true;
180
8
}
Unexecuted instantiation: bool clang::interp::Ret<(clang::interp::PrimType)0, false, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Unexecuted instantiation: bool clang::interp::Ret<(clang::interp::PrimType)1, false, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
bool clang::interp::Ret<(clang::interp::PrimType)2, false, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
160
8
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
8
  S.CallStackDepth--;
162
8
  const T &Ret = S.Stk.pop<T>();
163
164
8
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
8
  if (Builtin || !S.checkingPotentialConstantExpression())
166
7
    S.Current->popArgs();
167
168
8
  if (InterpFrame *Caller = S.Current->Caller) {
169
7
    PC = S.Current->getRetPC();
170
7
    delete S.Current;
171
7
    S.Current = Caller;
172
7
    S.Stk.push<T>(Ret);
173
7
  } else {
174
1
    delete S.Current;
175
1
    S.Current = nullptr;
176
1
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
1
  }
179
8
  return true;
180
8
}
Unexecuted instantiation: bool clang::interp::Ret<(clang::interp::PrimType)3, false, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
bool clang::interp::Ret<(clang::interp::PrimType)4, false, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
160
624
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
624
  S.CallStackDepth--;
162
624
  const T &Ret = S.Stk.pop<T>();
163
164
624
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
624
  if (Builtin || !S.checkingPotentialConstantExpression())
166
522
    S.Current->popArgs();
167
168
624
  if (InterpFrame *Caller = S.Current->Caller) {
169
522
    PC = S.Current->getRetPC();
170
522
    delete S.Current;
171
522
    S.Current = Caller;
172
522
    S.Stk.push<T>(Ret);
173
522
  } else {
174
102
    delete S.Current;
175
102
    S.Current = nullptr;
176
102
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
102
  }
179
624
  return true;
180
624
}
bool clang::interp::Ret<(clang::interp::PrimType)5, false, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
160
62
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
62
  S.CallStackDepth--;
162
62
  const T &Ret = S.Stk.pop<T>();
163
164
62
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
62
  if (Builtin || !S.checkingPotentialConstantExpression())
166
62
    S.Current->popArgs();
167
168
62
  if (InterpFrame *Caller = S.Current->Caller) {
169
62
    PC = S.Current->getRetPC();
170
62
    delete S.Current;
171
62
    S.Current = Caller;
172
62
    S.Stk.push<T>(Ret);
173
62
  } else {
174
0
    delete S.Current;
175
0
    S.Current = nullptr;
176
0
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
0
  }
179
62
  return true;
180
62
}
Unexecuted instantiation: bool clang::interp::Ret<(clang::interp::PrimType)6, false, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Unexecuted instantiation: bool clang::interp::Ret<(clang::interp::PrimType)7, false, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
bool clang::interp::Ret<(clang::interp::PrimType)8, false, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
160
73
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
73
  S.CallStackDepth--;
162
73
  const T &Ret = S.Stk.pop<T>();
163
164
73
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
73
  if (Builtin || !S.checkingPotentialConstantExpression())
166
60
    S.Current->popArgs();
167
168
73
  if (InterpFrame *Caller = S.Current->Caller) {
169
60
    PC = S.Current->getRetPC();
170
60
    delete S.Current;
171
60
    S.Current = Caller;
172
60
    S.Stk.push<T>(Ret);
173
60
  } else {
174
13
    delete S.Current;
175
13
    S.Current = nullptr;
176
13
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
13
  }
179
73
  return true;
180
73
}
bool clang::interp::Ret<(clang::interp::PrimType)10, false, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
160
46
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
46
  S.CallStackDepth--;
162
46
  const T &Ret = S.Stk.pop<T>();
163
164
46
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
46
  if (Builtin || !S.checkingPotentialConstantExpression())
166
37
    S.Current->popArgs();
167
168
46
  if (InterpFrame *Caller = S.Current->Caller) {
169
37
    PC = S.Current->getRetPC();
170
37
    delete S.Current;
171
37
    S.Current = Caller;
172
37
    S.Stk.push<T>(Ret);
173
37
  } else {
174
9
    delete S.Current;
175
9
    S.Current = nullptr;
176
9
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
9
  }
179
46
  return true;
180
46
}
bool clang::interp::Ret<(clang::interp::PrimType)11, false, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
160
7
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
7
  S.CallStackDepth--;
162
7
  const T &Ret = S.Stk.pop<T>();
163
164
7
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
7
  if (Builtin || !S.checkingPotentialConstantExpression())
166
5
    S.Current->popArgs();
167
168
7
  if (InterpFrame *Caller = S.Current->Caller) {
169
6
    PC = S.Current->getRetPC();
170
6
    delete S.Current;
171
6
    S.Current = Caller;
172
6
    S.Stk.push<T>(Ret);
173
6
  } else {
174
1
    delete S.Current;
175
1
    S.Current = nullptr;
176
1
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
1
  }
179
7
  return true;
180
7
}
bool clang::interp::Ret<(clang::interp::PrimType)9, false, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
160
11
bool Ret(InterpState &S, CodePtr &PC, APValue &Result) {
161
11
  S.CallStackDepth--;
162
11
  const T &Ret = S.Stk.pop<T>();
163
164
11
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
165
11
  if (Builtin || !S.checkingPotentialConstantExpression())
166
8
    S.Current->popArgs();
167
168
11
  if (InterpFrame *Caller = S.Current->Caller) {
169
8
    PC = S.Current->getRetPC();
170
8
    delete S.Current;
171
8
    S.Current = Caller;
172
8
    S.Stk.push<T>(Ret);
173
8
  } else {
174
3
    delete S.Current;
175
3
    S.Current = nullptr;
176
3
    if (!ReturnValue<T>(Ret, Result))
177
0
      return false;
178
3
  }
179
11
  return true;
180
11
}
181
182
template <bool Builtin = false>
183
464
inline bool RetVoid(InterpState &S, CodePtr &PC, APValue &Result) {
184
464
  S.CallStackDepth--;
185
186
464
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
187
464
  if (Builtin || 
!S.checkingPotentialConstantExpression()456
)
188
457
    S.Current->popArgs();
189
190
464
  if (InterpFrame *Caller = S.Current->Caller) {
191
459
    PC = S.Current->getRetPC();
192
459
    delete S.Current;
193
459
    S.Current = Caller;
194
459
  } else {
195
5
    delete S.Current;
196
5
    S.Current = nullptr;
197
5
  }
198
464
  return true;
199
464
}
bool clang::interp::RetVoid<true>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
183
8
inline bool RetVoid(InterpState &S, CodePtr &PC, APValue &Result) {
184
8
  S.CallStackDepth--;
185
186
8
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
187
8
  if (Builtin || 
!S.checkingPotentialConstantExpression()0
)
188
8
    S.Current->popArgs();
189
190
8
  if (InterpFrame *Caller = S.Current->Caller) {
191
8
    PC = S.Current->getRetPC();
192
8
    delete S.Current;
193
8
    S.Current = Caller;
194
8
  } else {
195
0
    delete S.Current;
196
0
    S.Current = nullptr;
197
0
  }
198
8
  return true;
199
8
}
bool clang::interp::RetVoid<false>(clang::interp::InterpState&, clang::interp::CodePtr&, clang::APValue&)
Line
Count
Source
183
456
inline bool RetVoid(InterpState &S, CodePtr &PC, APValue &Result) {
184
456
  S.CallStackDepth--;
185
186
456
  assert(S.Current->getFrameOffset() == S.Stk.size() && "Invalid frame");
187
456
  if (Builtin || !S.checkingPotentialConstantExpression())
188
449
    S.Current->popArgs();
189
190
456
  if (InterpFrame *Caller = S.Current->Caller) {
191
451
    PC = S.Current->getRetPC();
192
451
    delete S.Current;
193
451
    S.Current = Caller;
194
451
  } else {
195
5
    delete S.Current;
196
5
    S.Current = nullptr;
197
5
  }
198
456
  return true;
199
456
}
200
201
//===----------------------------------------------------------------------===//
202
// Add, Sub, Mul
203
//===----------------------------------------------------------------------===//
204
205
template <typename T, bool (*OpFW)(T, T, unsigned, T *),
206
          template <typename U> class OpAP>
207
bool AddSubMulHelper(InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS,
208
963
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
963
  T Result;
211
963
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
954
    S.Stk.push<T>(Result);
213
954
    return true;
214
954
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
9
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
9
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
9
  const Expr *E = S.Current->getExpr(OpPC);
224
9
  QualType Type = E->getType();
225
9
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
9
  } else {
232
9
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
9
    return S.noteUndefinedBehavior();
234
9
  }
235
9
}
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, true>, &(clang::interp::Integral<8u, true>::add(clang::interp::Integral<8u, true>, clang::interp::Integral<8u, true>, unsigned int, clang::interp::Integral<8u, true>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, true> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, false>, &(clang::interp::Integral<8u, false>::add(clang::interp::Integral<8u, false>, clang::interp::Integral<8u, false>, unsigned int, clang::interp::Integral<8u, false>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, false> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, true>, &(clang::interp::Integral<16u, true>::add(clang::interp::Integral<16u, true>, clang::interp::Integral<16u, true>, unsigned int, clang::interp::Integral<16u, true>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, true> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, false>, &(clang::interp::Integral<16u, false>::add(clang::interp::Integral<16u, false>, clang::interp::Integral<16u, false>, unsigned int, clang::interp::Integral<16u, false>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, false> const&)
bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, true>, &(clang::interp::Integral<32u, true>::add(clang::interp::Integral<32u, true>, clang::interp::Integral<32u, true>, unsigned int, clang::interp::Integral<32u, true>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, true> const&)
Line
Count
Source
208
697
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
697
  T Result;
211
697
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
694
    S.Stk.push<T>(Result);
213
694
    return true;
214
694
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
3
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
3
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
3
  const Expr *E = S.Current->getExpr(OpPC);
224
3
  QualType Type = E->getType();
225
3
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
3
  } else {
232
3
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
3
    return S.noteUndefinedBehavior();
234
3
  }
235
3
}
bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, false>, &(clang::interp::Integral<32u, false>::add(clang::interp::Integral<32u, false>, clang::interp::Integral<32u, false>, unsigned int, clang::interp::Integral<32u, false>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, false> const&)
Line
Count
Source
208
4
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
4
  T Result;
211
4
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
4
    S.Stk.push<T>(Result);
213
4
    return true;
214
4
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
0
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
0
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
0
  const Expr *E = S.Current->getExpr(OpPC);
224
0
  QualType Type = E->getType();
225
0
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
0
  } else {
232
0
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
0
    return S.noteUndefinedBehavior();
234
0
  }
235
0
}
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, true>, &(clang::interp::Integral<64u, true>::add(clang::interp::Integral<64u, true>, clang::interp::Integral<64u, true>, unsigned int, clang::interp::Integral<64u, true>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, true> const&)
bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, false>, &(clang::interp::Integral<64u, false>::add(clang::interp::Integral<64u, false>, clang::interp::Integral<64u, false>, unsigned int, clang::interp::Integral<64u, false>*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, false> const&)
Line
Count
Source
208
7
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
7
  T Result;
211
7
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
7
    S.Stk.push<T>(Result);
213
7
    return true;
214
7
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
0
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
0
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
0
  const Expr *E = S.Current->getExpr(OpPC);
224
0
  QualType Type = E->getType();
225
0
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
0
  } else {
232
0
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
0
    return S.noteUndefinedBehavior();
234
0
  }
235
0
}
bool clang::interp::AddSubMulHelper<clang::interp::Boolean, &(clang::interp::Boolean::add(clang::interp::Boolean, clang::interp::Boolean, unsigned int, clang::interp::Boolean*)), std::__1::plus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Boolean const&, clang::interp::Boolean const&)
Line
Count
Source
208
2
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
2
  T Result;
211
2
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
2
    S.Stk.push<T>(Result);
213
2
    return true;
214
2
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
0
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
0
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
0
  const Expr *E = S.Current->getExpr(OpPC);
224
0
  QualType Type = E->getType();
225
0
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
0
  } else {
232
0
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
0
    return S.noteUndefinedBehavior();
234
0
  }
235
0
}
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, true>, &(clang::interp::Integral<8u, true>::mul(clang::interp::Integral<8u, true>, clang::interp::Integral<8u, true>, unsigned int, clang::interp::Integral<8u, true>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, true> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, false>, &(clang::interp::Integral<8u, false>::mul(clang::interp::Integral<8u, false>, clang::interp::Integral<8u, false>, unsigned int, clang::interp::Integral<8u, false>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, false> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, true>, &(clang::interp::Integral<16u, true>::mul(clang::interp::Integral<16u, true>, clang::interp::Integral<16u, true>, unsigned int, clang::interp::Integral<16u, true>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, true> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, false>, &(clang::interp::Integral<16u, false>::mul(clang::interp::Integral<16u, false>, clang::interp::Integral<16u, false>, unsigned int, clang::interp::Integral<16u, false>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, false> const&)
bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, true>, &(clang::interp::Integral<32u, true>::mul(clang::interp::Integral<32u, true>, clang::interp::Integral<32u, true>, unsigned int, clang::interp::Integral<32u, true>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, true> const&)
Line
Count
Source
208
38
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
38
  T Result;
211
38
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
35
    S.Stk.push<T>(Result);
213
35
    return true;
214
35
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
3
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
3
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
3
  const Expr *E = S.Current->getExpr(OpPC);
224
3
  QualType Type = E->getType();
225
3
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
3
  } else {
232
3
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
3
    return S.noteUndefinedBehavior();
234
3
  }
235
3
}
bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, false>, &(clang::interp::Integral<32u, false>::mul(clang::interp::Integral<32u, false>, clang::interp::Integral<32u, false>, unsigned int, clang::interp::Integral<32u, false>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, false> const&)
Line
Count
Source
208
65
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
65
  T Result;
211
65
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
65
    S.Stk.push<T>(Result);
213
65
    return true;
214
65
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
0
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
0
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
0
  const Expr *E = S.Current->getExpr(OpPC);
224
0
  QualType Type = E->getType();
225
0
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
0
  } else {
232
0
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
0
    return S.noteUndefinedBehavior();
234
0
  }
235
0
}
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, true>, &(clang::interp::Integral<64u, true>::mul(clang::interp::Integral<64u, true>, clang::interp::Integral<64u, true>, unsigned int, clang::interp::Integral<64u, true>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, true> const&)
bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, false>, &(clang::interp::Integral<64u, false>::mul(clang::interp::Integral<64u, false>, clang::interp::Integral<64u, false>, unsigned int, clang::interp::Integral<64u, false>*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, false> const&)
Line
Count
Source
208
19
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
19
  T Result;
211
19
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
19
    S.Stk.push<T>(Result);
213
19
    return true;
214
19
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
0
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
0
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
0
  const Expr *E = S.Current->getExpr(OpPC);
224
0
  QualType Type = E->getType();
225
0
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
0
  } else {
232
0
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
0
    return S.noteUndefinedBehavior();
234
0
  }
235
0
}
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Boolean, &(clang::interp::Boolean::mul(clang::interp::Boolean, clang::interp::Boolean, unsigned int, clang::interp::Boolean*)), std::__1::multiplies>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Boolean const&, clang::interp::Boolean const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, true>, &(clang::interp::Integral<8u, true>::sub(clang::interp::Integral<8u, true>, clang::interp::Integral<8u, true>, unsigned int, clang::interp::Integral<8u, true>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, true> const&, clang::interp::Integral<8u, true> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<8u, false>, &(clang::interp::Integral<8u, false>::sub(clang::interp::Integral<8u, false>, clang::interp::Integral<8u, false>, unsigned int, clang::interp::Integral<8u, false>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<8u, false> const&, clang::interp::Integral<8u, false> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, true>, &(clang::interp::Integral<16u, true>::sub(clang::interp::Integral<16u, true>, clang::interp::Integral<16u, true>, unsigned int, clang::interp::Integral<16u, true>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, true> const&, clang::interp::Integral<16u, true> const&)
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Integral<16u, false>, &(clang::interp::Integral<16u, false>::sub(clang::interp::Integral<16u, false>, clang::interp::Integral<16u, false>, unsigned int, clang::interp::Integral<16u, false>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<16u, false> const&, clang::interp::Integral<16u, false> const&)
bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, true>, &(clang::interp::Integral<32u, true>::sub(clang::interp::Integral<32u, true>, clang::interp::Integral<32u, true>, unsigned int, clang::interp::Integral<32u, true>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, true> const&, clang::interp::Integral<32u, true> const&)
Line
Count
Source
208
59
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
59
  T Result;
211
59
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
56
    S.Stk.push<T>(Result);
213
56
    return true;
214
56
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
3
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
3
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
3
  const Expr *E = S.Current->getExpr(OpPC);
224
3
  QualType Type = E->getType();
225
3
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
3
  } else {
232
3
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
3
    return S.noteUndefinedBehavior();
234
3
  }
235
3
}
bool clang::interp::AddSubMulHelper<clang::interp::Integral<32u, false>, &(clang::interp::Integral<32u, false>::sub(clang::interp::Integral<32u, false>, clang::interp::Integral<32u, false>, unsigned int, clang::interp::Integral<32u, false>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<32u, false> const&, clang::interp::Integral<32u, false> const&)
Line
Count
Source
208
61
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
61
  T Result;
211
61
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
61
    S.Stk.push<T>(Result);
213
61
    return true;
214
61
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
0
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
0
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
0
  const Expr *E = S.Current->getExpr(OpPC);
224
0
  QualType Type = E->getType();
225
0
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
0
  } else {
232
0
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
0
    return S.noteUndefinedBehavior();
234
0
  }
235
0
}
bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, true>, &(clang::interp::Integral<64u, true>::sub(clang::interp::Integral<64u, true>, clang::interp::Integral<64u, true>, unsigned int, clang::interp::Integral<64u, true>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, true> const&, clang::interp::Integral<64u, true> const&)
Line
Count
Source
208
5
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
5
  T Result;
211
5
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
5
    S.Stk.push<T>(Result);
213
5
    return true;
214
5
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
0
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
0
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
0
  const Expr *E = S.Current->getExpr(OpPC);
224
0
  QualType Type = E->getType();
225
0
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
0
  } else {
232
0
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
0
    return S.noteUndefinedBehavior();
234
0
  }
235
0
}
bool clang::interp::AddSubMulHelper<clang::interp::Integral<64u, false>, &(clang::interp::Integral<64u, false>::sub(clang::interp::Integral<64u, false>, clang::interp::Integral<64u, false>, unsigned int, clang::interp::Integral<64u, false>*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Integral<64u, false> const&, clang::interp::Integral<64u, false> const&)
Line
Count
Source
208
6
                     const T &RHS) {
209
  // Fast path - add the numbers with fixed width.
210
6
  T Result;
211
6
  if (!OpFW(LHS, RHS, Bits, &Result)) {
212
6
    S.Stk.push<T>(Result);
213
6
    return true;
214
6
  }
215
216
  // If for some reason evaluation continues, use the truncated results.
217
0
  S.Stk.push<T>(Result);
218
219
  // Slow path - compute the result using another bit of precision.
220
0
  APSInt Value = OpAP<APSInt>()(LHS.toAPSInt(Bits), RHS.toAPSInt(Bits));
221
222
  // Report undefined behaviour, stopping if required.
223
0
  const Expr *E = S.Current->getExpr(OpPC);
224
0
  QualType Type = E->getType();
225
0
  if (S.checkingForUndefinedBehavior()) {
226
0
    SmallString<32> Trunc;
227
0
    Value.trunc(Result.bitWidth()).toString(Trunc, 10);
228
0
    auto Loc = E->getExprLoc();
229
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
230
0
    return true;
231
0
  } else {
232
0
    S.CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;
233
0
    return S.noteUndefinedBehavior();
234
0
  }
235
0
}
Unexecuted instantiation: bool clang::interp::AddSubMulHelper<clang::interp::Boolean, &(clang::interp::Boolean::sub(clang::interp::Boolean, clang::interp::Boolean, unsigned int, clang::interp::Boolean*)), std::__1::minus>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::interp::Boolean const&, clang::interp::Boolean const&)
236
237
template <PrimType Name, class T = typename PrimConv<Name>::T>
238
710
bool Add(InterpState &S, CodePtr OpPC) {
239
710
  const T &RHS = S.Stk.pop<T>();
240
710
  const T &LHS = S.Stk.pop<T>();
241
710
  const unsigned Bits = RHS.bitWidth() + 1;
242
710
  return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS);
243
710
}
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
238
697
bool Add(InterpState &S, CodePtr OpPC) {
239
697
  const T &RHS = S.Stk.pop<T>();
240
697
  const T &LHS = S.Stk.pop<T>();
241
697
  const unsigned Bits = RHS.bitWidth() + 1;
242
697
  return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS);
243
697
}
bool clang::interp::Add<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
238
4
bool Add(InterpState &S, CodePtr OpPC) {
239
4
  const T &RHS = S.Stk.pop<T>();
240
4
  const T &LHS = S.Stk.pop<T>();
241
4
  const unsigned Bits = RHS.bitWidth() + 1;
242
4
  return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS);
243
4
}
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
238
7
bool Add(InterpState &S, CodePtr OpPC) {
239
7
  const T &RHS = S.Stk.pop<T>();
240
7
  const T &LHS = S.Stk.pop<T>();
241
7
  const unsigned Bits = RHS.bitWidth() + 1;
242
7
  return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS);
243
7
}
bool clang::interp::Add<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
238
2
bool Add(InterpState &S, CodePtr OpPC) {
239
2
  const T &RHS = S.Stk.pop<T>();
240
2
  const T &LHS = S.Stk.pop<T>();
241
2
  const unsigned Bits = RHS.bitWidth() + 1;
242
2
  return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS);
243
2
}
244
245
36
inline bool Addf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) {
246
36
  const Floating &RHS = S.Stk.pop<Floating>();
247
36
  const Floating &LHS = S.Stk.pop<Floating>();
248
249
36
  Floating Result;
250
36
  auto Status = Floating::add(LHS, RHS, RM, &Result);
251
36
  S.Stk.push<Floating>(Result);
252
36
  return CheckFloatResult(S, OpPC, Status);
253
36
}
254
255
template <PrimType Name, class T = typename PrimConv<Name>::T>
256
127
bool Sub(InterpState &S, CodePtr OpPC) {
257
127
  const T &RHS = S.Stk.pop<T>();
258
127
  const T &LHS = S.Stk.pop<T>();
259
127
  const unsigned Bits = RHS.bitWidth() + 1;
260
127
  return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS);
261
127
}
Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Sub<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
256
59
bool Sub(InterpState &S, CodePtr OpPC) {
257
59
  const T &RHS = S.Stk.pop<T>();
258
59
  const T &LHS = S.Stk.pop<T>();
259
59
  const unsigned Bits = RHS.bitWidth() + 1;
260
59
  return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS);
261
59
}
bool clang::interp::Sub<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
256
61
bool Sub(InterpState &S, CodePtr OpPC) {
257
61
  const T &RHS = S.Stk.pop<T>();
258
61
  const T &LHS = S.Stk.pop<T>();
259
61
  const unsigned Bits = RHS.bitWidth() + 1;
260
61
  return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS);
261
61
}
bool clang::interp::Sub<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
256
1
bool Sub(InterpState &S, CodePtr OpPC) {
257
1
  const T &RHS = S.Stk.pop<T>();
258
1
  const T &LHS = S.Stk.pop<T>();
259
1
  const unsigned Bits = RHS.bitWidth() + 1;
260
1
  return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS);
261
1
}
bool clang::interp::Sub<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
256
6
bool Sub(InterpState &S, CodePtr OpPC) {
257
6
  const T &RHS = S.Stk.pop<T>();
258
6
  const T &LHS = S.Stk.pop<T>();
259
6
  const unsigned Bits = RHS.bitWidth() + 1;
260
6
  return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS);
261
6
}
Unexecuted instantiation: bool clang::interp::Sub<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
262
263
2
inline bool Subf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) {
264
2
  const Floating &RHS = S.Stk.pop<Floating>();
265
2
  const Floating &LHS = S.Stk.pop<Floating>();
266
267
2
  Floating Result;
268
2
  auto Status = Floating::sub(LHS, RHS, RM, &Result);
269
2
  S.Stk.push<Floating>(Result);
270
2
  return CheckFloatResult(S, OpPC, Status);
271
2
}
272
273
template <PrimType Name, class T = typename PrimConv<Name>::T>
274
122
bool Mul(InterpState &S, CodePtr OpPC) {
275
122
  const T &RHS = S.Stk.pop<T>();
276
122
  const T &LHS = S.Stk.pop<T>();
277
122
  const unsigned Bits = RHS.bitWidth() * 2;
278
122
  return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS);
279
122
}
Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Mul<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
274
38
bool Mul(InterpState &S, CodePtr OpPC) {
275
38
  const T &RHS = S.Stk.pop<T>();
276
38
  const T &LHS = S.Stk.pop<T>();
277
38
  const unsigned Bits = RHS.bitWidth() * 2;
278
38
  return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS);
279
38
}
bool clang::interp::Mul<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
274
65
bool Mul(InterpState &S, CodePtr OpPC) {
275
65
  const T &RHS = S.Stk.pop<T>();
276
65
  const T &LHS = S.Stk.pop<T>();
277
65
  const unsigned Bits = RHS.bitWidth() * 2;
278
65
  return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS);
279
65
}
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
274
19
bool Mul(InterpState &S, CodePtr OpPC) {
275
19
  const T &RHS = S.Stk.pop<T>();
276
19
  const T &LHS = S.Stk.pop<T>();
277
19
  const unsigned Bits = RHS.bitWidth() * 2;
278
19
  return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS);
279
19
}
Unexecuted instantiation: bool clang::interp::Mul<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
280
281
15
inline bool Mulf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) {
282
15
  const Floating &RHS = S.Stk.pop<Floating>();
283
15
  const Floating &LHS = S.Stk.pop<Floating>();
284
285
15
  Floating Result;
286
15
  auto Status = Floating::mul(LHS, RHS, RM, &Result);
287
15
  S.Stk.push<Floating>(Result);
288
15
  return CheckFloatResult(S, OpPC, Status);
289
15
}
290
/// 1) Pops the RHS from the stack.
291
/// 2) Pops the LHS from the stack.
292
/// 3) Pushes 'LHS & RHS' on the stack
293
template <PrimType Name, class T = typename PrimConv<Name>::T>
294
26
bool BitAnd(InterpState &S, CodePtr OpPC) {
295
26
  const T &RHS = S.Stk.pop<T>();
296
26
  const T &LHS = S.Stk.pop<T>();
297
298
26
  unsigned Bits = RHS.bitWidth();
299
26
  T Result;
300
26
  if (!T::bitAnd(LHS, RHS, Bits, &Result)) {
301
26
    S.Stk.push<T>(Result);
302
26
    return true;
303
26
  }
304
0
  return false;
305
26
}
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
294
20
bool BitAnd(InterpState &S, CodePtr OpPC) {
295
20
  const T &RHS = S.Stk.pop<T>();
296
20
  const T &LHS = S.Stk.pop<T>();
297
298
20
  unsigned Bits = RHS.bitWidth();
299
20
  T Result;
300
20
  if (!T::bitAnd(LHS, RHS, Bits, &Result)) {
301
20
    S.Stk.push<T>(Result);
302
20
    return true;
303
20
  }
304
0
  return false;
305
20
}
bool clang::interp::BitAnd<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
294
6
bool BitAnd(InterpState &S, CodePtr OpPC) {
295
6
  const T &RHS = S.Stk.pop<T>();
296
6
  const T &LHS = S.Stk.pop<T>();
297
298
6
  unsigned Bits = RHS.bitWidth();
299
6
  T Result;
300
6
  if (!T::bitAnd(LHS, RHS, Bits, &Result)) {
301
6
    S.Stk.push<T>(Result);
302
6
    return true;
303
6
  }
304
0
  return false;
305
6
}
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)
306
307
/// 1) Pops the RHS from the stack.
308
/// 2) Pops the LHS from the stack.
309
/// 3) Pushes 'LHS | RHS' on the stack
310
template <PrimType Name, class T = typename PrimConv<Name>::T>
311
34
bool BitOr(InterpState &S, CodePtr OpPC) {
312
34
  const T &RHS = S.Stk.pop<T>();
313
34
  const T &LHS = S.Stk.pop<T>();
314
315
34
  unsigned Bits = RHS.bitWidth();
316
34
  T Result;
317
34
  if (!T::bitOr(LHS, RHS, Bits, &Result)) {
318
34
    S.Stk.push<T>(Result);
319
34
    return true;
320
34
  }
321
0
  return false;
322
34
}
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
311
28
bool BitOr(InterpState &S, CodePtr OpPC) {
312
28
  const T &RHS = S.Stk.pop<T>();
313
28
  const T &LHS = S.Stk.pop<T>();
314
315
28
  unsigned Bits = RHS.bitWidth();
316
28
  T Result;
317
28
  if (!T::bitOr(LHS, RHS, Bits, &Result)) {
318
28
    S.Stk.push<T>(Result);
319
28
    return true;
320
28
  }
321
0
  return false;
322
28
}
bool clang::interp::BitOr<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
311
6
bool BitOr(InterpState &S, CodePtr OpPC) {
312
6
  const T &RHS = S.Stk.pop<T>();
313
6
  const T &LHS = S.Stk.pop<T>();
314
315
6
  unsigned Bits = RHS.bitWidth();
316
6
  T Result;
317
6
  if (!T::bitOr(LHS, RHS, Bits, &Result)) {
318
6
    S.Stk.push<T>(Result);
319
6
    return true;
320
6
  }
321
0
  return false;
322
6
}
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)
323
324
/// 1) Pops the RHS from the stack.
325
/// 2) Pops the LHS from the stack.
326
/// 3) Pushes 'LHS ^ RHS' on the stack
327
template <PrimType Name, class T = typename PrimConv<Name>::T>
328
30
bool BitXor(InterpState &S, CodePtr OpPC) {
329
30
  const T &RHS = S.Stk.pop<T>();
330
30
  const T &LHS = S.Stk.pop<T>();
331
332
30
  unsigned Bits = RHS.bitWidth();
333
30
  T Result;
334
30
  if (!T::bitXor(LHS, RHS, Bits, &Result)) {
335
30
    S.Stk.push<T>(Result);
336
30
    return true;
337
30
  }
338
0
  return false;
339
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
328
24
bool BitXor(InterpState &S, CodePtr OpPC) {
329
24
  const T &RHS = S.Stk.pop<T>();
330
24
  const T &LHS = S.Stk.pop<T>();
331
332
24
  unsigned Bits = RHS.bitWidth();
333
24
  T Result;
334
24
  if (!T::bitXor(LHS, RHS, Bits, &Result)) {
335
24
    S.Stk.push<T>(Result);
336
24
    return true;
337
24
  }
338
0
  return false;
339
24
}
bool clang::interp::BitXor<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
328
6
bool BitXor(InterpState &S, CodePtr OpPC) {
329
6
  const T &RHS = S.Stk.pop<T>();
330
6
  const T &LHS = S.Stk.pop<T>();
331
332
6
  unsigned Bits = RHS.bitWidth();
333
6
  T Result;
334
6
  if (!T::bitXor(LHS, RHS, Bits, &Result)) {
335
6
    S.Stk.push<T>(Result);
336
6
    return true;
337
6
  }
338
0
  return false;
339
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)
340
341
/// 1) Pops the RHS from the stack.
342
/// 2) Pops the LHS from the stack.
343
/// 3) Pushes 'LHS % RHS' on the stack (the remainder of dividing LHS by RHS).
344
template <PrimType Name, class T = typename PrimConv<Name>::T>
345
67
bool Rem(InterpState &S, CodePtr OpPC) {
346
67
  const T &RHS = S.Stk.pop<T>();
347
67
  const T &LHS = S.Stk.pop<T>();
348
349
67
  if (!CheckDivRem(S, OpPC, LHS, RHS))
350
20
    return false;
351
352
47
  const unsigned Bits = RHS.bitWidth() * 2;
353
47
  T Result;
354
47
  if (!T::rem(LHS, RHS, Bits, &Result)) {
355
47
    S.Stk.push<T>(Result);
356
47
    return true;
357
47
  }
358
0
  return false;
359
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
345
64
bool Rem(InterpState &S, CodePtr OpPC) {
346
64
  const T &RHS = S.Stk.pop<T>();
347
64
  const T &LHS = S.Stk.pop<T>();
348
349
64
  if (!CheckDivRem(S, OpPC, LHS, RHS))
350
20
    return false;
351
352
44
  const unsigned Bits = RHS.bitWidth() * 2;
353
44
  T Result;
354
44
  if (!T::rem(LHS, RHS, Bits, &Result)) {
355
44
    S.Stk.push<T>(Result);
356
44
    return true;
357
44
  }
358
0
  return false;
359
44
}
bool clang::interp::Rem<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
345
1
bool Rem(InterpState &S, CodePtr OpPC) {
346
1
  const T &RHS = S.Stk.pop<T>();
347
1
  const T &LHS = S.Stk.pop<T>();
348
349
1
  if (!CheckDivRem(S, OpPC, LHS, RHS))
350
0
    return false;
351
352
1
  const unsigned Bits = RHS.bitWidth() * 2;
353
1
  T Result;
354
1
  if (!T::rem(LHS, RHS, Bits, &Result)) {
355
1
    S.Stk.push<T>(Result);
356
1
    return true;
357
1
  }
358
0
  return false;
359
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
345
2
bool Rem(InterpState &S, CodePtr OpPC) {
346
2
  const T &RHS = S.Stk.pop<T>();
347
2
  const T &LHS = S.Stk.pop<T>();
348
349
2
  if (!CheckDivRem(S, OpPC, LHS, RHS))
350
0
    return false;
351
352
2
  const unsigned Bits = RHS.bitWidth() * 2;
353
2
  T Result;
354
2
  if (!T::rem(LHS, RHS, Bits, &Result)) {
355
2
    S.Stk.push<T>(Result);
356
2
    return true;
357
2
  }
358
0
  return false;
359
2
}
360
361
/// 1) Pops the RHS from the stack.
362
/// 2) Pops the LHS from the stack.
363
/// 3) Pushes 'LHS / RHS' on the stack
364
template <PrimType Name, class T = typename PrimConv<Name>::T>
365
58
bool Div(InterpState &S, CodePtr OpPC) {
366
58
  const T &RHS = S.Stk.pop<T>();
367
58
  const T &LHS = S.Stk.pop<T>();
368
369
58
  if (!CheckDivRem(S, OpPC, LHS, RHS))
370
27
    return false;
371
372
31
  const unsigned Bits = RHS.bitWidth() * 2;
373
31
  T Result;
374
31
  if (!T::div(LHS, RHS, Bits, &Result)) {
375
31
    S.Stk.push<T>(Result);
376
31
    return true;
377
31
  }
378
0
  return false;
379
31
}
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
365
52
bool Div(InterpState &S, CodePtr OpPC) {
366
52
  const T &RHS = S.Stk.pop<T>();
367
52
  const T &LHS = S.Stk.pop<T>();
368
369
52
  if (!CheckDivRem(S, OpPC, LHS, RHS))
370
27
    return false;
371
372
25
  const unsigned Bits = RHS.bitWidth() * 2;
373
25
  T Result;
374
25
  if (!T::div(LHS, RHS, Bits, &Result)) {
375
25
    S.Stk.push<T>(Result);
376
25
    return true;
377
25
  }
378
0
  return false;
379
25
}
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
365
6
bool Div(InterpState &S, CodePtr OpPC) {
366
6
  const T &RHS = S.Stk.pop<T>();
367
6
  const T &LHS = S.Stk.pop<T>();
368
369
6
  if (!CheckDivRem(S, OpPC, LHS, RHS))
370
0
    return false;
371
372
6
  const unsigned Bits = RHS.bitWidth() * 2;
373
6
  T Result;
374
6
  if (!T::div(LHS, RHS, Bits, &Result)) {
375
6
    S.Stk.push<T>(Result);
376
6
    return true;
377
6
  }
378
0
  return false;
379
6
}
380
381
26
inline bool Divf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) {
382
26
  const Floating &RHS = S.Stk.pop<Floating>();
383
26
  const Floating &LHS = S.Stk.pop<Floating>();
384
385
26
  if (!CheckDivRem(S, OpPC, LHS, RHS))
386
1
    return false;
387
388
25
  Floating Result;
389
25
  auto Status = Floating::div(LHS, RHS, RM, &Result);
390
25
  S.Stk.push<Floating>(Result);
391
25
  return CheckFloatResult(S, OpPC, Status);
392
26
}
393
394
//===----------------------------------------------------------------------===//
395
// Inv
396
//===----------------------------------------------------------------------===//
397
398
template <PrimType Name, class T = typename PrimConv<Name>::T>
399
172
bool Inv(InterpState &S, CodePtr OpPC) {
400
172
  using BoolT = PrimConv<PT_Bool>::T;
401
172
  const T &Val = S.Stk.pop<T>();
402
172
  const unsigned Bits = Val.bitWidth();
403
172
  Boolean R;
404
172
  Boolean::inv(BoolT::from(Val, Bits), &R);
405
406
172
  S.Stk.push<BoolT>(R);
407
172
  return true;
408
172
}
409
410
//===----------------------------------------------------------------------===//
411
// Neg
412
//===----------------------------------------------------------------------===//
413
414
template <PrimType Name, class T = typename PrimConv<Name>::T>
415
267
bool Neg(InterpState &S, CodePtr OpPC) {
416
267
  const T &Value = S.Stk.pop<T>();
417
267
  T Result;
418
419
267
  if (!T::neg(Value, &Result)) {
420
265
    S.Stk.push<T>(Result);
421
265
    return true;
422
265
  }
423
424
2
  assert(isIntegralType(Name) &&
425
2
         "don't expect other types to fail at constexpr negation");
426
2
  S.Stk.push<T>(Result);
427
428
2
  APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1);
429
2
  const Expr *E = S.Current->getExpr(OpPC);
430
2
  QualType Type = E->getType();
431
432
2
  if (S.checkingForUndefinedBehavior()) {
433
0
    SmallString<32> Trunc;
434
0
    NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10);
435
0
    auto Loc = E->getExprLoc();
436
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
437
0
    return true;
438
0
  }
439
440
2
  S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type;
441
2
  return S.noteUndefinedBehavior();
442
2
}
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)
Unexecuted instantiation: bool clang::interp::Neg<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
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
415
265
bool Neg(InterpState &S, CodePtr OpPC) {
416
265
  const T &Value = S.Stk.pop<T>();
417
265
  T Result;
418
419
265
  if (!T::neg(Value, &Result)) {
420
263
    S.Stk.push<T>(Result);
421
263
    return true;
422
263
  }
423
424
2
  assert(isIntegralType(Name) &&
425
2
         "don't expect other types to fail at constexpr negation");
426
2
  S.Stk.push<T>(Result);
427
428
2
  APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1);
429
2
  const Expr *E = S.Current->getExpr(OpPC);
430
2
  QualType Type = E->getType();
431
432
2
  if (S.checkingForUndefinedBehavior()) {
433
0
    SmallString<32> Trunc;
434
0
    NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10);
435
0
    auto Loc = E->getExprLoc();
436
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
437
0
    return true;
438
0
  }
439
440
2
  S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type;
441
2
  return S.noteUndefinedBehavior();
442
2
}
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
415
1
bool Neg(InterpState &S, CodePtr OpPC) {
416
1
  const T &Value = S.Stk.pop<T>();
417
1
  T Result;
418
419
1
  if (!T::neg(Value, &Result)) {
420
1
    S.Stk.push<T>(Result);
421
1
    return true;
422
1
  }
423
424
0
  assert(isIntegralType(Name) &&
425
0
         "don't expect other types to fail at constexpr negation");
426
0
  S.Stk.push<T>(Result);
427
428
0
  APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1);
429
0
  const Expr *E = S.Current->getExpr(OpPC);
430
0
  QualType Type = E->getType();
431
432
0
  if (S.checkingForUndefinedBehavior()) {
433
0
    SmallString<32> Trunc;
434
0
    NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10);
435
0
    auto Loc = E->getExprLoc();
436
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
437
0
    return true;
438
0
  }
439
440
0
  S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type;
441
0
  return S.noteUndefinedBehavior();
442
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::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Neg<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
415
1
bool Neg(InterpState &S, CodePtr OpPC) {
416
1
  const T &Value = S.Stk.pop<T>();
417
1
  T Result;
418
419
1
  if (!T::neg(Value, &Result)) {
420
1
    S.Stk.push<T>(Result);
421
1
    return true;
422
1
  }
423
424
0
  assert(isIntegralType(Name) &&
425
0
         "don't expect other types to fail at constexpr negation");
426
0
  S.Stk.push<T>(Result);
427
428
0
  APSInt NegatedValue = -Value.toAPSInt(Value.bitWidth() + 1);
429
0
  const Expr *E = S.Current->getExpr(OpPC);
430
0
  QualType Type = E->getType();
431
432
0
  if (S.checkingForUndefinedBehavior()) {
433
0
    SmallString<32> Trunc;
434
0
    NegatedValue.trunc(Result.bitWidth()).toString(Trunc, 10);
435
0
    auto Loc = E->getExprLoc();
436
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
437
0
    return true;
438
0
  }
439
440
0
  S.CCEDiag(E, diag::note_constexpr_overflow) << NegatedValue << Type;
441
0
  return S.noteUndefinedBehavior();
442
0
}
443
444
enum class PushVal : bool {
445
  No,
446
  Yes,
447
};
448
enum class IncDecOp {
449
  Inc,
450
  Dec,
451
};
452
453
template <typename T, IncDecOp Op, PushVal DoPush>
454
107
bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
455
107
  T Value = Ptr.deref<T>();
456
107
  T Result;
457
458
107
  if constexpr (DoPush == PushVal::Yes)
459
12
    
S0
.Stk.push<T>(Value);
460
461
107
  if constexpr (Op == IncDecOp::Inc) 
{0
462
91
    if (!T::increment(Value, &Result)) {
463
87
      Ptr.deref<T>() = Result;
464
87
      return true;
465
87
    }
466
91
  } else {
467
16
    if (!T::decrement(Value, &Result)) {
468
12
      Ptr.deref<T>() = Result;
469
12
      return true;
470
12
    }
471
16
  }
472
473
  // Something went wrong with the previous operation. Compute the
474
  // result with another bit of precision.
475
8
  unsigned Bits = Value.bitWidth() + 1;
476
8
  APSInt APResult;
477
8
  if constexpr (Op == IncDecOp::Inc)
478
4
    
APResult0
= ++Value.toAPSInt(Bits);
479
4
  else
480
4
    APResult = --Value.toAPSInt(Bits);
481
482
  // Report undefined behaviour, stopping if required.
483
8
  const Expr *E = S.Current->getExpr(OpPC);
484
8
  QualType Type = E->getType();
485
8
  if (S.checkingForUndefinedBehavior()) {
486
0
    SmallString<32> Trunc;
487
0
    APResult.trunc(Result.bitWidth()).toString(Trunc, 10);
488
0
    auto Loc = E->getExprLoc();
489
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
490
0
    return true;
491
0
  }
492
493
8
  S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type;
494
8
  return S.noteUndefinedBehavior();
495
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
454
6
bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
455
6
  T Value = Ptr.deref<T>();
456
6
  T Result;
457
458
6
  if constexpr (DoPush == PushVal::Yes)
459
6
    S.Stk.push<T>(Value);
460
461
6
  if constexpr (Op == IncDecOp::Inc) 
{0
462
6
    if (!T::increment(Value, &Result)) {
463
6
      Ptr.deref<T>() = Result;
464
6
      return true;
465
6
    }
466
6
  } else {
467
6
    if (!T::decrement(Value, &Result)) {
468
6
      Ptr.deref<T>() = Result;
469
6
      return true;
470
6
    }
471
6
  }
472
473
  // Something went wrong with the previous operation. Compute the
474
  // result with another bit of precision.
475
0
  unsigned Bits = Value.bitWidth() + 1;
476
0
  APSInt APResult;
477
0
  if constexpr (Op == IncDecOp::Inc)
478
0
    APResult = ++Value.toAPSInt(Bits);
479
0
  else
480
0
    APResult = --Value.toAPSInt(Bits);
481
482
  // Report undefined behaviour, stopping if required.
483
0
  const Expr *E = S.Current->getExpr(OpPC);
484
0
  QualType Type = E->getType();
485
0
  if (S.checkingForUndefinedBehavior()) {
486
0
    SmallString<32> Trunc;
487
0
    APResult.trunc(Result.bitWidth()).toString(Trunc, 10);
488
0
    auto Loc = E->getExprLoc();
489
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
490
0
    return true;
491
0
  }
492
493
0
  S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type;
494
0
  return S.noteUndefinedBehavior();
495
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::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
454
10
bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
455
10
  T Value = Ptr.deref<T>();
456
10
  T Result;
457
458
10
  if constexpr (DoPush == PushVal::Yes)
459
0
    S.Stk.push<T>(Value);
460
461
10
  if constexpr (Op == IncDecOp::Inc) 
{0
462
10
    if (!T::increment(Value, &Result)) {
463
10
      Ptr.deref<T>() = Result;
464
10
      return true;
465
10
    }
466
10
  } else {
467
10
    if (!T::decrement(Value, &Result)) {
468
6
      Ptr.deref<T>() = Result;
469
6
      return true;
470
6
    }
471
10
  }
472
473
  // Something went wrong with the previous operation. Compute the
474
  // result with another bit of precision.
475
4
  unsigned Bits = Value.bitWidth() + 1;
476
4
  APSInt APResult;
477
4
  if constexpr (Op == IncDecOp::Inc)
478
0
    APResult = ++Value.toAPSInt(Bits);
479
4
  else
480
4
    APResult = --Value.toAPSInt(Bits);
481
482
  // Report undefined behaviour, stopping if required.
483
4
  const Expr *E = S.Current->getExpr(OpPC);
484
4
  QualType Type = E->getType();
485
4
  if (S.checkingForUndefinedBehavior()) {
486
0
    SmallString<32> Trunc;
487
0
    APResult.trunc(Result.bitWidth()).toString(Trunc, 10);
488
0
    auto Loc = E->getExprLoc();
489
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
490
0
    return true;
491
0
  }
492
493
4
  S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type;
494
4
  return S.noteUndefinedBehavior();
495
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::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
454
6
bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
455
6
  T Value = Ptr.deref<T>();
456
6
  T Result;
457
458
6
  if constexpr (DoPush == PushVal::Yes)
459
6
    S.Stk.push<T>(Value);
460
461
6
  if constexpr (Op == IncDecOp::Inc) {
462
6
    if (!T::increment(Value, &Result)) {
463
6
      Ptr.deref<T>() = Result;
464
6
      return true;
465
6
    }
466
6
  } else {
467
0
    if (!T::decrement(Value, &Result)) {
468
0
      Ptr.deref<T>() = Result;
469
0
      return true;
470
0
    }
471
0
  }
472
473
  // Something went wrong with the previous operation. Compute the
474
  // result with another bit of precision.
475
0
  unsigned Bits = Value.bitWidth() + 1;
476
0
  APSInt APResult;
477
0
  if constexpr (Op == IncDecOp::Inc)
478
0
    APResult = ++Value.toAPSInt(Bits);
479
0
  else
480
0
    APResult = --Value.toAPSInt(Bits);
481
482
  // Report undefined behaviour, stopping if required.
483
0
  const Expr *E = S.Current->getExpr(OpPC);
484
0
  QualType Type = E->getType();
485
0
  if (S.checkingForUndefinedBehavior()) {
486
0
    SmallString<32> Trunc;
487
0
    APResult.trunc(Result.bitWidth()).toString(Trunc, 10);
488
0
    auto Loc = E->getExprLoc();
489
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
490
0
    return true;
491
0
  }
492
493
0
  S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type;
494
0
  return S.noteUndefinedBehavior();
495
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::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
454
85
bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
455
85
  T Value = Ptr.deref<T>();
456
85
  T Result;
457
458
85
  if constexpr (DoPush == PushVal::Yes)
459
0
    S.Stk.push<T>(Value);
460
461
85
  if constexpr (Op == IncDecOp::Inc) {
462
85
    if (!T::increment(Value, &Result)) {
463
81
      Ptr.deref<T>() = Result;
464
81
      return true;
465
81
    }
466
85
  } else {
467
4
    if (!T::decrement(Value, &Result)) {
468
4
      Ptr.deref<T>() = Result;
469
4
      return true;
470
4
    }
471
4
  }
472
473
  // Something went wrong with the previous operation. Compute the
474
  // result with another bit of precision.
475
4
  unsigned Bits = Value.bitWidth() + 1;
476
4
  APSInt APResult;
477
4
  if constexpr (Op == IncDecOp::Inc)
478
4
    APResult = ++Value.toAPSInt(Bits);
479
4
  else
480
4
    APResult = --Value.toAPSInt(Bits);
481
482
  // Report undefined behaviour, stopping if required.
483
4
  const Expr *E = S.Current->getExpr(OpPC);
484
4
  QualType Type = E->getType();
485
4
  if (S.checkingForUndefinedBehavior()) {
486
0
    SmallString<32> Trunc;
487
0
    APResult.trunc(Result.bitWidth()).toString(Trunc, 10);
488
0
    auto Loc = E->getExprLoc();
489
0
    S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
490
0
    return true;
491
0
  }
492
493
4
  S.CCEDiag(E, diag::note_constexpr_overflow) << APResult << Type;
494
4
  return S.noteUndefinedBehavior();
495
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&)
496
497
/// 1) Pops a pointer from the stack
498
/// 2) Load the value from the pointer
499
/// 3) Writes the value increased by one back to the pointer
500
/// 4) Pushes the original (pre-inc) value on the stack.
501
template <PrimType Name, class T = typename PrimConv<Name>::T>
502
6
bool Inc(InterpState &S, CodePtr OpPC) {
503
  // FIXME: Check initialization of Ptr
504
6
  const Pointer &Ptr = S.Stk.pop<Pointer>();
505
506
6
  return IncDecHelper<T, IncDecOp::Inc, PushVal::Yes>(S, OpPC, Ptr);
507
6
}
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
502
6
bool Inc(InterpState &S, CodePtr OpPC) {
503
  // FIXME: Check initialization of Ptr
504
6
  const Pointer &Ptr = S.Stk.pop<Pointer>();
505
506
6
  return IncDecHelper<T, IncDecOp::Inc, PushVal::Yes>(S, OpPC, Ptr);
507
6
}
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)
508
509
/// 1) Pops a pointer from the stack
510
/// 2) Load the value from the pointer
511
/// 3) Writes the value increased by one back to the pointer
512
template <PrimType Name, class T = typename PrimConv<Name>::T>
513
85
bool IncPop(InterpState &S, CodePtr OpPC) {
514
  // FIXME: Check initialization of Ptr
515
85
  const Pointer &Ptr = S.Stk.pop<Pointer>();
516
517
85
  return IncDecHelper<T, IncDecOp::Inc, PushVal::No>(S, OpPC, Ptr);
518
85
}
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
513
85
bool IncPop(InterpState &S, CodePtr OpPC) {
514
  // FIXME: Check initialization of Ptr
515
85
  const Pointer &Ptr = S.Stk.pop<Pointer>();
516
517
85
  return IncDecHelper<T, IncDecOp::Inc, PushVal::No>(S, OpPC, Ptr);
518
85
}
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)
519
520
/// 1) Pops a pointer from the stack
521
/// 2) Load the value from the pointer
522
/// 3) Writes the value decreased by one back to the pointer
523
/// 4) Pushes the original (pre-dec) value on the stack.
524
template <PrimType Name, class T = typename PrimConv<Name>::T>
525
6
bool Dec(InterpState &S, CodePtr OpPC) {
526
  // FIXME: Check initialization of Ptr
527
6
  const Pointer &Ptr = S.Stk.pop<Pointer>();
528
529
6
  return IncDecHelper<T, IncDecOp::Dec, PushVal::Yes>(S, OpPC, Ptr);
530
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
525
6
bool Dec(InterpState &S, CodePtr OpPC) {
526
  // FIXME: Check initialization of Ptr
527
6
  const Pointer &Ptr = S.Stk.pop<Pointer>();
528
529
6
  return IncDecHelper<T, IncDecOp::Dec, PushVal::Yes>(S, OpPC, Ptr);
530
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)
531
532
/// 1) Pops a pointer from the stack
533
/// 2) Load the value from the pointer
534
/// 3) Writes the value decreased by one back to the pointer
535
template <PrimType Name, class T = typename PrimConv<Name>::T>
536
10
bool DecPop(InterpState &S, CodePtr OpPC) {
537
  // FIXME: Check initialization of Ptr
538
10
  const Pointer &Ptr = S.Stk.pop<Pointer>();
539
540
10
  return IncDecHelper<T, IncDecOp::Dec, PushVal::No>(S, OpPC, Ptr);
541
10
}
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
536
10
bool DecPop(InterpState &S, CodePtr OpPC) {
537
  // FIXME: Check initialization of Ptr
538
10
  const Pointer &Ptr = S.Stk.pop<Pointer>();
539
540
10
  return IncDecHelper<T, IncDecOp::Dec, PushVal::No>(S, OpPC, Ptr);
541
10
}
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)
542
543
template <IncDecOp Op, PushVal DoPush>
544
bool IncDecFloatHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
545
6
                       llvm::RoundingMode RM) {
546
6
  Floating Value = Ptr.deref<Floating>();
547
6
  Floating Result;
548
549
6
  if constexpr (DoPush == PushVal::Yes)
550
0
    S.Stk.push<Floating>(Value);
551
552
6
  llvm::APFloat::opStatus Status;
553
6
  if constexpr (Op == IncDecOp::Inc)
554
4
    
Status0
= Floating::increment(Value, RM, &Result);
555
2
  else
556
2
    Status = Floating::decrement(Value, RM, &Result);
557
558
6
  Ptr.deref<Floating>() = Result;
559
560
6
  return CheckFloatResult(S, OpPC, Status);
561
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
545
4
                       llvm::RoundingMode RM) {
546
4
  Floating Value = Ptr.deref<Floating>();
547
4
  Floating Result;
548
549
4
  if constexpr (DoPush == PushVal::Yes)
550
0
    S.Stk.push<Floating>(Value);
551
552
4
  llvm::APFloat::opStatus Status;
553
4
  if constexpr (Op == IncDecOp::Inc)
554
4
    Status = Floating::increment(Value, RM, &Result);
555
4
  else
556
4
    Status = Floating::decrement(Value, RM, &Result);
557
558
4
  Ptr.deref<Floating>() = Result;
559
560
4
  return CheckFloatResult(S, OpPC, Status);
561
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
545
2
                       llvm::RoundingMode RM) {
546
2
  Floating Value = Ptr.deref<Floating>();
547
2
  Floating Result;
548
549
2
  if constexpr (DoPush == PushVal::Yes)
550
0
    S.Stk.push<Floating>(Value);
551
552
2
  llvm::APFloat::opStatus Status;
553
2
  if constexpr (Op == IncDecOp::Inc)
554
0
    Status = Floating::increment(Value, RM, &Result);
555
2
  else
556
2
    Status = Floating::decrement(Value, RM, &Result);
557
558
2
  Ptr.deref<Floating>() = Result;
559
560
2
  return CheckFloatResult(S, OpPC, Status);
561
2
}
562
563
0
inline bool Incf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) {
564
  // FIXME: Check initialization of Ptr
565
0
  const Pointer &Ptr = S.Stk.pop<Pointer>();
566
0
  return IncDecFloatHelper<IncDecOp::Inc, PushVal::Yes>(S, OpPC, Ptr, RM);
567
0
}
568
569
4
inline bool IncfPop(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) {
570
  // FIXME: Check initialization of Ptr
571
4
  const Pointer &Ptr = S.Stk.pop<Pointer>();
572
4
  return IncDecFloatHelper<IncDecOp::Inc, PushVal::No>(S, OpPC, Ptr, RM);
573
4
}
574
575
0
inline bool Decf(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) {
576
  // FIXME: Check initialization of Ptr
577
0
  const Pointer &Ptr = S.Stk.pop<Pointer>();
578
0
  return IncDecFloatHelper<IncDecOp::Dec, PushVal::Yes>(S, OpPC, Ptr, RM);
579
0
}
580
581
2
inline bool DecfPop(InterpState &S, CodePtr OpPC, llvm::RoundingMode RM) {
582
  // FIXME: Check initialization of Ptr
583
2
  const Pointer &Ptr = S.Stk.pop<Pointer>();
584
2
  return IncDecFloatHelper<IncDecOp::Dec, PushVal::No>(S, OpPC, Ptr, RM);
585
2
}
586
587
/// 1) Pops the value from the stack.
588
/// 2) Pushes the bitwise complemented value on the stack (~V).
589
template <PrimType Name, class T = typename PrimConv<Name>::T>
590
58
bool Comp(InterpState &S, CodePtr OpPC) {
591
58
  const T &Val = S.Stk.pop<T>();
592
58
  T Result;
593
58
  if (!T::comp(Val, &Result)) {
594
58
    S.Stk.push<T>(Result);
595
58
    return true;
596
58
  }
597
598
0
  return false;
599
58
}
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)
Unexecuted instantiation: bool clang::interp::Comp<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Comp<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Comp<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
590
58
bool Comp(InterpState &S, CodePtr OpPC) {
591
58
  const T &Val = S.Stk.pop<T>();
592
58
  T Result;
593
58
  if (!T::comp(Val, &Result)) {
594
58
    S.Stk.push<T>(Result);
595
58
    return true;
596
58
  }
597
598
0
  return false;
599
58
}
Unexecuted instantiation: bool clang::interp::Comp<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Comp<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Comp<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
600
601
//===----------------------------------------------------------------------===//
602
// EQ, NE, GT, GE, LT, LE
603
//===----------------------------------------------------------------------===//
604
605
using CompareFn = llvm::function_ref<bool(ComparisonCategoryResult)>;
606
607
template <typename T>
608
1.98k
bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) {
609
1.98k
  using BoolT = PrimConv<PT_Bool>::T;
610
1.98k
  const T &RHS = S.Stk.pop<T>();
611
1.98k
  const T &LHS = S.Stk.pop<T>();
612
1.98k
  S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS))));
613
1.98k
  return true;
614
1.98k
}
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
608
1
bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) {
609
1
  using BoolT = PrimConv<PT_Bool>::T;
610
1
  const T &RHS = S.Stk.pop<T>();
611
1
  const T &LHS = S.Stk.pop<T>();
612
1
  S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS))));
613
1
  return true;
614
1
}
Unexecuted instantiation: bool clang::interp::CmpHelper<clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
bool clang::interp::CmpHelper<clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
Line
Count
Source
608
1.36k
bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) {
609
1.36k
  using BoolT = PrimConv<PT_Bool>::T;
610
1.36k
  const T &RHS = S.Stk.pop<T>();
611
1.36k
  const T &LHS = S.Stk.pop<T>();
612
1.36k
  S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS))));
613
1.36k
  return true;
614
1.36k
}
bool clang::interp::CmpHelper<clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
Line
Count
Source
608
70
bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) {
609
70
  using BoolT = PrimConv<PT_Bool>::T;
610
70
  const T &RHS = S.Stk.pop<T>();
611
70
  const T &LHS = S.Stk.pop<T>();
612
70
  S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS))));
613
70
  return true;
614
70
}
bool clang::interp::CmpHelper<clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
Line
Count
Source
608
7
bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) {
609
7
  using BoolT = PrimConv<PT_Bool>::T;
610
7
  const T &RHS = S.Stk.pop<T>();
611
7
  const T &LHS = S.Stk.pop<T>();
612
7
  S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS))));
613
7
  return true;
614
7
}
bool clang::interp::CmpHelper<clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
Line
Count
Source
608
500
bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) {
609
500
  using BoolT = PrimConv<PT_Bool>::T;
610
500
  const T &RHS = S.Stk.pop<T>();
611
500
  const T &LHS = S.Stk.pop<T>();
612
500
  S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS))));
613
500
  return true;
614
500
}
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
608
35
bool CmpHelper(InterpState &S, CodePtr OpPC, CompareFn Fn) {
609
35
  using BoolT = PrimConv<PT_Bool>::T;
610
35
  const T &RHS = S.Stk.pop<T>();
611
35
  const T &LHS = S.Stk.pop<T>();
612
35
  S.Stk.push<BoolT>(BoolT::from(Fn(LHS.compare(RHS))));
613
35
  return true;
614
35
}
615
616
template <typename T>
617
1.84k
bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) {
618
1.84k
  return CmpHelper<T>(S, OpPC, Fn);
619
1.84k
}
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
617
1
bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) {
618
1
  return CmpHelper<T>(S, OpPC, Fn);
619
1
}
Unexecuted instantiation: bool clang::interp::CmpHelperEQ<clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
bool clang::interp::CmpHelperEQ<clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
Line
Count
Source
617
1.24k
bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) {
618
1.24k
  return CmpHelper<T>(S, OpPC, Fn);
619
1.24k
}
bool clang::interp::CmpHelperEQ<clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
Line
Count
Source
617
70
bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) {
618
70
  return CmpHelper<T>(S, OpPC, Fn);
619
70
}
bool clang::interp::CmpHelperEQ<clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
Line
Count
Source
617
7
bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) {
618
7
  return CmpHelper<T>(S, OpPC, Fn);
619
7
}
bool clang::interp::CmpHelperEQ<clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, llvm::function_ref<bool (clang::ComparisonCategoryResult)>)
Line
Count
Source
617
495
bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) {
618
495
  return CmpHelper<T>(S, OpPC, Fn);
619
495
}
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
617
23
bool CmpHelperEQ(InterpState &S, CodePtr OpPC, CompareFn Fn) {
618
23
  return CmpHelper<T>(S, OpPC, Fn);
619
23
}
620
621
/// Function pointers cannot be compared in an ordered way.
622
template <>
623
inline bool CmpHelper<FunctionPointer>(InterpState &S, CodePtr OpPC,
624
2
                                       CompareFn Fn) {
625
2
  const auto &RHS = S.Stk.pop<FunctionPointer>();
626
2
  const auto &LHS = S.Stk.pop<FunctionPointer>();
627
628
2
  const SourceInfo &Loc = S.Current->getSource(OpPC);
629
2
  S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified)
630
2
      << LHS.toDiagnosticString(S.getCtx())
631
2
      << RHS.toDiagnosticString(S.getCtx());
632
2
  return false;
633
2
}
634
635
template <>
636
inline bool CmpHelperEQ<FunctionPointer>(InterpState &S, CodePtr OpPC,
637
6
                                         CompareFn Fn) {
638
6
  const auto &RHS = S.Stk.pop<FunctionPointer>();
639
6
  const auto &LHS = S.Stk.pop<FunctionPointer>();
640
6
  S.Stk.push<Boolean>(Boolean::from(Fn(LHS.compare(RHS))));
641
6
  return true;
642
6
}
643
644
template <>
645
0
inline bool CmpHelper<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) {
646
0
  using BoolT = PrimConv<PT_Bool>::T;
647
0
  const Pointer &RHS = S.Stk.pop<Pointer>();
648
0
  const Pointer &LHS = S.Stk.pop<Pointer>();
649
650
0
  if (!Pointer::hasSameBase(LHS, RHS)) {
651
0
    const SourceInfo &Loc = S.Current->getSource(OpPC);
652
0
    S.FFDiag(Loc, diag::note_invalid_subexpr_in_const_expr);
653
0
    return false;
654
0
  } else {
655
0
    unsigned VL = LHS.getByteOffset();
656
0
    unsigned VR = RHS.getByteOffset();
657
0
    S.Stk.push<BoolT>(BoolT::from(Fn(Compare(VL, VR))));
658
0
    return true;
659
0
  }
660
0
}
661
662
template <>
663
219
inline bool CmpHelperEQ<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) {
664
219
  using BoolT = PrimConv<PT_Bool>::T;
665
219
  const Pointer &RHS = S.Stk.pop<Pointer>();
666
219
  const Pointer &LHS = S.Stk.pop<Pointer>();
667
668
219
  if (LHS.isZero() && 
RHS.isZero()20
) {
669
20
    S.Stk.push<BoolT>(BoolT::from(Fn(ComparisonCategoryResult::Equal)));
670
20
    return true;
671
20
  }
672
673
199
  if (!Pointer::hasSameBase(LHS, RHS)) {
674
8
    S.Stk.push<BoolT>(BoolT::from(Fn(ComparisonCategoryResult::Unordered)));
675
8
    return true;
676
191
  } else {
677
191
    unsigned VL = LHS.getByteOffset();
678
191
    unsigned VR = RHS.getByteOffset();
679
680
    // In our Pointer class, a pointer to an array and a pointer to the first
681
    // element in the same array are NOT equal. They have the same Base value,
682
    // but a different Offset. This is a pretty rare case, so we fix this here
683
    // by comparing pointers to the first elements.
684
191
    if (LHS.inArray() && 
LHS.isRoot()184
)
685
3
      VL = LHS.atIndex(0).getByteOffset();
686
191
    if (RHS.inArray() && 
RHS.isRoot()184
)
687
4
      VR = RHS.atIndex(0).getByteOffset();
688
689
191
    S.Stk.push<BoolT>(BoolT::from(Fn(Compare(VL, VR))));
690
191
    return true;
691
191
  }
692
199
}
693
694
template <PrimType Name, class T = typename PrimConv<Name>::T>
695
1.56k
bool EQ(InterpState &S, CodePtr OpPC) {
696
1.56k
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
1.56k
    return R == ComparisonCategoryResult::Equal;
698
1.56k
  });
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
696
1
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
1
    return R == ComparisonCategoryResult::Equal;
698
1
  });
Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
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
696
938
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
938
    return R == ComparisonCategoryResult::Equal;
698
938
  });
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
696
70
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
70
    return R == ComparisonCategoryResult::Equal;
698
70
  });
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
696
7
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
7
    return R == ComparisonCategoryResult::Equal;
698
7
  });
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
696
495
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
495
    return R == ComparisonCategoryResult::Equal;
698
495
  });
Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
bool clang::interp::EQ<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Line
Count
Source
696
29
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
29
    return R == ComparisonCategoryResult::Equal;
698
29
  });
bool clang::interp::EQ<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Line
Count
Source
696
5
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
5
    return R == ComparisonCategoryResult::Equal;
698
5
  });
bool clang::interp::EQ<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Line
Count
Source
696
23
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
23
    return R == ComparisonCategoryResult::Equal;
698
23
  });
699
1.56k
}
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
695
1
bool EQ(InterpState &S, CodePtr OpPC) {
696
1
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
1
    return R == ComparisonCategoryResult::Equal;
698
1
  });
699
1
}
Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::EQ<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
695
938
bool EQ(InterpState &S, CodePtr OpPC) {
696
938
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
938
    return R == ComparisonCategoryResult::Equal;
698
938
  });
699
938
}
bool clang::interp::EQ<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
695
70
bool EQ(InterpState &S, CodePtr OpPC) {
696
70
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
70
    return R == ComparisonCategoryResult::Equal;
698
70
  });
699
70
}
bool clang::interp::EQ<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
695
7
bool EQ(InterpState &S, CodePtr OpPC) {
696
7
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
7
    return R == ComparisonCategoryResult::Equal;
698
7
  });
699
7
}
bool clang::interp::EQ<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
695
495
bool EQ(InterpState &S, CodePtr OpPC) {
696
495
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
495
    return R == ComparisonCategoryResult::Equal;
698
495
  });
699
495
}
Unexecuted instantiation: bool clang::interp::EQ<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::EQ<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
695
29
bool EQ(InterpState &S, CodePtr OpPC) {
696
29
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
29
    return R == ComparisonCategoryResult::Equal;
698
29
  });
699
29
}
bool clang::interp::EQ<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
695
5
bool EQ(InterpState &S, CodePtr OpPC) {
696
5
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
5
    return R == ComparisonCategoryResult::Equal;
698
5
  });
699
5
}
bool clang::interp::EQ<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
695
23
bool EQ(InterpState &S, CodePtr OpPC) {
696
23
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
697
23
    return R == ComparisonCategoryResult::Equal;
698
23
  });
699
23
}
700
701
template <PrimType Name, class T = typename PrimConv<Name>::T>
702
497
bool NE(InterpState &S, CodePtr OpPC) {
703
497
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
704
497
    return R != ComparisonCategoryResult::Equal;
705
497
  });
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
703
306
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
704
306
    return R != ComparisonCategoryResult::Equal;
705
306
  });
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
bool clang::interp::NE<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Line
Count
Source
703
190
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
704
190
    return R != ComparisonCategoryResult::Equal;
705
190
  });
bool clang::interp::NE<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Line
Count
Source
703
1
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
704
1
    return R != ComparisonCategoryResult::Equal;
705
1
  });
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
706
497
}
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
702
306
bool NE(InterpState &S, CodePtr OpPC) {
703
306
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
704
306
    return R != ComparisonCategoryResult::Equal;
705
306
  });
706
306
}
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::NE<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
702
190
bool NE(InterpState &S, CodePtr OpPC) {
703
190
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
704
190
    return R != ComparisonCategoryResult::Equal;
705
190
  });
706
190
}
bool clang::interp::NE<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
702
1
bool NE(InterpState &S, CodePtr OpPC) {
703
1
  return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
704
1
    return R != ComparisonCategoryResult::Equal;
705
1
  });
706
1
}
Unexecuted instantiation: bool clang::interp::NE<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
707
708
template <PrimType Name, class T = typename PrimConv<Name>::T>
709
99
bool LT(InterpState &S, CodePtr OpPC) {
710
99
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
711
97
    return R == ComparisonCategoryResult::Less;
712
97
  });
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
710
97
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
711
97
    return R == ComparisonCategoryResult::Less;
712
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::Boolean>(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::Pointer>(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::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
713
99
}
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
709
97
bool LT(InterpState &S, CodePtr OpPC) {
710
97
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
711
97
    return R == ComparisonCategoryResult::Less;
712
97
  });
713
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::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LT<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::LT<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
709
2
bool LT(InterpState &S, CodePtr OpPC) {
710
2
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
711
2
    return R == ComparisonCategoryResult::Less;
712
2
  });
713
2
}
714
715
template <PrimType Name, class T = typename PrimConv<Name>::T>
716
0
bool LE(InterpState &S, CodePtr OpPC) {
717
0
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
718
0
    return R == ComparisonCategoryResult::Less ||
719
0
           R == ComparisonCategoryResult::Equal;
720
0
  });
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)10, clang::interp::Pointer>(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::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
721
0
}
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::LE<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
722
723
template <PrimType Name, class T = typename PrimConv<Name>::T>
724
36
bool GT(InterpState &S, CodePtr OpPC) {
725
36
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
726
36
    return R == ComparisonCategoryResult::Greater;
727
36
  });
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
725
19
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
726
19
    return R == ComparisonCategoryResult::Greater;
727
19
  });
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
725
5
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
726
5
    return R == ComparisonCategoryResult::Greater;
727
5
  });
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
bool clang::interp::GT<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Line
Count
Source
725
12
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
726
12
    return R == ComparisonCategoryResult::Greater;
727
12
  });
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
728
36
}
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
724
19
bool GT(InterpState &S, CodePtr OpPC) {
725
19
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
726
19
    return R == ComparisonCategoryResult::Greater;
727
19
  });
728
19
}
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
724
5
bool GT(InterpState &S, CodePtr OpPC) {
725
5
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
726
5
    return R == ComparisonCategoryResult::Greater;
727
5
  });
728
5
}
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::GT<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
724
12
bool GT(InterpState &S, CodePtr OpPC) {
725
12
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
726
12
    return R == ComparisonCategoryResult::Greater;
727
12
  });
728
12
}
Unexecuted instantiation: bool clang::interp::GT<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
729
730
template <PrimType Name, class T = typename PrimConv<Name>::T>
731
8
bool GE(InterpState &S, CodePtr OpPC) {
732
8
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
733
8
    return R == ComparisonCategoryResult::Greater ||
734
8
           
R == ComparisonCategoryResult::Equal2
;
735
8
  });
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
732
8
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
733
8
    return R == ComparisonCategoryResult::Greater ||
734
8
           
R == ComparisonCategoryResult::Equal2
;
735
8
  });
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)10, clang::interp::Pointer>(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::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)::'lambda'(clang::ComparisonCategoryResult)::operator()(clang::ComparisonCategoryResult) const
736
8
}
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
731
8
bool GE(InterpState &S, CodePtr OpPC) {
732
8
  return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
733
8
    return R == ComparisonCategoryResult::Greater ||
734
8
           R == ComparisonCategoryResult::Equal;
735
8
  });
736
8
}
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::GE<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
737
738
//===----------------------------------------------------------------------===//
739
// InRange
740
//===----------------------------------------------------------------------===//
741
742
template <PrimType Name, class T = typename PrimConv<Name>::T>
743
bool InRange(InterpState &S, CodePtr OpPC) {
744
  const T RHS = S.Stk.pop<T>();
745
  const T LHS = S.Stk.pop<T>();
746
  const T Value = S.Stk.pop<T>();
747
748
  S.Stk.push<bool>(LHS <= Value && Value <= RHS);
749
  return true;
750
}
751
752
//===----------------------------------------------------------------------===//
753
// Dup, Pop, Test
754
//===----------------------------------------------------------------------===//
755
756
template <PrimType Name, class T = typename PrimConv<Name>::T>
757
742
bool Dup(InterpState &S, CodePtr OpPC) {
758
742
  S.Stk.push<T>(S.Stk.peek<T>());
759
742
  return true;
760
742
}
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Dup<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
757
742
bool Dup(InterpState &S, CodePtr OpPC) {
758
742
  S.Stk.push<T>(S.Stk.peek<T>());
759
742
  return true;
760
742
}
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Dup<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
761
762
template <PrimType Name, class T = typename PrimConv<Name>::T>
763
924
bool Pop(InterpState &S, CodePtr OpPC) {
764
924
  S.Stk.pop<T>();
765
924
  return true;
766
924
}
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
763
9
bool Pop(InterpState &S, CodePtr OpPC) {
764
9
  S.Stk.pop<T>();
765
9
  return true;
766
9
}
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)
bool clang::interp::Pop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
763
2
bool Pop(InterpState &S, CodePtr OpPC) {
764
2
  S.Stk.pop<T>();
765
2
  return true;
766
2
}
bool clang::interp::Pop<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
763
913
bool Pop(InterpState &S, CodePtr OpPC) {
764
913
  S.Stk.pop<T>();
765
913
  return true;
766
913
}
Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Pop<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
767
768
//===----------------------------------------------------------------------===//
769
// Const
770
//===----------------------------------------------------------------------===//
771
772
template <PrimType Name, class T = typename PrimConv<Name>::T>
773
8.12k
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
8.12k
  S.Stk.push<T>(Arg);
775
8.12k
  return true;
776
8.12k
}
bool clang::interp::Const<(clang::interp::PrimType)8, bool>(clang::interp::InterpState&, clang::interp::CodePtr, bool const&)
Line
Count
Source
773
589
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
589
  S.Stk.push<T>(Arg);
775
589
  return true;
776
589
}
bool clang::interp::Const<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Floating const&)
Line
Count
Source
773
184
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
184
  S.Stk.push<T>(Arg);
775
184
  return true;
776
184
}
bool clang::interp::Const<(clang::interp::PrimType)0, signed char>(clang::interp::InterpState&, clang::interp::CodePtr, signed char const&)
Line
Count
Source
773
141
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
141
  S.Stk.push<T>(Arg);
775
141
  return true;
776
141
}
bool clang::interp::Const<(clang::interp::PrimType)2, short>(clang::interp::InterpState&, clang::interp::CodePtr, short const&)
Line
Count
Source
773
12
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
12
  S.Stk.push<T>(Arg);
775
12
  return true;
776
12
}
bool clang::interp::Const<(clang::interp::PrimType)4, int>(clang::interp::InterpState&, clang::interp::CodePtr, int const&)
Line
Count
Source
773
6.00k
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
6.00k
  S.Stk.push<T>(Arg);
775
6.00k
  return true;
776
6.00k
}
bool clang::interp::Const<(clang::interp::PrimType)6, long long>(clang::interp::InterpState&, clang::interp::CodePtr, long long const&)
Line
Count
Source
773
69
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
69
  S.Stk.push<T>(Arg);
775
69
  return true;
776
69
}
bool clang::interp::Const<(clang::interp::PrimType)1, unsigned char>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned char const&)
Line
Count
Source
773
170
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
170
  S.Stk.push<T>(Arg);
775
170
  return true;
776
170
}
Unexecuted instantiation: bool clang::interp::Const<(clang::interp::PrimType)3, unsigned short>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned short const&)
bool clang::interp::Const<(clang::interp::PrimType)5, unsigned int>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int const&)
Line
Count
Source
773
65
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
65
  S.Stk.push<T>(Arg);
775
65
  return true;
776
65
}
bool clang::interp::Const<(clang::interp::PrimType)7, unsigned long long>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned long long const&)
Line
Count
Source
773
889
bool Const(InterpState &S, CodePtr OpPC, const T &Arg) {
774
889
  S.Stk.push<T>(Arg);
775
889
  return true;
776
889
}
777
778
//===----------------------------------------------------------------------===//
779
// Get/Set Local/Param/Global/This
780
//===----------------------------------------------------------------------===//
781
782
template <PrimType Name, class T = typename PrimConv<Name>::T>
783
2.45k
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
2.45k
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
2.45k
  if (!CheckLoad(S, OpPC, Ptr))
786
4
    return false;
787
2.44k
  S.Stk.push<T>(Ptr.deref<T>());
788
2.44k
  return true;
789
2.45k
}
Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::GetLocal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
783
2
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
2
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
2
  if (!CheckLoad(S, OpPC, Ptr))
786
0
    return false;
787
2
  S.Stk.push<T>(Ptr.deref<T>());
788
2
  return true;
789
2
}
Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::GetLocal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
783
1.62k
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
1.62k
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
1.62k
  if (!CheckLoad(S, OpPC, Ptr))
786
4
    return false;
787
1.61k
  S.Stk.push<T>(Ptr.deref<T>());
788
1.61k
  return true;
789
1.62k
}
bool clang::interp::GetLocal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
783
18
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
18
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
18
  if (!CheckLoad(S, OpPC, Ptr))
786
0
    return false;
787
18
  S.Stk.push<T>(Ptr.deref<T>());
788
18
  return true;
789
18
}
Unexecuted instantiation: bool clang::interp::GetLocal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::GetLocal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
783
12
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
12
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
12
  if (!CheckLoad(S, OpPC, Ptr))
786
0
    return false;
787
12
  S.Stk.push<T>(Ptr.deref<T>());
788
12
  return true;
789
12
}
bool clang::interp::GetLocal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
783
28
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
28
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
28
  if (!CheckLoad(S, OpPC, Ptr))
786
0
    return false;
787
28
  S.Stk.push<T>(Ptr.deref<T>());
788
28
  return true;
789
28
}
bool clang::interp::GetLocal<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
783
747
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
747
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
747
  if (!CheckLoad(S, OpPC, Ptr))
786
0
    return false;
787
747
  S.Stk.push<T>(Ptr.deref<T>());
788
747
  return true;
789
747
}
bool clang::interp::GetLocal<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
783
6
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
6
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
6
  if (!CheckLoad(S, OpPC, Ptr))
786
0
    return false;
787
6
  S.Stk.push<T>(Ptr.deref<T>());
788
6
  return true;
789
6
}
bool clang::interp::GetLocal<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
783
17
bool GetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
784
17
  const Pointer &Ptr = S.Current->getLocalPointer(I);
785
17
  if (!CheckLoad(S, OpPC, Ptr))
786
0
    return false;
787
17
  S.Stk.push<T>(Ptr.deref<T>());
788
17
  return true;
789
17
}
790
791
/// 1) Pops the value from the stack.
792
/// 2) Writes the value to the local variable with the
793
///    given offset.
794
template <PrimType Name, class T = typename PrimConv<Name>::T>
795
765
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
796
765
  S.Current->setLocal<T>(I, S.Stk.pop<T>());
797
765
  return true;
798
765
}
Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::SetLocal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
795
2
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
796
2
  S.Current->setLocal<T>(I, S.Stk.pop<T>());
797
2
  return true;
798
2
}
Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::SetLocal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
795
425
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
796
425
  S.Current->setLocal<T>(I, S.Stk.pop<T>());
797
425
  return true;
798
425
}
Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetLocal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::SetLocal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
795
4
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
796
4
  S.Current->setLocal<T>(I, S.Stk.pop<T>());
797
4
  return true;
798
4
}
bool clang::interp::SetLocal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
795
13
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
796
13
  S.Current->setLocal<T>(I, S.Stk.pop<T>());
797
13
  return true;
798
13
}
bool clang::interp::SetLocal<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
795
303
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
796
303
  S.Current->setLocal<T>(I, S.Stk.pop<T>());
797
303
  return true;
798
303
}
bool clang::interp::SetLocal<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
795
6
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
796
6
  S.Current->setLocal<T>(I, S.Stk.pop<T>());
797
6
  return true;
798
6
}
bool clang::interp::SetLocal<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
795
12
bool SetLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
796
12
  S.Current->setLocal<T>(I, S.Stk.pop<T>());
797
12
  return true;
798
12
}
799
800
template <PrimType Name, class T = typename PrimConv<Name>::T>
801
1.35k
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
1.35k
  if (S.checkingPotentialConstantExpression()) {
803
105
    return false;
804
105
  }
805
1.24k
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
1.24k
  return true;
807
1.35k
}
Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::GetParam<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
801
2
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
2
  if (S.checkingPotentialConstantExpression()) {
803
0
    return false;
804
0
  }
805
2
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
2
  return true;
807
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
801
436
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
436
  if (S.checkingPotentialConstantExpression()) {
803
47
    return false;
804
47
  }
805
389
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
389
  return true;
807
436
}
bool clang::interp::GetParam<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
801
228
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
228
  if (S.checkingPotentialConstantExpression()) {
803
8
    return false;
804
8
  }
805
220
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
220
  return true;
807
228
}
Unexecuted instantiation: bool clang::interp::GetParam<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::GetParam<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
801
5
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
5
  if (S.checkingPotentialConstantExpression()) {
803
1
    return false;
804
1
  }
805
4
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
4
  return true;
807
5
}
bool clang::interp::GetParam<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
801
311
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
311
  if (S.checkingPotentialConstantExpression()) {
803
18
    return false;
804
18
  }
805
293
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
293
  return true;
807
311
}
bool clang::interp::GetParam<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
801
353
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
353
  if (S.checkingPotentialConstantExpression()) {
803
26
    return false;
804
26
  }
805
327
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
327
  return true;
807
353
}
bool clang::interp::GetParam<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
801
7
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
7
  if (S.checkingPotentialConstantExpression()) {
803
1
    return false;
804
1
  }
805
6
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
6
  return true;
807
7
}
bool clang::interp::GetParam<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
801
12
bool GetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
802
12
  if (S.checkingPotentialConstantExpression()) {
803
4
    return false;
804
4
  }
805
8
  S.Stk.push<T>(S.Current->getParam<T>(I));
806
8
  return true;
807
12
}
808
809
template <PrimType Name, class T = typename PrimConv<Name>::T>
810
0
bool SetParam(InterpState &S, CodePtr OpPC, uint32_t I) {
811
0
  S.Current->setParam<T>(I, S.Stk.pop<T>());
812
0
  return true;
813
0
}
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetParam<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
814
815
/// 1) Peeks a pointer on the stack
816
/// 2) Pushes the value of the pointer's field on the stack
817
template <PrimType Name, class T = typename PrimConv<Name>::T>
818
0
bool GetField(InterpState &S, CodePtr OpPC, uint32_t I) {
819
0
  const Pointer &Obj = S.Stk.peek<Pointer>();
820
0
  if (!CheckNull(S, OpPC, Obj, CSK_Field))
821
0
      return false;
822
0
  if (!CheckRange(S, OpPC, Obj, CSK_Field))
823
0
    return false;
824
0
  const Pointer &Field = Obj.atField(I);
825
0
  if (!CheckLoad(S, OpPC, Field))
826
0
    return false;
827
0
  S.Stk.push<T>(Field.deref<T>());
828
0
  return true;
829
0
}
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetField<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
830
831
template <PrimType Name, class T = typename PrimConv<Name>::T>
832
0
bool SetField(InterpState &S, CodePtr OpPC, uint32_t I) {
833
0
  const T &Value = S.Stk.pop<T>();
834
0
  const Pointer &Obj = S.Stk.peek<Pointer>();
835
0
  if (!CheckNull(S, OpPC, Obj, CSK_Field))
836
0
    return false;
837
0
  if (!CheckRange(S, OpPC, Obj, CSK_Field))
838
0
    return false;
839
0
  const Pointer &Field = Obj.atField(I);
840
0
  if (!CheckStore(S, OpPC, Field))
841
0
    return false;
842
0
  Field.deref<T>() = Value;
843
0
  return true;
844
0
}
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetField<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
845
846
/// 1) Pops a pointer from the stack
847
/// 2) Pushes the value of the pointer's field on the stack
848
template <PrimType Name, class T = typename PrimConv<Name>::T>
849
85
bool GetFieldPop(InterpState &S, CodePtr OpPC, uint32_t I) {
850
85
  const Pointer &Obj = S.Stk.pop<Pointer>();
851
85
  if (!CheckNull(S, OpPC, Obj, CSK_Field))
852
0
    return false;
853
85
  if (!CheckRange(S, OpPC, Obj, CSK_Field))
854
0
    return false;
855
85
  const Pointer &Field = Obj.atField(I);
856
85
  if (!CheckLoad(S, OpPC, Field))
857
9
    return false;
858
76
  S.Stk.push<T>(Field.deref<T>());
859
76
  return true;
860
85
}
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::GetFieldPop<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
849
85
bool GetFieldPop(InterpState &S, CodePtr OpPC, uint32_t I) {
850
85
  const Pointer &Obj = S.Stk.pop<Pointer>();
851
85
  if (!CheckNull(S, OpPC, Obj, CSK_Field))
852
0
    return false;
853
85
  if (!CheckRange(S, OpPC, Obj, CSK_Field))
854
0
    return false;
855
85
  const Pointer &Field = Obj.atField(I);
856
85
  if (!CheckLoad(S, OpPC, Field))
857
9
    return false;
858
76
  S.Stk.push<T>(Field.deref<T>());
859
76
  return true;
860
85
}
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetFieldPop<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
861
862
template <PrimType Name, class T = typename PrimConv<Name>::T>
863
0
bool GetThisField(InterpState &S, CodePtr OpPC, uint32_t I) {
864
0
  if (S.checkingPotentialConstantExpression())
865
0
    return false;
866
0
  const Pointer &This = S.Current->getThis();
867
0
  if (!CheckThis(S, OpPC, This))
868
0
    return false;
869
0
  const Pointer &Field = This.atField(I);
870
0
  if (!CheckLoad(S, OpPC, Field))
871
0
    return false;
872
0
  S.Stk.push<T>(Field.deref<T>());
873
0
  return true;
874
0
}
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::GetThisField<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
875
876
template <PrimType Name, class T = typename PrimConv<Name>::T>
877
0
bool SetThisField(InterpState &S, CodePtr OpPC, uint32_t I) {
878
0
  if (S.checkingPotentialConstantExpression())
879
0
    return false;
880
0
  const T &Value = S.Stk.pop<T>();
881
0
  const Pointer &This = S.Current->getThis();
882
0
  if (!CheckThis(S, OpPC, This))
883
0
    return false;
884
0
  const Pointer &Field = This.atField(I);
885
0
  if (!CheckStore(S, OpPC, Field))
886
0
    return false;
887
0
  Field.deref<T>() = Value;
888
0
  return true;
889
0
}
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetThisField<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
890
891
template <PrimType Name, class T = typename PrimConv<Name>::T>
892
311
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
311
  auto *B = S.P.getGlobal(I);
894
311
  if (B->isExtern())
895
0
    return false;
896
311
  S.Stk.push<T>(B->deref<T>());
897
311
  return true;
898
311
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
8
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
8
  auto *B = S.P.getGlobal(I);
894
8
  if (B->isExtern())
895
0
    return false;
896
8
  S.Stk.push<T>(B->deref<T>());
897
8
  return true;
898
8
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
4
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
4
  auto *B = S.P.getGlobal(I);
894
4
  if (B->isExtern())
895
0
    return false;
896
4
  S.Stk.push<T>(B->deref<T>());
897
4
  return true;
898
4
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
2
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
2
  auto *B = S.P.getGlobal(I);
894
2
  if (B->isExtern())
895
0
    return false;
896
2
  S.Stk.push<T>(B->deref<T>());
897
2
  return true;
898
2
}
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
892
147
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
147
  auto *B = S.P.getGlobal(I);
894
147
  if (B->isExtern())
895
0
    return false;
896
147
  S.Stk.push<T>(B->deref<T>());
897
147
  return true;
898
147
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
27
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
27
  auto *B = S.P.getGlobal(I);
894
27
  if (B->isExtern())
895
0
    return false;
896
27
  S.Stk.push<T>(B->deref<T>());
897
27
  return true;
898
27
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
6
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
6
  auto *B = S.P.getGlobal(I);
894
6
  if (B->isExtern())
895
0
    return false;
896
6
  S.Stk.push<T>(B->deref<T>());
897
6
  return true;
898
6
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
6
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
6
  auto *B = S.P.getGlobal(I);
894
6
  if (B->isExtern())
895
0
    return false;
896
6
  S.Stk.push<T>(B->deref<T>());
897
6
  return true;
898
6
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
20
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
20
  auto *B = S.P.getGlobal(I);
894
20
  if (B->isExtern())
895
0
    return false;
896
20
  S.Stk.push<T>(B->deref<T>());
897
20
  return true;
898
20
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
77
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
77
  auto *B = S.P.getGlobal(I);
894
77
  if (B->isExtern())
895
0
    return false;
896
77
  S.Stk.push<T>(B->deref<T>());
897
77
  return true;
898
77
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
7
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
7
  auto *B = S.P.getGlobal(I);
894
7
  if (B->isExtern())
895
0
    return false;
896
7
  S.Stk.push<T>(B->deref<T>());
897
7
  return true;
898
7
}
bool clang::interp::GetGlobal<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
892
7
bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
893
7
  auto *B = S.P.getGlobal(I);
894
7
  if (B->isExtern())
895
0
    return false;
896
7
  S.Stk.push<T>(B->deref<T>());
897
7
  return true;
898
7
}
899
900
template <PrimType Name, class T = typename PrimConv<Name>::T>
901
0
bool SetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
902
  // TODO: emit warning.
903
0
  return false;
904
0
}
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::SetGlobal<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
905
906
template <PrimType Name, class T = typename PrimConv<Name>::T>
907
160
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
160
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
160
  return true;
910
160
}
bool clang::interp::InitGlobal<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
907
4
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
4
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
4
  return true;
910
4
}
bool clang::interp::InitGlobal<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
907
2
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
2
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
2
  return true;
910
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
907
1
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
1
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
1
  return true;
910
1
}
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
907
51
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
51
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
51
  return true;
910
51
}
bool clang::interp::InitGlobal<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
907
13
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
13
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
13
  return true;
910
13
}
bool clang::interp::InitGlobal<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
907
6
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
6
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
6
  return true;
910
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
907
2
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
2
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
2
  return true;
910
2
}
bool clang::interp::InitGlobal<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
907
20
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
20
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
20
  return true;
910
20
}
bool clang::interp::InitGlobal<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
907
37
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
37
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
37
  return true;
910
37
}
bool clang::interp::InitGlobal<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
907
2
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
2
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
2
  return true;
910
2
}
bool clang::interp::InitGlobal<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
907
22
bool InitGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
908
22
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
909
22
  return true;
910
22
}
911
912
/// 1) Converts the value on top of the stack to an APValue
913
/// 2) Sets that APValue on \Temp
914
/// 3) Initialized global with index \I with that
915
template <PrimType Name, class T = typename PrimConv<Name>::T>
916
bool InitGlobalTemp(InterpState &S, CodePtr OpPC, uint32_t I,
917
1
                    const LifetimeExtendedTemporaryDecl *Temp) {
918
1
  assert(Temp);
919
1
  const T Value = S.Stk.peek<T>();
920
1
  APValue APV = Value.toAPValue();
921
1
  APValue *Cached = Temp->getOrCreateValue(true);
922
1
  *Cached = APV;
923
924
1
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
925
1
  return true;
926
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
917
1
                    const LifetimeExtendedTemporaryDecl *Temp) {
918
1
  assert(Temp);
919
1
  const T Value = S.Stk.peek<T>();
920
1
  APValue APV = Value.toAPValue();
921
1
  APValue *Cached = Temp->getOrCreateValue(true);
922
1
  *Cached = APV;
923
924
1
  S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
925
1
  return true;
926
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::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*)
Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*)
Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*)
Unexecuted instantiation: bool clang::interp::InitGlobalTemp<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int, clang::LifetimeExtendedTemporaryDecl const*)
927
928
template <PrimType Name, class T = typename PrimConv<Name>::T>
929
315
bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) {
930
315
  if (S.checkingPotentialConstantExpression())
931
11
    return false;
932
304
  const Pointer &This = S.Current->getThis();
933
304
  if (!CheckThis(S, OpPC, This))
934
0
    return false;
935
304
  const Pointer &Field = This.atField(I);
936
304
  Field.deref<T>() = S.Stk.pop<T>();
937
304
  Field.initialize();
938
304
  return true;
939
304
}
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::InitThisField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
929
14
bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) {
930
14
  if (S.checkingPotentialConstantExpression())
931
0
    return false;
932
14
  const Pointer &This = S.Current->getThis();
933
14
  if (!CheckThis(S, OpPC, This))
934
0
    return false;
935
14
  const Pointer &Field = This.atField(I);
936
14
  Field.deref<T>() = S.Stk.pop<T>();
937
14
  Field.initialize();
938
14
  return true;
939
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
929
203
bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) {
930
203
  if (S.checkingPotentialConstantExpression())
931
9
    return false;
932
194
  const Pointer &This = S.Current->getThis();
933
194
  if (!CheckThis(S, OpPC, This))
934
0
    return false;
935
194
  const Pointer &Field = This.atField(I);
936
194
  Field.deref<T>() = S.Stk.pop<T>();
937
194
  Field.initialize();
938
194
  return true;
939
194
}
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::InitThisField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
929
43
bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) {
930
43
  if (S.checkingPotentialConstantExpression())
931
2
    return false;
932
41
  const Pointer &This = S.Current->getThis();
933
41
  if (!CheckThis(S, OpPC, This))
934
0
    return false;
935
41
  const Pointer &Field = This.atField(I);
936
41
  Field.deref<T>() = S.Stk.pop<T>();
937
41
  Field.initialize();
938
41
  return true;
939
41
}
bool clang::interp::InitThisField<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
929
55
bool InitThisField(InterpState &S, CodePtr OpPC, uint32_t I) {
930
55
  if (S.checkingPotentialConstantExpression())
931
0
    return false;
932
55
  const Pointer &This = S.Current->getThis();
933
55
  if (!CheckThis(S, OpPC, This))
934
0
    return false;
935
55
  const Pointer &Field = This.atField(I);
936
55
  Field.deref<T>() = S.Stk.pop<T>();
937
55
  Field.initialize();
938
55
  return true;
939
55
}
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisField<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
940
941
template <PrimType Name, class T = typename PrimConv<Name>::T>
942
0
bool InitThisBitField(InterpState &S, CodePtr OpPC, const Record::Field *F) {
943
0
  if (S.checkingPotentialConstantExpression())
944
0
    return false;
945
0
  const Pointer &This = S.Current->getThis();
946
0
  if (!CheckThis(S, OpPC, This))
947
0
    return false;
948
0
  const Pointer &Field = This.atField(F->Offset);
949
0
  const auto &Value = S.Stk.pop<T>();
950
0
  Field.deref<T>() = Value.truncate(F->Decl->getBitWidthValue(S.getCtx()));
951
0
  Field.initialize();
952
0
  return true;
953
0
}
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitThisBitField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
954
955
template <PrimType Name, class T = typename PrimConv<Name>::T>
956
0
bool InitThisFieldActive(InterpState &S, CodePtr OpPC, uint32_t I) {
957
0
  if (S.checkingPotentialConstantExpression())
958
0
    return false;
959
0
  const Pointer &This = S.Current->getThis();
960
0
  if (!CheckThis(S, OpPC, This))
961
0
    return false;
962
0
  const Pointer &Field = This.atField(I);
963
0
  Field.deref<T>() = S.Stk.pop<T>();
964
0
  Field.activate();
965
0
  Field.initialize();
966
0
  return true;
967
0
}
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitThisFieldActive<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
968
969
/// 1) Pops the value from the stack
970
/// 2) Peeks a pointer from the stack
971
/// 3) Pushes the value to field I of the pointer on the stack
972
template <PrimType Name, class T = typename PrimConv<Name>::T>
973
213
bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) {
974
213
  const T &Value = S.Stk.pop<T>();
975
213
  const Pointer &Field = S.Stk.peek<Pointer>().atField(I);
976
213
  Field.deref<T>() = Value;
977
213
  Field.activate();
978
213
  Field.initialize();
979
213
  return true;
980
213
}
Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::InitField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
973
111
bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) {
974
111
  const T &Value = S.Stk.pop<T>();
975
111
  const Pointer &Field = S.Stk.peek<Pointer>().atField(I);
976
111
  Field.deref<T>() = Value;
977
111
  Field.activate();
978
111
  Field.initialize();
979
111
  return true;
980
111
}
Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::InitField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
973
75
bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) {
974
75
  const T &Value = S.Stk.pop<T>();
975
75
  const Pointer &Field = S.Stk.peek<Pointer>().atField(I);
976
75
  Field.deref<T>() = Value;
977
75
  Field.activate();
978
75
  Field.initialize();
979
75
  return true;
980
75
}
bool clang::interp::InitField<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
973
24
bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) {
974
24
  const T &Value = S.Stk.pop<T>();
975
24
  const Pointer &Field = S.Stk.peek<Pointer>().atField(I);
976
24
  Field.deref<T>() = Value;
977
24
  Field.activate();
978
24
  Field.initialize();
979
24
  return true;
980
24
}
bool clang::interp::InitField<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
973
1
bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) {
974
1
  const T &Value = S.Stk.pop<T>();
975
1
  const Pointer &Field = S.Stk.peek<Pointer>().atField(I);
976
1
  Field.deref<T>() = Value;
977
1
  Field.activate();
978
1
  Field.initialize();
979
1
  return true;
980
1
}
bool clang::interp::InitField<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
973
2
bool InitField(InterpState &S, CodePtr OpPC, uint32_t I) {
974
2
  const T &Value = S.Stk.pop<T>();
975
2
  const Pointer &Field = S.Stk.peek<Pointer>().atField(I);
976
2
  Field.deref<T>() = Value;
977
2
  Field.activate();
978
2
  Field.initialize();
979
2
  return true;
980
2
}
981
982
template <PrimType Name, class T = typename PrimConv<Name>::T>
983
0
bool InitBitField(InterpState &S, CodePtr OpPC, const Record::Field *F) {
984
0
  const T &Value = S.Stk.pop<T>();
985
0
  const Pointer &Field = S.Stk.pop<Pointer>().atField(F->Offset);
986
0
  Field.deref<T>() = Value.truncate(F->Decl->getBitWidthValue(S.getCtx()));
987
0
  Field.activate();
988
0
  Field.initialize();
989
0
  return true;
990
0
}
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
Unexecuted instantiation: bool clang::interp::InitBitField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Record::Field const*)
991
992
template <PrimType Name, class T = typename PrimConv<Name>::T>
993
0
bool InitFieldActive(InterpState &S, CodePtr OpPC, uint32_t I) {
994
0
  const T &Value = S.Stk.pop<T>();
995
0
  const Pointer &Ptr = S.Stk.pop<Pointer>();
996
0
  const Pointer &Field = Ptr.atField(I);
997
0
  Field.deref<T>() = Value;
998
0
  Field.activate();
999
0
  Field.initialize();
1000
0
  return true;
1001
0
}
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitFieldActive<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
1002
1003
//===----------------------------------------------------------------------===//
1004
// GetPtr Local/Param/Global/Field/This
1005
//===----------------------------------------------------------------------===//
1006
1007
1.84k
inline bool GetPtrLocal(InterpState &S, CodePtr OpPC, uint32_t I) {
1008
1.84k
  S.Stk.push<Pointer>(S.Current->getLocalPointer(I));
1009
1.84k
  return true;
1010
1.84k
}
1011
1012
121
inline bool GetPtrParam(InterpState &S, CodePtr OpPC, uint32_t I) {
1013
121
  if (S.checkingPotentialConstantExpression()) {
1014
5
    return false;
1015
5
  }
1016
116
  S.Stk.push<Pointer>(S.Current->getParamPointer(I));
1017
116
  return true;
1018
121
}
1019
1020
1.17k
inline bool GetPtrGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
1021
1.17k
  S.Stk.push<Pointer>(S.P.getPtrGlobal(I));
1022
1.17k
  return true;
1023
1.17k
}
1024
1025
/// 1) Pops a Pointer from the stack
1026
/// 2) Pushes Pointer.atField(Off) on the stack
1027
799
inline bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off) {
1028
799
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1029
799
  if (!CheckNull(S, OpPC, Ptr, CSK_Field))
1030
0
    return false;
1031
799
  if (!CheckExtern(S, OpPC, Ptr))
1032
0
    return false;
1033
799
  if (!CheckRange(S, OpPC, Ptr, CSK_Field))
1034
0
    return false;
1035
799
  S.Stk.push<Pointer>(Ptr.atField(Off));
1036
799
  return true;
1037
799
}
1038
1039
0
inline bool GetPtrThisField(InterpState &S, CodePtr OpPC, uint32_t Off) {
1040
0
  if (S.checkingPotentialConstantExpression())
1041
0
    return false;
1042
0
  const Pointer &This = S.Current->getThis();
1043
0
  if (!CheckThis(S, OpPC, This))
1044
0
    return false;
1045
0
  S.Stk.push<Pointer>(This.atField(Off));
1046
0
  return true;
1047
0
}
1048
1049
0
inline bool GetPtrActiveField(InterpState &S, CodePtr OpPC, uint32_t Off) {
1050
0
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1051
0
  if (!CheckNull(S, OpPC, Ptr, CSK_Field))
1052
0
    return false;
1053
0
  if (!CheckRange(S, OpPC, Ptr, CSK_Field))
1054
0
    return false;
1055
0
  Pointer Field = Ptr.atField(Off);
1056
0
  Ptr.deactivate();
1057
0
  Field.activate();
1058
0
  S.Stk.push<Pointer>(std::move(Field));
1059
0
  return true;
1060
0
}
1061
1062
0
inline bool GetPtrActiveThisField(InterpState &S, CodePtr OpPC, uint32_t Off) {
1063
0
 if (S.checkingPotentialConstantExpression())
1064
0
    return false;
1065
0
  const Pointer &This = S.Current->getThis();
1066
0
  if (!CheckThis(S, OpPC, This))
1067
0
    return false;
1068
0
  Pointer Field = This.atField(Off);
1069
0
  This.deactivate();
1070
0
  Field.activate();
1071
0
  S.Stk.push<Pointer>(std::move(Field));
1072
0
  return true;
1073
0
}
1074
1075
2
inline bool GetPtrBase(InterpState &S, CodePtr OpPC, uint32_t Off) {
1076
2
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1077
2
  if (!CheckNull(S, OpPC, Ptr, CSK_Base))
1078
0
    return false;
1079
2
  S.Stk.push<Pointer>(Ptr.atField(Off));
1080
2
  return true;
1081
2
}
1082
1083
135
inline bool GetPtrBasePop(InterpState &S, CodePtr OpPC, uint32_t Off) {
1084
135
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1085
135
  if (!CheckNull(S, OpPC, Ptr, CSK_Base))
1086
0
    return false;
1087
135
  S.Stk.push<Pointer>(Ptr.atField(Off));
1088
135
  return true;
1089
135
}
1090
1091
87
inline bool GetPtrThisBase(InterpState &S, CodePtr OpPC, uint32_t Off) {
1092
87
  if (S.checkingPotentialConstantExpression())
1093
25
    return false;
1094
62
  const Pointer &This = S.Current->getThis();
1095
62
  if (!CheckThis(S, OpPC, This))
1096
0
    return false;
1097
62
  S.Stk.push<Pointer>(This.atField(Off));
1098
62
  return true;
1099
62
}
1100
1101
inline bool VirtBaseHelper(InterpState &S, CodePtr OpPC, const RecordDecl *Decl,
1102
0
                           const Pointer &Ptr) {
1103
0
  Pointer Base = Ptr;
1104
0
  while (Base.isBaseClass())
1105
0
    Base = Base.getBase();
1106
1107
0
  auto *Field = Base.getRecord()->getVirtualBase(Decl);
1108
0
  S.Stk.push<Pointer>(Base.atField(Field->Offset));
1109
0
  return true;
1110
0
}
1111
1112
0
inline bool GetPtrVirtBase(InterpState &S, CodePtr OpPC, const RecordDecl *D) {
1113
0
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1114
0
  if (!CheckNull(S, OpPC, Ptr, CSK_Base))
1115
0
    return false;
1116
0
  return VirtBaseHelper(S, OpPC, D, Ptr);
1117
0
}
1118
1119
inline bool GetPtrThisVirtBase(InterpState &S, CodePtr OpPC,
1120
0
                               const RecordDecl *D) {
1121
0
  if (S.checkingPotentialConstantExpression())
1122
0
    return false;
1123
0
  const Pointer &This = S.Current->getThis();
1124
0
  if (!CheckThis(S, OpPC, This))
1125
0
    return false;
1126
0
  return VirtBaseHelper(S, OpPC, D, S.Current->getThis());
1127
0
}
1128
1129
//===----------------------------------------------------------------------===//
1130
// Load, Store, Init
1131
//===----------------------------------------------------------------------===//
1132
1133
template <PrimType Name, class T = typename PrimConv<Name>::T>
1134
420
bool Load(InterpState &S, CodePtr OpPC) {
1135
420
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1136
420
  if (!CheckLoad(S, OpPC, Ptr))
1137
0
    return false;
1138
420
  S.Stk.push<T>(Ptr.deref<T>());
1139
420
  return true;
1140
420
}
Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Load<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1134
172
bool Load(InterpState &S, CodePtr OpPC) {
1135
172
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1136
172
  if (!CheckLoad(S, OpPC, Ptr))
1137
0
    return false;
1138
172
  S.Stk.push<T>(Ptr.deref<T>());
1139
172
  return true;
1140
172
}
bool clang::interp::Load<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1134
18
bool Load(InterpState &S, CodePtr OpPC) {
1135
18
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1136
18
  if (!CheckLoad(S, OpPC, Ptr))
1137
0
    return false;
1138
18
  S.Stk.push<T>(Ptr.deref<T>());
1139
18
  return true;
1140
18
}
Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Load<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1134
4
bool Load(InterpState &S, CodePtr OpPC) {
1135
4
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1136
4
  if (!CheckLoad(S, OpPC, Ptr))
1137
0
    return false;
1138
4
  S.Stk.push<T>(Ptr.deref<T>());
1139
4
  return true;
1140
4
}
bool clang::interp::Load<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1134
22
bool Load(InterpState &S, CodePtr OpPC) {
1135
22
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1136
22
  if (!CheckLoad(S, OpPC, Ptr))
1137
0
    return false;
1138
22
  S.Stk.push<T>(Ptr.deref<T>());
1139
22
  return true;
1140
22
}
bool clang::interp::Load<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1134
184
bool Load(InterpState &S, CodePtr OpPC) {
1135
184
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1136
184
  if (!CheckLoad(S, OpPC, Ptr))
1137
0
    return false;
1138
184
  S.Stk.push<T>(Ptr.deref<T>());
1139
184
  return true;
1140
184
}
Unexecuted instantiation: bool clang::interp::Load<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Load<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1134
20
bool Load(InterpState &S, CodePtr OpPC) {
1135
20
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1136
20
  if (!CheckLoad(S, OpPC, Ptr))
1137
0
    return false;
1138
20
  S.Stk.push<T>(Ptr.deref<T>());
1139
20
  return true;
1140
20
}
1141
1142
template <PrimType Name, class T = typename PrimConv<Name>::T>
1143
1.32k
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
1.32k
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
1.32k
  if (!CheckLoad(S, OpPC, Ptr))
1146
52
    return false;
1147
1.27k
  S.Stk.push<T>(Ptr.deref<T>());
1148
1.27k
  return true;
1149
1.32k
}
bool clang::interp::LoadPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
180
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
180
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
180
  if (!CheckLoad(S, OpPC, Ptr))
1146
25
    return false;
1147
155
  S.Stk.push<T>(Ptr.deref<T>());
1148
155
  return true;
1149
180
}
bool clang::interp::LoadPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
2
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
2
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
2
  if (!CheckLoad(S, OpPC, Ptr))
1146
0
    return false;
1147
2
  S.Stk.push<T>(Ptr.deref<T>());
1148
2
  return true;
1149
2
}
bool clang::interp::LoadPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
25
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
25
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
25
  if (!CheckLoad(S, OpPC, Ptr))
1146
0
    return false;
1147
25
  S.Stk.push<T>(Ptr.deref<T>());
1148
25
  return true;
1149
25
}
Unexecuted instantiation: bool clang::interp::LoadPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::LoadPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
852
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
852
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
852
  if (!CheckLoad(S, OpPC, Ptr))
1146
26
    return false;
1147
826
  S.Stk.push<T>(Ptr.deref<T>());
1148
826
  return true;
1149
852
}
bool clang::interp::LoadPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
17
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
17
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
17
  if (!CheckLoad(S, OpPC, Ptr))
1146
0
    return false;
1147
17
  S.Stk.push<T>(Ptr.deref<T>());
1148
17
  return true;
1149
17
}
bool clang::interp::LoadPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
6
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
6
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
6
  if (!CheckLoad(S, OpPC, Ptr))
1146
0
    return false;
1147
6
  S.Stk.push<T>(Ptr.deref<T>());
1148
6
  return true;
1149
6
}
bool clang::interp::LoadPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
7
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
7
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
7
  if (!CheckLoad(S, OpPC, Ptr))
1146
1
    return false;
1147
6
  S.Stk.push<T>(Ptr.deref<T>());
1148
6
  return true;
1149
7
}
bool clang::interp::LoadPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
125
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
125
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
125
  if (!CheckLoad(S, OpPC, Ptr))
1146
0
    return false;
1147
125
  S.Stk.push<T>(Ptr.deref<T>());
1148
125
  return true;
1149
125
}
bool clang::interp::LoadPop<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
83
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
83
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
83
  if (!CheckLoad(S, OpPC, Ptr))
1146
0
    return false;
1147
83
  S.Stk.push<T>(Ptr.deref<T>());
1148
83
  return true;
1149
83
}
bool clang::interp::LoadPop<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
3
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
3
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
3
  if (!CheckLoad(S, OpPC, Ptr))
1146
0
    return false;
1147
3
  S.Stk.push<T>(Ptr.deref<T>());
1148
3
  return true;
1149
3
}
bool clang::interp::LoadPop<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1143
28
bool LoadPop(InterpState &S, CodePtr OpPC) {
1144
28
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1145
28
  if (!CheckLoad(S, OpPC, Ptr))
1146
0
    return false;
1147
28
  S.Stk.push<T>(Ptr.deref<T>());
1148
28
  return true;
1149
28
}
1150
1151
template <PrimType Name, class T = typename PrimConv<Name>::T>
1152
52
bool Store(InterpState &S, CodePtr OpPC) {
1153
52
  const T &Value = S.Stk.pop<T>();
1154
52
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1155
52
  if (!CheckStore(S, OpPC, Ptr))
1156
0
    return false;
1157
52
  if (!Ptr.isRoot())
1158
35
    Ptr.initialize();
1159
52
  Ptr.deref<T>() = Value;
1160
52
  return true;
1161
52
}
Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Store<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1152
22
bool Store(InterpState &S, CodePtr OpPC) {
1153
22
  const T &Value = S.Stk.pop<T>();
1154
22
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1155
22
  if (!CheckStore(S, OpPC, Ptr))
1156
0
    return false;
1157
22
  if (!Ptr.isRoot())
1158
18
    Ptr.initialize();
1159
22
  Ptr.deref<T>() = Value;
1160
22
  return true;
1161
22
}
Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Store<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1152
4
bool Store(InterpState &S, CodePtr OpPC) {
1153
4
  const T &Value = S.Stk.pop<T>();
1154
4
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1155
4
  if (!CheckStore(S, OpPC, Ptr))
1156
0
    return false;
1157
4
  if (!Ptr.isRoot())
1158
4
    Ptr.initialize();
1159
4
  Ptr.deref<T>() = Value;
1160
4
  return true;
1161
4
}
bool clang::interp::Store<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1152
2
bool Store(InterpState &S, CodePtr OpPC) {
1153
2
  const T &Value = S.Stk.pop<T>();
1154
2
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1155
2
  if (!CheckStore(S, OpPC, Ptr))
1156
0
    return false;
1157
2
  if (!Ptr.isRoot())
1158
2
    Ptr.initialize();
1159
2
  Ptr.deref<T>() = Value;
1160
2
  return true;
1161
2
}
bool clang::interp::Store<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1152
22
bool Store(InterpState &S, CodePtr OpPC) {
1153
22
  const T &Value = S.Stk.pop<T>();
1154
22
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1155
22
  if (!CheckStore(S, OpPC, Ptr))
1156
0
    return false;
1157
22
  if (!Ptr.isRoot())
1158
9
    Ptr.initialize();
1159
22
  Ptr.deref<T>() = Value;
1160
22
  return true;
1161
22
}
Unexecuted instantiation: bool clang::interp::Store<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::Store<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1152
2
bool Store(InterpState &S, CodePtr OpPC) {
1153
2
  const T &Value = S.Stk.pop<T>();
1154
2
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1155
2
  if (!CheckStore(S, OpPC, Ptr))
1156
0
    return false;
1157
2
  if (!Ptr.isRoot())
1158
2
    Ptr.initialize();
1159
2
  Ptr.deref<T>() = Value;
1160
2
  return true;
1161
2
}
1162
1163
template <PrimType Name, class T = typename PrimConv<Name>::T>
1164
1.15k
bool StorePop(InterpState &S, CodePtr OpPC) {
1165
1.15k
  const T &Value = S.Stk.pop<T>();
1166
1.15k
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1167
1.15k
  if (!CheckStore(S, OpPC, Ptr))
1168
0
    return false;
1169
1.15k
  if (!Ptr.isRoot())
1170
1.11k
    Ptr.initialize();
1171
1.15k
  Ptr.deref<T>() = Value;
1172
1.15k
  return true;
1173
1.15k
}
bool clang::interp::StorePop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1164
38
bool StorePop(InterpState &S, CodePtr OpPC) {
1165
38
  const T &Value = S.Stk.pop<T>();
1166
38
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1167
38
  if (!CheckStore(S, OpPC, Ptr))
1168
0
    return false;
1169
38
  if (!Ptr.isRoot())
1170
38
    Ptr.initialize();
1171
38
  Ptr.deref<T>() = Value;
1172
38
  return true;
1173
38
}
Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::StorePop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1164
2
bool StorePop(InterpState &S, CodePtr OpPC) {
1165
2
  const T &Value = S.Stk.pop<T>();
1166
2
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1167
2
  if (!CheckStore(S, OpPC, Ptr))
1168
0
    return false;
1169
2
  if (!Ptr.isRoot())
1170
2
    Ptr.initialize();
1171
2
  Ptr.deref<T>() = Value;
1172
2
  return true;
1173
2
}
Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::StorePop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1164
861
bool StorePop(InterpState &S, CodePtr OpPC) {
1165
861
  const T &Value = S.Stk.pop<T>();
1166
861
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1167
861
  if (!CheckStore(S, OpPC, Ptr))
1168
0
    return false;
1169
861
  if (!Ptr.isRoot())
1170
833
    Ptr.initialize();
1171
861
  Ptr.deref<T>() = Value;
1172
861
  return true;
1173
861
}
bool clang::interp::StorePop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1164
36
bool StorePop(InterpState &S, CodePtr OpPC) {
1165
36
  const T &Value = S.Stk.pop<T>();
1166
36
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1167
36
  if (!CheckStore(S, OpPC, Ptr))
1168
0
    return false;
1169
36
  if (!Ptr.isRoot())
1170
36
    Ptr.initialize();
1171
36
  Ptr.deref<T>() = Value;
1172
36
  return true;
1173
36
}
Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::StorePop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1164
41
bool StorePop(InterpState &S, CodePtr OpPC) {
1165
41
  const T &Value = S.Stk.pop<T>();
1166
41
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1167
41
  if (!CheckStore(S, OpPC, Ptr))
1168
0
    return false;
1169
41
  if (!Ptr.isRoot())
1170
41
    Ptr.initialize();
1171
41
  Ptr.deref<T>() = Value;
1172
41
  return true;
1173
41
}
bool clang::interp::StorePop<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1164
160
bool StorePop(InterpState &S, CodePtr OpPC) {
1165
160
  const T &Value = S.Stk.pop<T>();
1166
160
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1167
160
  if (!CheckStore(S, OpPC, Ptr))
1168
0
    return false;
1169
160
  if (!Ptr.isRoot())
1170
147
    Ptr.initialize();
1171
160
  Ptr.deref<T>() = Value;
1172
160
  return true;
1173
160
}
Unexecuted instantiation: bool clang::interp::StorePop<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::StorePop<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1164
20
bool StorePop(InterpState &S, CodePtr OpPC) {
1165
20
  const T &Value = S.Stk.pop<T>();
1166
20
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1167
20
  if (!CheckStore(S, OpPC, Ptr))
1168
0
    return false;
1169
20
  if (!Ptr.isRoot())
1170
20
    Ptr.initialize();
1171
20
  Ptr.deref<T>() = Value;
1172
20
  return true;
1173
20
}
1174
1175
template <PrimType Name, class T = typename PrimConv<Name>::T>
1176
0
bool StoreBitField(InterpState &S, CodePtr OpPC) {
1177
0
  const T &Value = S.Stk.pop<T>();
1178
0
  const Pointer &Ptr = S.Stk.peek<Pointer>();
1179
0
  if (!CheckStore(S, OpPC, Ptr))
1180
0
    return false;
1181
0
  if (!Ptr.isRoot())
1182
0
    Ptr.initialize();
1183
0
  if (auto *FD = Ptr.getField()) {
1184
0
    Ptr.deref<T>() = Value.truncate(FD->getBitWidthValue(S.getCtx()));
1185
0
  } else {
1186
0
    Ptr.deref<T>() = Value;
1187
0
  }
1188
0
  return true;
1189
0
}
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitField<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
1190
1191
template <PrimType Name, class T = typename PrimConv<Name>::T>
1192
0
bool StoreBitFieldPop(InterpState &S, CodePtr OpPC) {
1193
0
  const T &Value = S.Stk.pop<T>();
1194
0
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1195
0
  if (!CheckStore(S, OpPC, Ptr))
1196
0
    return false;
1197
0
  if (!Ptr.isRoot())
1198
0
    Ptr.initialize();
1199
0
  if (auto *FD = Ptr.getField()) {
1200
0
    Ptr.deref<T>() = Value.truncate(FD->getBitWidthValue(S.getCtx()));
1201
0
  } else {
1202
0
    Ptr.deref<T>() = Value;
1203
0
  }
1204
0
  return true;
1205
0
}
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::StoreBitFieldPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
1206
1207
template <PrimType Name, class T = typename PrimConv<Name>::T>
1208
0
bool InitPop(InterpState &S, CodePtr OpPC) {
1209
0
  const T &Value = S.Stk.pop<T>();
1210
0
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1211
0
  if (!CheckInit(S, OpPC, Ptr))
1212
0
    return false;
1213
0
  Ptr.initialize();
1214
0
  new (&Ptr.deref<T>()) T(Value);
1215
0
  return true;
1216
0
}
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::InitPop<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr)
1217
1218
/// 1) Pops the value from the stack
1219
/// 2) Peeks a pointer and gets its index \Idx
1220
/// 3) Sets the value on the pointer, leaving the pointer on the stack.
1221
template <PrimType Name, class T = typename PrimConv<Name>::T>
1222
468
bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) {
1223
468
  const T &Value = S.Stk.pop<T>();
1224
468
  const Pointer &Ptr = S.Stk.peek<Pointer>().atIndex(Idx);
1225
468
  if (!CheckInit(S, OpPC, Ptr))
1226
0
    return false;
1227
468
  Ptr.initialize();
1228
468
  new (&Ptr.deref<T>()) T(Value);
1229
468
  return true;
1230
468
}
bool clang::interp::InitElem<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
1222
39
bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) {
1223
39
  const T &Value = S.Stk.pop<T>();
1224
39
  const Pointer &Ptr = S.Stk.peek<Pointer>().atIndex(Idx);
1225
39
  if (!CheckInit(S, OpPC, Ptr))
1226
0
    return false;
1227
39
  Ptr.initialize();
1228
39
  new (&Ptr.deref<T>()) T(Value);
1229
39
  return true;
1230
39
}
Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::InitElem<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
1222
366
bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) {
1223
366
  const T &Value = S.Stk.pop<T>();
1224
366
  const Pointer &Ptr = S.Stk.peek<Pointer>().atIndex(Idx);
1225
366
  if (!CheckInit(S, OpPC, Ptr))
1226
0
    return false;
1227
366
  Ptr.initialize();
1228
366
  new (&Ptr.deref<T>()) T(Value);
1229
366
  return true;
1230
366
}
Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::InitElem<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
1222
32
bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) {
1223
32
  const T &Value = S.Stk.pop<T>();
1224
32
  const Pointer &Ptr = S.Stk.peek<Pointer>().atIndex(Idx);
1225
32
  if (!CheckInit(S, OpPC, Ptr))
1226
0
    return false;
1227
32
  Ptr.initialize();
1228
32
  new (&Ptr.deref<T>()) T(Value);
1229
32
  return true;
1230
32
}
bool clang::interp::InitElem<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
1222
17
bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) {
1223
17
  const T &Value = S.Stk.pop<T>();
1224
17
  const Pointer &Ptr = S.Stk.peek<Pointer>().atIndex(Idx);
1225
17
  if (!CheckInit(S, OpPC, Ptr))
1226
0
    return false;
1227
17
  Ptr.initialize();
1228
17
  new (&Ptr.deref<T>()) T(Value);
1229
17
  return true;
1230
17
}
Unexecuted instantiation: bool clang::interp::InitElem<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
bool clang::interp::InitElem<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Line
Count
Source
1222
14
bool InitElem(InterpState &S, CodePtr OpPC, uint32_t Idx) {
1223
14
  const T &Value = S.Stk.pop<T>();
1224
14
  const Pointer &Ptr = S.Stk.peek<Pointer>().atIndex(Idx);
1225
14
  if (!CheckInit(S, OpPC, Ptr))
1226
0
    return false;
1227
14
  Ptr.initialize();
1228
14
  new (&Ptr.deref<T>()) T(Value);
1229
14
  return true;
1230
14
}
1231
1232
/// The same as InitElem, but pops the pointer as well.
1233
template <PrimType Name, class T = typename PrimConv<Name>::T>
1234
0
bool InitElemPop(InterpState &S, CodePtr OpPC, uint32_t Idx) {
1235
0
  const T &Value = S.Stk.pop<T>();
1236
0
  const Pointer &Ptr = S.Stk.pop<Pointer>().atIndex(Idx);
1237
0
  if (!CheckInit(S, OpPC, Ptr))
1238
0
    return false;
1239
0
  Ptr.initialize();
1240
0
  new (&Ptr.deref<T>()) T(Value);
1241
0
  return true;
1242
0
}
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)7, clang::interp::Integral<64u, false> >(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)8, clang::interp::Boolean>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)10, clang::interp::Pointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)11, clang::interp::FunctionPointer>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
Unexecuted instantiation: bool clang::interp::InitElemPop<(clang::interp::PrimType)9, clang::interp::Floating>(clang::interp::InterpState&, clang::interp::CodePtr, unsigned int)
1243
1244
//===----------------------------------------------------------------------===//
1245
// AddOffset, SubOffset
1246
//===----------------------------------------------------------------------===//
1247
1248
template <class T, ArithOp Op>
1249
bool OffsetHelper(InterpState &S, CodePtr OpPC, const T &Offset,
1250
834
                  const Pointer &Ptr) {
1251
834
  if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer))
1252
0
    return false;
1253
1254
  // A zero offset does not change the pointer.
1255
834
  if (Offset.isZero()) {
1256
150
    S.Stk.push<Pointer>(Ptr);
1257
150
    return true;
1258
150
  }
1259
1260
684
  if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex))
1261
1
    return false;
1262
1263
  // Arrays of unknown bounds cannot have pointers into them.
1264
683
  if (!CheckArray(S, OpPC, Ptr))
1265
0
    return false;
1266
1267
  // Get a version of the index comparable to the type.
1268
683
  T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
1269
  // Compute the largest index into the array.
1270
683
  unsigned MaxIndex = Ptr.getNumElems();
1271
1272
  // Helper to report an invalid offset, computed as APSInt.
1273
683
  auto InvalidOffset = [&]() {
1274
15
    const unsigned Bits = Offset.bitWidth();
1275
15
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
15
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
15
    APSInt NewIndex =
1278
15
        (Op == ArithOp::Add) ? 
(APIndex + APOffset)9
:
(APIndex - APOffset)6
;
1279
15
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
15
        << NewIndex
1281
15
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
15
        << static_cast<unsigned>(MaxIndex);
1283
15
    return false;
1284
15
  };
bool clang::interp::OffsetHelper<clang::interp::Integral<8u, false>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Line
Count
Source
1273
4
  auto InvalidOffset = [&]() {
1274
4
    const unsigned Bits = Offset.bitWidth();
1275
4
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
4
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
4
    APSInt NewIndex =
1278
4
        (Op == ArithOp::Add) ? 
(APIndex + APOffset)0
: (APIndex - APOffset);
1279
4
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
4
        << NewIndex
1281
4
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
4
        << static_cast<unsigned>(MaxIndex);
1283
4
    return false;
1284
4
  };
bool clang::interp::OffsetHelper<clang::interp::Integral<8u, false>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Line
Count
Source
1273
4
  auto InvalidOffset = [&]() {
1274
4
    const unsigned Bits = Offset.bitWidth();
1275
4
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
4
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
4
    APSInt NewIndex =
1278
4
        (Op == ArithOp::Add) ? (APIndex + APOffset) : 
(APIndex - APOffset)0
;
1279
4
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
4
        << NewIndex
1281
4
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
4
        << static_cast<unsigned>(MaxIndex);
1283
4
    return false;
1284
4
  };
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, true>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, true>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, false>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
bool clang::interp::OffsetHelper<clang::interp::Integral<32u, true>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Line
Count
Source
1273
5
  auto InvalidOffset = [&]() {
1274
5
    const unsigned Bits = Offset.bitWidth();
1275
5
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
5
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
5
    APSInt NewIndex =
1278
5
        (Op == ArithOp::Add) ? (APIndex + APOffset) : 
(APIndex - APOffset)0
;
1279
5
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
5
        << NewIndex
1281
5
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
5
        << static_cast<unsigned>(MaxIndex);
1283
5
    return false;
1284
5
  };
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, false>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, true>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, false>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Boolean, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Boolean const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, true>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, true>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, false>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
bool clang::interp::OffsetHelper<clang::interp::Integral<32u, true>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Line
Count
Source
1273
2
  auto InvalidOffset = [&]() {
1274
2
    const unsigned Bits = Offset.bitWidth();
1275
2
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
2
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
2
    APSInt NewIndex =
1278
2
        (Op == ArithOp::Add) ? 
(APIndex + APOffset)0
: (APIndex - APOffset);
1279
2
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
2
        << NewIndex
1281
2
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
2
        << static_cast<unsigned>(MaxIndex);
1283
2
    return false;
1284
2
  };
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, false>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, true>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, false>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Boolean, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Boolean const&, clang::interp::Pointer const&)::'lambda'()::operator()() const
1285
1286
683
  unsigned MaxOffset = MaxIndex - Ptr.getIndex();
1287
683
  if constexpr (Op == ArithOp::Add) 
{0
1288
    // If the new offset would be negative, bail out.
1289
656
    if (Offset.isNegative() && 
(1
Offset.isMin()1
||
-Offset > Index1
))
1290
1
      return InvalidOffset();
1291
1292
    // If the new offset would be out of bounds, bail out.
1293
655
    if (Offset.isPositive() && Offset > MaxOffset)
1294
8
      return InvalidOffset();
1295
655
  } else {
1296
    // If the new offset would be negative, bail out.
1297
27
    if (Offset.isPositive() && Index < Offset)
1298
6
      return InvalidOffset();
1299
1300
    // If the new offset would be out of bounds, bail out.
1301
21
    if (Offset.isNegative() && 
(0
Offset.isMin()0
||
-Offset > MaxOffset0
))
1302
0
      return InvalidOffset();
1303
21
  }
1304
1305
  // Offset is valid - compute it on unsigned.
1306
668
  int64_t WideIndex = static_cast<int64_t>(Index);
1307
668
  int64_t WideOffset = static_cast<int64_t>(Offset);
1308
668
  int64_t Result;
1309
668
  if constexpr (Op == ArithOp::Add)
1310
647
    
Result0
= WideIndex + WideOffset;
1311
21
  else
1312
21
    Result = WideIndex - WideOffset;
1313
1314
668
  S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result)));
1315
668
  return true;
1316
683
}
bool clang::interp::OffsetHelper<clang::interp::Integral<8u, false>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Pointer const&)
Line
Count
Source
1250
234
                  const Pointer &Ptr) {
1251
234
  if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer))
1252
0
    return false;
1253
1254
  // A zero offset does not change the pointer.
1255
234
  if (Offset.isZero()) {
1256
0
    S.Stk.push<Pointer>(Ptr);
1257
0
    return true;
1258
0
  }
1259
1260
234
  if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex))
1261
0
    return false;
1262
1263
  // Arrays of unknown bounds cannot have pointers into them.
1264
234
  if (!CheckArray(S, OpPC, Ptr))
1265
0
    return false;
1266
1267
  // Get a version of the index comparable to the type.
1268
234
  T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
1269
  // Compute the largest index into the array.
1270
234
  unsigned MaxIndex = Ptr.getNumElems();
1271
1272
  // Helper to report an invalid offset, computed as APSInt.
1273
234
  auto InvalidOffset = [&]() {
1274
234
    const unsigned Bits = Offset.bitWidth();
1275
234
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
234
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
234
    APSInt NewIndex =
1278
234
        (Op == ArithOp::Add) ? (APIndex + APOffset) : (APIndex - APOffset);
1279
234
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
234
        << NewIndex
1281
234
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
234
        << static_cast<unsigned>(MaxIndex);
1283
234
    return false;
1284
234
  };
1285
1286
234
  unsigned MaxOffset = MaxIndex - Ptr.getIndex();
1287
234
  if constexpr (Op == ArithOp::Add) {
1288
    // If the new offset would be negative, bail out.
1289
234
    if (Offset.isNegative() && 
(0
Offset.isMin()0
||
-Offset > Index0
))
1290
0
      return InvalidOffset();
1291
1292
    // If the new offset would be out of bounds, bail out.
1293
234
    if (Offset.isPositive() && Offset > MaxOffset)
1294
4
      return InvalidOffset();
1295
234
  } else {
1296
    // If the new offset would be negative, bail out.
1297
230
    if (Offset.isPositive() && Index < Offset)
1298
230
      return InvalidOffset();
1299
1300
    // If the new offset would be out of bounds, bail out.
1301
230
    if (Offset.isNegative() && (Offset.isMin() || -Offset > MaxOffset))
1302
230
      return InvalidOffset();
1303
230
  }
1304
1305
  // Offset is valid - compute it on unsigned.
1306
230
  int64_t WideIndex = static_cast<int64_t>(Index);
1307
230
  int64_t WideOffset = static_cast<int64_t>(Offset);
1308
230
  int64_t Result;
1309
230
  if constexpr (Op == ArithOp::Add)
1310
230
    Result = WideIndex + WideOffset;
1311
230
  else
1312
230
    Result = WideIndex - WideOffset;
1313
1314
230
  S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result)));
1315
230
  return true;
1316
234
}
bool clang::interp::OffsetHelper<clang::interp::Integral<8u, false>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, false> const&, clang::interp::Pointer const&)
Line
Count
Source
1250
16
                  const Pointer &Ptr) {
1251
16
  if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer))
1252
0
    return false;
1253
1254
  // A zero offset does not change the pointer.
1255
16
  if (Offset.isZero()) {
1256
0
    S.Stk.push<Pointer>(Ptr);
1257
0
    return true;
1258
0
  }
1259
1260
16
  if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex))
1261
0
    return false;
1262
1263
  // Arrays of unknown bounds cannot have pointers into them.
1264
16
  if (!CheckArray(S, OpPC, Ptr))
1265
0
    return false;
1266
1267
  // Get a version of the index comparable to the type.
1268
16
  T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
1269
  // Compute the largest index into the array.
1270
16
  unsigned MaxIndex = Ptr.getNumElems();
1271
1272
  // Helper to report an invalid offset, computed as APSInt.
1273
16
  auto InvalidOffset = [&]() {
1274
16
    const unsigned Bits = Offset.bitWidth();
1275
16
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
16
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
16
    APSInt NewIndex =
1278
16
        (Op == ArithOp::Add) ? (APIndex + APOffset) : (APIndex - APOffset);
1279
16
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
16
        << NewIndex
1281
16
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
16
        << static_cast<unsigned>(MaxIndex);
1283
16
    return false;
1284
16
  };
1285
1286
16
  unsigned MaxOffset = MaxIndex - Ptr.getIndex();
1287
16
  if constexpr (Op == ArithOp::Add) 
{0
1288
    // If the new offset would be negative, bail out.
1289
16
    if (Offset.isNegative() && (Offset.isMin() || -Offset > Index))
1290
16
      return InvalidOffset();
1291
1292
    // If the new offset would be out of bounds, bail out.
1293
16
    if (Offset.isPositive() && Offset > MaxOffset)
1294
16
      return InvalidOffset();
1295
16
  } else {
1296
    // If the new offset would be negative, bail out.
1297
16
    if (Offset.isPositive() && Index < Offset)
1298
4
      return InvalidOffset();
1299
1300
    // If the new offset would be out of bounds, bail out.
1301
12
    if (Offset.isNegative() && 
(0
Offset.isMin()0
||
-Offset > MaxOffset0
))
1302
0
      return InvalidOffset();
1303
12
  }
1304
1305
  // Offset is valid - compute it on unsigned.
1306
12
  int64_t WideIndex = static_cast<int64_t>(Index);
1307
12
  int64_t WideOffset = static_cast<int64_t>(Offset);
1308
12
  int64_t Result;
1309
12
  if constexpr (Op == ArithOp::Add)
1310
0
    Result = WideIndex + WideOffset;
1311
12
  else
1312
12
    Result = WideIndex - WideOffset;
1313
1314
12
  S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result)));
1315
12
  return true;
1316
16
}
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, true>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Pointer const&)
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, true>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Pointer const&)
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, false>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Pointer const&)
bool clang::interp::OffsetHelper<clang::interp::Integral<32u, true>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Pointer const&)
Line
Count
Source
1250
436
                  const Pointer &Ptr) {
1251
436
  if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer))
1252
0
    return false;
1253
1254
  // A zero offset does not change the pointer.
1255
436
  if (Offset.isZero()) {
1256
119
    S.Stk.push<Pointer>(Ptr);
1257
119
    return true;
1258
119
  }
1259
1260
317
  if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex))
1261
1
    return false;
1262
1263
  // Arrays of unknown bounds cannot have pointers into them.
1264
316
  if (!CheckArray(S, OpPC, Ptr))
1265
0
    return false;
1266
1267
  // Get a version of the index comparable to the type.
1268
316
  T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
1269
  // Compute the largest index into the array.
1270
316
  unsigned MaxIndex = Ptr.getNumElems();
1271
1272
  // Helper to report an invalid offset, computed as APSInt.
1273
316
  auto InvalidOffset = [&]() {
1274
316
    const unsigned Bits = Offset.bitWidth();
1275
316
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
316
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
316
    APSInt NewIndex =
1278
316
        (Op == ArithOp::Add) ? (APIndex + APOffset) : (APIndex - APOffset);
1279
316
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
316
        << NewIndex
1281
316
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
316
        << static_cast<unsigned>(MaxIndex);
1283
316
    return false;
1284
316
  };
1285
1286
316
  unsigned MaxOffset = MaxIndex - Ptr.getIndex();
1287
316
  if constexpr (Op == ArithOp::Add) {
1288
    // If the new offset would be negative, bail out.
1289
316
    if (Offset.isNegative() && 
(1
Offset.isMin()1
||
-Offset > Index1
))
1290
1
      return InvalidOffset();
1291
1292
    // If the new offset would be out of bounds, bail out.
1293
315
    if (Offset.isPositive() && Offset > MaxOffset)
1294
4
      return InvalidOffset();
1295
315
  } else {
1296
    // If the new offset would be negative, bail out.
1297
311
    if (Offset.isPositive() && Index < Offset)
1298
311
      return InvalidOffset();
1299
1300
    // If the new offset would be out of bounds, bail out.
1301
311
    if (Offset.isNegative() && (Offset.isMin() || -Offset > MaxOffset))
1302
311
      return InvalidOffset();
1303
311
  }
1304
1305
  // Offset is valid - compute it on unsigned.
1306
311
  int64_t WideIndex = static_cast<int64_t>(Index);
1307
311
  int64_t WideOffset = static_cast<int64_t>(Offset);
1308
311
  int64_t Result;
1309
311
  if constexpr (Op == ArithOp::Add)
1310
311
    Result = WideIndex + WideOffset;
1311
311
  else
1312
311
    Result = WideIndex - WideOffset;
1313
1314
311
  S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result)));
1315
311
  return true;
1316
316
}
bool clang::interp::OffsetHelper<clang::interp::Integral<32u, false>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Pointer const&)
Line
Count
Source
1250
36
                  const Pointer &Ptr) {
1251
36
  if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer))
1252
0
    return false;
1253
1254
  // A zero offset does not change the pointer.
1255
36
  if (Offset.isZero()) {
1256
12
    S.Stk.push<Pointer>(Ptr);
1257
12
    return true;
1258
12
  }
1259
1260
24
  if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex))
1261
0
    return false;
1262
1263
  // Arrays of unknown bounds cannot have pointers into them.
1264
24
  if (!CheckArray(S, OpPC, Ptr))
1265
0
    return false;
1266
1267
  // Get a version of the index comparable to the type.
1268
24
  T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
1269
  // Compute the largest index into the array.
1270
24
  unsigned MaxIndex = Ptr.getNumElems();
1271
1272
  // Helper to report an invalid offset, computed as APSInt.
1273
24
  auto InvalidOffset = [&]() {
1274
24
    const unsigned Bits = Offset.bitWidth();
1275
24
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
24
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
24
    APSInt NewIndex =
1278
24
        (Op == ArithOp::Add) ? (APIndex + APOffset) : (APIndex - APOffset);
1279
24
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
24
        << NewIndex
1281
24
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
24
        << static_cast<unsigned>(MaxIndex);
1283
24
    return false;
1284
24
  };
1285
1286
24
  unsigned MaxOffset = MaxIndex - Ptr.getIndex();
1287
24
  if constexpr (Op == ArithOp::Add) {
1288
    // If the new offset would be negative, bail out.
1289
24
    if (Offset.isNegative() && 
(0
Offset.isMin()0
||
-Offset > Index0
))
1290
0
      return InvalidOffset();
1291
1292
    // If the new offset would be out of bounds, bail out.
1293
24
    if (Offset.isPositive() && Offset > MaxOffset)
1294
0
      return InvalidOffset();
1295
24
  } else {
1296
    // If the new offset would be negative, bail out.
1297
24
    if (Offset.isPositive() && Index < Offset)
1298
24
      return InvalidOffset();
1299
1300
    // If the new offset would be out of bounds, bail out.
1301
24
    if (Offset.isNegative() && (Offset.isMin() || -Offset > MaxOffset))
1302
24
      return InvalidOffset();
1303
24
  }
1304
1305
  // Offset is valid - compute it on unsigned.
1306
24
  int64_t WideIndex = static_cast<int64_t>(Index);
1307
24
  int64_t WideOffset = static_cast<int64_t>(Offset);
1308
24
  int64_t Result;
1309
24
  if constexpr (Op == ArithOp::Add)
1310
24
    Result = WideIndex + WideOffset;
1311
24
  else
1312
24
    Result = WideIndex - WideOffset;
1313
1314
24
  S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result)));
1315
24
  return true;
1316
24
}
bool clang::interp::OffsetHelper<clang::interp::Integral<64u, true>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Pointer const&)
Line
Count
Source
1250
50
                  const Pointer &Ptr) {
1251
50
  if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer))
1252
0
    return false;
1253
1254
  // A zero offset does not change the pointer.
1255
50
  if (Offset.isZero()) {
1256
0
    S.Stk.push<Pointer>(Ptr);
1257
0
    return true;
1258
0
  }
1259
1260
50
  if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex))
1261
0
    return false;
1262
1263
  // Arrays of unknown bounds cannot have pointers into them.
1264
50
  if (!CheckArray(S, OpPC, Ptr))
1265
0
    return false;
1266
1267
  // Get a version of the index comparable to the type.
1268
50
  T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
1269
  // Compute the largest index into the array.
1270
50
  unsigned MaxIndex = Ptr.getNumElems();
1271
1272
  // Helper to report an invalid offset, computed as APSInt.
1273
50
  auto InvalidOffset = [&]() {
1274
50
    const unsigned Bits = Offset.bitWidth();
1275
50
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
50
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
50
    APSInt NewIndex =
1278
50
        (Op == ArithOp::Add) ? (APIndex + APOffset) : (APIndex - APOffset);
1279
50
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
50
        << NewIndex
1281
50
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
50
        << static_cast<unsigned>(MaxIndex);
1283
50
    return false;
1284
50
  };
1285
1286
50
  unsigned MaxOffset = MaxIndex - Ptr.getIndex();
1287
50
  if constexpr (Op == ArithOp::Add) {
1288
    // If the new offset would be negative, bail out.
1289
50
    if (Offset.isNegative() && 
(0
Offset.isMin()0
||
-Offset > Index0
))
1290
0
      return InvalidOffset();
1291
1292
    // If the new offset would be out of bounds, bail out.
1293
50
    if (Offset.isPositive() && Offset > MaxOffset)
1294
0
      return InvalidOffset();
1295
50
  } else {
1296
    // If the new offset would be negative, bail out.
1297
50
    if (Offset.isPositive() && Index < Offset)
1298
50
      return InvalidOffset();
1299
1300
    // If the new offset would be out of bounds, bail out.
1301
50
    if (Offset.isNegative() && (Offset.isMin() || -Offset > MaxOffset))
1302
50
      return InvalidOffset();
1303
50
  }
1304
1305
  // Offset is valid - compute it on unsigned.
1306
50
  int64_t WideIndex = static_cast<int64_t>(Index);
1307
50
  int64_t WideOffset = static_cast<int64_t>(Offset);
1308
50
  int64_t Result;
1309
50
  if constexpr (Op == ArithOp::Add)
1310
50
    Result = WideIndex + WideOffset;
1311
50
  else
1312
50
    Result = WideIndex - WideOffset;
1313
1314
50
  S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result)));
1315
50
  return true;
1316
50
}
bool clang::interp::OffsetHelper<clang::interp::Integral<64u, false>, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Pointer const&)
Line
Count
Source
1250
48
                  const Pointer &Ptr) {
1251
48
  if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer))
1252
0
    return false;
1253
1254
  // A zero offset does not change the pointer.
1255
48
  if (Offset.isZero()) {
1256
16
    S.Stk.push<Pointer>(Ptr);
1257
16
    return true;
1258
16
  }
1259
1260
32
  if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex))
1261
0
    return false;
1262
1263
  // Arrays of unknown bounds cannot have pointers into them.
1264
32
  if (!CheckArray(S, OpPC, Ptr))
1265
0
    return false;
1266
1267
  // Get a version of the index comparable to the type.
1268
32
  T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
1269
  // Compute the largest index into the array.
1270
32
  unsigned MaxIndex = Ptr.getNumElems();
1271
1272
  // Helper to report an invalid offset, computed as APSInt.
1273
32
  auto InvalidOffset = [&]() {
1274
32
    const unsigned Bits = Offset.bitWidth();
1275
32
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
32
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
32
    APSInt NewIndex =
1278
32
        (Op == ArithOp::Add) ? (APIndex + APOffset) : (APIndex - APOffset);
1279
32
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
32
        << NewIndex
1281
32
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
32
        << static_cast<unsigned>(MaxIndex);
1283
32
    return false;
1284
32
  };
1285
1286
32
  unsigned MaxOffset = MaxIndex - Ptr.getIndex();
1287
32
  if constexpr (Op == ArithOp::Add) {
1288
    // If the new offset would be negative, bail out.
1289
32
    if (Offset.isNegative() && 
(0
Offset.isMin()0
||
-Offset > Index0
))
1290
0
      return InvalidOffset();
1291
1292
    // If the new offset would be out of bounds, bail out.
1293
32
    if (Offset.isPositive() && Offset > MaxOffset)
1294
0
      return InvalidOffset();
1295
32
  } else {
1296
    // If the new offset would be negative, bail out.
1297
32
    if (Offset.isPositive() && Index < Offset)
1298
32
      return InvalidOffset();
1299
1300
    // If the new offset would be out of bounds, bail out.
1301
32
    if (Offset.isNegative() && (Offset.isMin() || -Offset > MaxOffset))
1302
32
      return InvalidOffset();
1303
32
  }
1304
1305
  // Offset is valid - compute it on unsigned.
1306
32
  int64_t WideIndex = static_cast<int64_t>(Index);
1307
32
  int64_t WideOffset = static_cast<int64_t>(Offset);
1308
32
  int64_t Result;
1309
32
  if constexpr (Op == ArithOp::Add)
1310
32
    Result = WideIndex + WideOffset;
1311
32
  else
1312
32
    Result = WideIndex - WideOffset;
1313
1314
32
  S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result)));
1315
32
  return true;
1316
32
}
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Boolean, (clang::interp::ArithOp)0>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Boolean const&, clang::interp::Pointer const&)
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<8u, true>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<8u, true> const&, clang::interp::Pointer const&)
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, true>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, true> const&, clang::interp::Pointer const&)
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<16u, false>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<16u, false> const&, clang::interp::Pointer const&)
bool clang::interp::OffsetHelper<clang::interp::Integral<32u, true>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, true> const&, clang::interp::Pointer const&)
Line
Count
Source
1250
14
                  const Pointer &Ptr) {
1251
14
  if (!CheckRange(S, OpPC, Ptr, CSK_ArrayToPointer))
1252
0
    return false;
1253
1254
  // A zero offset does not change the pointer.
1255
14
  if (Offset.isZero()) {
1256
3
    S.Stk.push<Pointer>(Ptr);
1257
3
    return true;
1258
3
  }
1259
1260
11
  if (!CheckNull(S, OpPC, Ptr, CSK_ArrayIndex))
1261
0
    return false;
1262
1263
  // Arrays of unknown bounds cannot have pointers into them.
1264
11
  if (!CheckArray(S, OpPC, Ptr))
1265
0
    return false;
1266
1267
  // Get a version of the index comparable to the type.
1268
11
  T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
1269
  // Compute the largest index into the array.
1270
11
  unsigned MaxIndex = Ptr.getNumElems();
1271
1272
  // Helper to report an invalid offset, computed as APSInt.
1273
11
  auto InvalidOffset = [&]() {
1274
11
    const unsigned Bits = Offset.bitWidth();
1275
11
    APSInt APOffset(Offset.toAPSInt().extend(Bits + 2), false);
1276
11
    APSInt APIndex(Index.toAPSInt().extend(Bits + 2), false);
1277
11
    APSInt NewIndex =
1278
11
        (Op == ArithOp::Add) ? (APIndex + APOffset) : (APIndex - APOffset);
1279
11
    S.CCEDiag(S.Current->getSource(OpPC), diag::note_constexpr_array_index)
1280
11
        << NewIndex
1281
11
        << /*array*/ static_cast<int>(!Ptr.inArray())
1282
11
        << static_cast<unsigned>(MaxIndex);
1283
11
    return false;
1284
11
  };
1285
1286
11
  unsigned MaxOffset = MaxIndex - Ptr.getIndex();
1287
11
  if constexpr (Op == ArithOp::Add) 
{0
1288
    // If the new offset would be negative, bail out.
1289
11
    if (Offset.isNegative() && (Offset.isMin() || -Offset > Index))
1290
11
      return InvalidOffset();
1291
1292
    // If the new offset would be out of bounds, bail out.
1293
11
    if (Offset.isPositive() && Offset > MaxOffset)
1294
11
      return InvalidOffset();
1295
11
  } else {
1296
    // If the new offset would be negative, bail out.
1297
11
    if (Offset.isPositive() && Index < Offset)
1298
2
      return InvalidOffset();
1299
1300
    // If the new offset would be out of bounds, bail out.
1301
9
    if (Offset.isNegative() && 
(0
Offset.isMin()0
||
-Offset > MaxOffset0
))
1302
0
      return InvalidOffset();
1303
9
  }
1304
1305
  // Offset is valid - compute it on unsigned.
1306
9
  int64_t WideIndex = static_cast<int64_t>(Index);
1307
9
  int64_t WideOffset = static_cast<int64_t>(Offset);
1308
9
  int64_t Result;
1309
9
  if constexpr (Op == ArithOp::Add)
1310
0
    Result = WideIndex + WideOffset;
1311
9
  else
1312
9
    Result = WideIndex - WideOffset;
1313
1314
9
  S.Stk.push<Pointer>(Ptr.atIndex(static_cast<unsigned>(Result)));
1315
9
  return true;
1316
11
}
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<32u, false>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<32u, false> const&, clang::interp::Pointer const&)
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, true>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, true> const&, clang::interp::Pointer const&)
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Integral<64u, false>, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Integral<64u, false> const&, clang::interp::Pointer const&)
Unexecuted instantiation: bool clang::interp::OffsetHelper<clang::interp::Boolean, (clang::interp::ArithOp)1>(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Boolean const&, clang::interp::Pointer const&)
1317
1318
template <PrimType Name, class T = typename PrimConv<Name>::T>
1319
266
bool AddOffset(InterpState &S, CodePtr OpPC) {
1320
266
  const T &Offset = S.Stk.pop<T>();
1321
266
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1322
266
  return OffsetHelper<T, ArithOp::Add>(S, OpPC, Offset, Ptr);
1323
266
}
Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)0, clang::interp::Integral<8u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::AddOffset<(clang::interp::PrimType)1, clang::interp::Integral<8u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1319
164
bool AddOffset(InterpState &S, CodePtr OpPC) {
1320
164
  const T &Offset = S.Stk.pop<T>();
1321
164
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1322
164
  return OffsetHelper<T, ArithOp::Add>(S, OpPC, Offset, Ptr);
1323
164
}
Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)2, clang::interp::Integral<16u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)3, clang::interp::Integral<16u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::AddOffset<(clang::interp::PrimType)4, clang::interp::Integral<32u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
Line
Count
Source
1319
52
bool AddOffset(InterpState &S, CodePtr OpPC) {
1320
52
  const T &Offset = S.Stk.pop<T>();
1321
52
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1322
52
  return OffsetHelper<T, ArithOp::Add>(S, OpPC, Offset, Ptr);
1323
52
}
Unexecuted instantiation: bool clang::interp::AddOffset<(clang::interp::PrimType)5, clang::interp::Integral<32u, false> >(clang::interp::InterpState&, clang::interp::CodePtr)
bool clang::interp::AddOffset<(clang::interp::PrimType)6, clang::interp::Integral<64u, true> >(clang::interp::InterpState&, clang::interp::CodePtr)
<
Line
Count
Source
1319
50
bool AddOffset(InterpState &S, CodePtr OpPC) {
1320
50
  const T &Offset = S.Stk.pop<T>();
1321
50
  const Pointer &Ptr = S.Stk.pop<Pointer>();
1322
50
  return OffsetHelper<T, ArithOp::Add>(S, OpPC, Offset, Ptr);
1323