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

Method feed

libevmasm/Assembly.cpp:363–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361 {}
362
363 void feed(AssemblyItem const& _item, DebugInfoSelection const& _debugInfoSelection)
364 {
365 if (_item.location().isValid() && _item.location() != m_location)
366 {
367 flush();
368 m_location = _item.location();
369 printLocation(_debugInfoSelection);
370 }
371
372 std::string expression = _item.toAssemblyText(m_assembly);
373
374 if (!(
375 _item.canBeFunctional() &&
376 _item.returnValues() <= 1 &&
377 _item.arguments() <= m_pending.size()
378 ))
379 {
380 flush();
381 m_out << m_prefix << (_item.type() == Tag ? "" : " ") << expression << std::endl;
382 return;
383 }
384 if (_item.arguments() > 0)
385 {
386 expression += "(";
387 for (size_t i = 0; i < _item.arguments(); ++i)
388 {
389 expression += m_pending.back();
390 m_pending.pop_back();
391 if (i + 1 < _item.arguments())
392 expression += ", ";
393 }
394 expression += ")";
395 }
396
397 m_pending.push_back(expression);
398 if (_item.returnValues() != 1)
399 flush();
400 }
401
402 void flush()
403 {

Callers 1

assemblyStreamMethod · 0.80

Calls 8

toAssemblyTextMethod · 0.80
canBeFunctionalMethod · 0.80
returnValuesMethod · 0.80
isValidMethod · 0.45
locationMethod · 0.45
argumentsMethod · 0.45
sizeMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected