llvm-extra-0.7.3: Utility functions for the llvm interface

Safe HaskellNone

LLVM.Extra.Array

Synopsis

Documentation

size :: Natural n => Value (Array n a) -> IntSource

assemble :: (Natural n, IsFirstClass a, IsSized a) => [Value a] -> CodeGenFunction r (Value (Array n a))Source

construct an array out of single elements

You must assert that the length of the list matches the array size.

This can be considered the inverse of extractAll.

extractAll :: (Natural n, IsFirstClass a, IsSized a) => Value (Array n a) -> CodeGenFunction r [Value a]Source

provide the elements of an array as a list of individual virtual registers

This can be considered the inverse of assemble.

map :: (Natural n, IsFirstClass a, IsSized a, IsFirstClass b, IsSized b) => (Value a -> CodeGenFunction r (Value b)) -> Value (Array n a) -> CodeGenFunction r (Value (Array n b))Source

The loop is unrolled, since insertvalue and extractvalue expect constant indices.