1f85d7b725
Here we don't want to depend on the JIT runFunction, because of its limitations, when it comes to return value handling. There it is not clear who provides the storage and who cleans it up in a platform independent way. Depending on the type we need to synthesize a call to cling: 0) void : do nothing; 1) enum, integral, float, double, referece, pointer types : call to cling::internal::setValueNoAlloc(...); 2) object type (alloc on the stack) : cling::internal::setValueWithAlloc 2.1) constant arrays: call to cling::runtime::internal::copyArray(...) We need to synthesize later (see RuntimeUniverse.h) Wrapper has signature: void w(cling::StoredValueRef SVR) case 1): setValueNoAlloc(gCling, &SVR, lastExprTy, lastExpr()) case 2): new (setValueWithAlloc(gCling, &SVR, lastExprTy)) (lastExpr) case 2.1): copyArray(src, placement, N)