mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
JSSpecCompiler: Prepare for building SSA
This commit introduces NamedVariableDeclaration and SSAVariableDeclaration and allows storing both of them in Variable node. Also, it adds additional structures in FunctionDefinition and BasicBlock, which will be used to store SSA form related information.
This commit is contained in:
committed by
Andrew Kaster
parent
23164bc570
commit
0aeb7a26e9
@@ -28,8 +28,15 @@ FunctionDeclaration::FunctionDeclaration(StringView name)
|
||||
FunctionDefinition::FunctionDefinition(StringView name, Tree ast)
|
||||
: FunctionDeclaration(name)
|
||||
, m_ast(move(ast))
|
||||
, m_return_value(make_ref_counted<VariableDeclaration>("$return"sv))
|
||||
, m_return_value(make_ref_counted<NamedVariableDeclaration>("$return"sv))
|
||||
{
|
||||
}
|
||||
|
||||
void FunctionDefinition::reindex_ssa_variables()
|
||||
{
|
||||
size_t index = 0;
|
||||
for (auto const& var : m_local_ssa_variables)
|
||||
var->m_index = index++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user