mamcx
mamcx

Reputation: 16186

Is possible to load a function from *any|some* llvm generated code in iOS (not made by clang)?

If I build a function with LLVM, like

int sum(int a, int b)
{
    return a + b;
}

using something like http://www.llvmpy.org/llvmpy-doc/dev/doc/firstexample.html, is possible to use that function from inside iOS? as if was a function made with C/C++/Obj-c?

This is because I wonder if building a languaje on LLVM auto-magically provide the path to support iOS for free (ie: is as hard as embed python or something like that).

If yes, how can be done? (ie: call sum from obj-c)

Upvotes: 1

Views: 125

Answers (1)

Mārtiņš Možeiko
Mārtiņš Možeiko

Reputation: 12927

Yes, it is possible. I have done exactly that on Android. And iOS is similar enough that it should be possible there. As long as you are using Interpreter for executing your LLVM code. Because using JIT is forbidden by Apple Developer agreement.

Upvotes: 0

Related Questions