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

Method controlFlowKind

libyul/optimiser/Semantics.cpp:204–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204TerminationFinder::ControlFlow TerminationFinder::controlFlowKind(Statement const& _statement)
205{
206 if (
207 std::holds_alternative<VariableDeclaration>(_statement) &&
208 std::get<VariableDeclaration>(_statement).value &&
209 containsNonContinuingFunctionCall(*std::get<VariableDeclaration>(_statement).value)
210 )
211 return ControlFlow::Terminate;
212 else if (
213 std::holds_alternative<Assignment>(_statement) &&
214 containsNonContinuingFunctionCall(*std::get<Assignment>(_statement).value)
215 )
216 return ControlFlow::Terminate;
217 else if (
218 std::holds_alternative<ExpressionStatement>(_statement) &&
219 containsNonContinuingFunctionCall(std::get<ExpressionStatement>(_statement).expression)
220 )
221 return ControlFlow::Terminate;
222 else if (std::holds_alternative<Break>(_statement))
223 return ControlFlow::Break;
224 else if (std::holds_alternative<Continue>(_statement))
225 return ControlFlow::Continue;
226 else if (std::holds_alternative<Leave>(_statement))
227 return ControlFlow::Leave;
228 else
229 return ControlFlow::FlowOut;
230}
231
232bool TerminationFinder::containsNonContinuingFunctionCall(Expression const& _expr)
233{

Callers 3

operator()Method · 0.80
operator()Method · 0.80
visitMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected