Skip to content

Commit aef59c1

Browse files
committed
Comment L0's usage of holding type information in location fields
1 parent 820e565 commit aef59c1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

gibbon-compiler/src/Gibbon/L0/Syntax.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import Gibbon.Language hiding (UrTy(..))
2828

2929
--------------------------------------------------------------------------------
3030

31+
-- In L0, type information may be held in locations, as locations don't exist
3132
type Exp0 = PreExp E0Ext Ty0 Ty0
3233
type DDefs0 = DDefs Ty0
3334
type DDef0 = DDef Ty0
@@ -41,6 +42,7 @@ type Prog0 = Prog Exp0
4142
data E0Ext loc dec =
4243
LambdaE [(Var,dec)] -- Variable tagged with type
4344
(PreExp E0Ext loc dec)
45+
-- unused for much of L0, may be due to a bug
4446
| PolyAppE (PreExp E0Ext loc dec) -- Operator
4547
(PreExp E0Ext loc dec) -- Operand
4648
| FunRefE [loc] Var -- Reference to a function (toplevel or lambda),

gibbon-compiler/src/Gibbon/Language/Syntax.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ data PreExp (ext :: Type -> Type -> Type) loc dec =
361361
| MkProdE [EXP] -- ^ Tuple construction
362362
| ProjE Int EXP -- ^ Tuple projection.
363363

364+
-- in L0, loc carries the type of the corresponding var
365+
-- as there is no location information
364366
| CaseE EXP [(DataCon, [(Var,loc)], EXP)]
365367
-- ^ Case on a datatype. Each bound, unpacked variable lives at
366368
-- a fixed, read-only location.

0 commit comments

Comments
 (0)