mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
JSSpecCompiler: Make TranslationUnit fields private
For some reason I was afraid to add trivial accessors to classes in earlier PRs, so we now have dozens of classes with public fields. I'm not exactly looking forward to refactoring them all at once but I'll do so gradually.
This commit is contained in:
parent
a2f7849238
commit
3aec6952a2
8 changed files with 46 additions and 24 deletions
|
@ -120,8 +120,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
step.dump_cfg = true;
|
||||
});
|
||||
|
||||
TranslationUnit translation_unit;
|
||||
translation_unit.filename = filename;
|
||||
TranslationUnit translation_unit(filename);
|
||||
|
||||
// Functions referenced in DifferenceISODate
|
||||
// TODO: This is here just for testing. In a long run, we need some place, which is not
|
||||
|
@ -139,14 +138,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
if (step.dump_ast) {
|
||||
outln(stderr, "===== AST after {} =====", step.step->name());
|
||||
for (auto const& function : translation_unit.functions_to_compile) {
|
||||
for (auto const& function : translation_unit.functions_to_compile()) {
|
||||
outln(stderr, "{}({}):", function->m_name, function->m_argument_names);
|
||||
outln(stderr, "{}", function->m_ast);
|
||||
}
|
||||
}
|
||||
if (step.dump_cfg && translation_unit.functions_to_compile[0]->m_cfg != nullptr) {
|
||||
if (step.dump_cfg && translation_unit.functions_to_compile()[0]->m_cfg != nullptr) {
|
||||
outln(stderr, "===== CFG after {} =====", step.step->name());
|
||||
for (auto const& function : translation_unit.functions_to_compile) {
|
||||
for (auto const& function : translation_unit.functions_to_compile()) {
|
||||
outln(stderr, "{}({}):", function->m_name, function->m_argument_names);
|
||||
outln(stderr, "{}", *function->m_cfg);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue