@@ -2730,8 +2730,6 @@ proc translateProc(c; env: var MirEnv, procType: TypeId,
2730
2730
let typ = c.genProcType(env, procType)
2731
2731
c.complete(env, typ, c.prc, body, content)
2732
2732
2733
- import compiler/mir/utils
2734
-
2735
2733
proc replaceProcAst(config: ConfigRef, prc: PSym, with: PNode) =
2736
2734
## Replaces the ``PSym.ast`` of `prc` with the routine AST `with`,
2737
2735
## reparenting all symbols found in the body. This is crude, brittle, and
@@ -2852,13 +2850,8 @@ proc processEvent(env: var MirEnv, bodies: var ProcMap,
2852
2850
var body = evt.body
2853
2851
apply(body, env) # apply the additional MIR passes
2854
2852
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)
2862
2855
of bekImported:
2863
2856
# dynlib procedures are not supported
2864
2857
c.graph.config.localReport(evt.sym.info,
@@ -2916,8 +2909,6 @@ proc generateCodeForMain(c; env: var MirEnv; m: Module,
2916
2909
let typ = c.genProcType(env, env.types.add(prc.typ))
2917
2910
result = (prc, c.complete(env, typ, c.prc, body, finish(bu)))
2918
2911
2919
- import compiler/backend/ccgutils
2920
-
2921
2912
proc generateCode*(graph: ModuleGraph): PackedTree[NodeKind] =
2922
2913
## Generates the IL code for the full program represented by `graph` and
2923
2914
## returns the result as a single self-contained IL module.
@@ -3015,11 +3006,4 @@ proc generateCode*(graph: ModuleGraph): PackedTree[NodeKind] =
3015
3006
bu.add Node(kind: StringVal, val: c.lit.pack("stack_size"))
3016
3007
bu.add Node(kind: Global, val: c.globals.len.uint32)
3017
3008
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
-
3025
3009
result = initTree[NodeKind](finish(bu), c.lit)
0 commit comments