Trim unused imports detected by new unused-import code
[ghc-hetmet.git] / compiler / codeGen / ClosureInfo.lhs
index 9598233..18734e1 100644 (file)
@@ -72,7 +72,6 @@ import Id
 import IdInfo
 import DataCon
 import Name
-import OccName
 import Type
 import TypeRep
 import TcType
@@ -598,6 +597,10 @@ getCallMethod _ name caf (LFReEntrant _ arity _ _) n_args
   | otherwise      = DirectEntry (enterIdLabel name caf) arity
 
 getCallMethod _ _ _ (LFCon con) n_args
+  | opt_SccProfilingOn     -- when profiling, we must always enter
+  = EnterIt                -- a closure when we use it, so that the closure
+                           -- can be recorded as used for LDV profiling.
+  | otherwise
   = ASSERT( n_args == 0 )
     ReturnCon con