File tree 7 files changed +33
-4
lines changed
7 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -227,8 +227,8 @@ static GTY(()) tree ix86_builtins[(int) IX86_BUILTIN_MAX + 1];
227
227
228
228
struct builtin_isa ix86_builtins_isa[(int ) IX86_BUILTIN_MAX];
229
229
230
- static void
231
- clear_builtin_types (void )
230
+ void
231
+ ix86_cleanup_builtins (void )
232
232
{
233
233
for (int i = 0 ; i < IX86_BT_LAST_CPTR + 1 ; i++)
234
234
ix86_builtin_type_tab[i] = NULL ;
@@ -1490,8 +1490,6 @@ ix86_init_builtins (void)
1490
1490
{
1491
1491
tree ftype, decl;
1492
1492
1493
- clear_builtin_types ();
1494
-
1495
1493
ix86_init_builtin_types ();
1496
1494
1497
1495
/* Builtins to get CPU type and features. */
Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ extern builtin_isa ix86_builtins_isa[(int) IX86_BUILTIN_MAX];
318
318
tree ix86_builtin_vectorized_function (unsigned int fn , tree type_out ,
319
319
tree type_in );
320
320
void ix86_init_builtins (void );
321
+ void ix86_cleanup_builtins (void );
321
322
tree ix86_vectorize_builtin_gather (const_tree mem_vectype ,
322
323
const_tree index_type , int scale );
323
324
tree ix86_builtin_decl (unsigned code , bool );
Original file line number Diff line number Diff line change @@ -26538,6 +26538,8 @@ static const scoped_attribute_specs *const ix86_attribute_table[] =
26538
26538
26539
26539
#undef TARGET_INIT_BUILTINS
26540
26540
#define TARGET_INIT_BUILTINS ix86_init_builtins
26541
+ #undef TARGET_CLEANUP_BUILTINS
26542
+ #define TARGET_CLEANUP_BUILTINS ix86_cleanup_builtins
26541
26543
#undef TARGET_BUILTIN_DECL
26542
26544
#define TARGET_BUILTIN_DECL ix86_builtin_decl
26543
26545
#undef TARGET_EXPAND_BUILTIN
Original file line number Diff line number Diff line change @@ -12112,6 +12112,13 @@ only language front ends that use those two functions will call
12112
12112
@samp{TARGET_INIT_BUILTINS}.
12113
12113
@end deftypefn
12114
12114
12115
+ @deftypefn {Target Hook} void TARGET_CLEANUP_BUILTINS (void)
12116
+ Define this hook if you have any machine-specific built-in functions
12117
+ that need to be cleaned up. It should be a function that performs the
12118
+ necessary cleanup so that a second compilation in the same process via
12119
+ the jit frontend will not fail.
12120
+ @end deftypefn
12121
+
12115
12122
@deftypefn {Target Hook} tree TARGET_BUILTIN_DECL (unsigned @var{code}, bool @var{initialize_p})
12116
12123
Define this hook if you have any machine-specific built-in functions
12117
12124
that need to be defined. It should be a function that returns the
Original file line number Diff line number Diff line change @@ -7868,6 +7868,8 @@ to by @var{ce_info}.
7868
7868
7869
7869
@hook TARGET_INIT_BUILTINS
7870
7870
7871
+ @hook TARGET_CLEANUP_BUILTINS
7872
+
7871
7873
@hook TARGET_BUILTIN_DECL
7872
7874
7873
7875
@hook TARGET_EXPAND_BUILTIN
Original file line number Diff line number Diff line change @@ -1088,6 +1088,12 @@ jit_langhook_init (void)
1088
1088
return true ;
1089
1089
}
1090
1090
1091
+ void
1092
+ jit_langhook_finish (void )
1093
+ {
1094
+ targetm.cleanup_builtins ();
1095
+ }
1096
+
1091
1097
static void
1092
1098
jit_langhook_parse_file (void )
1093
1099
{
@@ -1455,6 +1461,9 @@ jit_langhook_eh_personality (void)
1455
1461
#undef LANG_HOOKS_INIT
1456
1462
#define LANG_HOOKS_INIT jit_langhook_init
1457
1463
1464
+ #undef LANG_HOOKS_FINISH
1465
+ #define LANG_HOOKS_FINISH jit_langhook_finish
1466
+
1458
1467
#undef LANG_HOOKS_PARSE_FILE
1459
1468
#define LANG_HOOKS_PARSE_FILE jit_langhook_parse_file
1460
1469
Original file line number Diff line number Diff line change @@ -2450,6 +2450,16 @@ only language front ends that use those two functions will call\n\
2450
2450
void, (void),
2451
2451
hook_void_void)
2452
2452
2453
+ /* Clean up target-specific built-in functions. */
2454
+ DEFHOOK
2455
+ (cleanup_builtins,
2456
+ "Define this hook if you have any machine-specific built-in functions\n\
2457
+ that need to be cleaned up. It should be a function that performs the\n\
2458
+ necessary cleanup so that a second compilation in the same process via\n\
2459
+ the jit frontend will not fail.",
2460
+ void, (void),
2461
+ hook_void_void)
2462
+
2453
2463
/* Initialize (if INITIALIZE_P is true) and return the target-specific
2454
2464
built-in function decl for CODE.
2455
2465
Return NULL if that is not possible. Return error_mark_node if CODE
You can’t perform that action at this time.
0 commit comments