Skip to content

Commit

Permalink
Update to immutable AST class
Browse files Browse the repository at this point in the history
  • Loading branch information
r0qs committed Aug 13, 2024
1 parent b8172c2 commit a6f3a88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libyul/YulStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,15 @@ Json YulStack::astJson() const
Json YulStack::cfgJson() const
{
yulAssert(m_parserResult, "");
yulAssert(m_parserResult->code, "");
yulAssert(m_parserResult->hasCode(), "");
yulAssert(m_parserResult->analysisInfo, "");
// FIXME: we should not regenerate the cfg, but for now this is sufficient for testing purposes
auto exportCFGFromObject = [&](Object const& _object) -> Json {
// NOTE: The block Ids are reset for each object
auto ssaCfg = SSAControlFlowGraphBuilder::build(
*_object.analysisInfo.get(),
languageToDialect(m_language, m_evmVersion),
*_object.code.get()
_object.code()->root()
);
YulControlFlowGraphExporter exporter(*ssaCfg);
//std::unique_ptr<CFG> cfg = ControlFlowGraphBuilder::build(
Expand Down
2 changes: 1 addition & 1 deletion test/libyul/SSAControlFlowGraphTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ TestCase::TestResult SSAControlFlowGraphTest::run(std::ostream& _stream, std::st
auto ssaCfg = SSAControlFlowGraphBuilder::build(
info,
*m_dialect,
*object->code
object->code()->root()
);

output << "digraph SSACFG {\nnodesep=0.7;\nnode[shape=box];\n\n";
Expand Down

0 comments on commit a6f3a88

Please sign in to comment.