xiangzhai / dragonegg

DragonEgg has been migrated to GCC 8 and LLVM 6 but also able to work for GCC 4.8 and LLVM 3.3
https://gcc.gnu.org/ml/gcc/2017-08/msg00245.html
GNU General Public License v2.0
18 stars 6 forks source link

How to initialize LLVMContext when there is no llvm::Type, Value or BasicBlock #4

Closed xiangzhai closed 7 years ago

xiangzhai commented 7 years ago

there is no getGlobalContext any more after LLVM v3.9, then it is correct migrate it like this:

LLVMContext TheContext;

TheModule = new Module(ModuleID,                                                  
#if LLVM_VERSION_CODE > LLVM_VERSION(3, 8)                                          
                         TheContext                                                 
#else                                                                               
                         getGlobalContext()                                         
#endif                                                                              
                         );

how to initialize TheContext?