diff options
-rw-r--r-- | compiler/ast.nim | 1 | ||||
-rw-r--r-- | compiler/ccgexprs.nim | 5 | ||||
-rw-r--r-- | compiler/ccgstmts.nim | 2 | ||||
-rw-r--r-- | compiler/semfold.nim | 2 | ||||
-rw-r--r-- | compiler/transf.nim | 10 |
5 files changed, 4 insertions, 16 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 8a3c76435..306fcdedc 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -271,7 +271,6 @@ type TSymFlags* = set[TSymFlag] const - sfFakeConst* = sfDeadCodeElim # const cannot be put into a data section sfDispatcher* = sfDeadCodeElim # copied method symbol is the dispatcher sfNoInit* = sfMainModule # don't generate code to init the variable diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 3f12fed2c..75a7cb3bb 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2003,10 +2003,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = internalError(n.info, "expr: proc not init " & sym.name.s) putLocIntoDest(p, d, sym.loc) of skConst: - if sfFakeConst in sym.flags: - if sfGlobal in sym.flags: genVarPrototype(p.module, sym) - putLocIntoDest(p, d, sym.loc) - elif isSimpleConst(sym.typ): + if isSimpleConst(sym.typ): putIntoDest(p, d, n.typ, genLiteral(p, sym.ast, sym.typ), OnStatic) else: genComplexConst(p, sym, d) diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 4836527a2..a5ce147c3 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -269,8 +269,6 @@ proc genConstStmt(p: BProc, t: PNode) = if it.kind != nkConstDef: internalError(t.info, "genConstStmt") var c = it.sons[0].sym if c.typ.containsCompileTimeOnly: continue - if sfFakeConst in c.flags: - genSingleVar(p, it) elif c.typ.kind in ConstantDataTypes and lfNoDecl notin c.loc.flags and c.ast.len != 0: if not emitLazily(c): requestConstImpl(p, c) diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 7c734e33b..02f238ae6 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -648,7 +648,7 @@ proc getConstExpr(m: PSym, n: PNode): PNode = if isDefined(s.name): result = newStrNodeT(lookupSymbol(s.name), n) else: - if sfFakeConst notin s.flags: result = copyTree(s.ast) + result = copyTree(s.ast) of {skProc, skMethod}: result = n of skType: diff --git a/compiler/transf.nim b/compiler/transf.nim index 25988fb8c..d64276cfb 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -204,14 +204,8 @@ proc transformConstSection(c: PTransf, v: PNode): PTransNode = if it.kind != nkConstDef: internalError(it.info, "transformConstSection") if it.sons[0].kind != nkSym: internalError(it.info, "transformConstSection") - if sfFakeConst in it[0].sym.flags: - var b = newNodeI(nkConstDef, it.info) - addSon(b, it[0]) - addSon(b, ast.emptyNode) # no type description - addSon(b, transform(c, it[2]).PNode) - result[i] = PTransNode(b) - else: - result[i] = PTransNode(it) + + result[i] = PTransNode(it) proc hasContinue(n: PNode): bool = case n.kind |