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

Method formatDebugData

libyul/AsmPrinter.cpp:308–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308std::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}

Callers

nothing calls this directly

Calls 5

formatSourceLocationFunction · 0.85
joinHumanReadableFunction · 0.85
to_stringFunction · 0.70
noneMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected