| 1148 | } |
| 1149 | |
| 1150 | void IRGenerator::resetContext(ContractDefinition const& _contract, ExecutionContext _context) |
| 1151 | { |
| 1152 | solAssert( |
| 1153 | m_context.functionGenerationQueueEmpty(), |
| 1154 | "Reset function generation queue while it still had functions." |
| 1155 | ); |
| 1156 | solAssert( |
| 1157 | m_context.functionCollector().requestedFunctions().empty(), |
| 1158 | "Reset context while it still had functions." |
| 1159 | ); |
| 1160 | solAssert( |
| 1161 | m_context.internalDispatchClean(), |
| 1162 | "Reset internal dispatch map without consuming it." |
| 1163 | ); |
| 1164 | IRGenerationContext newContext( |
| 1165 | m_evmVersion, |
| 1166 | m_eofVersion, |
| 1167 | _context, |
| 1168 | m_context.revertStrings(), |
| 1169 | m_context.sourceIndices(), |
| 1170 | m_context.debugInfoSelection(), |
| 1171 | m_context.soliditySourceProvider() |
| 1172 | ); |
| 1173 | |
| 1174 | m_context = std::move(newContext); |
| 1175 | |
| 1176 | m_context.setMostDerivedContract(_contract); |
| 1177 | for (auto const location: {DataLocation::Storage, DataLocation::Transient}) |
| 1178 | for (auto const& var: ContractType(_contract).linearizedStateVariables(location)) |
| 1179 | m_context.addStateVariable(*std::get<0>(var), std::get<1>(var), std::get<2>(var)); |
| 1180 | } |
| 1181 | |
| 1182 | std::string IRGenerator::dispenseLocationComment(ASTNode const& _node) |
| 1183 | { |
nothing calls this directly
no test coverage detected