To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 15280fa3 authored by Pavel Zakopaylo's avatar Pavel Zakopaylo
Browse files

Fixed issue where BBLs and functions printed backwards

parent 54646a44
......@@ -6,7 +6,7 @@ module Mu.PrettyPrint
import Prelude
(Maybe(..), Show(..), String, unwords, map, concat, unlines, error,
reverse, ($), (.), (++), init, last, concatMap)
($), (.), (++), init, last, concatMap)
import Data.Char (toUpper)
import Mu.AST
......@@ -482,7 +482,7 @@ instance PrettyPrint Definition where
where printSig :: [TypedefName] -> String
printSig lst = "(" ++ (pp lst) ++ ")"
FunctionDefinition name ver sig firstBlock restBlock -> do
pBody <- local (++ "\t") (mapM ppFormat $ reverse $ firstBlock : restBlock)
pBody <- local (++ "\t") (mapM ppFormat $ firstBlock : restBlock)
return $
printf
"%s.funcdef %s VERSION %s <%s> {\n%s\t}"
......@@ -520,7 +520,7 @@ instance PrettyPrint ConstConstructor where
instance PrettyPrint BasicBlock where
ppFormat (BasicBlock name params exec instructions term) = do
ind <- ask
blocks <- local (++ "\t") (printBlocks $ reverse instructions)
blocks <- local (++ "\t") (printBlocks instructions)
termInst <- local (++ "\t") (ppFormat term)
return $
printf
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment