optimize bind functions

This commit is contained in:
Ivan 2018-06-03 02:41:28 +03:00
parent eb211c899a
commit 0c8c8e8067
4 changed files with 141 additions and 14 deletions

View file

@ -18,16 +18,25 @@
#include "param_slice.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
namespace llvm {
class Constant;
class Type;
class Module;
class Function;
}
using BindOverride =
llvm::Optional<llvm::function_ref<llvm::Constant*(
llvm::Type &, const void *, size_t)>>;
llvm::Function *bindParamsToFunc(
llvm::Module &module, llvm::Function &srcFunc,llvm::Function &exampleFunc,
const llvm::ArrayRef<ParamSlice> &params,
llvm::function_ref<void(const std::string &)> errHandler);
llvm::function_ref<void(const std::string &)> errHandler,
const BindOverride &override = BindOverride{});
#endif // BIND_H