Skip to content

Commit

Permalink
cc: remove preprocessed file before dumping AST
Browse files Browse the repository at this point in the history
  • Loading branch information
atirut-w committed Aug 14, 2024
1 parent d4c22e6 commit 3604422
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/cc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@ int main(int argc, char *argv[])
cerr << "BUG: ANTLR syntax error. mayhapes C version newer than C11?" << endl;
return 1;
}

if (!keep_intermediate)
{
filesystem::remove(intermediate.replace_extension(".i"));
}
if (args->get<bool>("--dump-ast"))
{
cout << tree->toStringTree(&parser, true) << endl;
return 0;
}

if (!keep_intermediate)
{
filesystem::remove(intermediate.replace_extension(".i"));
}
std::ofstream output(intermediate.replace_extension(".s"));

Analyzer analyzer;
Expand Down

0 comments on commit 3604422

Please sign in to comment.