mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 06:52:52 +00:00
JSSpecCompiler: Add control flow graph simplification pass
It removes empty `BasicBlock`s with an unconditional jump continuation and then removes unreferenced blocks from the graph.
This commit is contained in:
parent
475ef6965a
commit
12072dbac5
Notes:
sideshowbarker
2024-07-17 03:27:40 +09:00
Author: https://github.com/DanShaders
Commit: 12072dbac5
Pull-request: https://github.com/SerenityOS/serenity/pull/22289
Reviewed-by: https://github.com/ADKaster ✅
7 changed files with 215 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <LibMain/Main.h>
|
||||
|
||||
#include "Compiler/Passes/CFGBuildingPass.h"
|
||||
#include "Compiler/Passes/CFGSimplificationPass.h"
|
||||
#include "Compiler/Passes/FunctionCallCanonicalizationPass.h"
|
||||
#include "Compiler/Passes/IfBranchMergingPass.h"
|
||||
#include "Compiler/Passes/ReferenceResolvingPass.h"
|
||||
|
@ -106,6 +107,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
pipeline.add_compilation_pass<IfBranchMergingPass>();
|
||||
pipeline.add_compilation_pass<ReferenceResolvingPass>();
|
||||
pipeline.add_compilation_pass<CFGBuildingPass>();
|
||||
pipeline.add_compilation_pass<CFGSimplificationPass>();
|
||||
|
||||
pipeline.for_each_step_in(passes_to_dump_ast, [](CompilationStepWithDumpOptions& step) {
|
||||
step.dump_ast = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue