-- -----------------------------------------------------------------------------
-- Does a CLabel need declaring before use or not?
+--
+-- See wiki:Commentary/Compiler/Backends/PprC#Prototypes
needsCDecl :: CLabel -> Bool
-- False <=> it's pre-declared; don't bother
needsCDecl (StringLitLabel _) = False
needsCDecl (AsmTempLabel _) = False
needsCDecl (RtsLabel _) = False
- -- RTS labels are declared in RTS header files. Otherwise we'd need
- -- to give types for each label reference in the RTS .cmm files
- -- somehow; when generating .cmm code we know the types of labels (info,
- -- entry etc.) but for hand-written .cmm code we don't.
needsCDecl l@(ForeignLabel _ _ _) = not (isMathFun l)
needsCDecl (CC_Label _) = True
needsCDecl (CCS_Label _) = True
--
-- Print Cmm as real C, for -fvia-C
--
+-- See wiki:Commentary/Compiler/Backends/PprC
+--
-- This is simpler than the old PprAbsC, because Cmm is "macro-expanded"
-- relative to the old AbstractC, and many oddities/decorations have
-- disappeared from the data type.
where
ppr_fn = parens (cCast (pprCFunType (char '*') cconv results args) fn)
+ -- See wiki:Commentary/Compiler/Backends/PprC#Prototypes
maybe_proto =
case fn of
CmmLit (CmmLabel lbl) | not (isMathFun lbl) ->
* our Cmm code generator doesn't know how to generate local symbols
* for the RTS bits (it assumes all RTS symbols are external).
*
+ * See wiki:Commentary/Compiler/Backends/PprC#Prototypes
+ *
* --------------------------------------------------------------------------*/
#ifndef STGMISCCLOSURES_H