简体   繁体   English

是否可以从iOS中的* any | some * llvm生成的代码中加载功能(不是clang制作的)?

[英]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 如果我使用LLVM构建函数,例如

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? 是否可以使用类似http://www.llvmpy.org/llvmpy-doc/dev/doc/firstexample.html之类的东西在iOS内部使用该功能? as if was a function made with C/C++/Obj-c? 好像是用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). 这是因为我想知道是否在LLVM上构建语言自动提供了免费支持iOS的途径(即:与嵌入python一样困难)。

If yes, how can be done? 如果是,该怎么办? (ie: call sum from obj-c) (即:从obj-c调用求和)

Yes, it is possible. 对的,这是可能的。 I have done exactly that on Android. 我已经在Android上做到了。 And iOS is similar enough that it should be possible there. 而且iOS非常相似,因此应该在那里。 As long as you are using Interpreter for executing your LLVM code. 只要您使用解释器执行LLVM代码即可。 Because using JIT is forbidden by Apple Developer agreement. 因为Apple Developer协议禁止使用JIT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM