XXX: A crude hack to bring down the number of types for a

GENRIC kernel below 2**15-1 (from ~34000 to ~29800).

Remove the type attributes "volatile", "const" and "restrict",
for DTRACE these attributes are of little value.
This commit is contained in:
hannken 2019-07-16 07:27:35 +00:00
parent 9112aa41cd
commit bb86f86314
1 changed files with 51 additions and 0 deletions

View File

@ -41,6 +41,7 @@
#include "ctftools.h"
#include "hash.h"
#include "memory.h"
#include "traverse.h"
/*
* Due to 4432619, the 6.1 compiler will sometimes incorrectly generate pointer
@ -320,6 +321,55 @@ fix_kmutex_private(tdata_t *td, size_t ptrsize)
}
}
/*
* XXX: A crude hack to bring down the number of types for a
* GENRIC kernel below 2**15-1 (from ~34000 to ~29800).
*
* Remove the type attributes "volatile", "const" and "restrict",
* for DTRACE these attributes are of little value.
*/
static int
fix_kill_attr_cb(tdesc_t *tdp, tdesc_t **tdpp, void *private __unused)
{
while (tdp->t_type == VOLATILE ||
tdp->t_type == RESTRICT ||
tdp->t_type == CONST)
tdp = tdp->t_tdesc;
*tdpp = tdp;
return 1;
}
static tdtrav_cb_f fix_kill_attr_tab[] = {
NULL,
NULL, /* intrinsic */
NULL, /* pointer */
NULL, /* reference */
NULL, /* array */
NULL, /* function */
NULL, /* struct */
NULL, /* union */
NULL, /* class */
NULL, /* enum */
NULL , /* forward */
NULL, /* typedef */
NULL, /* typedef unres */
fix_kill_attr_cb, /* volatile */
fix_kill_attr_cb, /* const */
fix_kill_attr_cb, /* restrict */
};
static void
fix_kill_attr(tdata_t *td, size_t ptrsize)
{
(void) iitraverse_hash(td->td_iihash, &td->td_curvgen,
fix_kill_attr_tab, NULL, NULL, NULL);
}
#endif /* __NetBSD__ */
void
@ -328,5 +378,6 @@ cvt_fixups(tdata_t *td, size_t ptrsize)
fix_small_cpu_struct(td, ptrsize);
#ifdef __NetBSD__
fix_kmutex_private(td, ptrsize);
fix_kill_attr(td, ptrsize);
#endif
}