方法是调用一些InitializeNativeTarget\*函数,添加一个全局变量TheJIT,在main中初始化: static std::unique_ptr<KaleidoscopeJIT> TheJIT fprintf(stderr, "ready> "); getNextToken(); TheJIT = std::make_unique<KaleidoscopeJIT>(); // auto H = TheJIT->addModule(std::move(TheModule)); InitializeModuleAndPassManager(); // Search auto ExprSymbol = TheJIT->findSymbol("__anon_expr"); assert(ExprSymbol && "Function not found") TheJIT->removeModule(H); } 如果解析和编码生成成功,则下一步是将包含顶层表达式的模块添加到JIT。
类型: Toolkit 技术: JavaScript, Python 开源协议: MIT 资源链接 主页:http://thejit.org/ 源码地址:https://github.com/philogb
类型: Toolkit 技术: JavaScript, Python 开源协议: MIT 资源链接 主页:http://thejit.org/ 源码地址:https://github.com/philogb
类型: Toolkit 技术: JavaScript, Python 开源协议: MIT 资源链接 主页:http://thejit.org/ 源码地址:https://github.com/philogb