llvm-general-quote-0.2.0.0: QuasiQuoting llvm code for llvm-general

Safe HaskellNone
LanguageHaskell2010

LLVM.General.Quote.AST

Synopsis

Documentation

data Instruction Source

Constructors

Add 
FAdd 
Sub 
FSub 
Mul 
FMul 
UDiv 
SDiv 
FDiv 
URem 
SRem 
FRem 
Shl 
LShr 
AShr 
And 
Or 
Xor 
Alloca 
Load 
Store 
GetElementPtr 
Fence 

Fields

atomicity :: Atomicity
 
metadata :: InstructionMetadata
 
CmpXchg 
AtomicRMW 

Fields

volatile :: Bool
 
rmwOperation :: RMWOperation
 
address :: Operand
 
value :: Operand
 
atomicity :: Atomicity
 
metadata :: InstructionMetadata
 
Trunc 
ZExt 
SExt 
FPToUI 
FPToSI 
UIToFP 
SIToFP 
FPTrunc 
FPExt 
PtrToInt 
IntToPtr 
BitCast 
AddrSpaceCast 
ICmp 

Fields

iPredicate :: IntegerPredicate
 
operand0 :: Operand
 
operand1 :: Operand
 
metadata :: InstructionMetadata
 
FCmp 

Fields

fpPredicate :: FloatingPointPredicate
 
operand0 :: Operand
 
operand1 :: Operand
 
metadata :: InstructionMetadata
 
Phi 
Call 

Fields

isTailCall :: Bool
 
callingConvention :: CallingConvention
 
returnAttributes :: [ParameterAttribute]
 
function :: CallableOperand
 
arguments :: [(Operand, [ParameterAttribute])]
 
functionAttributes :: [FunctionAttribute]
 
metadata :: InstructionMetadata
 
Select 
VAArg 
ExtractElement 
InsertElement 
ShuffleVector 
ExtractValue 
InsertValue 
LandingPad 
AntiInstruction String 
Ret 
CondBr 
Br 
Switch 
IndirectBr 
Invoke 

Fields

callingConvention' :: CallingConvention
 
returnAttributes' :: [ParameterAttribute]
 
function' :: CallableOperand
 
arguments' :: [(Operand, [ParameterAttribute])]
 
functionAttributes' :: [FunctionAttribute]
 
returnDest :: Name
 
exceptionDest :: Name
 
metadata :: InstructionMetadata
 
Resume 
Unreachable 
OperandInstruction Operand 

data NamedInstruction Source

Instances of instructions may be given a name, allowing their results to be referenced as Operands. Sometimes instructions - e.g. a call to a function returning void - don't need names.

newtype MetadataNodeID Source

A MetadataNodeID is a number for identifying a metadata node. Note this is different from "named metadata", which are represented with NamedMetadataDefinition.

Constructors

MetadataNodeID Word 

type CallableOperand = Either InlineAssembly Operand Source

The Call instruction is special: the callee can be inline assembly

data Constant Source

http://llvm.org/docs/LangRef.html#constants

N.B. - http://llvm.org/docs/LangRef.html#constant-expressions

Although constant expressions and instructions have many similarites, there are important differences - so they're represented using different types in this AST. At the cost of making it harder to move an code back and forth between being constant and not, this approach embeds more of the rules of what IR is legal into the Haskell types.

data Name Source

Objects of various sorts in LLVM IR are identified by address in the LLVM C++ API, and may be given a string name. When printed to (resp. read from) human-readable LLVM assembly, objects without string names are numbered sequentially (resp. must be numbered sequentially). String names may be quoted, and are quoted when printed if they would otherwise be misread - e.g. when containing special characters.

7

means the seventh unnamed object, while

"7"

means the object named with the string "7".

This libraries handling of UnNames during translation of the AST down into C++ IR is somewhat more forgiving than the LLVM assembly parser: it does not require that unnamed values be numbered sequentially; however, the numbers of UnNames passed into C++ cannot be preserved in the C++ objects. If the C++ IR is printed as assembly or translated into a Haskell AST, unnamed nodes will be renumbered sequentially. Thus unnamed node numbers should be thought of as having any scope limited to the Module in which they are used.

Constructors

Name String

a string name

UnName Word

a number for a nameless thing

NeedsName 
AntiName String 

data DataLayout Source

a description of the various data layout properties which may be used during optimization

Constructors

DataLayout 

Fields

endianness :: Maybe Endianness
 
stackAlignment :: Maybe Word32
 
pointerLayouts :: Map AddrSpace (Word32, AlignmentInfo)
 
typeLayouts :: Map (AlignType, Word32) AlignmentInfo
 
nativeSizes :: Maybe (Set Word32)
 
AntiDataLayout String