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

Method shiftLeftFunctionDynamic

libsolidity/codegen/YulUtilFunctions.cpp:455–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455std::string YulUtilFunctions::shiftLeftFunctionDynamic()
456{
457 std::string functionName = "shift_left_dynamic";
458 return m_functionCollector.createFunction(functionName, [&]() {
459 return
460 Whiskers(R"(
461 function <functionName>(bits, value) -> newValue {
462 newValue :=
463 <?hasShifts>
464 shl(bits, value)
465 <!hasShifts>
466 mul(value, exp(2, bits))
467 </hasShifts>
468 }
469 )")
470 ("functionName", functionName)
471 ("hasShifts", m_evmVersion.hasBitwiseShifting())
472 .render();
473 });
474}
475
476std::string YulUtilFunctions::shiftRightFunction(size_t _numBits)
477{

Callers

nothing calls this directly

Calls 4

WhiskersClass · 0.85
renderMethod · 0.80
hasBitwiseShiftingMethod · 0.80
createFunctionMethod · 0.45

Tested by

no test coverage detected