.
This commit is contained in:
parent
15a09a1506
commit
3213e1deac
9 changed files with 90 additions and 3 deletions
17
buildtypes/test-multithreaded.txt
Normal file
17
buildtypes/test-multithreaded.txt
Normal 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
|
||||||
|
|
||||||
41
calculate_assignment_simplifications.c
Normal file
41
calculate_assignment_simplifications.c
Normal 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
|
||||||
11
calculate_assignment_simplifications.h
Normal file
11
calculate_assignment_simplifications.h
Normal 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
|
||||||
|
|
@ -548,6 +548,11 @@ void calculate_simplifications(
|
||||||
|
|
||||||
if (!flags->quiet && flags->verbose)
|
if (!flags->quiet && flags->verbose)
|
||||||
{
|
{
|
||||||
|
printf(""
|
||||||
|
"note: the usual verbosity is disabled in the "
|
||||||
|
"multithreaded section" "\n"
|
||||||
|
"");
|
||||||
|
|
||||||
flag_no_verbose.verbose = false;
|
flag_no_verbose.verbose = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
4
debug.c
Normal file
4
debug.c
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
int debug_depth = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -170,7 +170,7 @@ struct simplifications* get_cached_simplifications(const struct cmdln_flags* fla
|
||||||
|
|
||||||
snprintf(buffer, PATH_MAX, "/proc/self/fd/%d", fd);
|
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);
|
printf("unlink(%s): %m" "\n", path.data);
|
||||||
|
|
||||||
|
|
|
||||||
13
print.c
13
print.c
|
|
@ -167,8 +167,17 @@ static void helper(
|
||||||
|
|
||||||
case ek_assignment:
|
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;
|
break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
0
update_simplifications.c
Normal file
0
update_simplifications.c
Normal file
0
update_simplifications.h
Normal file
0
update_simplifications.h
Normal file
Loading…
Reference in a new issue