Skip to content

Commit

Permalink
fix: Moved optimization phase after LLVM IR debugging print
Browse files Browse the repository at this point in the history
  • Loading branch information
alinalihassan committed May 6, 2022
1 parent 1ddba5d commit c785973
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ int main(int argc, char **argv) {
auto codegen = std::make_unique<Codegen>(std::move(parser), options->file, options->jit, true);
codegen->Run();)

// Optimization
TIMEIT("Optimizing", codegen->Optimize(llvm::PassBuilder::OptimizationLevel::O3);)

if (options->debug) {
print(DEBUG, "LLVM IR: \n");
codegen->Dump();
}

// Optimization
TIMEIT("Optimizing", codegen->Optimize(llvm::PassBuilder::OptimizationLevel::O3);)

int exit_code = 0;
if (!options->jit) {
// Compile to Object File
Expand Down

0 comments on commit c785973

Please sign in to comment.