issue #79 upgrade to LLVM 3.8

pull/81/head
Dibyendu Majumdar 8 years ago
parent ec50f8ec6c
commit 7adae06302

@ -164,6 +164,9 @@ endif ()
# Enable minimal required LLVM components so that the
# the size of the resulting binary is manageable
if (LLVM_JIT)
if (${LLVM_PACKAGE_VERSION} VERSION_LESS "3.8")
set(LLVM_EXTRA_LIBS ipa)
endif()
llvm_map_components_to_libnames(LLVM_LIBS
Analysis
Core
@ -173,7 +176,7 @@ if (LLVM_JIT)
BitReader
ExecutionEngine
InstCombine
ipa
${LLVM_EXTRA_LIBS}
ipo
MC
MCJIT

@ -962,7 +962,7 @@ std::unique_ptr<RaviJITFunction> RaviCodeGenerator::create_function(
builder.SetInsertPoint(entry);
auto argiter = mainFunc->arg_begin();
llvm::Value *arg1 = argiter++;
llvm::Value *arg1 = &(*argiter);
arg1->setName("L");
def->jitState = jitState_;

@ -243,7 +243,9 @@ void RaviJITModule::runpasses(bool dumpAsm) {
MPM->run(*module_);
// Note that in 3.7 this flus appears to have no effect
#if LLVM_VERSION_MINOR <= 7
formatted_stream.flush();
#endif
}
if (dumpAsm && codestr.length() > 0) llvm::errs() << codestr << "\n";
}

@ -604,7 +604,7 @@ static int context_new_lua_CFunction(lua_State *L) {
MainFunctionHolder *h = alloc_LLVM_mainfunction(
L, context->jitState, context->jitState->types()->lua_CFunctionT, name);
/* set L arg */
h->arg1 = h->func->function()->arg_begin();
h->arg1 = &(*h->func->function()->arg_begin());
h->arg1->setName("L");
return 1;
}
@ -975,7 +975,7 @@ static int func_getarg(lua_State *L) {
auto E = func->arg_end();
for (int i = 1; B != E; B++, i++) {
if (i == argn) {
alloc_LLVM_value(L, B);
alloc_LLVM_value(L, &(*B));
break;
}
}
@ -1032,7 +1032,7 @@ static int func_alloca(lua_State *L) {
const char *name = nullptr;
if (lua_gettop(L) >= 3) name = luaL_checkstring(L, 3);
if (lua_gettop(L) >= 4) arraysize = get_value(L, 4);
llvm::BasicBlock *block = func->getBasicBlockList().begin();
llvm::BasicBlock *block = &(*func->getBasicBlockList().begin());
luaL_argcheck(L, block != nullptr, 1, "No basic block in function");
llvm::IRBuilder<> builder(block, block->begin());
llvm::Instruction *inst = builder.CreateAlloca(ty, arraysize, name);

@ -89,7 +89,7 @@ int test1() {
// Get the first argument which is RaviGCObject *
auto argiter = mainFunc->arg_begin();
llvm::Value *arg1 = argiter++;
llvm::Value *arg1 = &(*argiter);
arg1->setName("obj");
// Now we need a GEP for the second field in RaviGCObject

Loading…
Cancel
Save