diff options
author | Edward Z. Yang <ezyang@mit.edu> | 2011-04-13 15:29:48 +0100 |
---|---|---|
committer | Edward Z. Yang <ezyang@mit.edu> | 2011-04-14 00:32:25 +0100 |
commit | b1cf9aae4a495b619375da716d6d14f7cb494f8e (patch) | |
tree | 56d8bac97af31c0a55cc08bd886e94c5bb434352 /compiler/codeGen/CodeGen.lhs | |
parent | 1de43f7ca9e3790bb6450bb6860d5d14261470d9 (diff) | |
download | haskell-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/CodeGen.lhs')
-rw-r--r-- | compiler/codeGen/CodeGen.lhs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/codeGen/CodeGen.lhs b/compiler/codeGen/CodeGen.lhs index 81a65f7325..7a7bf48b92 100644 --- a/compiler/codeGen/CodeGen.lhs +++ b/compiler/codeGen/CodeGen.lhs @@ -105,7 +105,7 @@ mkModuleInit dflags cost_centre_info this_mod hpc_info -- 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 () |