1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 20:45:00 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators/JSSpecCompiler/Compiler
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
..
Passes JSSpecCompiler: Recurse into the correct subtrees in RecursiveASTVisitor 2024-01-21 14:57:10 -07:00
CompilerPass.cpp JSSpecCompiler: Make TranslationUnit fields private 2024-01-21 14:57:10 -07:00
CompilerPass.h JSSpecCompiler: Refactor CompilerPass to accept TranslationUnitRef 2023-10-26 15:45:31 -06:00
ControlFlowGraph.cpp JSSpecCompiler: Prepare for building SSA 2024-01-04 12:06:56 -07:00
ControlFlowGraph.h JSSpecCompiler: Prepare for building SSA 2024-01-04 12:06:56 -07:00
EnableGraphPointers.h JSSpecCompiler: Prepare for building SSA 2024-01-04 12:06:56 -07:00
GenericASTPass.cpp JSSpecCompiler: Recurse into the correct subtrees in RecursiveASTVisitor 2024-01-21 14:57:10 -07:00
GenericASTPass.h JSSpecCompiler: Refactor CompilerPass to accept TranslationUnitRef 2023-10-26 15:45:31 -06:00
StronglyConnectedComponents.h JSSpecCompiler: Add bare-bones DCE pass 2024-01-14 16:05:51 -07:00