mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Add name to data indices [#81470252]
This commit is contained in:
parent
399cf2845e
commit
5c1e344a3e
1 changed files with 15 additions and 2 deletions
|
|
@ -29,6 +29,19 @@ llvm::StructType* RuntimeData::getType()
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
llvm::Twine getName(RuntimeData::Index _index)
|
||||||
|
{
|
||||||
|
switch (_index)
|
||||||
|
{
|
||||||
|
default: return "data";
|
||||||
|
case RuntimeData::Gas: return "gas";
|
||||||
|
case RuntimeData::Address: return "address";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Runtime* g_runtime; // FIXME: Remove
|
static Runtime* g_runtime; // FIXME: Remove
|
||||||
|
|
||||||
Runtime::Runtime(u256 _gas, ExtVMFace& _ext):
|
Runtime::Runtime(u256 _gas, ExtVMFace& _ext):
|
||||||
|
|
@ -94,8 +107,8 @@ llvm::Value* RuntimeManager::getRuntimePtr()
|
||||||
llvm::Value* RuntimeManager::get(RuntimeData::Index _index)
|
llvm::Value* RuntimeManager::get(RuntimeData::Index _index)
|
||||||
{
|
{
|
||||||
llvm::Value* idxList[] = {m_builder.getInt32(0), m_builder.getInt32(0), m_builder.getInt32(_index)};
|
llvm::Value* idxList[] = {m_builder.getInt32(0), m_builder.getInt32(0), m_builder.getInt32(_index)};
|
||||||
auto ptr = m_builder.CreateInBoundsGEP(getRuntimePtr(), idxList, "dataElemPtr");
|
auto ptr = m_builder.CreateInBoundsGEP(getRuntimePtr(), idxList, getName(_index) + "Ptr");
|
||||||
return m_builder.CreateLoad(ptr);
|
return m_builder.CreateLoad(ptr, getName(_index));
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::Value* RuntimeManager::getGas()
|
llvm::Value* RuntimeManager::getGas()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue