delete reinterpret_cast<BaseMemoryManager*>(memorymgr);
}
-extern "C" void
-lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)
-{
-#if HAVE_LLVM >= 0x0306
- llvm::Argument *A = llvm::unwrap<llvm::Argument>(val);
- llvm::AttrBuilder B;
- B.addDereferenceableAttr(bytes);
- A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1, B));
-#endif
-}
-
extern "C" LLVMValueRef
lp_get_called_value(LLVMValueRef call)
{
extern void
lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr);
-extern void
-lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes);
-
extern LLVMValueRef
lp_get_called_value(LLVMValueRef call);
if (LLVMGetTypeKind(LLVMTypeOf(P)) == LLVMPointerTypeKind) {
lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_BYVAL);
lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_NOALIAS);
- lp_add_attr_dereferenceable(P, UINT64_MAX);
+ ac_add_attr_dereferenceable(P, UINT64_MAX);
} else
lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_INREG);
}