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

Commit c234231f authored by Pavel Zakopaylo's avatar Pavel Zakopaylo
Browse files

Fixed issue where Name type is printed, not value

parent 51d710d7
......@@ -27,6 +27,11 @@ instance (PrettyPrint a) =>
lst <- (mapM ppFormat t)
return $ ind ++ (unwords lst)
instance PrettyPrint Name where
ppFormat name = do
ind <- ask
return $ ind ++ (show name)
instance PrettyPrint Type where
ppFormat uType = do
ind <- ask
......@@ -65,17 +70,47 @@ instance PrettyPrint CallConvention where
instance PrettyPrint VarName where
ppFormat (VarName iD) = do
ind <- ask
return $ printf "%s%s%s" ind "@" $ show iD
return $ printf "%s%s%s" ind "@" $ (pp iD)
instance PrettyPrint TypedefName where
ppFormat (TypedefName name) = do
ind <- ask
return $ ind ++ ('@' : show name)
return $ ind ++ ('@' : pp name)
instance PrettyPrint SignatureName where
ppFormat (SignatureName name) = do
ind <- ask
return $ ind ++ ('@' : show name)
return $ ind ++ ('@' : pp name)
instance PrettyPrint BasicBlockName where
ppFormat (BasicBlockName name) = do
ind <- ask
return $ ind ++ ('@' : pp name)
instance PrettyPrint FunctionName where
ppFormat (FunctionName name) = do
ind <- ask
return $ ind ++ ('@' : pp name)
instance PrettyPrint GlobalCellName where
ppFormat (GlobalCellName name) = do
ind <- ask
return $ ind ++ ('@' : pp name)
instance PrettyPrint ExposeName where
ppFormat (ExposeName name) = do
ind <- ask
return $ ind ++ ('@' : pp name)
instance PrettyPrint ConstantName where
ppFormat (ConstantName name) = do
ind <- ask
return $ ind ++ ('@' : pp name)
instance PrettyPrint CookieName where
ppFormat (CookieName name) = do
ind <- ask
return $ ind ++ ('@' : pp name)
instance PrettyPrint ExceptionClause where
ppFormat (ExceptionClause nor exc) = do
......@@ -95,7 +130,7 @@ instance PrettyPrint KeepAliveClause where
instance PrettyPrint DestinationClause where
ppFormat (DestinationClause dest args) = do
ind <- ask
return $ printf "%s%s(%s)" ind ('%' : show dest) (pp args)
return $ printf "%s%s(%s)" ind ('%' : pp dest) (pp args)
instance PrettyPrint Flag where
ppFormat (Flag s) = do
......@@ -425,7 +460,7 @@ instance PrettyPrint Definition where
ind <- ask
case defn of
Constant n ty con -> return $
printf "%s.const %s <%s> = %s" ind (show n) (pp ty) (pp con)
printf "%s.const %s <%s> = %s" ind (pp n) (pp ty) (pp con)
{-
Constdefn var@(VarName _ dType) val ->
......@@ -434,7 +469,7 @@ instance PrettyPrint Definition where
-}
TypeDefinition n ty ->
return $ printf "%s.typedef %s = %s" ind (show n) (pp ty)
return $ printf "%s.typedef %s = %s" ind (pp n) (pp ty)
SignatureDefinition var tLst ret ->
return $
......@@ -452,7 +487,7 @@ instance PrettyPrint Definition where
printf
"%s.funcdef @%s VERSION %s <%s> {\n%s\t}"
ind
(show name)
(pp name)
('%' : show ver)
(pp sig)
(unlines pBody)
......@@ -461,16 +496,16 @@ instance PrettyPrint Definition where
return $ printf "%s.funcdefn @%s = <%s>" ind name (pp sig)
-}
GlobalCell var uType ->
return $ printf "%s.global %s <%s>" ind (show var) (show uType)
return $ printf "%s.global %s <%s>" ind (pp var) (pp uType)
ExposedFunction name fName cconv cookie ->
return $
printf
"%s.expose @%s = @%s <%s> %s"
ind
(show name)
(show fName)
(pp name)
(pp fName)
(pp cconv)
(show cookie)
(pp cookie)
instance PrettyPrint ConstConstructor where
ppFormat con = do
......@@ -496,7 +531,7 @@ instance PrettyPrint BasicBlock where
printf
"%s%s (%s)%s:\n%s%s"
ind
('%' : show name)
('%' : pp name)
(printParams params)
(printExec exec)
(blocks)
......
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