与LLVM 3.8.4绑定没有getGlobalContext [英] Binding against LLVM 3.8.4 no 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屋!