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

Commit 30040f87 authored by Pavel Zakopaylo's avatar Pavel Zakopaylo
Browse files

Added support for declaring undefined functions

parent ed03094c
......@@ -170,6 +170,7 @@ data Definition
= TypeDefinition TypedefName Type
| SignatureDefinition SignatureName [TypedefName] [TypedefName]
| FunctionDefinition FunctionName Version SignatureName BasicBlock [BasicBlock]
| FunctionDeclaration FunctionName SignatureName
| Constant ConstantName TypedefName ConstConstructor
| GlobalCell GlobalCellName TypedefName
| ExposedFunction ExposeName FunctionName CallConvention CookieName
......
......@@ -37,7 +37,7 @@ printf :: (Text.Printf.PrintfType r) => String -> r
--printf a = trace a (Text.Printf.printf a)
printf = Text.Printf.printf
class PrettyPrint a where
class PrettyPrint a where
ppFormat :: a -> Reader String String
pp :: a -> String
pp t = runReader (ppFormat t) ""
......@@ -488,6 +488,8 @@ instance PrettyPrint Definition where
('%' : show ver)
(pp sig)
(unlines pBody)
FunctionDeclaration name sig -> do
return $ printf "%s.funcdecl %s <%s>" ind (pp name) (pp sig)
GlobalCell var uType ->
return $ printf "%s.global %s <%s>" ind (pp var) (pp uType)
......
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