[project @ 2001-04-30 20:07:49 by qrczak]
authorqrczak <unknown>
Mon, 30 Apr 2001 20:07:49 +0000 (20:07 +0000)
committerqrczak <unknown>
Mon, 30 Apr 2001 20:07:49 +0000 (20:07 +0000)
Fix the inlining bug: exprIsConApp_maybe didn't recognize constructor
applications inside notes.

I'm not sure if it's the right place to fix. Should notes be ignored
in other uses of collectArgs? Perhaps they should be ignored inside
the loop of collectArgs? And why the function marked as inline was
not inlined even though it's not a constructor application?

ghc/compiler/coreSyn/CoreUtils.lhs

index 901bc4d..696793e 100644 (file)
@@ -559,8 +559,8 @@ idAppIsValue id n_val_args
 
 \begin{code}
 exprIsConApp_maybe :: CoreExpr -> Maybe (DataCon, [CoreExpr])
-exprIsConApp_maybe expr
-  = analyse (collectArgs expr)
+exprIsConApp_maybe (Note _ expr) = exprIsConApp_maybe expr
+exprIsConApp_maybe expr          = analyse (collectArgs expr)
   where
     analyse (Var fun, args)
        | Just con <- isDataConId_maybe fun,