refactor: rename RCollector.std_copy_for -> std_move_for
This commit is contained in:
parent
8bb460f402
commit
5172de7862
37 changed files with 37 additions and 37 deletions
|
|
@ -55,7 +55,7 @@ public:
|
|||
|
||||
/** convenience template for move-constructible T (this is common) **/
|
||||
template <typename T>
|
||||
T * std_copy_for(T * src) noexcept {
|
||||
T * std_move_for(T * src) noexcept {
|
||||
void * mem = this->alloc_copy_for(src);
|
||||
if (mem) {
|
||||
return new (mem) T(std::move(*src));
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace xo {
|
|||
DConstant *
|
||||
DConstant::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ namespace xo {
|
|||
DDefineExpr *
|
||||
DDefineExpr::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ namespace xo {
|
|||
DGlobalSymtab *
|
||||
DGlobalSymtab::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace xo {
|
|||
DIfElseExpr *
|
||||
DIfElseExpr::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ namespace xo {
|
|||
|
||||
DLambdaExpr *
|
||||
DLambdaExpr::shallow_move(obj<ACollector> gc) noexcept {
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ namespace xo {
|
|||
DLocalSymtab *
|
||||
DLocalSymtab::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ namespace xo {
|
|||
DSequenceExpr *
|
||||
DSequenceExpr::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace xo {
|
|||
DTypename *
|
||||
DTypename::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ namespace xo {
|
|||
DVarRef *
|
||||
DVarRef::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace xo {
|
|||
DVariable *
|
||||
DVariable::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace xo {
|
|||
|
||||
DClosure *
|
||||
DClosure::shallow_move(obj<ACollector> gc) noexcept {
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ namespace xo {
|
|||
|
||||
DLocalEnv *
|
||||
DLocalEnv::shallow_move(obj<ACollector> gc) noexcept {
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -958,7 +958,7 @@ namespace xo {
|
|||
{
|
||||
(void)gc;
|
||||
|
||||
/** TODO: should be able to use gc.std_copy_for(this) now
|
||||
/** TODO: should be able to use gc.std_move_for(this) now
|
||||
* that shallow_move uses move construction.
|
||||
* DVirtualSchematikaMachine is (or can be made) moveable.
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace xo {
|
|||
DVsmApplyClosureFrame *
|
||||
DVsmApplyClosureFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace xo {
|
|||
DVsmApplyFrame *
|
||||
DVsmApplyFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace xo {
|
|||
DVsmDefContFrame *
|
||||
DVsmDefContFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for<DVsmDefContFrame>(this);
|
||||
return gc.std_move_for<DVsmDefContFrame>(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace xo {
|
|||
DVsmEvalArgsFrame *
|
||||
DVsmEvalArgsFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace xo {
|
|||
DVsmIfElseContFrame *
|
||||
DVsmIfElseContFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for<DVsmIfElseContFrame>(this);
|
||||
return gc.std_move_for<DVsmIfElseContFrame>(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace xo {
|
|||
DVsmSeqContFrame *
|
||||
DVsmSeqContFrame::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for<DVsmSeqContFrame>(this);
|
||||
return gc.std_move_for<DVsmSeqContFrame>(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ namespace xo {
|
|||
DArray *
|
||||
DArray::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
// note: not using gc.std_copy_for() here.
|
||||
// note: not using gc.std_move_for() here.
|
||||
// flexible array -> compiler doesn't know actual DArray allocation size
|
||||
|
||||
DArray * copy = (DArray *)gc.alloc_copy((std::byte *)this);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace xo {
|
|||
DBoolean *
|
||||
DBoolean::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ namespace xo {
|
|||
DDictionary *
|
||||
DDictionary::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace xo {
|
|||
DFloat *
|
||||
DFloat::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace xo {
|
|||
DInteger *
|
||||
DInteger::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ namespace xo {
|
|||
DList *
|
||||
DList::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
auto
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ namespace xo {
|
|||
DRuntimeError *
|
||||
DRuntimeError::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ namespace xo {
|
|||
template <typename Fn>
|
||||
Primitive<Fn> *
|
||||
Primitive<Fn>::shallow_move(obj<ACollector> gc) noexcept {
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
template <typename Fn>
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ namespace xo {
|
|||
DGlobalEnv *
|
||||
DGlobalEnv::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for<DGlobalEnv>(this);
|
||||
return gc.std_move_for<DGlobalEnv>(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ namespace xo {
|
|||
{
|
||||
(void)gc;
|
||||
|
||||
/** TODO: may be feasible to use gc.std_copy_for(this)
|
||||
/** TODO: may be feasible to use gc.std_move_for(this)
|
||||
* if/when DSchematikaParser is moveable
|
||||
**/
|
||||
assert(false);
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ namespace xo {
|
|||
DString *
|
||||
DString::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
// note: not using gc.std_copy_for() here
|
||||
// note: not using gc.std_move_for() here
|
||||
// b/c DString flexible array means not move-constructible
|
||||
|
||||
DString * copy = (DString *)gc.alloc_copy_for(this);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ namespace xo {
|
|||
{
|
||||
// well-posed, but not expected to be used.
|
||||
//
|
||||
// Not using gc.std_copy_for() here because compiler doesn't know
|
||||
// Not using gc.std_move_for() here because compiler doesn't know
|
||||
// actual alloc size of a DUniqueString instance
|
||||
|
||||
assert(false);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace xo {
|
|||
DArrayType *
|
||||
DArrayType::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ namespace xo {
|
|||
DAtomicType *
|
||||
DAtomicType::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ namespace xo {
|
|||
DFunctionType *
|
||||
DFunctionType::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace xo {
|
|||
DListType *
|
||||
DListType::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace xo {
|
|||
DTypeVarRef *
|
||||
DTypeVarRef::shallow_move(obj<ACollector> gc) noexcept
|
||||
{
|
||||
return gc.std_copy_for(this);
|
||||
return gc.std_move_for(this);
|
||||
}
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue