| 71 | } |
| 72 | |
| 73 | void CompilerContext::addImmutable(VariableDeclaration const& _variable) |
| 74 | { |
| 75 | solAssert(_variable.immutable(), "Attempted to register a non-immutable variable as immutable."); |
| 76 | solUnimplementedAssert(_variable.annotation().type->isValueType(), "Only immutable variables of value type are supported."); |
| 77 | solAssert(m_runtimeContext, "Attempted to register an immutable variable for runtime code generation."); |
| 78 | m_immutableVariables[&_variable] = CompilerUtils::generalPurposeMemoryStart + *m_reservedMemory; |
| 79 | solAssert(_variable.annotation().type->memoryHeadSize() == 32, "Memory writes might overlap."); |
| 80 | *m_reservedMemory += _variable.annotation().type->memoryHeadSize(); |
| 81 | } |
| 82 | |
| 83 | size_t CompilerContext::immutableMemoryOffset(VariableDeclaration const& _variable) const |
| 84 | { |
no test coverage detected