How using "get global context"?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How using "get global context"?

Borneq
I try compile conjure3 sample from Spirit which uses LLVM.
I changed old
   llvm::LLVMContext& context() const
        { return llvm::getGlobalContext(); }
to new:
::LLVMContextRef context() const
        { return ::LLVMGetGlobalContext(); }

but is problem with
/home/andrzej/proj/conjure3/compiler.hpp|180|error: no matching function for call to ‘llvm::IRBuilder<>::IRBuilder(LLVMContextRef)’|
IRBuilder wants LLVMContext &C
while LLVMContextRef is
/**
 * The top-level container for all LLVM global data. See the LLVMContext class.
 */
typedef struct LLVMOpaqueContext *LLVMContextRef;

I must convert between them? How? or one is base class of other?
Reply | Threaded
Open this post in threaded view
|

Re: How using "get global context"?

Borneq
I changed to
        llvm::LLVMContext& context() const
        { return *llvm::unwrap(::LLVMGetGlobalContext()); }
because:
http://llvm.org/doxygen/LLVMContext_8h_source.html