diff options
author | Max Bolingbroke <batterseapower@hotmail.com> | 2011-07-06 16:18:09 +0100 |
---|---|---|
committer | Max Bolingbroke <batterseapower@hotmail.com> | 2011-07-06 16:41:20 +0100 |
commit | 41ca0b8dcb91cf02f389b3d099c33fbdf009312c (patch) | |
tree | 29b35ed3623b47ce36f25ede3abd79eedeb84e6d /compiler/llvmGen/LlvmCodeGen.hs | |
parent | 43293b8c3210003c9e5b5b4a662f0fdb874353b7 (diff) | |
download | haskell-41ca0b8dcb91cf02f389b3d099c33fbdf009312c.tar.gz |
Refactoring: explicitly mark whether we have an info table in RawCmm
I introduced this to support explicitly recording the info table label
in RawCmm for another patch I am working on, but it turned out to lead
to significant simplification in those parts of the compiler that
consume RawCmm.
Now, instead of lots of tests for null [CmmStatic] we have a simple
test of a Maybe, and have reduced the number of guys that need to know
how to convert entry->info labels by a TON. There are only 3 callers
of that function now!
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen.hs')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs index 46f3f268a3..340a313561 100644 --- a/compiler/llvmGen/LlvmCodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen.hs @@ -13,7 +13,6 @@ import LlvmCodeGen.Data import LlvmCodeGen.Ppr import LlvmMangler -import CLabel import CgUtils ( fixStgRegisters ) import OldCmm import OldPprCmm @@ -40,9 +39,9 @@ llvmCodeGen dflags h us cmms (cdata,env) = foldr split ([],initLlvmEnv) cmm split (CmmData s d' ) (d,e) = ((s,d'):d,e) split (CmmProc i l _) (d,e) = - let lbl = strCLabel_llvm $ if not (null i) - then entryLblToInfoLbl l - else l + let lbl = strCLabel_llvm $ case i of + Nothing -> l + Just (Statics info_lbl _) -> info_lbl env' = funInsert lbl llvmFunTy e in (d,env') in do |