Skip to content

Commit

Permalink
use type alias for descriptive names
Browse files Browse the repository at this point in the history
  • Loading branch information
vidsinghal committed Dec 2, 2024
1 parent 1016cf0 commit 4373542
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion gibbon-compiler/src/Gibbon/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
module Gibbon.Common
(
-- * Variables
Var(..), LocVar(..), Location
Var(..), LocVar(..), Location, FieldIndex
, RegVar, fromVar, toVar, varAppend, toEndV, toEndVLoc, toSeqV, cleanFunName
, TyVar(..), isUserTv
, Symbol, intern, unintern
Expand Down Expand Up @@ -139,6 +139,9 @@ toSeqV v = varAppend v (toVar "_seq")
-- | A location variable stores the abstract location.
type Location = Var

-- | The position or index of a field in a data constructor value.
type FieldIndex = Int

data LocVar = Single Location
deriving (Show, Ord, Eq, Read, Generic, NFData, Out)

Expand Down
14 changes: 7 additions & 7 deletions gibbon-compiler/src/Gibbon/L2/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,13 @@ data Region = GlobR Var Multiplicity -- ^ A global region with lifetime equal to
-- are no free locations in the program.
deriving (Read,Show,Eq,Ord, Generic)

data ExtendedRegion = AoSR Region -- ^ A simple "flat" region where the datatype
-- will reside in an array of structure representation.
| SoAR Region [((String, Int), Region)] -- ^ A complex region representation for a datatype
-- One "flat" buffer makes space for all the data constructors.
-- In addition to a list containing a "flat" buffer for each
-- field. The region can also be mapped to which data constructore
-- and field tuple it belongs to. A structure of arrays representation.
data ExtendedRegion = AoSR Region -- ^ A simple "flat" region where the datatype
-- will reside in an array of structure representation.
| SoAR Region [((DataCon, FieldIndex), Region)] -- ^ A complex region representation for a datatype
-- One "flat" buffer makes space for all the data constructors.
-- In addition to a list containing a "flat" buffer for each
-- field. The region can also be mapped to which data constructore
-- and field tuple it belongs to. A structure of arrays representation.
deriving (Read,Show,Eq,Ord, Generic)


Expand Down

0 comments on commit 4373542

Please sign in to comment.