Skip to content

Commit 923c885

Browse files
committed
Fix compilation
1 parent 56fd34e commit 923c885

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang/include/clang/Interpreter/Value.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
// HEADERS, like <string>, <memory> and etc. (That pulls a large number of
4444
// tokens and will impact the runtime performance of the REPL)
4545

46-
extern "C" void *memcpy(void *dest, const void *src, size_t n);
47-
4846
namespace llvm {
4947
class raw_ostream;
5048

@@ -142,10 +140,7 @@ class REPL_EXTERNAL_VISIBILITY Value {
142140

143141
void *getPtr() const;
144142
void setPtr(void *Ptr) { Data.m_Ptr = Ptr; }
145-
void setRawBits(void *Ptr, unsigned NBits = sizeof(Storage)) {
146-
assert(NBits <= sizeof(Storage) && "Greater than the total size");
147-
memcpy(/*dest=*/Data.m_RawBits, /*src=*/Ptr, /*nbytes=*/NBits / 8);
148-
}
143+
void setRawBits(void *Ptr, unsigned NBits = sizeof(Storage));
149144

150145
#define X(type, name) \
151146
void set##name(type Val) { Data.m_##name = Val; } \

clang/lib/Interpreter/Value.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ void *Value::getPtr() const {
232232
return Data.m_Ptr;
233233
}
234234

235+
void Value::setRawBits(void *Ptr, unsigned NBits /*= sizeof(Storage)*/) {
236+
assert(NBits <= sizeof(Storage) && "Greater than the total size");
237+
memcpy(/*dest=*/Data.m_RawBits, /*src=*/Ptr, /*nbytes=*/NBits / 8);
238+
}
239+
235240
QualType Value::getType() const {
236241
return QualType::getFromOpaquePtr(OpaqueType);
237242
}

0 commit comments

Comments
 (0)