Change noinline to dontinline (#312)

We defined `noinline` as an abbreviation for the longer version
`__attribute__((__noinline__))` which caused name clashes since
third party codebases often write it as `__attribute__((noinline))`.
This commit is contained in:
Gautham 2021-11-13 04:42:18 +05:30 committed by GitHub
parent ca611efc43
commit 6f658f058b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 122 additions and 122 deletions

View file

@ -2247,7 +2247,7 @@ static void OnMovslq(struct As *a, struct Slice s) {
EmitModrm(a, reg, modrm, disp);
}
static noinline void OpAluImpl(struct As *a, struct Slice opname, int op) {
static dontinline void OpAluImpl(struct As *a, struct Slice opname, int op) {
int reg, modrm, imm, disp;
if (IsPunct(a, a->i, '$')) { // imm -> reg/modrm
++a->i;
@ -2270,11 +2270,11 @@ static noinline void OpAluImpl(struct As *a, struct Slice opname, int op) {
}
}
static noinline void OpAlu(struct As *a, struct Slice opname, int op) {
static dontinline void OpAlu(struct As *a, struct Slice opname, int op) {
OpAluImpl(a, opname, op);
}
static noinline void OpBsuImpl(struct As *a, struct Slice opname, int op) {
static dontinline void OpBsuImpl(struct As *a, struct Slice opname, int op) {
int reg, modrm, imm, disp;
if (IsPunct(a, a->i, '$')) {
++a->i;
@ -2303,11 +2303,11 @@ static noinline void OpBsuImpl(struct As *a, struct Slice opname, int op) {
EmitExpr(a, imm, R_X86_64_8, EmitByte);
}
static noinline void OpBsu(struct As *a, struct Slice opname, int op) {
static dontinline void OpBsu(struct As *a, struct Slice opname, int op) {
OpBsuImpl(a, opname, op);
}
static noinline int OpF6Impl(struct As *a, struct Slice s, int reg) {
static dontinline int OpF6Impl(struct As *a, struct Slice s, int reg) {
int modrm, imm, disp;
modrm = ParseModrm(a, &disp);
reg |= GetOpSize(a, s, modrm, 1) << 3;
@ -2315,7 +2315,7 @@ static noinline int OpF6Impl(struct As *a, struct Slice s, int reg) {
return reg;
}
static noinline int OpF6(struct As *a, struct Slice s, int reg) {
static dontinline int OpF6(struct As *a, struct Slice s, int reg) {
return OpF6Impl(a, s, reg);
}
@ -2516,7 +2516,7 @@ static bool IsSsePrefix(int c) {
return c == 0x66 || c == 0xF2 || c == 0xF3; // must come before rex
}
static noinline void OpSseImpl(struct As *a, int op) {
static dontinline void OpSseImpl(struct As *a, int op) {
int reg, modrm, disp;
if (IsSsePrefix((op & 0xff000000) >> 24)) {
EmitByte(a, (op & 0xff000000) >> 24);
@ -2532,11 +2532,11 @@ static noinline void OpSseImpl(struct As *a, int op) {
EmitRexOpModrm(a, op, reg, modrm, disp, 0);
}
static noinline void OpSse(struct As *a, int op) {
static dontinline void OpSse(struct As *a, int op) {
OpSseImpl(a, op);
}
static noinline void OpSseIbImpl(struct As *a, int op) {
static dontinline void OpSseIbImpl(struct As *a, int op) {
int imm;
ConsumePunct(a, '$');
imm = Parse(a);
@ -2545,7 +2545,7 @@ static noinline void OpSseIbImpl(struct As *a, int op) {
EmitExpr(a, imm, R_X86_64_8, EmitByte);
}
static noinline void OpSseIb(struct As *a, int op) {
static dontinline void OpSseIb(struct As *a, int op) {
OpSseIbImpl(a, op);
}
@ -2611,7 +2611,7 @@ static void OnRet(struct As *a, struct Slice s) {
}
}
static noinline void OpCmovccImpl(struct As *a, int cc) {
static dontinline void OpCmovccImpl(struct As *a, int cc) {
int reg, modrm, disp;
modrm = ParseModrm(a, &disp);
ConsumeComma(a);
@ -2619,17 +2619,17 @@ static noinline void OpCmovccImpl(struct As *a, int cc) {
EmitRexOpModrm(a, 0x0F40 | cc, reg, modrm, disp, 0);
}
static noinline void OpCmovcc(struct As *a, int cc) {
static dontinline void OpCmovcc(struct As *a, int cc) {
OpCmovccImpl(a, cc);
}
static noinline void OpSetccImpl(struct As *a, int cc) {
static dontinline void OpSetccImpl(struct As *a, int cc) {
int modrm, disp;
modrm = ParseModrm(a, &disp);
EmitRexOpModrm(a, 0x0F90 | cc, 6, modrm, disp, 0);
}
static noinline void OpSetcc(struct As *a, int cc) {
static dontinline void OpSetcc(struct As *a, int cc) {
OpSetccImpl(a, cc);
}
@ -2662,7 +2662,7 @@ static void OnCall(struct As *a, struct Slice s) {
}
}
static noinline void OpJmpImpl(struct As *a, int cc) {
static dontinline void OpJmpImpl(struct As *a, int cc) {
int modrm, disp;
if (IsPunct(a, a->i, '*')) ++a->i;
modrm = RemoveRexw(ParseModrm(a, &disp));
@ -2682,17 +2682,17 @@ static noinline void OpJmpImpl(struct As *a, int cc) {
}
}
static noinline void OpJmp(struct As *a, int cc) {
static dontinline void OpJmp(struct As *a, int cc) {
OpJmpImpl(a, cc);
}
static noinline void OpFpu1Impl(struct As *a, int op, int reg) {
static dontinline void OpFpu1Impl(struct As *a, int op, int reg) {
int modrm, disp;
modrm = ParseModrm(a, &disp);
EmitRexOpModrm(a, op, reg, modrm, disp, 0);
}
static noinline void OpFpu1(struct As *a, int op, int reg) {
static dontinline void OpFpu1(struct As *a, int op, int reg) {
OpFpu1Impl(a, op, reg);
}
@ -2711,7 +2711,7 @@ static void OnBswap(struct As *a, struct Slice s) {
EmitByte(a, 0310 | srm & 7);
}
static noinline void OpFcomImpl(struct As *a, int op) {
static dontinline void OpFcomImpl(struct As *a, int op) {
int rm;
if (IsSemicolon(a)) {
rm = 1;
@ -2727,7 +2727,7 @@ static noinline void OpFcomImpl(struct As *a, int op) {
EmitVarword(a, op | rm & 7);
}
static noinline void OpFcom(struct As *a, int op) {
static dontinline void OpFcom(struct As *a, int op) {
OpFcomImpl(a, op);
}

View file

@ -120,7 +120,7 @@ static Token *new_token(TokenKind kind, char *start, char *end) {
// Read an identifier and returns the length of it.
// If p does not point to a valid identifier, 0 is returned.
noinline int read_ident(char *start) {
dontinline int read_ident(char *start) {
uint32_t c;
char *p = start;
if (('a' <= *p && *p <= 'z') || ('A' <= *p && *p <= 'Z') || *p == '_') {

View file

@ -166,7 +166,7 @@ static void dlmalloc_add_segment(struct MallocState *m, char *tbase,
/* ─────────────────────────── system integration ─────────────────────────── */
/* Return true if segment contains a segment link */
noinline int has_segment_link(struct MallocState *m, msegmentptr ss) {
dontinline int has_segment_link(struct MallocState *m, msegmentptr ss) {
msegmentptr sp;
assert(m);
sp = &m->seg;

View file

@ -368,7 +368,7 @@ static uint32_t RCON[10];
static int aes_init_done;
static noinline void aes_gen_tables( void )
static dontinline void aes_gen_tables( void )
{
int i, x, y, z;
int pow[256];

View file

@ -3128,7 +3128,7 @@ int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp,
* private key for the given curve.
* \return Another negative error code on other kinds of failure.
*/
noinline int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp,
dontinline int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp,
const mbedtls_mpi *d )
{
ECP_VALIDATE_RET( grp );

View file

@ -794,7 +794,7 @@ static int convert_params(size_t cnt, char **params, int *int_params_store) {
*
* \return 0 for success else 1
*/
static noinline int test_snprintf(size_t n, const char *ref_buf, int ref_ret) {
static dontinline int test_snprintf(size_t n, const char *ref_buf, int ref_ret) {
int ret;
char buf[10] = "xxxxxxxxx";
const char ref[10] = "xxxxxxxxx";

View file

@ -2280,7 +2280,7 @@ PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs)
/* Issue #29234: Inlining _PyStack_AsTuple() into callers increases their
stack consumption, Disable inlining to optimize the stack consumption. */
PyObject* noinline
PyObject* dontinline
_PyStack_AsTuple(PyObject **stack, Py_ssize_t nargs)
{
PyObject *args;

View file

@ -4210,7 +4210,7 @@ restore_and_clear_exc_state(PyThreadState *tstate, PyFrameObject *f)
/* Logic for the raise statement (too complicated for inlining).
This *consumes* a reference count to each of its arguments. */
static noinline int
static dontinline int
do_raise(PyObject *exc, PyObject *cause)
{
PyObject *type = NULL, *value = NULL;

View file

@ -85,7 +85,7 @@ typedef int bf_op2_func_t(bf_t *r, const bf_t *a, const bf_t *b, limb_t prec,
#define FFT_MUL_R_OVERLAP_B (1 << 1)
#define FFT_MUL_R_NORESIZE (1 << 2)
static noinline int fft_mul(bf_context_t *s,
static dontinline int fft_mul(bf_context_t *s,
bf_t *res, limb_t *a_tab, limb_t a_len,
limb_t *b_tab, limb_t b_len, int mul_flags);
static void fft_clear_cache(bf_context_t *s);
@ -2192,7 +2192,7 @@ int bf_sqrt(bf_t *r, const bf_t *a, limb_t prec, bf_flags_t flags)
return BF_ST_MEM_ERROR;
}
static noinline int bf_op2(bf_t *r, const bf_t *a, const bf_t *b, limb_t prec,
static dontinline int bf_op2(bf_t *r, const bf_t *a, const bf_t *b, limb_t prec,
bf_flags_t flags, bf_op2_func_t *func)
{
bf_t tmp;
@ -7570,7 +7570,7 @@ static void ntt_free(BFNTTState *s, void *ptr)
bf_aligned_free(s->ctx, ptr);
}
static noinline int ntt_fft(BFNTTState *s,
static dontinline int ntt_fft(BFNTTState *s,
NTTLimb *out_buf, NTTLimb *in_buf,
NTTLimb *tmp_buf, int fft_len_log2,
int inverse, int m_idx)
@ -7703,7 +7703,7 @@ static void ntt_vec_mul(BFNTTState *s,
}
}
static noinline void mul_trig(NTTLimb *buf,
static dontinline void mul_trig(NTTLimb *buf,
limb_t n, limb_t c1, limb_t m, limb_t m_inv1)
{
limb_t i, c2, c3, c4;
@ -7751,7 +7751,7 @@ static inline NTTLimb int_to_ntt_limb(slimb_t a, limb_t m)
return a;
}
static noinline int ntt_fft(BFNTTState *s, NTTLimb *out_buf, NTTLimb *in_buf,
static dontinline int ntt_fft(BFNTTState *s, NTTLimb *out_buf, NTTLimb *in_buf,
NTTLimb *tmp_buf, int fft_len_log2,
int inverse, int m_idx)
{
@ -7833,7 +7833,7 @@ static void ntt_vec_mul(BFNTTState *s,
}
}
static noinline void mul_trig(NTTLimb *buf,
static dontinline void mul_trig(NTTLimb *buf,
limb_t n, limb_t c_mul, limb_t m, limb_t m_inv)
{
limb_t i, c0, c_mul_inv;
@ -7848,7 +7848,7 @@ static noinline void mul_trig(NTTLimb *buf,
#endif /* !AVX2 */
static noinline NTTLimb *get_trig(BFNTTState *s,
static dontinline NTTLimb *get_trig(BFNTTState *s,
int k, int inverse, int m_idx)
{
NTTLimb *tab;
@ -8003,7 +8003,7 @@ static int ntt_conv(BFNTTState *s, NTTLimb *buf1, NTTLimb *buf2,
}
static noinline void limb_to_ntt(BFNTTState *s,
static dontinline void limb_to_ntt(BFNTTState *s,
NTTLimb *tabr, limb_t fft_len,
const limb_t *taba, limb_t a_len, int dpl,
int first_m_idx, int nb_mods)
@ -8072,7 +8072,7 @@ typedef union {
double d[4];
} VecUnion;
static noinline void ntt_to_limb(BFNTTState *s, limb_t *tabr, limb_t r_len,
static dontinline void ntt_to_limb(BFNTTState *s, limb_t *tabr, limb_t r_len,
const NTTLimb *buf, int fft_len_log2, int dpl,
int nb_mods)
{
@ -8176,7 +8176,7 @@ static noinline void ntt_to_limb(BFNTTState *s, limb_t *tabr, limb_t r_len,
}
}
#else
static noinline void ntt_to_limb(BFNTTState *s, limb_t *tabr, limb_t r_len,
static dontinline void ntt_to_limb(BFNTTState *s, limb_t *tabr, limb_t r_len,
const NTTLimb *buf, int fft_len_log2, int dpl,
int nb_mods)
{
@ -8389,7 +8389,7 @@ int bf_get_fft_size(int *pdpl, int *pnb_mods, limb_t len)
}
/* return 0 if OK, -1 if memory error */
static noinline int fft_mul(bf_context_t *s1,
static dontinline int fft_mul(bf_context_t *s1,
bf_t *res, limb_t *a_tab, limb_t a_len,
limb_t *b_tab, limb_t b_len, int mul_flags)
{

View file

@ -3543,7 +3543,7 @@ JSProperty *add_property(JSContext *ctx, JSObject *p, JSAtom prop, int prop_flag
/* can be called on Array or Arguments objects. return < 0 if
memory alloc error. */
static noinline __exception int convert_fast_array_to_array(JSContext *ctx,
static dontinline __exception int convert_fast_array_to_array(JSContext *ctx,
JSObject *p)
{
JSProperty *pr;

View file

@ -2112,7 +2112,7 @@ static unsigned char *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y,
}
}
static noinline void *stbi__jpeg_load(stbi__context *s, int *x, int *y,
static dontinline void *stbi__jpeg_load(stbi__context *s, int *x, int *y,
int *comp, int req_comp,
stbi__result_info *ri) {
unsigned char *result;
@ -3413,7 +3413,7 @@ static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp,
return result;
}
static noinline void *stbi__png_load(stbi__context *s, int *x, int *y,
static dontinline void *stbi__png_load(stbi__context *s, int *x, int *y,
int *comp, int req_comp,
stbi__result_info *ri) {
stbi__png p;
@ -3916,7 +3916,7 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
}
}
static noinline void *stbi__gif_load(stbi__context *s, int *x, int *y,
static dontinline void *stbi__gif_load(stbi__context *s, int *x, int *y,
int *comp, int req_comp,
stbi__result_info *ri) {
unsigned char *u = 0;
@ -3969,7 +3969,7 @@ static int stbi__pnm_test(stbi__context *s) {
return 1;
}
static noinline void *stbi__pnm_load(stbi__context *s, int *x, int *y,
static dontinline void *stbi__pnm_load(stbi__context *s, int *x, int *y,
int *comp, int req_comp,
stbi__result_info *ri) {
unsigned char *out;

View file

@ -480,7 +480,7 @@ static int error(vorb *f, enum STBVorbisError e) {
// given a sufficiently large block of memory, make an array of pointers to
// subblocks of it
static noinline void *make_block_array(void *mem, int count, int size) {
static dontinline void *make_block_array(void *mem, int count, int size) {
int i;
void **p = (void **)mem;
char *q = (char *)(p + count);
@ -491,7 +491,7 @@ static noinline void *make_block_array(void *mem, int count, int size) {
return p;
}
static noinline void *setup_malloc(vorb *f, int sz) {
static dontinline void *setup_malloc(vorb *f, int sz) {
sz = (sz + 3) & ~3;
f->setup_memory_required += sz;
if (f->alloc.alloc_buffer) {
@ -503,12 +503,12 @@ static noinline void *setup_malloc(vorb *f, int sz) {
return sz ? malloc(sz) : NULL;
}
static noinline void setup_free(vorb *f, void *p) {
static dontinline void setup_free(vorb *f, void *p) {
if (f->alloc.alloc_buffer) return; // do nothing; setup mem is a stack
free(p);
}
static noinline void *setup_temp_malloc(vorb *f, int sz) {
static dontinline void *setup_temp_malloc(vorb *f, int sz) {
sz = (sz + 3) & ~3;
if (f->alloc.alloc_buffer) {
if (f->temp_offset - sz < f->setup_offset) return NULL;
@ -518,7 +518,7 @@ static noinline void *setup_temp_malloc(vorb *f, int sz) {
return malloc(sz);
}
static noinline void setup_temp_free(vorb *f, void *p, int sz) {
static dontinline void setup_temp_free(vorb *f, void *p, int sz) {
if (f->alloc.alloc_buffer) {
f->temp_offset += (sz + 3) & ~3;
return;
@ -551,7 +551,7 @@ static float square(float x) {
// log2(4) = 3 as required by the specification. fast(?) implementation from
// stb.h
// @OPTIMIZE: called multiple times per-packet with "constants"; move to setup
static noinline int ilog(int32 n) {
static dontinline int ilog(int32 n) {
static signed char log2_4[16] = {0, 1, 2, 2, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4};
if (n < 0) return 0; // signed n returns 0