Squashing file write bugs
This commit is contained in:
18
main.cpp
18
main.cpp
@@ -160,7 +160,7 @@ int main(int argument_count, char **arguments){
|
||||
Scratch scratch;
|
||||
String name = string_fmt(scratch, "%s.kl", arguments[1]);
|
||||
String c_filename = string_fmt(scratch, "%s.c", arguments[1]);
|
||||
String compiler_call = string_fmt(scratch, "clang.exe %s.c -g -o %s.exe", arguments[1], arguments[1]);
|
||||
|
||||
String run_program = string_fmt(scratch, "%s.exe", arguments[1]);
|
||||
|
||||
Array<String> files = {scratch};
|
||||
@@ -186,10 +186,18 @@ int main(int argument_count, char **arguments){
|
||||
resolve_everything_in_module(module);
|
||||
String result = end_compilation();
|
||||
assert(os_write_file("program.c"_s, result));
|
||||
printf("\nTotal time = %f", os_time() - total_time);
|
||||
printf("\nTotal parsing = %f", parsing_time_end - parsing_time_begin);
|
||||
printf("\nTotal resolving = %f", resolving_time_end - resolving_time_begin);
|
||||
printf("\nTotal generatin = %f", generating_time_end - generating_time_begin);
|
||||
{
|
||||
Scratch scratch;
|
||||
F64 begin = os_time();
|
||||
String compiler_call = string_fmt(scratch, "clang.exe program.c -Wall -Wno-parentheses-equality -g -o a.exe -lgdi32 -luser32");
|
||||
system((const char *)compiler_call.str);
|
||||
printf("\nclang = %f", os_time() - begin);
|
||||
}
|
||||
|
||||
printf("\ntotal = %f", os_time() - total_time);
|
||||
printf("\nparsing = %f", parsing_time_end - parsing_time_begin);
|
||||
printf("\nresolving = %f", resolving_time_end - resolving_time_begin);
|
||||
printf("\ngeneratin = %f", generating_time_end - generating_time_begin);
|
||||
#endif
|
||||
__debugbreak();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user