diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index b5ece69ae6..ea4db4f516 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -3471,6 +3471,10 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = genProcPrototype(p.module, sym) else: genProc(p.module, sym) + # For cross-module inline procs with optCompress, ensure prototype is emitted + if sym.typ.callConv == ccInline and optCompress in p.config.globalOptions and + sym.itemId.module != p.module.module.position: + genProcPrototype(p.module, sym) if sym.loc.snippet == "" or sym.loc.lode == nil: internalError(p.config, n.info, "expr: proc not init " & sym.name.s) putLocIntoDest(p, d, sym.loc) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index de7467567a..a932c180ff 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -1518,9 +1518,9 @@ proc genProcNoForward(m: BModule, prc: PSym) = fillProcLoc(m2, prc.ast[namePos]) #elif {sfExportc, sfImportc} * prc.flags == {}: # # reset name to restore consistency in case of hashing collisions: - # echo "resetting ", prc.id, " by ", m.module.name.s - # prc.loc.snippet = nil - # prc.loc.snippet = mangleName(m, prc) + # #echo "resetting ", prc.id, " by ", m.module.name.s + # #prc.loc.snippet = nil + # #prc.loc.snippet = mangleName(m, prc) genProcPrototype(m, prc) genProcAux(m, prc) elif sfImportc notin prc.flags: