Skip to content

Commit

Permalink
Remove unecessary fields from Yul CFG Json export
Browse files Browse the repository at this point in the history
  • Loading branch information
r0qs committed Oct 14, 2024
1 parent e733c09 commit 94bf7df
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions libyul/YulControlFlowGraphExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ Json YulControlFlowGraphExporter::exportBlock(SSACFG const& _cfg, SSACFG::BlockI
Json exitBlockJson = Json::object();
std::visit(util::GenericVisitor{
[&](SSACFG::BasicBlock::MainExit const&) {
exitBlockJson["targets"] = { "Block" + std::to_string(_blockId.value) };
exitBlockJson["type"] = "MainExit";
},
[&](SSACFG::BasicBlock::Jump const& _jump)
Expand All @@ -115,12 +114,10 @@ Json YulControlFlowGraphExporter::exportBlock(SSACFG const& _cfg, SSACFG::BlockI
_addChild(_conditionalJump.nonZero);
},
[&](SSACFG::BasicBlock::FunctionReturn const& _return) {
exitBlockJson["instructions"] = toJson(_cfg, _return.returnValues);
exitBlockJson["targets"] = { "Block" + std::to_string(_blockId.value) };
exitBlockJson["returnValues"] = toJson(_cfg, _return.returnValues);
exitBlockJson["type"] = "FunctionReturn";
},
[&](SSACFG::BasicBlock::Terminated const&) {
exitBlockJson["targets"] = { "Block" + std::to_string(_blockId.value) };
exitBlockJson["type"] = "Terminated";
},
[&](SSACFG::BasicBlock::JumpTable const&) {
Expand Down

0 comments on commit 94bf7df

Please sign in to comment.