threading code deactivated; tiny C bugfix: don't report warnings to error callback

This commit is contained in:
Araq 2010-09-19 21:35:44 +02:00
commit 93b3c03dbd
15 changed files with 208 additions and 135 deletions

View file

@ -12,9 +12,9 @@
# code!**
import
ast, astalgo, strutils, nhashes, trees, platform, magicsys, extccomp, options,
nversion, nimsets, msgs, crc, bitsets, idents, lists, types, os, times, ropes,
math, passes, ccgutils, wordrecg, rnimsyn, rodread
ast, astalgo, strutils, nhashes, trees, platform, magicsys, extccomp,
options, nversion, nimsets, msgs, crc, bitsets, idents, lists, types, os,
times, ropes, math, passes, ccgutils, wordrecg, rnimsyn, rodread
proc ecmasgenPass*(): TPass
# implementation
@ -39,7 +39,8 @@ type
kind*: TEcmasTypeKind
com*: PRope # computation part
# address if this is a (address, index)-tuple
res*: PRope # result part; index if this is a (address, index)-tuple
res*: PRope # result part; index if this is an
# (address, index)-tuple
TBlock{.final.} = object
id*: int # the ID of the label; positive means that it
@ -886,12 +887,11 @@ proc genDeref(p: var TProc, n: PNode, r: var TCompRes) =
if a.kind != etyBaseIndex: InternalError(n.info, "genDeref")
r.res = ropef("$1[$2]", [a.com, a.res])
proc genCall(p: var TProc, n: PNode, r: var TCompRes) =
var a: TCompRes
gen(p, n.sons[0], r)
proc genArgs(p: var TProc, n: PNode, r: var TCompRes) =
app(r.res, "(")
for i in countup(1, sonsLen(n) - 1):
if i > 1: app(r.res, ", ")
var a: TCompRes
gen(p, n.sons[i], a)
if a.kind == etyBaseIndex:
app(r.res, a.com)
@ -901,6 +901,14 @@ proc genCall(p: var TProc, n: PNode, r: var TCompRes) =
app(r.res, mergeExpr(a))
app(r.res, ")")
proc genCall(p: var TProc, n: PNode, r: var TCompRes) =
gen(p, n.sons[0], r)
genArgs(p, n, r)
proc genEcho(p: var TProc, n: PNode, r: var TCompRes) =
app(r.res, "rawEcho")
genArgs(p, n, r)
proc putToSeq(s: string, indirect: bool): PRope =
result = toRope(s)
if indirect: result = ropef("[$1]", [result])
@ -1124,6 +1132,8 @@ proc genMagic(p: var TProc, n: PNode, r: var TCompRes) =
of mInSet: binaryExpr(p, n, r, "", "($1[$2] != undefined)")
of mNLen..mNError:
liMessage(n.info, errCannotGenerateCodeForX, n.sons[0].sym.name.s)
of mNewSeq: binaryStmt(p, n, r, "", "$1 = new Array($2)")
of mEcho: genEcho(p, n, r)
else:
genCall(p, n, r)
#else internalError(e.info, 'genMagic: ' + magicToStr[op]);
@ -1389,7 +1399,7 @@ proc newModule(module: PSym, filename: string): BModule =
proc genHeader(): PRope =
result = ropef("/* Generated by the Nimrod Compiler v$1 */$n" &
"/* (c) 2008 Andreas Rumpf */$n$n" & "$nvar Globals = this;$n" &
"/* (c) 2010 Andreas Rumpf */$n$n" & "$nvar Globals = this;$n" &
"var framePtr = null;$n" & "var excHandler = null;$n",
[toRope(versionAsString)])