| 4279 | } |
| 4280 | |
| 4281 | std::string YulUtilFunctions::negateNumberWrappingFunction(Type const& _type) |
| 4282 | { |
| 4283 | solAssert(_type.category() == Type::Category::Integer, ""); |
| 4284 | IntegerType const& type = dynamic_cast<IntegerType const&>(_type); |
| 4285 | solAssert(type.isSigned(), "Expected signed type!"); |
| 4286 | |
| 4287 | std::string const functionName = "negate_wrapping_" + _type.identifier(); |
| 4288 | return m_functionCollector.createFunction(functionName, [&]() { |
| 4289 | return Whiskers(R"( |
| 4290 | function <functionName>(value) -> ret { |
| 4291 | ret := <cleanupFunction>(sub(0, value)) |
| 4292 | } |
| 4293 | )") |
| 4294 | ("functionName", functionName) |
| 4295 | ("cleanupFunction", cleanupFunction(type)) |
| 4296 | .render(); |
| 4297 | }); |
| 4298 | } |
| 4299 | |
| 4300 | std::string YulUtilFunctions::zeroValueFunction(Type const& _type, bool _splitFunctionTypes) |
| 4301 | { |
no test coverage detected