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

Method resetContext

libsolidity/codegen/ir/IRGenerator.cpp:1150–1180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1148}
1149
1150void 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
1182std::string IRGenerator::dispenseLocationComment(ASTNode const& _node)
1183{

Callers

nothing calls this directly

Calls 12

ContractTypeClass · 0.85
requestedFunctionsMethod · 0.80
internalDispatchCleanMethod · 0.80
emptyMethod · 0.45
revertStringsMethod · 0.45
sourceIndicesMethod · 0.45
debugInfoSelectionMethod · 0.45
addStateVariableMethod · 0.45

Tested by

no test coverage detected