1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 18:04:59 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Compiler/Passes
Dan Klishch b4a9fde756 JSSpecCompiler: Recurse into the correct subtrees in RecursiveASTVisitor
RecursiveASTVisitor was recursing into the subtrees of an old root if it
was changed in on_entry callback. Fix that by querying root pointer just
after on_entry callback returns. While on it, also use
`AK::TemporaryChange` instead of setting `m_current_subtree_pointer`
manually.

As it turns out, `FunctionCallCanonicalizationPass` was relying on being
able to replace tree on entry, and the bug in RecursiveASTVisitor made
the pass to not fully canonicalize nested function calls.

The changes to GenericASTPass.cpp alone are enough to fix the problem
but it is canonical (for some definition of canonicity) to only change
trees in on_leave. Therefore, the commit also switches
FunctionCallCanonicalizationPass to on_leave callback.

A test for this fix and one from the previous commit is also included.
2024-01-21 14:57:10 -07:00
..
CFGBuildingPass.cpp JSSpecCompiler: Save references to return value and function arguments 2024-01-14 16:05:51 -07:00
CFGBuildingPass.h JSSpecCompiler: Add control flow building pass 2023-12-14 09:06:05 -07:00
CFGSimplificationPass.cpp JSSpecCompiler: Add control flow graph simplification pass 2024-01-04 12:06:56 -07:00
CFGSimplificationPass.h JSSpecCompiler: Add control flow graph simplification pass 2024-01-04 12:06:56 -07:00
DeadCodeEliminationPass.cpp JSSpecCompiler: Add bare-bones DCE pass 2024-01-14 16:05:51 -07:00
DeadCodeEliminationPass.h JSSpecCompiler: Add bare-bones DCE pass 2024-01-14 16:05:51 -07:00
FunctionCallCanonicalizationPass.cpp JSSpecCompiler: Recurse into the correct subtrees in RecursiveASTVisitor 2024-01-21 14:57:10 -07:00
FunctionCallCanonicalizationPass.h JSSpecCompiler: Recurse into the correct subtrees in RecursiveASTVisitor 2024-01-21 14:57:10 -07:00
IfBranchMergingPass.cpp JSSpecCompiler: Move passes to Passes subdirectory of Compiler/ 2023-10-26 15:45:31 -06:00
IfBranchMergingPass.h JSSpecCompiler: Provide an adequate command line interface 2023-10-26 15:45:31 -06:00
ReferenceResolvingPass.cpp JSSpecCompiler: Store arguments in declaration instead of definition 2024-01-21 14:57:10 -07:00
ReferenceResolvingPass.h JSSpecCompiler: Save references to return value and function arguments 2024-01-14 16:05:51 -07:00
SSABuildingPass.cpp JSSpecCompiler: Store arguments in declaration instead of definition 2024-01-21 14:57:10 -07:00
SSABuildingPass.h JSSpecCompiler: Add SSA form building pass 2024-01-12 16:22:22 -07:00