summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-01-23 11:22:14 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-01-23 11:22:19 +0100
commitd65101268835b4dcda054bdd0687f2527b65eee0 (patch)
tree1ab8b0b44b1e8c5ee9c48fb7a1bed30c46d366b6 /compiler
parent93068f1ba69de7ccf0ed9b1b30a55abde88d5d66 (diff)
downloadNim-d65101268835b4dcda054bdd0687f2527b65eee0.tar.gz
template+emit supports volatileRead and volatileWrite ops
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgstmts.nim2
-rw-r--r--compiler/semtempl.nim4
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim
index 123d627b5..b3d21c35e 100644
--- a/compiler/ccgstmts.nim
+++ b/compiler/ccgstmts.nim
@@ -973,6 +973,8 @@ proc genAsmOrEmitStmt(p: BProc, t: PNode, isAsmStmt=false): Rope =
           r = mangleName(p.module, sym)
           sym.loc.r = r       # but be consequent!
         res.add($r)
+    of nkTypeOfExpr:
+      res.add($getTypeDesc(p.module, t.sons[i].typ))
     else:
       var a: TLoc
       initLocExpr(p, t.sons[i], a)
diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim
index e016e689c..b63928807 100644
--- a/compiler/semtempl.nim
+++ b/compiler/semtempl.nim
@@ -445,7 +445,9 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode =
   of nkPostfix:
     result.sons[1] = semTemplBody(c, n.sons[1])
   of nkPragma:
-    result = onlyReplaceParams(c, n)
+    for x in n:
+      if x.kind == nkExprColonExpr:
+        x.sons[1] = semTemplBody(c, x.sons[1])
   of nkBracketExpr:
     result = newNodeI(nkCall, n.info)
     result.add newIdentNode(getIdent("[]"), n.info)