mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 13:55:00 +00:00
JSSpecCompiler: Add if branch merging pass
It merges standalone IfBranch/ElseIfBranch nodes into IfElseIfChain nodes. This will ease CFG generation later.
This commit is contained in:
parent
092ed1cc8a
commit
4c4e1e1aed
8 changed files with 184 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <LibXML/Parser/Parser.h>
|
||||
|
||||
#include "Compiler/FunctionCallCanonicalizationPass.h"
|
||||
#include "Compiler/IfBranchMergingPass.h"
|
||||
#include "Function.h"
|
||||
#include "Parser/SpecParser.h"
|
||||
|
||||
|
@ -39,6 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|||
auto function = make_ref_counted<JSSpecCompiler::Function>(&context, spec_function.m_name, spec_function.m_algorithm.m_tree);
|
||||
|
||||
FunctionCallCanonicalizationPass(function).run();
|
||||
IfBranchMergingPass(function).run();
|
||||
|
||||
out("{}", function->m_ast);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue