mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[libsolidity] Prepare evm assembly json import.
This commit is contained in:
@@ -388,6 +388,17 @@ bool CompilerStack::parse()
|
||||
return !m_hasError;
|
||||
}
|
||||
|
||||
void CompilerStack::importEvmAssemblyJson(map<string, Json::Value> const& _sources)
|
||||
{
|
||||
solAssert(_sources.size() == 1, "");
|
||||
if (m_stackState != Empty)
|
||||
solThrow(CompilerError, "Must call importEvmAssemblyJson only before the SourcesSet state.");
|
||||
|
||||
m_evmAssemblyJson = std::make_unique<Json::Value>(_sources.begin()->second);
|
||||
m_importedSources = true;
|
||||
m_stackState = SourcesSet;
|
||||
}
|
||||
|
||||
void CompilerStack::importASTs(map<string, Json::Value> const& _sources)
|
||||
{
|
||||
if (m_stackState != Empty)
|
||||
|
||||
@@ -222,6 +222,8 @@ public:
|
||||
/// Will throw errors if the import fails
|
||||
void importASTs(std::map<std::string, Json::Value> const& _sources);
|
||||
|
||||
void importEvmAssemblyJson(std::map<std::string, Json::Value> const& _sources);
|
||||
|
||||
/// Performs the analysis steps (imports, scopesetting, syntaxCheck, referenceResolving,
|
||||
/// typechecking, staticAnalysis) on previously parsed sources.
|
||||
/// @returns false on error.
|
||||
@@ -499,6 +501,7 @@ private:
|
||||
std::map<std::string const, Source> m_sources;
|
||||
// if imported, store AST-JSONS for each filename
|
||||
std::map<std::string, Json::Value> m_sourceJsons;
|
||||
std::unique_ptr<Json::Value> m_evmAssemblyJson;
|
||||
std::vector<std::string> m_unhandledSMTLib2Queries;
|
||||
std::map<util::h256, std::string> m_smtlib2Responses;
|
||||
std::shared_ptr<GlobalContext> m_globalContext;
|
||||
|
||||
Reference in New Issue
Block a user