| 306 | } |
| 307 | |
| 308 | std::string AsmPrinter::formatDebugData(langutil::DebugData::ConstPtr const& _debugData, bool _statement) |
| 309 | { |
| 310 | if (!_debugData || m_debugInfoSelection.none()) |
| 311 | return ""; |
| 312 | |
| 313 | std::vector<std::string> items; |
| 314 | if (auto id = _debugData->astID) |
| 315 | if (m_debugInfoSelection.astID) |
| 316 | items.emplace_back("@ast-id " + std::to_string(*id)); |
| 317 | |
| 318 | if ( |
| 319 | m_lastLocation != _debugData->originLocation && |
| 320 | !m_nameToSourceIndex.empty() |
| 321 | ) |
| 322 | { |
| 323 | m_lastLocation = _debugData->originLocation; |
| 324 | |
| 325 | items.emplace_back(formatSourceLocation( |
| 326 | _debugData->originLocation, |
| 327 | m_nameToSourceIndex, |
| 328 | m_debugInfoSelection, |
| 329 | m_soliditySourceProvider |
| 330 | )); |
| 331 | } |
| 332 | |
| 333 | std::string commentBody = joinHumanReadable(items, " "); |
| 334 | if (commentBody.empty()) |
| 335 | return ""; |
| 336 | else |
| 337 | return |
| 338 | _statement ? |
| 339 | "/// " + commentBody + "\n" : |
| 340 | "/** " + commentBody + " */ "; |
| 341 | } |
nothing calls this directly
no test coverage detected