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

Method decrementWrappingFunction

libsolidity/codegen/YulUtilFunctions.cpp:4197–4214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4195}
4196
4197std::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
4216std::string YulUtilFunctions::incrementCheckedFunction(Type const& _type)
4217{

Callers 1

visitMethod · 0.80

Calls 5

WhiskersClass · 0.85
identifierMethod · 0.80
renderMethod · 0.80
categoryMethod · 0.45
createFunctionMethod · 0.45

Tested by

no test coverage detected