summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-01-07 02:41:50 +0100
committerAraq <rumpf_a@web.de>2015-01-07 02:41:50 +0100
commitb907fac5f9888e2c0ea26f71c6f66eabd811093a (patch)
tree814192dbf56f3507be06c6f94c3d6d0f5831d0a8
parent417eb3e02677bff57bf2bd4a5ed1bfd2b8f888b4 (diff)
downloadNim-b907fac5f9888e2c0ea26f71c6f66eabd811093a.tar.gz
minor cleanups
-rw-r--r--compiler/main.nim20
-rw-r--r--compiler/semexprs.nim6
-rw-r--r--lib/pure/net.nim2
3 files changed, 3 insertions, 25 deletions
diff --git a/compiler/main.nim b/compiler/main.nim
index 82e55058c..6afd9a73e 100644
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -19,12 +19,6 @@ import
 
 from magicsys import systemModule, resetSysTypes
 
-const
-  hasLLVM_Backend = false
-
-when hasLLVM_Backend:
-  import llvmgen
-
 proc rodPass =
   if optSymbolFiles in gGlobalOptions:
     registerPass(rodwritePass)
@@ -111,14 +105,6 @@ proc commandCompileToC =
     ccgutils.resetCaches()
     GC_fullCollect()
 
-when hasLLVM_Backend:
-  proc commandCompileToLLVM =
-    semanticPasses()
-    registerPass(llvmgen.llvmgenPass())
-    rodPass()
-    #registerPass(cleanupPass())
-    compileProject()
-
 proc commandCompileToJS =
   #incl(gGlobalOptions, optSafeCode)
   setTarget(osJS, cpuJS)
@@ -290,12 +276,6 @@ proc mainCommand* =
   of "js", "compiletojs":
     gCmd = cmdCompileToJS
     commandCompileToJS()
-  of "compiletollvm":
-    gCmd = cmdCompileToLLVM
-    when hasLLVM_Backend:
-      CommandCompileToLLVM()
-    else:
-      rawMessage(errInvalidCommandX, command)
   of "doc":
     wantMainModule()
     gCmd = cmdDoc
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 89110a479..9bf04c955 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -926,8 +926,7 @@ const
 proc readTypeParameter(c: PContext, typ: PType,
                        paramName: PIdent, info: TLineInfo): PNode =
   let ty = if typ.kind == tyGenericInst: typ.skipGenericAlias
-           else: (internalAssert(typ.kind == tyCompositeTypeClass);
-                  typ.sons[1].skipGenericAlias)
+           else: (internalAssert(typ.kind == tyCompositeTypeClass); typ.sons[1])
   #debug ty
   let tbody = ty.sons[0]
   for s in countup(0, tbody.len-2):
@@ -966,7 +965,6 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
   var ty = n.sons[0].typ
   var f: PSym = nil
   result = nil
-
   if isTypeExpr(n.sons[0]) or (ty.kind == tyTypeDesc and ty.base.kind != tyNone):
     if ty.kind == tyTypeDesc: ty = ty.base
     ty = ty.skipTypes(tyDotOpTransparent)
@@ -1055,7 +1053,7 @@ proc dotTransformation(c: PContext, n: PNode): PNode =
   
 proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = 
   # this is difficult, because the '.' is used in many different contexts
-  # in Nimrod. We first allow types in the semantic checking.
+  # in Nim. We first allow types in the semantic checking.
   result = builtinFieldAccess(c, n, flags)
   if result == nil:
     result = dotTransformation(c, n)
diff --git a/lib/pure/net.nim b/lib/pure/net.nim
index e6fe79740..9a0bb6931 100644
--- a/lib/pure/net.nim
+++ b/lib/pure/net.nim
@@ -119,7 +119,7 @@ proc newSocket*(domain, typ, protocol: cint, buffered = true): Socket =
   result = newSocket(fd, buffered)
 
 proc newSocket*(domain: Domain = AF_INET, typ: SockType = SOCK_STREAM,
-             protocol: Protocol = IPPROTO_TCP, buffered = true): Socket =
+                protocol: Protocol = IPPROTO_TCP, buffered = true): Socket =
   ## Creates a new socket.
   ##
   ## If an error occurs EOS will be raised.