mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 23:54:19 +00:00
remove unused magics: mIntToStr, mInt64ToStr, mFloatToStr (#23486)
mIntToStr, mInt64ToStr, mFloatToStr,
This commit is contained in:
@@ -488,7 +488,6 @@ type
|
||||
mUnaryPlusI, mBitnotI,
|
||||
mUnaryPlusF64, mUnaryMinusF64,
|
||||
mCharToStr, mBoolToStr,
|
||||
mIntToStr, mInt64ToStr, mFloatToStr, # for compiling nimStdlibVersion < 1.5.1 (not bootstrapping)
|
||||
mCStrToStr,
|
||||
mStrToStr, mEnumToStr,
|
||||
mAnd, mOr,
|
||||
@@ -558,7 +557,6 @@ const
|
||||
mUnaryMinusI, mUnaryMinusI64, mAbsI, mNot, mUnaryPlusI, mBitnotI,
|
||||
mUnaryPlusF64, mUnaryMinusF64,
|
||||
mCharToStr, mBoolToStr,
|
||||
mIntToStr, mInt64ToStr, mFloatToStr,
|
||||
mCStrToStr,
|
||||
mStrToStr, mEnumToStr,
|
||||
mAnd, mOr,
|
||||
|
||||
@@ -2467,15 +2467,8 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
|
||||
of mLeStr: binaryExpr(p, e, d, "(#cmpStrings($1, $2) <= 0)")
|
||||
of mLtStr: binaryExpr(p, e, d, "(#cmpStrings($1, $2) < 0)")
|
||||
of mIsNil: genIsNil(p, e, d)
|
||||
of mIntToStr: genDollar(p, e, d, "#nimIntToStr($1)")
|
||||
of mInt64ToStr: genDollar(p, e, d, "#nimInt64ToStr($1)")
|
||||
of mBoolToStr: genDollar(p, e, d, "#nimBoolToStr($1)")
|
||||
of mCharToStr: genDollar(p, e, d, "#nimCharToStr($1)")
|
||||
of mFloatToStr:
|
||||
if e[1].typ.skipTypes(abstractInst).kind == tyFloat32:
|
||||
genDollar(p, e, d, "#nimFloat32ToStr($1)")
|
||||
else:
|
||||
genDollar(p, e, d, "#nimFloatToStr($1)")
|
||||
of mCStrToStr:
|
||||
if p.module.compileToCpp:
|
||||
# fixes for const qualifier; bug #12703; bug #19588
|
||||
|
||||
@@ -469,9 +469,6 @@ const # magic checked op; magic unchecked op;
|
||||
mUnaryMinusF64: ["", ""],
|
||||
mCharToStr: ["nimCharToStr", "nimCharToStr"],
|
||||
mBoolToStr: ["nimBoolToStr", "nimBoolToStr"],
|
||||
mIntToStr: ["cstrToNimstr", "cstrToNimstr"],
|
||||
mInt64ToStr: ["cstrToNimstr", "cstrToNimstr"],
|
||||
mFloatToStr: ["cstrToNimstr", "cstrToNimstr"],
|
||||
mCStrToStr: ["cstrToNimstr", "cstrToNimstr"],
|
||||
mStrToStr: ["", ""]]
|
||||
|
||||
@@ -816,8 +813,6 @@ proc arithAux(p: PProc, n: PNode, r: var TCompRes, op: TMagic) =
|
||||
of mUnaryMinusF64: applyFormat("-($1)", "-($1)")
|
||||
of mCharToStr: applyFormat("nimCharToStr($1)", "nimCharToStr($1)")
|
||||
of mBoolToStr: applyFormat("nimBoolToStr($1)", "nimBoolToStr($1)")
|
||||
of mIntToStr: applyFormat("cstrToNimstr(($1) + \"\")", "cstrToNimstr(($1) + \"\")")
|
||||
of mInt64ToStr: applyFormat("cstrToNimstr(($1) + \"\")", "cstrToNimstr(($1) + \"\")")
|
||||
of mCStrToStr: applyFormat("cstrToNimstr($1)", "cstrToNimstr($1)")
|
||||
of mStrToStr, mUnown, mIsolate, mFinished: applyFormat("$1", "$1")
|
||||
else:
|
||||
@@ -838,7 +833,7 @@ proc arith(p: PProc, n: PNode, r: var TCompRes, op: TMagic) =
|
||||
arithAux(p, n, r, op)
|
||||
of mModI:
|
||||
arithAux(p, n, r, op)
|
||||
of mCharToStr, mBoolToStr, mIntToStr, mInt64ToStr, mCStrToStr, mStrToStr, mEnumToStr:
|
||||
of mCharToStr, mBoolToStr, mCStrToStr, mStrToStr, mEnumToStr:
|
||||
arithAux(p, n, r, op)
|
||||
of mEqRef:
|
||||
if mapType(n[1].typ) != etyBaseIndex:
|
||||
|
||||
@@ -1819,15 +1819,8 @@ proc genMagic(c: var ProcCon; n: PNode; d: var Value; m: TMagic) =
|
||||
if t.kind in {tyUInt8..tyUInt32} or (t.kind == tyUInt and size < 8):
|
||||
c.gABC(n, opcNarrowU, d, TRegister(size*8))
|
||||
of mStrToStr, mEnsureMove: c.gen n[1], d
|
||||
of mIntToStr: genUnaryCp(c, n, d, "nimIntToStr")
|
||||
of mInt64ToStr: genUnaryCp(c, n, d, "nimInt64ToStr")
|
||||
of mBoolToStr: genUnaryCp(c, n, d, "nimBoolToStr")
|
||||
of mCharToStr: genUnaryCp(c, n, d, "nimCharToStr")
|
||||
of mFloatToStr:
|
||||
if n[1].typ.skipTypes(abstractInst).kind == tyFloat32:
|
||||
genUnaryCp(c, n, d, "nimFloat32ToStr")
|
||||
else:
|
||||
genUnaryCp(c, n, d, "nimFloatToStr")
|
||||
of mCStrToStr: genUnaryCp(c, n, d, "cstrToNimstr")
|
||||
of mEnumToStr: genEnumToStr(c, n, d)
|
||||
|
||||
|
||||
@@ -307,11 +307,9 @@ proc evalOp(m: TMagic, n, a, b, c: PNode; idgen: IdGenerator; g: ModuleGraph): P
|
||||
of mRepr:
|
||||
# BUGFIX: we cannot eval mRepr here for reasons that I forgot.
|
||||
discard
|
||||
of mIntToStr, mInt64ToStr: result = newStrNodeT($(getOrdValue(a)), n, g)
|
||||
of mBoolToStr:
|
||||
if getOrdValue(a) == 0: result = newStrNodeT("false", n, g)
|
||||
else: result = newStrNodeT("true", n, g)
|
||||
of mFloatToStr: result = newStrNodeT($getFloat(a), n, g)
|
||||
of mCStrToStr, mCharToStr:
|
||||
result = newStrNodeT(getStrOrChar(a), n, g)
|
||||
of mStrToStr: result = newStrNodeT(getStrOrChar(a), n, g)
|
||||
|
||||
@@ -1182,7 +1182,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) =
|
||||
let size = getSize(c.config, t)
|
||||
if t.kind in {tyUInt8..tyUInt32} or (t.kind == tyUInt and size < 8):
|
||||
c.gABC(n, opcNarrowU, dest, TRegister(size*8))
|
||||
of mCharToStr, mBoolToStr, mIntToStr, mInt64ToStr, mFloatToStr, mCStrToStr, mStrToStr, mEnumToStr:
|
||||
of mCharToStr, mBoolToStr, mCStrToStr, mStrToStr, mEnumToStr:
|
||||
genConv(c, n, n[1], dest)
|
||||
of mEqStr: genBinaryABC(c, n, dest, opcEqStr)
|
||||
of mEqCString: genBinaryABC(c, n, dest, opcEqCString)
|
||||
|
||||
Reference in New Issue
Block a user