| 86 | } |
| 87 | |
| 88 | void IRGenerationContext::registerImmutableVariable(VariableDeclaration const& _variable) |
| 89 | { |
| 90 | solAssert(m_executionContext != ExecutionContext::Deployed); |
| 91 | solAssert(_variable.immutable(), "Attempted to register a non-immutable variable as immutable."); |
| 92 | solUnimplementedAssert( |
| 93 | _variable.annotation().type->isValueType(), |
| 94 | "Only immutable variables of value type are supported." |
| 95 | ); |
| 96 | solAssert(m_reservedMemory.has_value(), "Reserved memory has already been reset."); |
| 97 | m_immutableVariables[&_variable] = CompilerUtils::generalPurposeMemoryStart + *m_reservedMemory; |
| 98 | solAssert(_variable.annotation().type->memoryHeadSize() == 32, "Memory writes might overlap."); |
| 99 | *m_reservedMemory += _variable.annotation().type->memoryHeadSize(); |
| 100 | } |
| 101 | |
| 102 | size_t IRGenerationContext::immutableMemoryOffset(VariableDeclaration const& _variable) const |
| 103 | { |
no test coverage detected