summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmm.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@mit.edu>2011-04-13 15:29:48 +0100
committerEdward Z. Yang <ezyang@mit.edu>2011-04-14 00:32:25 +0100
commitb1cf9aae4a495b619375da716d6d14f7cb494f8e (patch)
tree56d8bac97af31c0a55cc08bd886e94c5bb434352 /compiler/codeGen/StgCmm.hs
parent1de43f7ca9e3790bb6450bb6860d5d14261470d9 (diff)
downloadhaskell-b1cf9aae4a495b619375da716d6d14f7cb494f8e.tar.gz
For BC labels, emit empty data section instead of empty proc.
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>
Diffstat (limited to 'compiler/codeGen/StgCmm.hs')
-rw-r--r--compiler/codeGen/StgCmm.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/codeGen/StgCmm.hs b/compiler/codeGen/StgCmm.hs
index fa3dcfed83..2bfe1876ba 100644
--- a/compiler/codeGen/StgCmm.hs
+++ b/compiler/codeGen/StgCmm.hs
@@ -25,6 +25,7 @@ import StgCmmTicky
import MkGraph
import CmmExpr
+import CmmDecl
import CLabel
import PprCmm
@@ -181,7 +182,7 @@ mkModuleInit cost_centre_info this_mod hpc_info
; 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) ]
}
---------------------------------------------------------------