From 5efdc23006f33d0d160522635fe487f0af57ce95 Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 19 Jul 2022 15:25:53 +0200 Subject: [PATCH] Benchmark Parsing and IR Generation --- src/sapphire.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sapphire.cpp b/src/sapphire.cpp index 6cd36a2..b2c4cf3 100644 --- a/src/sapphire.cpp +++ b/src/sapphire.cpp @@ -35,11 +35,18 @@ int main(int argc, char** argv) auto parser = Parser::new_parser(result); - auto ast = parser->parse(); + std::shared_ptr ast; + { + benchmark("Parsing"); + ast = parser->parse(); + } IRBuilder builder; - builder.create_main_function(ast); + { + benchmark("IR generation"); + builder.create_main_function(ast); + } std::cout << builder.getGeneratedIR(); }