mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
tmp
This commit is contained in:
@@ -100,7 +100,7 @@ string IRGenerator::generate(FunctionDefinition const& _function)
|
||||
std::stringstream code;
|
||||
code << "function " << IRNames::function(_function) << "(";
|
||||
if (_function.parameters().size() > 1)
|
||||
for (auto const& arg: _function.parameters() | ranges::view::drop_last(1))
|
||||
for (auto const& arg: _function.parameters() | ranges::views::drop_last(1))
|
||||
code << IRNames::localVariable(*arg) << ", ";
|
||||
if (!_function.parameters().empty())
|
||||
code << IRNames::localVariable(*_function.parameters().back());
|
||||
@@ -109,7 +109,7 @@ string IRGenerator::generate(FunctionDefinition const& _function)
|
||||
{
|
||||
code << " -> ";
|
||||
if (_function.returnParameters().size() > 1)
|
||||
for (auto const& arg: _function.returnParameters() | ranges::view::drop_last(1))
|
||||
for (auto const& arg: _function.returnParameters() | ranges::views::drop_last(1))
|
||||
code << IRNames::localVariable(*arg) << ", ";
|
||||
if (!_function.returnParameters().empty())
|
||||
code << IRNames::localVariable(*_function.returnParameters().back());
|
||||
|
||||
@@ -46,14 +46,14 @@ public:
|
||||
std::optional<uint8_t> _eofVersion,
|
||||
RevertStrings /*_revertStrings*/,
|
||||
std::map<std::string, unsigned> /*_sourceIndices*/,
|
||||
langutil::DebugInfoSelection const& _debugInfoSelection,
|
||||
langutil::CharStreamProvider const* _soliditySourceProvider,
|
||||
langutil::DebugInfoSelection const& /*_debugInfoSelection*/,
|
||||
langutil::CharStreamProvider const* /*_soliditySourceProvider*/,
|
||||
Analysis const& _analysis
|
||||
):
|
||||
m_evmVersion(_evmVersion),
|
||||
m_eofVersion(_eofVersion),
|
||||
m_debugInfoSelection(_debugInfoSelection),
|
||||
m_soliditySourceProvider(_soliditySourceProvider),
|
||||
// m_debugInfoSelection(_debugInfoSelection),
|
||||
// m_soliditySourceProvider(_soliditySourceProvider),
|
||||
m_context{_analysis, {}, {}}
|
||||
{}
|
||||
|
||||
@@ -69,8 +69,8 @@ private:
|
||||
langutil::EVMVersion const m_evmVersion;
|
||||
std::optional<uint8_t> const m_eofVersion;
|
||||
OptimiserSettings const m_optimiserSettings;
|
||||
langutil::DebugInfoSelection m_debugInfoSelection = {};
|
||||
langutil::CharStreamProvider const* m_soliditySourceProvider = nullptr;
|
||||
// langutil::DebugInfoSelection m_debugInfoSelection = {};
|
||||
// langutil::CharStreamProvider const* m_soliditySourceProvider = nullptr;
|
||||
IRGenerationContext m_context;
|
||||
};
|
||||
|
||||
|
||||
@@ -145,7 +145,6 @@ void IRGeneratorForStatements::endVisit(Return const& _return)
|
||||
m_code << IRNames::localVariable(*returnParameters.front()) << " := " << IRNames::localVariable(*value) << "\n";
|
||||
}
|
||||
|
||||
_return.annotation().functionReturnParameters;
|
||||
m_code << "leave\n";
|
||||
}
|
||||
|
||||
@@ -163,7 +162,7 @@ bool IRGeneratorForStatements::visit(FunctionCall const& _functionCall)
|
||||
m_code << "let " << IRNames::localVariable(_functionCall) << " := " << IRNames::function(*functionDefinition) << "(";
|
||||
auto const& arguments = _functionCall.arguments();
|
||||
if (arguments.size() > 1)
|
||||
for (auto arg: arguments | ranges::view::drop_last(1))
|
||||
for (auto arg: arguments | ranges::views::drop_last(1))
|
||||
m_code << IRNames::localVariable(*arg) << ", ";
|
||||
if (!arguments.empty())
|
||||
m_code << IRNames::localVariable(*arguments.back());
|
||||
@@ -188,4 +187,4 @@ bool IRGeneratorForStatements::visit(Assignment const& _assignment)
|
||||
bool IRGeneratorForStatements::visitNode(ASTNode const&)
|
||||
{
|
||||
solAssert(false, "Unsupported AST node during statement code generation.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user