| 88 | } |
| 89 | |
| 90 | std::vector<std::string> CompilerContext::immutableVariableSlotNames(VariableDeclaration const& _variable) |
| 91 | { |
| 92 | std::string baseName = std::to_string(_variable.id()); |
| 93 | solAssert(_variable.annotation().type->sizeOnStack() > 0, ""); |
| 94 | if (_variable.annotation().type->sizeOnStack() == 1) |
| 95 | return {baseName}; |
| 96 | std::vector<std::string> names; |
| 97 | auto collectSlotNames = [&](std::string const& _baseName, Type const* type, auto const& _recurse) -> void { |
| 98 | for (auto const& [slot, type]: type->stackItems()) |
| 99 | if (type) |
| 100 | _recurse(_baseName + " " + slot, type, _recurse); |
| 101 | else |
| 102 | names.emplace_back(_baseName); |
| 103 | }; |
| 104 | collectSlotNames(baseName, _variable.annotation().type, collectSlotNames); |
| 105 | return names; |
| 106 | } |
| 107 | |
| 108 | size_t CompilerContext::reservedMemory() |
| 109 | { |
no test coverage detected