module DDC.Llvm.Syntax.Metadata
( Metadata (..)
, tbaaNode
, tbaaRoot
, MDecl (..)
, MRef (..)
, MDString (..)
, MDNode (..)
, MDNodeOp (..)
, rval )
where
import DDC.Llvm.Syntax.Type
data Metadata
= Tbaa MDNode
| Debug
deriving (Eq, Show)
data MDecl
= MDecl MRef Metadata
deriving Show
data MRef
= MRef Int
deriving (Show, Eq)
rval :: MDecl -> Metadata
rval (MDecl _ m) = m
data MDString
= MDString String
deriving (Eq, Show)
data MDNode
= MDNode [MDNodeOp]
deriving (Eq, Show)
data MDNodeOp = OpNull
| OpMDString MDString
| OpMDNode MDNode
| OpMDRef MRef
| OpBool Bool
| OpType Type
deriving (Eq, Show)
tbaaNode
:: String
-> MRef
-> Bool
-> Metadata
tbaaNode n pr c
= Tbaa $ MDNode [ OpMDString (MDString n)
, OpMDRef pr
, OpBool c ]
tbaaRoot :: String -> Metadata
tbaaRoot n
= Tbaa $ MDNode [ OpMDString (MDString n)
, OpNull
, OpBool True ]