与LLVM 3.8.4绑定没有getGlobalContext [英] Binding against LLVM 3.8.4 no getGlobalContext

查看:368
本文介绍了与LLVM 3.8.4绑定没有getGlobalContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试遵循 https://github.com/lsegal/my_toy_compiler ,但是即使它已针对LLVM 3.8.0进行了更新,我也无法使用--with-clang --with-lld --with-jit --with-python从brew中使用LLVM 3.8.4进行编译.具体来说,我收到以下错误use of undeclared identifier 'getGlobalContext'.

I am attempting to follow the https://github.com/lsegal/my_toy_compiler, but even though it has been updated for LLVM 3.8.0, I am unable to get it to compile using LLVM 3.8.4 from brew with --with-clang --with-lld --with-jit --with-python. Specifically I get the following error, use of undeclared identifier 'getGlobalContext'.

此外,符号getGlobalContext不会出现在/usr/local/opt/llvm/include/llvm/IR/LLVMContext.h/usr/local/opt/llvm/include目录中的任何位置.

Additionally the symbol getGlobalContext does not appear in the /usr/local/opt/llvm/include/llvm/IR/LLVMContext.h or indeed anywhere in the /usr/local/opt/llvm/include directory.

我希望这个功能最近已被弃用(对此我无法找到任何证据),或者我没有正确构建它.

I expect that either this function has been deprecated recently, (for which I have not been able to find any evidence), or that I am not building it correctly.

任何提示将不胜感激.

注意我见过

NOTE I have seen Trouble linking against LLVM with project including Flex and Bison and it did not resolve my particular problem

推荐答案

我也遇到了llvm 4.0的相同问题. 我的解决方法如下.

I also encountered the same problem with llvm 4.0. My solution is as follows.

旧:

LLVMContext *llvmcx;
llvmcx = &getGlobalContext();

新:

LLVMContext *llvmcx;
static LLVMContext MyGlobalContext;
llvmcx = &MyGlobalContext;

这篇关于与LLVM 3.8.4绑定没有getGlobalContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆