@@ -24,8 +24,9 @@ primDefs = [UN "mkForeign", UN "FalseElim"]
24compile :: FilePath -> Term -> Idris ()
24compile :: FilePath -> Term -> Idris ()
25compile f tm
25compile f tm
26 = do checkMVs
26 = do checkMVs
27+ let tmnames = namesUsed (STerm tm)
27− used <- allNames [] (NS (UN "main") ["main"])
28+ used <- mapM (allNames []) tmnames
28− ds <- mkDecls tm ((UN "run__IO") : (UN "io_return") : used)
29+ ds <- mkDecls tm (concat used)
29 objs <- getObjectFiles
30 objs <- getObjectFiles
30 libs <- getLibs
31 libs <- getLibs
31 hdrs <- getHdrs
32 hdrs <- getHdrs