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

Function formatLinkReferences

libsolidity/interface/StandardCompiler.cpp:406–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404}
405
406Json formatLinkReferences(std::map<size_t, std::string> const& linkReferences)
407{
408 Json ret = Json::object();
409
410 for (auto const& ref: linkReferences)
411 {
412 std::string const& fullname = ref.second;
413
414 // If the link reference does not contain a colon, assume that the file name is missing and
415 // the whole string represents the library name.
416 size_t colon = fullname.rfind(':');
417 std::string file = (colon != std::string::npos ? fullname.substr(0, colon) : "");
418 std::string name = (colon != std::string::npos ? fullname.substr(colon + 1) : fullname);
419
420 Json fileObject = ret.value(file, Json::object());
421 Json libraryArray = fileObject.value(name, Json::array());
422
423 Json entry;
424 entry["start"] = Json(ref.first);
425 entry["length"] = 20;
426
427 libraryArray.emplace_back(entry);
428 fileObject[name] = libraryArray;
429 ret[file] = fileObject;
430 }
431
432 return ret;
433}
434
435Json formatImmutableReferences(std::map<u256, evmasm::LinkerObject::ImmutableRefs> const& _immutableReferences)
436{

Callers 3

importEVMAssemblyMethod · 0.85
compileSolidityMethod · 0.85
compileYulMethod · 0.85

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected