This fixes two bugs:
- The new code generator doesn't like procedures with
empty graphs, and panicked in labelAGraph.
- LLVM optimizes away empty procedures but not empty
data sections, so now the backwards-compatibility
labels actually work with -fllvm.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
-- For backwards compatibility: user code may refer to this
-- label for calling hs_add_root().
- ; emitSimpleProc (mkPlainModuleInitLabel this_mod) $ return ()
+ ; emitData Data $ [ CmmDataLabel (mkPlainModuleInitLabel this_mod) ]
; whenC (this_mod == mainModIs dflags) $
emitSimpleProc (mkPlainModuleInitLabel rOOT_MAIN) $ return ()
import MkGraph
import CmmExpr
+import CmmDecl
import CLabel
import PprCmm
; initCostCentres cost_centre_info
-- For backwards compatibility: user code may refer to this
-- label for calling hs_add_root().
- ; emitSimpleProc (mkPlainModuleInitLabel this_mod) $ emptyAGraph
+ ; emitData Data $ [ CmmDataLabel (mkPlainModuleInitLabel this_mod) ]
}
---------------------------------------------------------------