Skip to content

Commit 994b602

Browse files
committed
rebase
1 parent a2b6f6f commit 994b602

File tree

8 files changed

+10
-12
lines changed

8 files changed

+10
-12
lines changed

libyul/backends/evm/SSACFGEVMCodeTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ std::vector<StackTooDeepError> SSACFGEVMCodeTransform::run(
7272
std::cout << "--------------------\n";
7373
std::cout << "Running SSACFGEVMCodeTransform" << std::endl;
7474
std::cout << "--------------------\n";
75-
fmt::print("{}\n", _liveness.toDot(nullptr)); // &mainCodeTransform.m_stackLayout
75+
fmt::print("{}\n", _liveness.toDot());
7676
std::fflush(nullptr);
7777
}
7878

libyul/backends/evm/SSACFGStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ std::string ssa::slotToString(StackSlot const& _slot)
3030
{
3131
return std::visit(util::GenericVisitor{
3232
[&](SSACFG::ValueId const _value) {
33-
return "v" + std::to_string(_value.value);
33+
return "v" + std::to_string(_value.value());
3434
},
3535
[](AbstractAssembly::LabelID const _label) {
3636
return "LABEL[" + std::to_string(_label) + "]";

libyul/backends/evm/SSACFGStack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct SlotCanBeFreelyGenerated
6969
bool operator()(Slot const& _slot) const
7070
{
7171
if (std::holds_alternative<SSACFG::ValueId>(_slot))
72-
return m_cfg->isLiteralValue(std::get<SSACFG::ValueId>(_slot));
72+
return std::get<SSACFG::ValueId>(_slot).isLiteral();
7373
return std::holds_alternative<JunkSlot>(_slot) || std::holds_alternative<FunctionReturnLabel>(_slot);
7474
}
7575

libyul/backends/evm/ssa/ControlFlow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ControlFlowLiveness::ControlFlowLiveness(ControlFlow const& _controlFlow):
2727
cfgLiveness(_controlFlow.functionGraphs | ranges::views::transform([](auto const& _cfg) { return std::make_unique<LivenessAnalysis>(*_cfg); }) | ranges::to<std::vector>)
2828
{ }
2929

30-
std::string ControlFlowLiveness::toDot(SSACFGStackLayout const* _stackLayout) const
30+
std::string ControlFlowLiveness::toDot() const
3131
{
32-
return controlFlow.get().toDot(this, _stackLayout);
32+
return controlFlow.get().toDot(this);
3333
}

libyul/backends/evm/ssa/OperationForwardShuffler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class OperationForwardShuffler
5656
else
5757
++histogramArgs[slot];
5858
if (_stack.size() - i - 1 < ReachableStackDepth)
59-
++histogramReachable[slot]++;
59+
++histogramReachable[slot];
6060
}
6161
}
6262

libyul/backends/evm/ssa/SSACFG.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,6 @@ class SSACFG
279279
return *idx;
280280
}
281281

282-
std::string valueDescription(ValueId const& _valueId) const;
283-
284282
std::string toDot(
285283
bool _includeDiGraphDefinition=true,
286284
std::optional<size_t> _functionIndex=std::nullopt,

libyul/backends/evm/ssa/Stack.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ std::string slotToString(StackSlot const& _slot)
4444
std::string slotToString(StackSlot const& _slot, SSACFG const& _cfg)
4545
{
4646
if (_slot.kind() == StackSlot::Kind::ValueID)
47-
return _cfg.valueDescription(_slot.valueID());
47+
return _slot.valueID().str(_cfg);
4848

4949
return slotToString(_slot);
5050
}
5151

52-
std::string stackToString(Stack<>::Data const& _stackData)
52+
std::string stackToString(StackData const& _stackData)
5353
{
5454
auto const numJunk = junkTailSize(_stackData);
5555
if (numJunk > 0)
@@ -65,7 +65,7 @@ std::string stackToString(Stack<>::Data const& _stackData)
6565
);
6666
}
6767

68-
std::string stackToString(Stack<>::Data const& _stackData, SSACFG const& _cfg)
68+
std::string stackToString(StackData const& _stackData, SSACFG const& _cfg)
6969
{
7070
auto const numJunk = junkTailSize(_stackData);
7171
if (numJunk > 0)

test/libyul/Misctest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE(yo)
145145
<< fmt::format("{{ {} }} + ", fmt::join(r, ", "))
146146
<< fmt::format("[ {} ]\n", fmt::join(args | t2, ", "));
147147
}
148-
ssa::OperationForwardShuffler<TestStack>::shuffle(*stack, args, liveness, true);
148+
ssa::OperationForwardShuffler<PrintCallback>::shuffle(*stack, args, liveness, true, stack->size());
149149
std::cout << "--- fin ---" << std::endl;
150150
std::cout << ssa::stackToString(stack->data(), *cfg) << std::endl;
151151
final = stack->data();

0 commit comments

Comments
 (0)