| 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 | { |
no test coverage detected