llvm-pretty-0.3.1.1: A pretty printing library inspired by the llvm binding.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.LLVM.AST

Synopsis

Documentation

breaks :: (a -> Bool) -> [a] -> [[a]] Source

uncons :: MonadPlus m => [a] -> m (a, [a]) Source

ppMaybe :: (a -> Doc) -> Maybe a -> Doc Source

opt :: Bool -> Doc -> Doc Source

data NamedMd Source

Constructors

NamedMd 

Fields

nmName :: String
 
nmValues :: [Int]
 

Instances

data UnnamedMd Source

Constructors

UnnamedMd 

Fields

umIndex :: !Int
 
umValues :: [Typed Value]
 

Instances

ppDataLayout :: DataLayout -> Doc Source

Pretty print a data layout specification.

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.

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.

data Type' ident Source

Constructors

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 

Instances

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.

ppArgList :: Bool -> [Doc] -> Doc Source

Build a variable-argument argument list.

data NullResult lab Source

Constructors

HasNull (Value' lab) 
ResolveNull Ident 

elimSequentialType :: MonadPlus m => Type -> m Type Source

Eliminator for array, pointer and vector types.

data TypeDecl Source

Constructors

TypeDecl 

Fields

typeName :: Ident
 
typeValue :: Type
 

Instances

data Declare Source

Constructors

Declare 

Instances

data FunAttrs Source

Constructors

FunAttrs 

Instances

data BasicBlock' lab Source

Constructors

BasicBlock 

Fields

bbLabel :: lab
 
bbStmts :: [Stmt]
 

Instances

Show lab => Show (BasicBlock' lab) 

newtype GC Source

Constructors

GC 

Fields

getGC :: String
 

Instances

mapMTyped :: Monad m => (a -> m b) -> Typed a -> m (Typed b) Source

ppTyped :: (a -> Doc) -> Typed a -> Doc Source

data BitOp Source

Constructors

Shl Bool Bool 
Lshr Bool 
Ashr Bool 
And 
Or 
Xor 

Instances

data Instr' lab Source

Constructors

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)) 

Instances

data Clause' lab Source

Constructors

Catch (Typed (Value' lab)) 
Filter (Typed (Value' lab)) 

Instances

data ICmpOp Source

Constructors

Ieq 
Ine 
Iugt 
Iuge 
Iult 
Iule 
Isgt 
Isge 
Islt 
Isle 

Instances

data FCmpOp Source

Instances

data ValMd' lab Source

Instances

data DebugLoc' lab Source

Constructors

DebugLoc 

Fields

dlLine :: Int32
 
dlCol :: Int32
 
dlScope :: ValMd' lab
 
dlIA :: Maybe (ValMd' lab)
 

data Stmt' lab Source

Constructors

Result Ident (Instr' lab) [(String, ValMd' lab)] 
Effect (Instr' lab) [(String, ValMd' lab)] 

Instances

extendMetadata :: (String, ValMd' lab) -> Stmt' lab -> Stmt' lab Source

data IndexResult Source

Constructors

Invalid

An invalid use of GEP

HasType Type

A resolved type

Resolve Ident (Type -> IndexResult)

Continue, after resolving an alias

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.