summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-02-04 15:48:13 +0100
committerAraq <rumpf_a@web.de>2012-02-04 15:48:13 +0100
commit0d4c8ec70c32613f7284c1df5872936c1121ffc5 (patch)
treeee9c700b328dd51f8d25986f8fe4386b5f50d4d1 /compiler
parent2633e3fb27f1c55b362bbbfd19388b356add6488 (diff)
parentc3e790b1edb22da2c61d65cd67c015c4dff2b82e (diff)
downloadNim-0d4c8ec70c32613f7284c1df5872936c1121ffc5.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/ccgtypes.nim7
-rwxr-xr-xcompiler/cgen.nim2
2 files changed, 5 insertions, 4 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index b4cd77c2b..a2faf3cbf 100755
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -520,14 +520,17 @@ proc finishTypeDescriptions(m: BModule) =
 proc genProcHeader(m: BModule, prc: PSym): PRope = 
   var 
     rettype, params: PRope
+  genCLineDir(result, prc.info)
   # 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()
   fillLoc(prc.loc, locProc, prc.typ, mangleName(prc), OnUnknown)
   genProcParams(m, prc.typ, rettype, params, check)
   # careful here! don't access ``prc.ast`` as that could reload large parts of
   # the object graph!
-  genCLineDir(result, prc.info)
   appf(result, "$1($2, $3)$4", 
        [toRope(CallingConvToStr[prc.typ.callConv]), rettype, prc.loc.r, params])
 
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index eb3e58a98..d60f11639 100755
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -574,8 +574,6 @@ proc deinitFrame(p: BProc): PRope =
 proc genProcAux(m: BModule, prc: PSym) =
   var p = newProc(prc, m)
   var header = genProcHeader(m, prc)
-  if gCmd != cmdCompileToLLVM and lfExportLib in prc.loc.flags: 
-    header = con("N_LIB_EXPORT ", header)
   var returnStmt: PRope = nil
   assert(prc.ast != nil)
   if sfPure notin prc.flags and prc.typ.sons[0] != nil: