17 using Creator = std::function<llvm::Function*()>;
23 llvm::Value*
call(
IRBuilder& _builder, std::initializer_list<llvm::Value*>
const& _args, llvm::Twine
const& _name =
"");
41 void free() { m_freeFunc.call(m_builder, {m_array}); }
48 static llvm::Type* getType();
53 llvm::Function* createArrayPushFunc();
54 llvm::Function* createArraySetFunc();
55 llvm::Function* createArrayGetFunc();
56 llvm::Function* createGetPtrFunc();
57 llvm::Function* createFreeFunc();
58 llvm::Function* createExtendFunc();
59 llvm::Function* getReallocFunc();
61 LazyFunction m_pushFunc = {[
this](){
return createArrayPushFunc(); }};
62 LazyFunction m_setFunc = {[
this](){
return createArraySetFunc(); }};
63 LazyFunction m_getPtrFunc = {[
this](){
return createGetPtrFunc(); }};
64 LazyFunction m_getFunc = {[
this](){
return createArrayGetFunc(); }};
66 LazyFunction m_extendFunc = {[
this](){
return createExtendFunc(); }};
67 LazyFunction m_reallocFunc = {[
this](){
return getReallocFunc(); }};
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
std::function< llvm::Function *()> Creator
llvm::Value * call(IRBuilder &_builder, std::initializer_list< llvm::Value * > const &_args, llvm::Twine const &_name="")
bool extend(Iterator it, const Pair &other)
llvm::Value * getPointerTo() const
Base class for compiler helpers like Memory, GasMeter, etc.
LazyFunction(Creator _creator)
uint8_t const size_t const size
void push(llvm::Value *_value)
llvm::Value * getPtr(llvm::Value *_arrayPtr, llvm::Value *_index)
llvm::IRBuilder<> IRBuilder