Skip to content

Commit e3a9c8b

Browse files
committed
Tweak invoke API and make JitCall internal
1 parent c15be21 commit e3a9c8b

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

lib/Interpreter/CXCppInterOp.cpp

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,36 +1360,17 @@ CXObject clang_construct(CXScope scope, void* arena) {
13601360
return nullptr;
13611361
}
13621362

1363+
void clang_invoke(CXScope func, void* result, void** args, size_t n,
1364+
void* self) {
1365+
Cpp::MakeFunctionCallableImpl(getInterpreter(func), getDecl(func))
1366+
.Invoke(result, {args, n}, self);
1367+
}
1368+
13631369
namespace Cpp {
13641370
void DestructImpl(compat::Interpreter& interp, TCppObject_t This,
13651371
clang::Decl* Class, bool withFree);
13661372
} // namespace Cpp
13671373

13681374
void clang_destruct(CXObject This, CXScope S, bool withFree) {
13691375
Cpp::DestructImpl(*getInterpreter(S), This, getDecl(S), withFree);
1370-
}
1371-
1372-
CXJitCall clang_jitcall_create(CXScope func) {
1373-
auto J = Cpp::MakeFunctionCallableImpl(getInterpreter(func), getDecl(func));
1374-
auto Ptr = std::make_unique<Cpp::JitCall>(J);
1375-
return reinterpret_cast<CXJitCall>(Ptr.release()); // NOLINT(*-cast)
1376-
}
1377-
1378-
void clang_jitcall_dispose(CXJitCall J) {
1379-
delete reinterpret_cast<Cpp::JitCall*>(J); // NOLINT(*-owning-memory, *-cast)
1380-
}
1381-
1382-
CXJitCallKind clang_jitcall_getKind(CXJitCall J) {
1383-
const auto* call = reinterpret_cast<Cpp::JitCall*>(J); // NOLINT(*-cast)
1384-
return static_cast<CXJitCallKind>(call->getKind());
1385-
}
1386-
1387-
bool clang_jitcall_isValid(CXJitCall J) {
1388-
return reinterpret_cast<Cpp::JitCall*>(J)->isValid(); // NOLINT(*-cast)
1389-
}
1390-
1391-
void clang_jitcall_invoke(CXJitCall J, void* result, void** args,
1392-
unsigned int n, void* self) {
1393-
const auto* call = reinterpret_cast<Cpp::JitCall*>(J); // NOLINT(*-cast)
1394-
call->Invoke(result, {args, n}, self);
13951376
}

0 commit comments

Comments
 (0)