Doing old tutorials, I often see getGlobalContext() used. However, in LLVM 3.9.1, this function can no longer be found.
What should I replace these calls with for equivalent behaviour?
you just can use
static LLVMContext TheContext;
I found this review very useful: https://reviews.llvm.org/rL266379
It shows the tutorials being changed in llvm/docs to match the new API. They are replacing getGlobalContext()
with code to allocate an LLVMContext
to match the usage (static if it's being used with a static IRBuilder
, for example).
So basically, make your own LLVMContext
instead of using getGlobalContext()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With