MCPcopy Create free account
hub / github.com/argotorg/solidity / generateEVMFromIR

Method generateEVMFromIR

libsolidity/interface/CompilerStack.cpp:1677–1705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1675}
1676
1677void CompilerStack::generateEVMFromIR(ContractDefinition const& _contract)
1678{
1679 solAssert(m_stackState >= AnalysisSuccessful, "");
1680
1681 if (!_contract.canBeDeployed())
1682 return;
1683
1684 Contract& compiledContract = m_contracts.at(_contract.fullyQualifiedName());
1685 solAssert(compiledContract.yulIROptimized);
1686 solAssert(!compiledContract.yulIROptimized->empty());
1687 if (!compiledContract.object.bytecode.empty())
1688 return;
1689
1690 // Re-parse the Yul IR in EVM dialect
1691 YulStack stack = loadGeneratedIR(*compiledContract.yulIROptimized);
1692
1693 std::string deployedName = IRNames::deployedObject(_contract);
1694 solAssert(!deployedName.empty(), "");
1695 tie(compiledContract.evmAssembly, compiledContract.evmRuntimeAssembly) = stack.assembleEVMWithDeployed(deployedName, m_viaSSACFG);
1696
1697 if (stack.hasErrors())
1698 {
1699 for (std::shared_ptr<Error const> const& error: stack.errors())
1700 reportIRPostAnalysisError(error.get(), compiledContract.contract);
1701 return;
1702 }
1703
1704 assembleYul(_contract, compiledContract.evmAssembly, compiledContract.evmRuntimeAssembly);
1705}
1706
1707CompilerStack::Contract const& CompilerStack::contract(std::string const& _contractName) const
1708{

Callers

nothing calls this directly

Calls 7

canBeDeployedMethod · 0.80
atMethod · 0.80
fullyQualifiedNameMethod · 0.80
emptyMethod · 0.45
hasErrorsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected