| 2999 | } |
| 3000 | |
| 3001 | void IRGeneratorForStatements::declareAssign(IRVariable const& _lhs, IRVariable const& _rhs, bool _declare, bool _forceCleanup) |
| 3002 | { |
| 3003 | std::string output; |
| 3004 | if (_lhs.type() == _rhs.type() && !_forceCleanup) |
| 3005 | for (auto const& [stackItemName, stackItemType]: _lhs.type().stackItems()) |
| 3006 | if (stackItemType) |
| 3007 | declareAssign(_lhs.part(stackItemName), _rhs.part(stackItemName), _declare); |
| 3008 | else |
| 3009 | appendCode() << (_declare ? "let ": "") << _lhs.part(stackItemName).name() << " := " << _rhs.part(stackItemName).name() << "\n"; |
| 3010 | else |
| 3011 | { |
| 3012 | if (_lhs.type().sizeOnStack() > 0) |
| 3013 | appendCode() << |
| 3014 | (_declare ? "let ": "") << |
| 3015 | _lhs.commaSeparatedList() << |
| 3016 | " := "; |
| 3017 | appendCode() << m_context.utils().conversionFunction(_rhs.type(), _lhs.type()) << |
| 3018 | "(" << |
| 3019 | _rhs.commaSeparatedList() << |
| 3020 | ")\n"; |
| 3021 | } |
| 3022 | } |
| 3023 | |
| 3024 | IRVariable IRGeneratorForStatements::zeroValue(Type const& _type, bool _splitFunctionTypes) |
| 3025 | { |
nothing calls this directly
no test coverage detected