@@ -1265,7 +1265,7 @@ proc genProcHeader(m: BModule; prc: PSym; result: var Rope; asPtr: bool = false)
12651265
12661266proc genTypeInfoV1 (m: BModule ; t: PType ; info: TLineInfo ): Rope
12671267proc getNimNode (m: BModule ): Rope =
1268- result = subscript (m.typeNodesName, rope (m.typeNodes))
1268+ result = subscript (m.typeNodesName, cIntValue (m.typeNodes))
12691269 inc (m.typeNodes)
12701270
12711271proc tiNameForHcr (m: BModule ; name: Rope ): Rope =
@@ -1324,11 +1324,11 @@ proc genTypeInfoAux(m: BModule; typ, origType: PType, name: Rope;
13241324 var x = typ.last
13251325 if typ.kind == tyObject: x = x.skipTypes (skipPtrs)
13261326 if typ.kind == tyPtr and x.kind == tyObject and incompleteType (x):
1327- base = rope ( " 0 " )
1327+ base = cIntValue ( 0 )
13281328 else :
13291329 base = genTypeInfoV1 (m, x, info)
13301330 else :
1331- base = rope ( " 0 " )
1331+ base = cIntValue ( 0 )
13321332 genTypeInfoAuxBase (m, typ, origType, name, base, info)
13331333
13341334proc discriminatorTableName (m: BModule ; objtype: PType , d: PSym ): Rope =
@@ -1366,20 +1366,20 @@ proc genObjectFields(m: BModule; typ, origType: PType, n: PNode, expr: Rope;
13661366 genTNimNodeArray (m, tmp, rope (n.len))
13671367 for i in 0 ..< n.len:
13681368 var tmp2 = getNimNode (m)
1369- m.s[cfsTypeInit3].addSubscriptAssignment (tmp, rope (i)):
1369+ m.s[cfsTypeInit3].addSubscriptAssignment (tmp, cIntValue (i)):
13701370 m.s[cfsTypeInit3].add (cAddr (tmp2))
13711371 genObjectFields (m, typ, origType, n[i], tmp2, info)
13721372 m.s[cfsTypeInit3].addFieldAssignment (expr, " len" ):
1373- m.s[cfsTypeInit3].add ( rope ( n.len) )
1373+ m.s[cfsTypeInit3].addIntValue ( n.len)
13741374 m.s[cfsTypeInit3].addFieldAssignment (expr, " kind" ):
1375- m.s[cfsTypeInit3].add ( " 2 " )
1375+ m.s[cfsTypeInit3].addIntValue ( 2 )
13761376 m.s[cfsTypeInit3].addFieldAssignment (expr, " sons" ):
1377- m.s[cfsTypeInit3].add (cAddr (subscript (tmp, " 0 " )))
1377+ m.s[cfsTypeInit3].add (cAddr (subscript (tmp, cIntValue ( 0 ) )))
13781378 else :
13791379 m.s[cfsTypeInit3].addFieldAssignment (expr, " len" ):
1380- m.s[cfsTypeInit3].add ( rope ( n.len) )
1380+ m.s[cfsTypeInit3].addIntValue ( n.len)
13811381 m.s[cfsTypeInit3].addFieldAssignment (expr, " kind" ):
1382- m.s[cfsTypeInit3].add ( " 2 " )
1382+ m.s[cfsTypeInit3].addIntValue ( 2 )
13831383 of nkRecCase:
13841384 assert (n[0 ].kind == nkSym)
13851385 var field = n[0 ].sym
@@ -1410,14 +1410,14 @@ proc genObjectFields(m: BModule; typ, origType: PType, n: PNode, expr: Rope;
14101410 var x = toInt (getOrdValue (b[j][0 ]))
14111411 var y = toInt (getOrdValue (b[j][1 ]))
14121412 while x <= y:
1413- m.s[cfsTypeInit3].addSubscriptAssignment (tmp, rope (x)):
1413+ m.s[cfsTypeInit3].addSubscriptAssignment (tmp, cIntValue (x)):
14141414 m.s[cfsTypeInit3].add (cAddr (tmp2))
14151415 inc (x)
14161416 else :
1417- m.s[cfsTypeInit3].addSubscriptAssignment (tmp, rope (getOrdValue (b[j]))):
1417+ m.s[cfsTypeInit3].addSubscriptAssignment (tmp, cIntValue (getOrdValue (b[j]))):
14181418 m.s[cfsTypeInit3].add (cAddr (tmp2))
14191419 of nkElse:
1420- m.s[cfsTypeInit3].addSubscriptAssignment (tmp, rope (L)):
1420+ m.s[cfsTypeInit3].addSubscriptAssignment (tmp, cIntValue (L)):
14211421 m.s[cfsTypeInit3].add (cAddr (tmp2))
14221422 else : internalError (m.config, n.info, " genObjectFields(nkRecCase)" )
14231423 of nkSym:
@@ -1452,31 +1452,31 @@ proc genObjectInfo(m: BModule; typ, origType: PType, name: Rope; info: TLineInfo
14521452 t = t.baseClass
14531453
14541454proc genTupleInfo (m: BModule ; typ, origType: PType , name: Rope ; info: TLineInfo ) =
1455- genTypeInfoAuxBase (m, typ, typ, name, rope ( " 0 " ), info)
1455+ genTypeInfoAuxBase (m, typ, typ, name, cIntValue ( 0 ), info)
14561456 var expr = getNimNode (m)
14571457 if not typ.isEmptyTupleType:
14581458 var tmp = getTempName (m) & " _" & $ typ.kidsLen
14591459 genTNimNodeArray (m, tmp, rope (typ.kidsLen))
14601460 for i, a in typ.ikids:
14611461 var tmp2 = getNimNode (m)
1462- m.s[cfsTypeInit3].addSubscriptAssignment (tmp, rope (i)):
1462+ m.s[cfsTypeInit3].addSubscriptAssignment (tmp, cIntValue (i)):
14631463 m.s[cfsTypeInit3].add (cAddr (tmp2))
14641464 m.s[cfsTypeInit3].addf (" $1.kind = 1;$n" &
14651465 " $1.offset = offsetof($2, Field$3);$n" &
14661466 " $1.typ = $4;$n" &
14671467 " $1.name = \" Field$3\" ;$n" ,
14681468 [tmp2, getTypeDesc (m, origType, dkVar), rope (i), genTypeInfoV1 (m, a, info)])
14691469 m.s[cfsTypeInit3].addFieldAssignment (expr, " len" ):
1470- m.s[cfsTypeInit3].add ( rope ( typ.kidsLen) )
1470+ m.s[cfsTypeInit3].addIntValue ( typ.kidsLen)
14711471 m.s[cfsTypeInit3].addFieldAssignment (expr, " kind" ):
1472- m.s[cfsTypeInit3].add ( " 2 " )
1472+ m.s[cfsTypeInit3].addIntValue ( 2 )
14731473 m.s[cfsTypeInit3].addFieldAssignment (expr, " sons" ):
1474- m.s[cfsTypeInit3].add (cAddr (subscript (tmp, " 0 " )))
1474+ m.s[cfsTypeInit3].add (cAddr (subscript (tmp, cIntValue ( 0 ) )))
14751475 else :
14761476 m.s[cfsTypeInit3].addFieldAssignment (expr, " len" ):
1477- m.s[cfsTypeInit3].add ( rope ( typ.kidsLen) )
1477+ m.s[cfsTypeInit3].addIntValue ( typ.kidsLen)
14781478 m.s[cfsTypeInit3].addFieldAssignment (expr, " kind" ):
1479- m.s[cfsTypeInit3].add ( " 2 " )
1479+ m.s[cfsTypeInit3].addIntValue ( 2 )
14801480 m.s[cfsTypeInit3].addFieldAssignment (tiNameForHcr (m, name), " node" ):
14811481 m.s[cfsTypeInit3].add (cAddr (expr))
14821482
@@ -1506,7 +1506,7 @@ proc genEnumInfo(m: BModule; typ: PType, name: Rope; info: TLineInfo) =
15061506 enumNames.add (makeCString (field.ast.strVal))
15071507 if field.position != i or tfEnumHasHoles in typ.flags:
15081508 specialCases.addFieldAssignment (elemNode, " offset" ):
1509- specialCases.add ( rope ( field.position) )
1509+ specialCases.addIntValue ( field.position)
15101510 hasHoles = true
15111511 var enumArray = getTempName (m)
15121512 var counter = getTempName (m)
@@ -1524,11 +1524,11 @@ proc genEnumInfo(m: BModule; typ: PType, name: Rope; info: TLineInfo) =
15241524 m.s[cfsTypeInit3].add (specialCases)
15251525 let n = getNimNode (m)
15261526 m.s[cfsTypeInit3].addFieldAssignment (n, " len" ):
1527- m.s[cfsTypeInit3].add ( rope ( typ.n.len) )
1527+ m.s[cfsTypeInit3].addIntValue ( typ.n.len)
15281528 m.s[cfsTypeInit3].addFieldAssignment (n, " kind" ):
1529- m.s[cfsTypeInit3].add ( " 2 " )
1529+ m.s[cfsTypeInit3].addIntValue ( 0 )
15301530 m.s[cfsTypeInit3].addFieldAssignment (n, " sons" ):
1531- m.s[cfsTypeInit3].add (cAddr (subscript (nodePtrs, " 0 " )))
1531+ m.s[cfsTypeInit3].add (cAddr (subscript (nodePtrs, cIntValue ( 0 ) )))
15321532 m.s[cfsTypeInit3].addFieldAssignment (tiNameForHcr (m, name), " node" ):
15331533 m.s[cfsTypeInit3].add (cAddr (n))
15341534 if hasHoles:
@@ -1540,9 +1540,9 @@ proc genSetInfo(m: BModule; typ: PType, name: Rope; info: TLineInfo) =
15401540 genTypeInfoAux (m, typ, typ, name, info)
15411541 var tmp = getNimNode (m)
15421542 m.s[cfsTypeInit3].addFieldAssignment (tmp, " len" ):
1543- m.s[cfsTypeInit3].add ( rope ( firstOrd (m.config, typ) ))
1543+ m.s[cfsTypeInit3].addIntValue ( firstOrd (m.config, typ))
15441544 m.s[cfsTypeInit3].addFieldAssignment (tmp, " kind" ):
1545- m.s[cfsTypeInit3].add ( " 0 " )
1545+ m.s[cfsTypeInit3].addIntValue ( 0 )
15461546 m.s[cfsTypeInit3].addFieldAssignment (tiNameForHcr (m, name), " node" ):
15471547 m.s[cfsTypeInit3].add (cAddr (tmp))
15481548
@@ -1746,7 +1746,7 @@ proc genTypeInfoV2OldImpl(m: BModule; t, origType: PType, name: Rope; info: TLin
17461746 len = objDepth + 1 ,
17471747 initializer = objDisplay)
17481748 typeEntry.addFieldAssignment (name, " display" ):
1749- typeEntry.add (rope ( objDisplayStore) )
1749+ typeEntry.add (objDisplayStore)
17501750
17511751 let dispatchMethods = toSeq (getMethodsPerType (m.g.graph, t))
17521752 if dispatchMethods.len > 0 :
@@ -1940,9 +1940,9 @@ proc genTypeInfoV1(m: BModule; t: PType; info: TLineInfo): Rope =
19401940 rememberEmittedTypeInfo (m.g.graph, FileIndex (owner), $ result )
19411941
19421942 case t.kind
1943- of tyEmpty, tyVoid: result = rope " 0 "
1943+ of tyEmpty, tyVoid: result = cIntValue ( 0 )
19441944 of tyPointer, tyBool, tyChar, tyCstring, tyString, tyInt.. tyUInt64, tyVar, tyLent:
1945- genTypeInfoAuxBase (m, t, t, result , rope " 0 " , info)
1945+ genTypeInfoAuxBase (m, t, t, result , cIntValue ( 0 ) , info)
19461946 of tyStatic:
19471947 if t.n != nil : result = genTypeInfoV1 (m, skipModifier t, info)
19481948 else : internalError (m.config, " genTypeInfoV1(" & $ t.kind & ')' )
@@ -1951,7 +1951,7 @@ proc genTypeInfoV1(m: BModule; t: PType; info: TLineInfo): Rope =
19511951 return genTypeInfoV1 (m, t.skipModifier, info)
19521952 of tyProc:
19531953 if t.callConv != ccClosure:
1954- genTypeInfoAuxBase (m, t, t, result , rope " 0 " , info)
1954+ genTypeInfoAuxBase (m, t, t, result , cIntValue ( 0 ) , info)
19551955 else :
19561956 let x = fakeClosureType (m, t.owner)
19571957 genTupleInfo (m, x, x, result , info)
0 commit comments