This commit is contained in:
Zahary Karadjov 2012-02-03 03:23:43 +02:00
commit c3e790b1ed
2 changed files with 5 additions and 4 deletions

View file

@ -520,14 +520,17 @@ proc finishTypeDescriptions(m: BModule) =
proc genProcHeader(m: BModule, prc: PSym): PRope = proc genProcHeader(m: BModule, prc: PSym): PRope =
var var
rettype, params: PRope rettype, params: PRope
genCLineDir(result, prc.info)
# using static is needed for inline procs # using static is needed for inline procs
if (prc.typ.callConv == ccInline): result = toRope"static " if gCmd != cmdCompileToLLVM and lfExportLib in prc.loc.flags:
result.app "N_LIB_EXPORT "
elif prc.typ.callConv == ccInline:
result.app "static "
var check = initIntSet() var check = initIntSet()
fillLoc(prc.loc, locProc, prc.typ, mangleName(prc), OnUnknown) fillLoc(prc.loc, locProc, prc.typ, mangleName(prc), OnUnknown)
genProcParams(m, prc.typ, rettype, params, check) genProcParams(m, prc.typ, rettype, params, check)
# careful here! don't access ``prc.ast`` as that could reload large parts of # careful here! don't access ``prc.ast`` as that could reload large parts of
# the object graph! # the object graph!
genCLineDir(result, prc.info)
appf(result, "$1($2, $3)$4", appf(result, "$1($2, $3)$4",
[toRope(CallingConvToStr[prc.typ.callConv]), rettype, prc.loc.r, params]) [toRope(CallingConvToStr[prc.typ.callConv]), rettype, prc.loc.r, params])

View file

@ -574,8 +574,6 @@ proc deinitFrame(p: BProc): PRope =
proc genProcAux(m: BModule, prc: PSym) = proc genProcAux(m: BModule, prc: PSym) =
var p = newProc(prc, m) var p = newProc(prc, m)
var header = genProcHeader(m, prc) var header = genProcHeader(m, prc)
if gCmd != cmdCompileToLLVM and lfExportLib in prc.loc.flags:
header = con("N_LIB_EXPORT ", header)
var returnStmt: PRope = nil var returnStmt: PRope = nil
assert(prc.ast != nil) assert(prc.ast != nil)
if sfPure notin prc.flags and prc.typ.sons[0] != nil: if sfPure notin prc.flags and prc.typ.sons[0] != nil: