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

Method setLValueFromDeclaration

libsolidity/codegen/ExpressionCompiler.cpp:3048–3061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3046}
3047
3048void ExpressionCompiler::setLValueFromDeclaration(Declaration const& _declaration, Expression const& _expression)
3049{
3050 if (m_context.isLocalVariable(&_declaration))
3051 setLValue<StackVariable>(_expression, dynamic_cast<VariableDeclaration const&>(_declaration));
3052 else if (m_context.isStateVariable(&_declaration))
3053 {
3054 if (dynamic_cast<VariableDeclaration const&>(_declaration).referenceLocation() == VariableDeclaration::Location::Transient)
3055 setLValue<TransientStorageItem>(_expression, dynamic_cast<VariableDeclaration const&>(_declaration));
3056 else
3057 setLValue<StorageItem>(_expression, dynamic_cast<VariableDeclaration const&>(_declaration));
3058 }
3059 else
3060 solAssert(false, "Identifier type not supported or identifier not found.");
3061}
3062
3063void ExpressionCompiler::setLValueToStorageItem(Expression const& _expression)
3064{

Callers

nothing calls this directly

Calls 3

referenceLocationMethod · 0.80
isLocalVariableMethod · 0.45
isStateVariableMethod · 0.45

Tested by

no test coverage detected