mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[libevmasm] EVMAssemblStack: remove std::optional for source mappings.
This commit is contained in:
parent
ff05b7a485
commit
ac7fcd6f7c
@ -48,12 +48,12 @@ void EVMAssemblyStack::assemble()
|
|||||||
solAssert(!m_evmRuntimeAssembly);
|
solAssert(!m_evmRuntimeAssembly);
|
||||||
|
|
||||||
m_object = m_evmAssembly->assemble();
|
m_object = m_evmAssembly->assemble();
|
||||||
m_sourceMapping.emplace(AssemblyItem::computeSourceMapping(m_evmAssembly->items(), sourceIndices()));
|
m_sourceMapping = AssemblyItem::computeSourceMapping(m_evmAssembly->items(), sourceIndices());
|
||||||
if (m_evmAssembly->numSubs() > 0)
|
if (m_evmAssembly->numSubs() > 0)
|
||||||
{
|
{
|
||||||
m_evmRuntimeAssembly = make_shared<evmasm::Assembly>(m_evmAssembly->sub(0));
|
m_evmRuntimeAssembly = make_shared<evmasm::Assembly>(m_evmAssembly->sub(0));
|
||||||
solAssert(m_evmRuntimeAssembly && !m_evmRuntimeAssembly->isCreation());
|
solAssert(m_evmRuntimeAssembly && !m_evmRuntimeAssembly->isCreation());
|
||||||
m_runtimeSourceMapping.emplace(AssemblyItem::computeSourceMapping(m_evmRuntimeAssembly->items(), sourceIndices()));
|
m_runtimeSourceMapping = AssemblyItem::computeSourceMapping(m_evmRuntimeAssembly->items(), sourceIndices());
|
||||||
m_runtimeObject = m_evmRuntimeAssembly->assemble();
|
m_runtimeObject = m_evmRuntimeAssembly->assemble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,13 +87,13 @@ map<string, unsigned> EVMAssemblyStack::sourceIndices() const
|
|||||||
string const* EVMAssemblyStack::sourceMapping(string const& _contractName) const
|
string const* EVMAssemblyStack::sourceMapping(string const& _contractName) const
|
||||||
{
|
{
|
||||||
solAssert(_contractName == m_name);
|
solAssert(_contractName == m_name);
|
||||||
return m_sourceMapping.has_value() ? &m_sourceMapping.value() : nullptr;
|
return &m_sourceMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
string const* EVMAssemblyStack::runtimeSourceMapping(string const& _contractName) const
|
string const* EVMAssemblyStack::runtimeSourceMapping(string const& _contractName) const
|
||||||
{
|
{
|
||||||
solAssert(_contractName == m_name);
|
solAssert(_contractName == m_name);
|
||||||
return m_runtimeSourceMapping.has_value() ? &m_runtimeSourceMapping.value() : nullptr;
|
return &m_runtimeSourceMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value EVMAssemblyStack::assemblyJSON(string const& _contractName) const
|
Json::Value EVMAssemblyStack::assemblyJSON(string const& _contractName) const
|
||||||
|
@ -79,8 +79,8 @@ private:
|
|||||||
evmasm::LinkerObject m_runtimeObject; ///< Runtime object.
|
evmasm::LinkerObject m_runtimeObject; ///< Runtime object.
|
||||||
std::vector<std::string> m_sourceList;
|
std::vector<std::string> m_sourceList;
|
||||||
langutil::DebugInfoSelection m_debugInfoSelection = langutil::DebugInfoSelection::Default();
|
langutil::DebugInfoSelection m_debugInfoSelection = langutil::DebugInfoSelection::Default();
|
||||||
std::optional<std::string const> m_sourceMapping;
|
std::string m_sourceMapping;
|
||||||
std::optional<std::string const> m_runtimeSourceMapping;
|
std::string m_runtimeSourceMapping;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace solidity::evmasm
|
} // namespace solidity::evmasm
|
||||||
|
Loading…
Reference in New Issue
Block a user