[project @ 2003-02-20 18:33:50 by simonpj]
authorsimonpj <unknown>
Thu, 20 Feb 2003 18:33:55 +0000 (18:33 +0000)
committersimonpj <unknown>
Thu, 20 Feb 2003 18:33:55 +0000 (18:33 +0000)
commit56b5a8b862d4eaeeaa941dd53e3d1009bdeadc0d
tree6bad69fec74d502a12abb8dcb912593a8356d484
parent8589a69045e96e56f2f4e8cced1bdfc486355623
[project @ 2003-02-20 18:33:50 by simonpj]
-------------------------------------
      Add Core Notes and the {-# CORE #-} pragma
-------------------------------------

This is an idea of Hal Daume's. The key point is that Notes in Core
are augmented thus:

  data Note
    = SCC CostCentre
    | ...
    | CoreNote String     -- NEW

These notes can be injected via a Haskell-source pragma:

   f x = ({-# CORE "foo" #-} show) ({-# CORE "bar" #-} x)

This wraps a (Note (CoreNote "foo")) around the 'show' variable,
and a similar note around the argument to 'show'.

These notes are basically ignored by GHC, but are emitted into
External Core, where they may convey useful information.

Exactly how code involving these notes is munged by the simplifier
isn't very well defined.  We'll see how it pans out.  Meanwhile
the impact on the rest of the compiler is minimal.
19 files changed:
ghc/compiler/coreSyn/CorePrep.lhs
ghc/compiler/coreSyn/CoreSyn.lhs
ghc/compiler/coreSyn/CoreUtils.lhs
ghc/compiler/coreSyn/MkExternalCore.lhs
ghc/compiler/coreSyn/PprCore.lhs
ghc/compiler/deSugar/DsExpr.lhs
ghc/compiler/deSugar/DsMeta.hs
ghc/compiler/hsSyn/HsCore.lhs
ghc/compiler/hsSyn/HsExpr.lhs
ghc/compiler/main/BinIface.hs
ghc/compiler/parser/Lex.lhs
ghc/compiler/parser/Parser.y
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/rename/RnSource.lhs
ghc/compiler/simplCore/FloatIn.lhs
ghc/compiler/simplCore/Simplify.lhs
ghc/compiler/typecheck/TcClassDcl.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcHsSyn.lhs