diff options
| author | 2026-02-18 18:17:14 +0100 | |
|---|---|---|
| committer | 2026-02-18 18:19:11 +0100 | |
| commit | 0b90de2e773f439fa606ddf2bc403d2f42fa4c3d (patch) | |
| tree | 2b7b6600d8bbbe08735c1f2d6d3e6b2885c0e5e0 /c | |
| parent | 886fdfe8c856ee778103661b832b28cf3e6aed7e (diff) | |
ir: basic inlining pass implementation
Diffstat (limited to 'c')
| -rw-r--r-- | c/c.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |