Skip to content

Commit

Permalink
feat: Finished compilation step, fixed jit being executed regardless
Browse files Browse the repository at this point in the history
  • Loading branch information
alinalihassan committed Mar 7, 2022
1 parent 25eaba9 commit ba47c6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ int main(int argc, char **argv) {
// print(DEBUG, "LLVM IR: \n");
// codegen->Dump();

int exit_code = 0;
if (!options->jit) {
// Compile to Object File
TIMEIT("Writing Object File", codegen->WriteToObjectFile(options->output);)
Expand All @@ -65,9 +66,10 @@ int main(int argc, char **argv) {

// Remove Object File
TIMEIT("Remove Object File", remove(fmt::format("{}.o", options->output).c_str());)
} else {
// Executing
TIMEIT("Execution", exit_code = codegen->JIT(std::move(codegen->Modules));)
}
// Executing
TIMEIT("Execution", int exit_code = codegen->JIT(std::move(codegen->Modules)););

if (options->debug)
print(DEBUG, "Total -> {:.2f} ms\n", total);
Expand Down

0 comments on commit ba47c6c

Please sign in to comment.