Skip to content

Commit

Permalink
Ensure ArrowTy Ty2 is printed in debug mode -v4
Browse files Browse the repository at this point in the history
  • Loading branch information
vidsinghal committed Feb 12, 2024
1 parent 9198a0e commit e5a2a2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gibbon-compiler/src/Gibbon/Compiler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ Also see Note [Adding dummy traversals] and Note [Adding random access nodes].
-- it adds regions to 'locs' in AppE and LetE which the
-- typechecker doesn't know how to handle.
l2' <- go "threadRegions" threadRegions l2'
l2' <- go "markTailCalls" markTailCalls l2'
l2' <- go "markTailCalls" markTailCalls l2'
-- L2 -> L3
-- TODO: Compose L3.TcM with (ReaderT Config)
l3 <- go "cursorize" cursorize l2'
Expand Down
6 changes: 3 additions & 3 deletions gibbon-compiler/src/Gibbon/Passes/MarkTailCalls.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ markTailCallsFn ddefs f@FunDef{funName, funArgs, funTy, funMeta, funBody} = do
then
let (ArrowTy2 locVars arrIns _arrEffs arrOut _locRets _isPar _) = funTy
funTy' = (ArrowTy2 locVars arrIns _arrEffs arrOut _locRets _isPar TC)
in dbgTraceIt (sdoc (tailCallTy, funName, funTy')) dbgTraceIt "a" return $ FunDef funName funArgs funTy' funBody funMeta
in return $ FunDef funName funArgs funTy' funBody funMeta {-dbgTraceIt (sdoc (tailCallTy, funName, funTy')) dbgTraceIt "a"-}
else if elem TMC tailCallTy
then
let (ArrowTy2 locVars arrIns _arrEffs arrOut _locRets _isPar _) = funTy
funTy' = (ArrowTy2 locVars arrIns _arrEffs arrOut _locRets _isPar TMC)
in dbgTraceIt (sdoc (tailCallTy, funName, funTy')) dbgTraceIt "b" return $ FunDef funName funArgs funTy' funBody funMeta
else dbgTraceIt (sdoc (tailCallTy, funName, funTy)) dbgTraceIt "c" pure f
in return $ FunDef funName funArgs funTy' funBody funMeta {-dbgTraceIt (sdoc (tailCallTy, funName, funTy')) dbgTraceIt "b"-}
else pure f {-dbgTraceIt (sdoc (tailCallTy, funName, funTy)) dbgTraceIt "c"-}
--dbgTraceIt (sdoc tailCallTy) pure f


Expand Down
3 changes: 2 additions & 1 deletion gibbon-compiler/src/Gibbon/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ instance Pretty ty2 => Pretty (ArrowTy2 ty2) where
braces (text "locvars" <+> doc (locVars fnty) <> comma $$
text "effs: " <+> doc (arrEffs fnty) <> comma $$
text "locrets: " <+> doc (locRets fnty) <> comma $$
text "parallel: " <+> doc (hasParallelism fnty))
text "parallel: " <+> doc (hasParallelism fnty) $$
text "tailrecursiontype: " <+> doc (tailRecType fnty))


-- Expressions
Expand Down

0 comments on commit e5a2a2b

Please sign in to comment.