From 0b90de2e773f439fa606ddf2bc403d2f42fa4c3d Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 18 Feb 2026 18:17:14 +0100 Subject: ir: basic inlining pass implementation --- c/c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'c') diff --git a/c/c.c b/c/c.c index aa291e1..a7f48a4 100644 --- a/c/c.c +++ b/c/c.c @@ -4574,7 +4574,8 @@ tldecl(struct comp *cm) decl.isdef = 1; int idecl = putdecl(cm, &decl); struct decl *d = &declsbuf.p[idecl]; - struct function fn = { &cm->fnarena, .name = d->sym, .globl = d->scls != SCSTATIC, .fnty = decl.ty, .retty = td->ret }; + if (d->inlin && decl.scls != SCSTATIC) fatal(&d->span, "non-static inline is unimplemented"); + struct function fn = { &cm->fnarena, .name = d->sym, .globl = d->scls != SCSTATIC, .fnty = decl.ty, .retty = td->ret, .inlin = d->inlin }; irinit(&fn); function(cm, &fn, st.pnames, st.pspans, st.pqual); if (!nerror && ccopt.dbg.p) -- cgit v1.2.3