summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/ast.nim2
-rwxr-xr-xcompiler/ccgexprs.nim5
2 files changed, 6 insertions, 1 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index d1c10168a..673dae5e9 100755
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -352,7 +352,7 @@ type
     mNIntVal, mNFloatVal, mNSymbol, mNIdent, mNGetType, mNStrVal, mNSetIntVal, 
     mNSetFloatVal, mNSetSymbol, mNSetIdent, mNSetType, mNSetStrVal, 
     mNNewNimNode, mNCopyNimNode, mNCopyNimTree, mStrToIdent, mIdentToStr, 
-    mEqIdent, mEqNimrodNode, mNHint, mNWarning, mNError
+    mEqIdent, mEqNimrodNode, mNHint, mNWarning, mNError, mGetTypeInfo
 
 type 
   PNode* = ref TNode
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 2cb99d3a9..7447dbb6c 100755
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1052,6 +1052,10 @@ proc genRepr(p: BProc, e: PNode, d: var TLoc) =
     putIntoDest(p, d, e.typ, ropecg(p.module, "#reprAny($1, $2)",
                                    [addrLoc(a), genTypeInfo(p.module, t)]))
 
+proc genGetTypeInfo(p: BProc, e: PNode, d: var TLoc) =
+  var t = skipTypes(e.sons[1].typ, abstractVarRange)
+  putIntoDest(p, d, e.typ, genTypeInfo(p.module, t))
+
 proc genDollar(p: BProc, n: PNode, d: var TLoc, frmt: string) =
   var a: TLoc
   InitLocExpr(p, n.sons[1], a)
@@ -1378,6 +1382,7 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
   of mShrI..mXor: binaryArith(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)
   of mUnaryLt: 
     if not (optOverflowCheck in p.Options): unaryExpr(p, e, d, "$1 - 1")