Skip to content

Commit 0cfbfc9

Browse files
committed
skully: remove leftover debug code
This also makes the LLVM produced by the code generator compile, as there are no longer any duplicated interface names.
1 parent e68504f commit 0cfbfc9

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

skully/backend.nim

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,8 +2730,6 @@ proc translateProc(c; env: var MirEnv, procType: TypeId,
27302730
let typ = c.genProcType(env, procType)
27312731
c.complete(env, typ, c.prc, body, content)
27322732

2733-
import compiler/mir/utils
2734-
27352733
proc replaceProcAst(config: ConfigRef, prc: PSym, with: PNode) =
27362734
## Replaces the ``PSym.ast`` of `prc` with the routine AST `with`,
27372735
## reparenting all symbols found in the body. This is crude, brittle, and
@@ -2852,13 +2850,8 @@ proc processEvent(env: var MirEnv, bodies: var ProcMap,
28522850
var body = evt.body
28532851
apply(body, env) # apply the additional MIR passes
28542852

2855-
try:
2856-
let procType = env.types.add(evt.sym.typ)
2857-
bodies[c.registerProc(evt.id)] = c.translateProc(env, procType, body)
2858-
except:
2859-
echo evt.sym
2860-
echo render(body.code, addr env, addr body)
2861-
raise
2853+
let procType = env.types.add(evt.sym.typ)
2854+
bodies[c.registerProc(evt.id)] = c.translateProc(env, procType, body)
28622855
of bekImported:
28632856
# dynlib procedures are not supported
28642857
c.graph.config.localReport(evt.sym.info,
@@ -2916,8 +2909,6 @@ proc generateCodeForMain(c; env: var MirEnv; m: Module,
29162909
let typ = c.genProcType(env, env.types.add(prc.typ))
29172910
result = (prc, c.complete(env, typ, c.prc, body, finish(bu)))
29182911

2919-
import compiler/backend/ccgutils
2920-
29212912
proc generateCode*(graph: ModuleGraph): PackedTree[NodeKind] =
29222913
## Generates the IL code for the full program represented by `graph` and
29232914
## returns the result as a single self-contained IL module.
@@ -3015,11 +3006,4 @@ proc generateCode*(graph: ModuleGraph): PackedTree[NodeKind] =
30153006
bu.add Node(kind: StringVal, val: c.lit.pack("stack_size"))
30163007
bu.add Node(kind: Global, val: c.globals.len.uint32)
30173008

3018-
for id, v in c.procMap.pairs:
3019-
let s = env.procedures[id]
3020-
if sfImportc notin s.flags:
3021-
bu.subTree Export:
3022-
bu.add Node(kind: StringVal, val: c.lit.pack(mangle(s.skipGenericOwner.name.s & "." & s.name.s)))
3023-
bu.add Node(kind: Proc, val: v.uint32)
3024-
30253009
result = initTree[NodeKind](finish(bu), c.lit)

0 commit comments

Comments
 (0)