|
@@ -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);
|
|
|
}
|