This commit is contained in:
Zander Thannhauser 2025-06-30 09:03:33 -05:00
parent 15a09a1506
commit 3213e1deac
9 changed files with 90 additions and 3 deletions

View file

@ -0,0 +1,17 @@
-g
-D _GNU_SOURCE
-D TEST_BUILD
-D MULTITHREADED_BUILD
-I .
-Werror -Wall -Wextra -Wstrict-prototypes -Wfatal-errors
-Wno-unused
-lreadline

View file

@ -0,0 +1,41 @@
#if 0
#include <limits.h>
#include <stdio.h>
#include <assert.h>
#include <debug.h>
#include <defines.h>
#include <cmdln.h>
#include "simplifications.h"
#include "calculate_simplifications.h"
#include "calculate_assignment_simplifications.h"
void calculate_assignment_simplifications(
const struct cmdln_flags* flags,
struct simplifications* simps)
{
ENTER;
struct cmdln_flags flag_no_assign = *flags;
flag_no_assign.use_operators.assignment = false;
for (int a = 0; a < N; a++)
{
simps->with_vars[a] = \
calculate_simplifications(
/* cmdln flags: */ &flag_no_assign,
/* have extra variable? */ true,
/* extra variable value: */ a);
}
simps->main = calculate_simplifications(flags, false, 0);
EXIT;
}
#endif

View file

@ -0,0 +1,11 @@
#if 0
struct cmdln_flags;
struct simplifications;
void calculate_assignment_simplifications(
const struct cmdln_flags* flags,
struct simplifications* simps);
#endif

View file

@ -548,6 +548,11 @@ void calculate_simplifications(
if (!flags->quiet && flags->verbose)
{
printf(""
"note: the usual verbosity is disabled in the "
"multithreaded section" "\n"
"");
flag_no_verbose.verbose = false;
}

4
debug.c Normal file
View file

@ -0,0 +1,4 @@
int debug_depth = 0;

View file

@ -170,7 +170,7 @@ struct simplifications* get_cached_simplifications(const struct cmdln_flags* fla
snprintf(buffer, PATH_MAX, "/proc/self/fd/%d", fd);
if (unlink(path.data) < 0)
if (unlink(path.data) < 0 && errno != ENOENT)
{
printf("unlink(%s): %m" "\n", path.data);

13
print.c
View file

@ -167,8 +167,17 @@ static void helper(
case ek_assignment:
{
TODO;
const char *start = "", *end = "";
if (print_with_color)
{
start = operator_colors[depth % 10];
end = RESET_ESCAPE;
}
printf("%s(a = ..., ...)%s", start, end);
break;
};
}

0
update_simplifications.c Normal file
View file

0
update_simplifications.h Normal file
View file