Skip to content

Commit

Permalink
back to use of bitSize (to make uhc compile under GHC 7.6)
Browse files Browse the repository at this point in the history
  • Loading branch information
atzedijkstra committed Mar 1, 2015
1 parent d1994ac commit 8d0e226
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 30 deletions.
3 changes: 3 additions & 0 deletions EHC/src/ehc/CoreRun/Run/Val/Prim.chs
Expand Up @@ -87,8 +87,11 @@ rvalPrim pr as = do
(RP_primShiftRightInt , [RVal_Int i1, RVal_Int i2]) -> rsemPush $ RVal_Int $ i1 `shiftR` i2
(RP_primRotateLeftInt , [RVal_Int i1, RVal_Int i2]) -> rsemPush $ RVal_Int $ i1 `rotateL` i2
(RP_primRotateRightInt, [RVal_Int i1, RVal_Int i2]) -> rsemPush $ RVal_Int $ i1 `rotateR` i2
(RP_primBitSize , [RVal_Int i1] ) -> rsemPush $ RVal_Int $ bitSize i1 -- fromJust $ bitSizeMaybe i1
{-
(RP_primBitSize , [RVal_Int i1] ) -> rsemPush $ RVal_Int $ fromJust $ bitSizeMaybe i1
(RP_primBitSizeMaybe , [RVal_Int i1] ) -> hsUnmarshall $ bitSizeMaybe i1
-}
(RP_primPopCount , [RVal_Int i1] ) -> rsemPush $ RVal_Int $ popCount i1
(RP_primBit , [RVal_Int i1] ) -> rsemPush $ RVal_Int $ bit i1

Expand Down
Expand Up @@ -10,7 +10,7 @@
Abstraction for dealing with AST formats
%%]

%%[8 module {%{EH}EHC.SourceHandler}
%%[8 module {%{EH}EHC.ASTHandler}
%%]

-- general imports
Expand Down Expand Up @@ -39,38 +39,38 @@ Abstraction for dealing with AST formats
%%]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% SourceType
%%% ASTType
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%[8 export(SourceType(..))
-- | An 'Enum' listing all types of files we can deal with
data SourceType
= SourceType_Hs
| SourceType_LitHs
| SourceType_Core
| SourceType_CoreRun
%%[8 export(ASTType(..))
-- | An 'Enum' listing all types of ast we can deal with
data ASTType
= ASTType_Hs
| ASTType_LitHs
| ASTType_Core
| ASTType_CoreRun
deriving (Eq, Ord, Enum, Typeable, Generic, Bounded, Show)
%%]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% SourceHandler
%%% ASTHandler
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%[8 export(SourceHandler(..))
data SourceHandler ast
= SourceHandler
{ _shParseFromText :: forall m . EHCCompileRunner m => Bool -> HsName -> EHCompilePhaseT m (Maybe ast)
%%[8 export(ASTHandler(..))
data ASTHandler ast
= ASTHandler
{ _asthdlrParseFromText :: forall m . EHCCompileRunner m => Bool -> HsName -> EHCompilePhaseT m (Maybe ast)
}
%%]

%%[8888 export(shParseFromText)
mkLabel ''SourceHandler
%%[8888 export(asthdlrParseFromText)
mkLabel ''ASTHandler
%%]

%%[8 export(emptySourceHandler)
emptySourceHandler :: SourceHandler ast
emptySourceHandler
= SourceHandler
{ _shParseFromText = \_ _ -> return Nothing
%%[8 export(emptyASTHandler)
emptyASTHandler :: ASTHandler ast
emptyASTHandler
= ASTHandler
{ _asthdlrParseFromText = \_ _ -> return Nothing
}
%%]
Expand Up @@ -3,20 +3,20 @@
%%]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% SourceHandler instances
%%% ASTHandler instances
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%[doesWhat doclatex
%%]

%%[8 module {%{EH}EHC.SourceHandler.Instances}
%%[8 module {%{EH}EHC.ASTHandler.Instances}
%%]

-- general imports
%%[8 import ({%{EH}EHC.Common}, {%{EH}EHC.CompileUnit}, {%{EH}EHC.CompileRun})
%%]

%%[8 import ({%{EH}EHC.SourceHandler})
%%[8 import ({%{EH}EHC.ASTHandler})
%%]

%%[8888 import (Control.Applicative)
Expand Down Expand Up @@ -86,13 +86,13 @@
%%]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% SourceHandler: CoreRun
%%% ASTHandler: CoreRun
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%[8 export(sourceHandler_CoreRun)
sourceHandler_CoreRun :: SourceHandler CoreRun.Mod
sourceHandler_CoreRun :: ASTHandler CoreRun.Mod
sourceHandler_CoreRun =
emptySourceHandler
emptyASTHandler
{-
-}
%%]
2 changes: 1 addition & 1 deletion EHC/src/ehc/EHC/BuildFunction/Run.chs
Expand Up @@ -27,7 +27,7 @@ Running of BuildFunction
%%]

-- source handling
%%[8 import ({%{EH}EHC.SourceHandler}, {%{EH}EHC.SourceHandler.Instances})
%%[8 import ({%{EH}EHC.ASTHandler}, {%{EH}EHC.ASTHandler.Instances})
%%]

-- general imports
Expand Down
4 changes: 2 additions & 2 deletions EHC/src/ehc/files1.mk
Expand Up @@ -89,10 +89,10 @@ EHC_HS_UTIL_SRC_CHS_DFLT := $(patsubst %,$(SRC_EHC_PREFIX)%.chs,\
$(addprefix TyCore/,Base Utils2 Coercion Full0 Full1 Full2 Subst) \
$(addprefix TyCore/Trf/,Common) \
$(addprefix GrinCode/,Common SolveEqs) \
$(addprefix EHC/,Main Common FileSuffMp Environment CompileUnit CompileGroup CompileRun GrinCompilerDriver InitialSetup SourceHandler BuildFunction \
$(addprefix EHC/,Main Common FileSuffMp Environment CompileUnit CompileGroup CompileRun GrinCompilerDriver InitialSetup ASTHandler BuildFunction \
$(addprefix Main/,Utils Compile) \
$(addprefix BuildFunction/,Run) \
$(addprefix SourceHandler/,Instances) \
$(addprefix ASTHandler/,Instances) \
$(addprefix CompilePhase/,Common Run Parsers Output Translations Transformations \
FlowBetweenPhase TransformGrin Semantics \
CompileLLVM CompileC CompileJVM CompileJavaScript Link \
Expand Down

0 comments on commit 8d0e226

Please sign in to comment.