Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- commas :: [Doc] -> Doc
- colons :: [Doc] -> Doc
- breaks :: (a -> Bool) -> [a] -> [[a]]
- uncons :: MonadPlus m => [a] -> m (a, [a])
- int32 :: Int32 -> Doc
- angles :: Doc -> Doc
- structBraces :: Doc -> Doc
- ppMaybe :: (a -> Doc) -> Maybe a -> Doc
- opt :: Bool -> Doc -> Doc
- data Module = Module {
- modDataLayout :: DataLayout
- modTypes :: [TypeDecl]
- modNamedMd :: [NamedMd]
- modUnnamedMd :: [UnnamedMd]
- modGlobals :: [Global]
- modDeclares :: [Declare]
- modDefines :: [Define]
- modInlineAsm :: InlineAsm
- modAliases :: [GlobalAlias]
- emptyModule :: Module
- ppModule :: Module -> Doc
- data NamedMd = NamedMd {}
- ppNamedMd :: NamedMd -> Doc
- data UnnamedMd = UnnamedMd {}
- ppUnnamedMd :: UnnamedMd -> Doc
- data GlobalAlias = GlobalAlias {}
- ppGlobalAlias :: GlobalAlias -> Doc
- type DataLayout = [LayoutSpec]
- ppDataLayout :: DataLayout -> Doc
- data LayoutSpec
- = BigEndian
- | LittleEndian
- | PointerSize !Int !Int (Maybe Int)
- | IntegerSize !Int !Int (Maybe Int)
- | VectorSize !Int !Int (Maybe Int)
- | FloatSize !Int !Int (Maybe Int)
- | AggregateSize !Int !Int (Maybe Int)
- | StackObjSize !Int !Int (Maybe Int)
- | NativeIntSize [Int]
- | StackAlign !Int
- | Mangling Mangling
- data Mangling
- ppLayoutSpec :: LayoutSpec -> Doc
- ppLayoutBody :: Int -> Int -> Maybe Int -> Doc
- ppMangling :: Mangling -> Doc
- parseDataLayout :: MonadPlus m => String -> m DataLayout
- parseLayoutSpec :: MonadPlus m => String -> m LayoutSpec
- type InlineAsm = [String]
- ppInlineAsm :: InlineAsm -> Doc
- newtype Ident = Ident String
- ppIdent :: Ident -> Doc
- newtype Symbol = Symbol String
- ppSymbol :: Symbol -> Doc
- data PrimType
- ppPrimType :: PrimType -> Doc
- data FloatType
- ppFloatType :: FloatType -> Doc
- type Type = Type' Ident
- data Type' ident
- updateAliases :: (a -> Type' b) -> Type' a -> Type' b
- ppType :: Type -> Doc
- isFloatingPoint :: PrimType -> Bool
- isAlias :: Type -> Bool
- isPrimTypeOf :: (PrimType -> Bool) -> Type -> Bool
- isLabel :: PrimType -> Bool
- isInteger :: PrimType -> Bool
- isVector :: Type -> Bool
- isVectorOf :: (Type -> Bool) -> Type -> Bool
- isArray :: Type -> Bool
- isPointer :: Type -> Bool
- ppArgList :: Bool -> [Doc] -> Doc
- data NullResult lab
- = HasNull (Value' lab)
- | ResolveNull Ident
- primTypeNull :: PrimType -> Value' lab
- floatTypeNull :: FloatType -> Value' lab
- typeNull :: Type -> NullResult lab
- elimFunTy :: MonadPlus m => Type -> m (Type, [Type], Bool)
- elimAlias :: MonadPlus m => Type -> m Ident
- elimPtrTo :: MonadPlus m => Type -> m Type
- elimVector :: MonadPlus m => Type -> m (Int32, Type)
- elimArray :: MonadPlus m => Type -> m (Int32, Type)
- elimFunPtr :: MonadPlus m => Type -> m (Type, [Type], Bool)
- elimPrimType :: MonadPlus m => Type -> m PrimType
- elimFloatType :: MonadPlus m => PrimType -> m FloatType
- elimSequentialType :: MonadPlus m => Type -> m Type
- data TypeDecl = TypeDecl {}
- ppTypeDecl :: TypeDecl -> Doc
- data Global = Global {}
- ppGlobal :: Global -> Doc
- addGlobal :: Global -> Module -> Module
- data GlobalAttrs = GlobalAttrs {
- gaLinkage :: Maybe Linkage
- gaConstant :: Bool
- ppGlobalAttrs :: GlobalAttrs -> Doc
- data Declare = Declare {
- decRetType :: Type
- decName :: Symbol
- decArgs :: [Type]
- decVarArgs :: Bool
- ppDeclare :: Declare -> Doc
- data Define = Define {
- defAttrs :: FunAttrs
- defRetType :: Type
- defName :: Symbol
- defArgs :: [Typed Ident]
- defVarArgs :: Bool
- defSection :: Maybe String
- defBody :: [BasicBlock]
- ppDefine :: Define -> Doc
- addDefine :: Define -> Module -> Module
- data FunAttrs = FunAttrs {}
- emptyFunAttrs :: FunAttrs
- data BlockLabel
- ppLabelDef :: BlockLabel -> Doc
- ppLabel :: BlockLabel -> Doc
- data BasicBlock' lab = BasicBlock {}
- type BasicBlock = BasicBlock' (Maybe BlockLabel)
- ppBasicBlock :: BasicBlock -> Doc
- brTargets :: BasicBlock' lab -> [BlockLabel]
- data Linkage
- ppLinkage :: Linkage -> Doc
- newtype GC = GC {}
- ppGC :: GC -> Doc
- data Typed a = Typed {
- typedType :: Type
- typedValue :: a
- mapMTyped :: Monad m => (a -> m b) -> Typed a -> m (Typed b)
- ppTyped :: (a -> Doc) -> Typed a -> Doc
- data ArithOp
- ppSignBits :: Bool -> Bool -> Doc
- ppExact :: Bool -> Doc
- ppArithOp :: ArithOp -> Doc
- isIArith :: ArithOp -> Bool
- isFArith :: ArithOp -> Bool
- data BitOp
- ppBitOp :: BitOp -> Doc
- data ConvOp
- ppConvOp :: ConvOp -> Doc
- type Align = Int
- data Instr' lab
- = Ret (Typed (Value' lab))
- | RetVoid
- | Arith ArithOp (Typed (Value' lab)) (Value' lab)
- | Bit BitOp (Typed (Value' lab)) (Value' lab)
- | Conv ConvOp (Typed (Value' lab)) Type
- | Call Bool Type (Value' lab) [Typed (Value' lab)]
- | Alloca Type (Maybe (Typed (Value' lab))) (Maybe Int)
- | Load (Typed (Value' lab)) (Maybe Align)
- | Store (Typed (Value' lab)) (Typed (Value' lab)) (Maybe Align)
- | ICmp ICmpOp (Typed (Value' lab)) (Value' lab)
- | FCmp FCmpOp (Typed (Value' lab)) (Value' lab)
- | Phi Type [(Value' lab, lab)]
- | GEP Bool (Typed (Value' lab)) [Typed (Value' lab)]
- | Select (Typed (Value' lab)) (Typed (Value' lab)) (Value' lab)
- | ExtractValue (Typed (Value' lab)) [Int32]
- | InsertValue (Typed (Value' lab)) (Typed (Value' lab)) [Int32]
- | ExtractElt (Typed (Value' lab)) (Value' lab)
- | InsertElt (Typed (Value' lab)) (Typed (Value' lab)) (Value' lab)
- | ShuffleVector (Typed (Value' lab)) (Value' lab) (Typed (Value' lab))
- | Jump lab
- | Br (Typed (Value' lab)) lab lab
- | Invoke Type (Value' lab) [Typed (Value' lab)] lab lab
- | Comment String
- | Unreachable
- | Unwind
- | VaArg (Typed (Value' lab)) Type
- | IndirectBr (Typed (Value' lab)) [lab]
- | Switch (Typed (Value' lab)) lab [(Integer, lab)]
- | LandingPad Type (Typed (Value' lab)) Bool [Clause' lab]
- | Resume (Typed (Value' lab))
- type Instr = Instr' BlockLabel
- data Clause' lab
- type Clause = Clause' BlockLabel
- isTerminator :: Instr' lab -> Bool
- isComment :: Instr' lab -> Bool
- isPhi :: Instr' lab -> Bool
- ppInstr :: Instr -> Doc
- ppClauses :: Bool -> [Clause] -> Doc
- ppClause :: Clause -> Doc
- ppTypedLabel :: BlockLabel -> Doc
- ppSwitchEntry :: Type -> (Integer, BlockLabel) -> Doc
- ppVectorIndex :: Value -> Doc
- ppAlign :: Maybe Align -> Doc
- ppAlloca :: Type -> Maybe (Typed Value) -> Maybe Int -> Doc
- ppCall :: Bool -> Type -> Value -> [Typed Value] -> Doc
- ppCallSym :: Type -> Value -> Doc
- ppGEP :: Bool -> Typed Value -> [Typed Value] -> Doc
- ppInvoke :: Type -> Value -> [Typed Value] -> BlockLabel -> BlockLabel -> Doc
- ppPhiArg :: (Value, BlockLabel) -> Doc
- data ICmpOp
- ppICmpOp :: ICmpOp -> Doc
- data FCmpOp
- ppFCmpOp :: FCmpOp -> Doc
- data Value' lab
- = ValInteger Integer
- | ValBool Bool
- | ValFloat Float
- | ValDouble Double
- | ValIdent Ident
- | ValSymbol Symbol
- | ValNull
- | ValArray Type [Value' lab]
- | ValVector Type [Value' lab]
- | ValStruct [Typed (Value' lab)]
- | ValPackedStruct [Typed (Value' lab)]
- | ValString String
- | ValConstExpr (ConstExpr' lab)
- | ValUndef
- | ValLabel lab
- | ValZeroInit
- | ValAsm Bool Bool String String
- | ValMd (ValMd' lab)
- type Value = Value' BlockLabel
- data ValMd' lab
- type ValMd = ValMd' BlockLabel
- data DebugLoc' lab = DebugLoc {}
- type DebugLoc = DebugLoc' BlockLabel
- isConst :: Value' lab -> Bool
- ppValue :: Value -> Doc
- ppValMd :: ValMd -> Doc
- ppDebugLoc :: DebugLoc -> Doc
- ppTypedValMd :: ValMd -> Doc
- ppMetadata :: Doc -> Doc
- ppMetadataNode :: [Typed Value] -> Doc
- ppBool :: Bool -> Doc
- ppStringLiteral :: String -> Doc
- ppAsm :: Bool -> Bool -> String -> String -> Doc
- elimValSymbol :: MonadPlus m => Value' lab -> m Symbol
- elimValInteger :: MonadPlus m => Value' lab -> m Integer
- data Stmt' lab
- type Stmt = Stmt' BlockLabel
- stmtInstr :: Stmt' lab -> Instr' lab
- stmtMetadata :: Stmt' lab -> [(String, ValMd' lab)]
- extendMetadata :: (String, ValMd' lab) -> Stmt' lab -> Stmt' lab
- ppStmt :: Stmt -> Doc
- ppAttachedMetadata :: [(String, ValMd)] -> Doc
- data ConstExpr' lab
- type ConstExpr = ConstExpr' BlockLabel
- ppConstExpr :: ConstExpr -> Doc
- data IndexResult
- isInvalid :: IndexResult -> Bool
- resolveGep :: Type -> [Typed (Value' lab)] -> IndexResult
- resolveGepBody :: Type -> [Typed (Value' lab)] -> IndexResult
- isGepIndex :: Typed (Value' lab) -> Bool
- isGepStructIndex :: Typed (Value' lab) -> Maybe Integer
- resolveValueIndex :: Type -> [Int32] -> IndexResult
Documentation
structBraces :: Doc -> Doc Source
Module | |
|
ppUnnamedMd :: UnnamedMd -> Doc Source
ppGlobalAlias :: GlobalAlias -> Doc Source
type DataLayout = [LayoutSpec] Source
ppDataLayout :: DataLayout -> Doc Source
Pretty print a data layout specification.
data LayoutSpec Source
BigEndian | |
LittleEndian | |
PointerSize !Int !Int (Maybe Int) | |
IntegerSize !Int !Int (Maybe Int) | |
VectorSize !Int !Int (Maybe Int) | |
FloatSize !Int !Int (Maybe Int) | |
AggregateSize !Int !Int (Maybe Int) | |
StackObjSize !Int !Int (Maybe Int) | |
NativeIntSize [Int] | |
StackAlign !Int | |
Mangling Mangling |
ppLayoutSpec :: LayoutSpec -> Doc Source
Pretty print a single layout specification.
ppLayoutBody :: Int -> Int -> Maybe Int -> Doc Source
Pretty-print the common case for data layout specifications.
ppMangling :: Mangling -> Doc Source
parseDataLayout :: MonadPlus m => String -> m DataLayout Source
Parse the data layout string.
parseLayoutSpec :: MonadPlus m => String -> m LayoutSpec Source
Parse a single layout specification from a string.
ppInlineAsm :: InlineAsm -> Doc Source
Pretty-print the inline assembly block.
Eq Ident | |
Ord Ident | |
Show Ident | |
IsString Ident | |
IsValue Ident | |
DefineArgs Type (Typed Value -> BB ()) | |
DefineArgs (Type, Type) (Typed Value -> Typed Value -> BB ()) | |
DefineArgs as k => DefineArgs ((:>) Type as) (Typed Value -> k) | |
DefineArgs (Type, Type, Type) (Typed Value -> Typed Value -> Typed Value -> BB ()) |
ppPrimType :: PrimType -> Doc Source
ppFloatType :: FloatType -> Doc Source
PrimType PrimType | |
Alias ident | |
Array Int32 (Type' ident) | |
FunTy (Type' ident) [Type' ident] Bool | |
PtrTo (Type' ident) | |
Struct [Type' ident] | |
PackedStruct [Type' ident] | |
Vector Int32 (Type' ident) | |
Opaque |
Functor Type' | |
DefineArgs Type (Typed Value -> BB ()) | |
Eq ident => Eq (Type' ident) | |
Ord ident => Ord (Type' ident) | |
Show ident => Show (Type' ident) | |
DefineArgs (Type, Type) (Typed Value -> Typed Value -> BB ()) | |
DefineArgs as k => DefineArgs ((:>) Type as) (Typed Value -> k) | |
DefineArgs (Type, Type, Type) (Typed Value -> Typed Value -> Typed Value -> BB ()) |
updateAliases :: (a -> Type' b) -> Type' a -> Type' b Source
Traverse a type, updating or removing aliases.
isFloatingPoint :: PrimType -> Bool Source
data NullResult lab Source
HasNull (Value' lab) | |
ResolveNull Ident |
primTypeNull :: PrimType -> Value' lab Source
floatTypeNull :: FloatType -> Value' lab Source
typeNull :: Type -> NullResult lab Source
elimPrimType :: MonadPlus m => Type -> m PrimType Source
elimFloatType :: MonadPlus m => PrimType -> m FloatType Source
elimSequentialType :: MonadPlus m => Type -> m Type Source
Eliminator for array, pointer and vector types.
ppTypeDecl :: TypeDecl -> Doc Source
Global | |
|
ppGlobalAttrs :: GlobalAttrs -> Doc Source
Declare | |
|
Define | |
|
data BlockLabel Source
Eq BlockLabel | |
Ord BlockLabel | |
Show BlockLabel | |
IsString BlockLabel | |
IsValue Value | |
DefineArgs Type (Typed Value -> BB ()) | |
DefineArgs (Type, Type) (Typed Value -> Typed Value -> BB ()) | |
DefineArgs as k => DefineArgs ((:>) Type as) (Typed Value -> k) | |
DefineArgs (Type, Type, Type) (Typed Value -> Typed Value -> Typed Value -> BB ()) |
ppLabelDef :: BlockLabel -> Doc Source
ppLabel :: BlockLabel -> Doc Source
type BasicBlock = BasicBlock' (Maybe BlockLabel) Source
ppBasicBlock :: BasicBlock -> Doc Source
brTargets :: BasicBlock' lab -> [BlockLabel] Source
Symbol Linkage
Typed | |
|
Functor Typed | |
Foldable Typed | |
Traversable Typed | |
DefineArgs Type (Typed Value -> BB ()) | |
Show a => Show (Typed a) | |
IsValue a => IsValue (Typed a) | |
DefineArgs (Type, Type) (Typed Value -> Typed Value -> BB ()) | |
DefineArgs as k => DefineArgs ((:>) Type as) (Typed Value -> k) | |
DefineArgs (Type, Type, Type) (Typed Value -> Typed Value -> Typed Value -> BB ()) |
ppSignBits :: Bool -> Bool -> Doc Source
type Instr = Instr' BlockLabel Source
type Clause = Clause' BlockLabel Source
isTerminator :: Instr' lab -> Bool Source
ppTypedLabel :: BlockLabel -> Doc Source
ppSwitchEntry :: Type -> (Integer, BlockLabel) -> Doc Source
ppVectorIndex :: Value -> Doc Source
ppInvoke :: Type -> Value -> [Typed Value] -> BlockLabel -> BlockLabel -> Doc Source
ppPhiArg :: (Value, BlockLabel) -> Doc Source
ValInteger Integer | |
ValBool Bool | |
ValFloat Float | |
ValDouble Double | |
ValIdent Ident | |
ValSymbol Symbol | |
ValNull | |
ValArray Type [Value' lab] | |
ValVector Type [Value' lab] | |
ValStruct [Typed (Value' lab)] | |
ValPackedStruct [Typed (Value' lab)] | |
ValString String | |
ValConstExpr (ConstExpr' lab) | |
ValUndef | |
ValLabel lab | |
ValZeroInit | |
ValAsm Bool Bool String String | |
ValMd (ValMd' lab) |
Functor Value' | |
HasLabel Value' | |
IsValue Value | |
DefineArgs Type (Typed Value -> BB ()) | |
Show lab => Show (Value' lab) | |
DefineArgs (Type, Type) (Typed Value -> Typed Value -> BB ()) | |
DefineArgs as k => DefineArgs ((:>) Type as) (Typed Value -> k) | |
DefineArgs (Type, Type, Type) (Typed Value -> Typed Value -> Typed Value -> BB ()) |
type Value = Value' BlockLabel Source
type ValMd = ValMd' BlockLabel Source
type DebugLoc = DebugLoc' BlockLabel Source
ppDebugLoc :: DebugLoc -> Doc Source
ppTypedValMd :: ValMd -> Doc Source
ppMetadata :: Doc -> Doc Source
ppMetadataNode :: [Typed Value] -> Doc Source
ppStringLiteral :: String -> Doc Source
elimValSymbol :: MonadPlus m => Value' lab -> m Symbol Source
elimValInteger :: MonadPlus m => Value' lab -> m Integer Source
type Stmt = Stmt' BlockLabel Source
stmtMetadata :: Stmt' lab -> [(String, ValMd' lab)] Source
ppAttachedMetadata :: [(String, ValMd)] -> Doc Source
data ConstExpr' lab Source
ConstGEP Bool [Typed (Value' lab)] | |
ConstConv ConvOp (Typed (Value' lab)) Type | |
ConstSelect (Typed (Value' lab)) (Typed (Value' lab)) (Typed (Value' lab)) | |
ConstBlockAddr Symbol lab |
Functor ConstExpr' | |
HasLabel ConstExpr' | |
Show lab => Show (ConstExpr' lab) |
type ConstExpr = ConstExpr' BlockLabel Source
ppConstExpr :: ConstExpr -> Doc Source
data IndexResult Source
isInvalid :: IndexResult -> Bool Source
resolveGep :: Type -> [Typed (Value' lab)] -> IndexResult Source
Resolve the type of a GEP instruction. Note that the type produced is the type of the result, not necessarily a pointer.
resolveGepBody :: Type -> [Typed (Value' lab)] -> IndexResult Source
Resolve the type of a GEP instruction. This assumes that the input has already been processed as a pointer.
isGepIndex :: Typed (Value' lab) -> Bool Source
resolveValueIndex :: Type -> [Int32] -> IndexResult Source