mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
Call helper
This commit is contained in:
parent
6da6f3dc52
commit
2493ef5f9e
2 changed files with 8 additions and 1 deletions
|
|
@ -31,6 +31,13 @@ protected:
|
|||
llvm::IRBuilder<>& m_builder;
|
||||
llvm::IRBuilder<>& getBuilder() { return m_builder; }
|
||||
|
||||
template<typename ..._Args>
|
||||
llvm::CallInst* call(llvm::Function* _func, _Args*... _args)
|
||||
{
|
||||
llvm::Value* args[] = {_args...};
|
||||
return m_builder.CreateCall(_func, args);
|
||||
}
|
||||
|
||||
friend class RuntimeHelper;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ void GasMeter::countSStore(Ext& _ext, llvm::Value* _index, llvm::Value* _newValu
|
|||
auto isDel = m_builder.CreateAnd(oldValueIsntZero, newValueIsZero, "isDel");
|
||||
auto cost = m_builder.CreateSelect(isAdd, Constant::get(2 * sstoreCost), Constant::get(sstoreCost), "cost");
|
||||
cost = m_builder.CreateSelect(isDel, Constant::get(0), cost, "cost");
|
||||
m_builder.CreateCall(m_gasCheckFunc, cost);
|
||||
call(m_gasCheckFunc, cost);
|
||||
}
|
||||
|
||||
void GasMeter::giveBack(llvm::Value* _gas)
|
||||
|
|
|
|||
Loading…
Reference in a new issue