Skip to content

Commit

Permalink
Merge pull request iovisor#301 from iovisor/bblanco_dev
Browse files Browse the repository at this point in the history
Fix breakage from LLVM 3.8 API change
  • Loading branch information
4ast committed Dec 3, 2015
2 parents e665cbe + 2739fdf commit 0fadcee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/cc/bpf_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,11 @@ Function * BPFModule::make_reader(Module *mod, Type *type) {
Function *fn = Function::Create(fn_type, GlobalValue::ExternalLinkage,
"reader" + std::to_string(readers_.size()), mod);
auto arg_it = fn->arg_begin();
Argument *arg_in = arg_it++;
Argument *arg_in = &*arg_it;
++arg_it;
arg_in->setName("in");
Argument *arg_out = arg_it++;
Argument *arg_out = &*arg_it;
++arg_it;
arg_out->setName("out");

BasicBlock *label_entry = BasicBlock::Create(*ctx_, "entry", fn);
Expand Down Expand Up @@ -240,11 +242,14 @@ Function * BPFModule::make_writer(Module *mod, Type *type) {
Function *fn = Function::Create(fn_type, GlobalValue::ExternalLinkage,
"writer" + std::to_string(writers_.size()), mod);
auto arg_it = fn->arg_begin();
Argument *arg_out = arg_it++;
Argument *arg_out = &*arg_it;
++arg_it;
arg_out->setName("out");
Argument *arg_len = arg_it++;
Argument *arg_len = &*arg_it;
++arg_it;
arg_len->setName("len");
Argument *arg_in = arg_it++;
Argument *arg_in = &*arg_it;
++arg_it;
arg_in->setName("in");

BasicBlock *label_entry = BasicBlock::Create(*ctx_, "entry", fn);
Expand Down
2 changes: 1 addition & 1 deletion src/cc/frontends/b/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ StatusTuple CodegenLLVM::visit_func_decl_stmt_node(FuncDeclStmtNode *n) {
TRY2((*formal)->accept(this));
Value *ptr = vars_[formal->get()];
if (!ptr) return mkstatus_(n, "cannot locate memory location for arg %s", (*formal)->id_->c_str());
B.CreateStore(arg, ptr);
B.CreateStore(&*arg, ptr);

// Type *ptype;
// if ((*formal)->is_struct()) {
Expand Down

0 comments on commit 0fadcee

Please sign in to comment.