| 1675 | } |
| 1676 | |
| 1677 | void 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 | |
| 1707 | CompilerStack::Contract const& CompilerStack::contract(std::string const& _contractName) const |
| 1708 | { |
nothing calls this directly
no test coverage detected