Skip to content

Commit

Permalink
expose more FTy patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
Ptival committed Dec 9, 2023
1 parent 228c2f7 commit 040c533
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions src/Reopt/TypeInference/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ module Reopt.TypeInference.Solver (
tyToLLVMType,
-- FTy stuff
FTy,
pattern FConflictTy,
pattern FFunPtrTy,
pattern FNamedStruct,
pattern FNumTy,
pattern FPreFunPtrTy,
pattern FPtrTy,
pattern FFunPtrTy,
pattern FStructTy,
pattern FTupleTy,
pattern FUnknownFunPtrTy,
pattern FUnknownTy,
pattern FNamedStruct,
pattern FStructTy,
pattern FConflictTy,
pattern FVecTy,
pattern FVoidTy,
-- Testing
) where

Expand Down Expand Up @@ -387,26 +391,27 @@ maybeGlobalTC ty rowv off = do
--------------------------------------------------------------------------------
-- LLVM support (FTy patterns)

pattern FConflictTy :: Int -> FTy
pattern FConflictTy n = FTy (ConflictTy n)
pattern FFunPtrTy :: [FTy] -> FTy -> FTy
pattern FFunPtrTy args ret = FTy (FunPtrTy args ret)
pattern FNamedStruct :: StructName -> FTy
pattern FNamedStruct s = NamedStruct s
pattern FNumTy :: Int -> FTy
pattern FNumTy sz = FTy (NumTy sz)

pattern FPreFunPtrTy :: [FTy] -> FTy -> FTy
pattern FPreFunPtrTy args ret = FTy (PreFunPtrTy args ret)
pattern FPtrTy :: FTy -> FTy
pattern FPtrTy ty = FTy (PtrTy ty)

pattern FFunPtrTy :: [FTy] -> FTy -> FTy
pattern FFunPtrTy args ret = FTy (FunPtrTy args ret)

pattern FStructTy :: FieldMap FTy -> FTy
pattern FStructTy fm = StructTy fm
pattern FTupleTy :: [FTy] -> FTy
pattern FTupleTy tys = FTy (TupleTy tys)
pattern FUnknownFunPtrTy :: FTy
pattern FUnknownFunPtrTy = FTy UnknownFunPtrTy

pattern FUnknownTy :: FTy
pattern FUnknownTy = UnknownTy

pattern FStructTy :: FieldMap FTy -> FTy
pattern FStructTy fm = StructTy fm

pattern FNamedStruct :: StructName -> FTy
pattern FNamedStruct s = NamedStruct s

pattern FConflictTy :: Int -> FTy
pattern FConflictTy n = FTy (ConflictTy n)
pattern FVecTy :: Int -> FTy -> FTy
pattern FVecTy a b = FTy (VecTy a b)
pattern FVoidTy :: FTy
pattern FVoidTy = FTy VoidTy

0 comments on commit 040c533

Please sign in to comment.