Skip to content

Commit

Permalink
Merge pull request iovisor#528 from iovisor/bblanco_dev
Browse files Browse the repository at this point in the history
fix llvm 3.9 build
  • Loading branch information
drzaeus77 committed May 5, 2016
2 parents 6bfb3b0 + a1e889b commit 6acf4b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/cc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ add_library(bcc-loader-static libbpf.c perf_reader.c bcc_elf.c bcc_proc.c)
add_library(bcc-static STATIC bpf_common.cc bpf_module.cc shared_table.cc exported_files.cc bcc_syms.cc usdt_args.cc usdt.cc)
set_target_properties(bcc-static PROPERTIES OUTPUT_NAME bcc)

# BPF is still experimental otherwise it should be available
#llvm_map_components_to_libnames(llvm_libs bpf mcjit irreader passes)
llvm_map_components_to_libnames(llvm_libs bitwriter bpfcodegen irreader linker
set(llvm_raw_libs bitwriter bpfcodegen irreader linker
mcjit objcarcopts option passes nativecodegen)
list(FIND LLVM_AVAILABLE_LIBS "LLVMCoverage" _llvm_coverage)
if (${_llvm_coverage} GREATER -1)
list(APPEND llvm_raw_libs coverage)
endif()
llvm_map_components_to_libnames(llvm_libs ${llvm_raw_libs})
llvm_expand_dependencies(expanded_libs ${llvm_libs})

# order is important
Expand Down
3 changes: 2 additions & 1 deletion src/cc/frontends/b/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,8 @@ StatusTuple CodegenLLVM::emit_atomic_add(MethodCallExprNode *n) {
Value *lhs = B.CreateBitCast(pop_expr(), Type::getInt64PtrTy(ctx()));
TRY2(n->args_[1]->accept(this));
Value *rhs = B.CreateSExt(pop_expr(), B.getInt64Ty());
AtomicRMWInst *atomic_inst = B.CreateAtomicRMW(AtomicRMWInst::Add, lhs, rhs, SequentiallyConsistent);
AtomicRMWInst *atomic_inst = B.CreateAtomicRMW(
AtomicRMWInst::Add, lhs, rhs, AtomicOrdering::SequentiallyConsistent);
atomic_inst->setVolatile(false);
return mkstatus(0);
}
Expand Down

0 comments on commit 6acf4b6

Please sign in to comment.