| 4195 | } |
| 4196 | |
| 4197 | std::string YulUtilFunctions::decrementWrappingFunction(Type const& _type) |
| 4198 | { |
| 4199 | solAssert(_type.category() == Type::Category::Integer, ""); |
| 4200 | IntegerType const& type = dynamic_cast<IntegerType const&>(_type); |
| 4201 | |
| 4202 | std::string const functionName = "decrement_wrapping_" + _type.identifier(); |
| 4203 | |
| 4204 | return m_functionCollector.createFunction(functionName, [&]() { |
| 4205 | return Whiskers(R"( |
| 4206 | function <functionName>(value) -> ret { |
| 4207 | ret := <cleanupFunction>(sub(value, 1)) |
| 4208 | } |
| 4209 | )") |
| 4210 | ("functionName", functionName) |
| 4211 | ("cleanupFunction", cleanupFunction(type)) |
| 4212 | .render(); |
| 4213 | }); |
| 4214 | } |
| 4215 | |
| 4216 | std::string YulUtilFunctions::incrementCheckedFunction(Type const& _type) |
| 4217 | { |
no test coverage detected