When generating C, don't pretend functions are data
[ghc-hetmet.git] / compiler / basicTypes / BasicTypes.lhs
index aa1741c..04ed8fa 100644 (file)
@@ -18,6 +18,8 @@ module BasicTypes(
        Version, bumpVersion, initialVersion,
 
        Arity, 
+
+    FunctionOrData(..),
        
        WarningTxt(..),
 
@@ -30,6 +32,8 @@ module BasicTypes(
 
        RecFlag(..), isRec, isNonRec, boolToRecFlag,
 
+       RuleName,
+
        TopLevelFlag(..), isTopLevel, isNotTopLevel,
 
        OverlapFlag(..), 
@@ -70,6 +74,21 @@ import Outputable
 type Arity = Int
 \end{code}
 
+%************************************************************************
+%*                                                                     *
+\subsection[FunctionOrData]{FunctionOrData}
+%*                                                                     *
+%************************************************************************
+
+\begin{code}
+data FunctionOrData = IsFunction | IsData
+    deriving (Eq, Ord)
+
+instance Outputable FunctionOrData where
+    ppr IsFunction = text "(function)"
+    ppr IsData     = text "(data)"
+\end{code}
+
 
 %************************************************************************
 %*                                                                     *
@@ -129,6 +148,15 @@ instance Outputable name => Outputable (IPName name) where
     ppr (IPName n) = char '?' <> ppr n -- Ordinary implicit parameters
 \end{code}
 
+%************************************************************************
+%*                                                                     *
+               Rules
+%*                                                                     *
+%************************************************************************
+
+\begin{code}
+type RuleName = FastString
+\end{code}
 
 %************************************************************************
 %*                                                                     *
@@ -555,8 +583,8 @@ data Activation = NeverActive
 data InlineSpec
   = Inline 
        Activation      -- Says during which phases inlining is allowed
-       Bool            -- True <=> make the RHS look small, so that when inlining
-                       --          is enabled, it will definitely actually happen
+       Bool            -- True  <=> INLINE
+                       -- False <=> NOINLINE
   deriving( Eq )
 
 defaultInlineSpec, alwaysInlineSpec, neverInlineSpec :: InlineSpec