From 62d995124c0cc2eaeec79e18edc3e044f3e524c9 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 23 Mar 2026 23:38:53 +0100 Subject: IR: emit inline function standalone bodies lazily If a function is stashed for inlining and inlined in all of its callsites or unused, it never ends up in the object file. If any symbol reference to it is emitted, then it must be de-inlined (rematerialized), and this is done near the end before emitting the actual object file. --- src/obj.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/obj.h') diff --git a/src/obj.h b/src/obj.h index d898c55..3973721 100644 --- a/src/obj.h +++ b/src/obj.h @@ -33,7 +33,8 @@ void objini(const char *infile, const char *outfile); void objdeffunc(internstr nam, bool globl, uint off, uint siz); enum section objhassym(internstr name, uint *off); uint objnewdat(internstr name, enum section, bool globl, uint siz, uint align); -void objreloc(internstr sym, enum relockind, enum section, uint off, s64int addend); -void objfini(void); +void objreloc(internstr sym, /*enum symflags*/int, enum relockind, enum section, uint off, s64int addend); +void objfini(bool emit); +bool fnisneeded(internstr); /* vim:set ts=3 sw=3 expandtab: */ -- cgit v1.2.3