diff options
author | Araq <rumpf_a@web.de> | 2013-12-29 01:13:51 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-12-29 01:13:51 +0100 |
commit | 438703f59e4d226f6e83e78c4f549a381526c6c2 (patch) | |
tree | dd13f0b882482e51f513cbbcb0ce292a66098c09 /compiler/ccgexprs.nim | |
parent | 1101a40f91880b6cd1f0807d2b272eda7b5c9491 (diff) | |
download | Nim-438703f59e4d226f6e83e78c4f549a381526c6c2.tar.gz |
case consistency: next steps
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r-- | compiler/ccgexprs.nim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index b10d306a7..495c342ed 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -11,7 +11,7 @@ # -------------------------- constant expressions ------------------------ -proc intLiteral(i: biggestInt): PRope = +proc intLiteral(i: BiggestInt): PRope = if (i > low(int32)) and (i <= high(int32)): result = toRope(i) elif i == low(int32): @@ -419,10 +419,10 @@ proc unaryExprChar(p: BProc, e: PNode, d: var TLoc, frmt: string) = proc binaryArithOverflow(p: BProc, e: PNode, d: var TLoc, m: TMagic) = const - prc: array[mAddi..mModi64, string] = ["addInt", "subInt", "mulInt", + prc: array[mAddI..mModI64, string] = ["addInt", "subInt", "mulInt", "divInt", "modInt", "addInt64", "subInt64", "mulInt64", "divInt64", "modInt64"] - opr: array[mAddi..mModi64, string] = ["+", "-", "*", "/", "%", "+", "-", + opr: array[mAddI..mModI64, string] = ["+", "-", "*", "/", "%", "+", "-", "*", "/", "%"] var a, b: TLoc assert(e.sons[1].typ != nil) @@ -1040,7 +1040,7 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = app(tmp2.r, field.loc.r) tmp2.k = locTemp tmp2.t = field.loc.t - tmp2.s = onHeap + tmp2.s = OnHeap tmp2.heapRoot = tmp.r expr(p, it.sons[1], tmp2) if d.k == locNone: @@ -1196,7 +1196,7 @@ proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) = of tyOpenArray, tyVarargs: if op == mHigh: unaryExpr(p, e, d, "($1Len0-1)") else: unaryExpr(p, e, d, "$1Len0") - of tyCstring: + of tyCString: if op == mHigh: unaryExpr(p, e, d, "(strlen($1)-1)") else: unaryExpr(p, e, d, "strlen($1)") of tyString, tySequence: @@ -1481,7 +1481,7 @@ proc genStrEquals(p: BProc, e: PNode, d: var TLoc) = binaryExpr(p, e, d, "#eqStrings($1, $2)") proc binaryFloatArith(p: BProc, e: PNode, d: var TLoc, m: TMagic) = - if {optNanCheck, optInfCheck} * p.options != {}: + if {optNaNCheck, optInfCheck} * p.options != {}: const opr: array[mAddF64..mDivF64, string] = ["+", "-", "*", "/"] var a, b: TLoc assert(e.sons[1].typ != nil) @@ -1491,7 +1491,7 @@ proc binaryFloatArith(p: BProc, e: PNode, d: var TLoc, m: TMagic) = putIntoDest(p, d, e.typ, rfmt(nil, "(($4)($2) $1 ($4)($3))", toRope(opr[m]), rdLoc(a), rdLoc(b), getSimpleTypeDesc(p.module, e[1].typ))) - if optNanCheck in p.options: + if optNaNCheck in p.options: linefmt(p, cpsStmts, "#nanCheck($1);$n", rdLoc(d)) if optInfCheck in p.options: linefmt(p, cpsStmts, "#infCheck($1);$n", rdLoc(d)) @@ -1507,7 +1507,7 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) = of mAddF64..mDivF64: binaryFloatArith(p, e, d, op) of mShrI..mXor: binaryArith(p, e, d, op) of mEqProc: genEqProc(p, e, d) - of mAddi..mModi64: binaryArithOverflow(p, e, d, op) + of mAddI..mModI64: binaryArithOverflow(p, e, d, op) of mRepr: genRepr(p, e, d) of mGetTypeInfo: genGetTypeInfo(p, e, d) of mSwap: genSwap(p, e, d) |