@@ -248,7 +248,6 @@ Interpreter::~Interpreter() {
248
248
// can't find the precise resource directory in unittests so we have to hard
249
249
// code them.
250
250
const char *const Runtimes = R"(
251
- void* operator new(__SIZE_TYPE__, void* __p) noexcept;
252
251
void *__clang_Interpreter_SetValueWithAlloc(void*, void*, void*);
253
252
void __clang_Interpreter_SetValueNoAlloc(void*, void*, void*);
254
253
void __clang_Interpreter_SetValueNoAlloc(void*, void*, void*, void*);
@@ -257,14 +256,9 @@ const char *const Runtimes = R"(
257
256
void __clang_Interpreter_SetValueNoAlloc(void*, void*, void*, long double);
258
257
void __clang_Interpreter_SetValueNoAlloc(void*,void*,void*,unsigned long long);
259
258
template <class T, class = T (*)() /*disable for arrays*/>
260
- void __clang_Interpreter_SetValueCopyArr(T* Src, void* Placement, unsigned long Size) {
261
- for (auto Idx = 0; Idx < Size; ++Idx)
262
- new ((void*)(((T*)Placement) + Idx)) T(Src[Idx]);
263
- }
259
+ void __clang_Interpreter_SetValueCopyArr(T* Src, void* Placement, unsigned long Size);
264
260
template <class T, unsigned long N>
265
- void __clang_Interpreter_SetValueCopyArr(const T (*Src)[N], void* Placement, unsigned long Size) {
266
- __clang_Interpreter_SetValueCopyArr(Src[0], Placement, Size);
267
- }
261
+ void __clang_Interpreter_SetValueCopyArr(const T (*Src)[N], void* Placement, unsigned long Size);
268
262
)" ;
269
263
270
264
llvm::Expected<std::unique_ptr<Interpreter>>
@@ -762,6 +756,20 @@ __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal,
762
756
VRef = Value (static_cast <Interpreter *>(This), OpaqueType);
763
757
}
764
758
759
+ template <class T , class >
760
+ REPL_EXTERNAL_VISIBILITY void
761
+ __clang_Interpreter_SetValueCopyArr (T *Src, void *Placement,
762
+ unsigned long Size) {
763
+ for (unsigned long Idx = 0 ; Idx < Size; ++Idx)
764
+ new ((void *)(((T *)Placement) + Idx)) T (Src[Idx]);
765
+ }
766
+ template <class T , unsigned long N>
767
+ REPL_EXTERNAL_VISIBILITY void
768
+ __clang_Interpreter_SetValueCopyArr (const T (*Src)[N], void *Placement,
769
+ unsigned long Size) {
770
+ __clang_Interpreter_SetValueCopyArr (Src[0 ], Placement, Size);
771
+ }
772
+
765
773
static void SetValueDataBasedOnQualType (Value &V, unsigned long long Data) {
766
774
QualType QT = V.getType ();
767
775
if (const auto *ET = QT->getAs <EnumType>())
0 commit comments