frostc-1.0.0.0: The Frost Programming Language Compiler
Safe HaskellSafe-Inferred
LanguageHaskell2010

Codegen.ExprGen.Cast

Synopsis

Documentation

generateCast :: (MonadCodegen m, ExprGen Expr) => Expr -> m Operand Source #

Generate LLVM code for type casts.

llvmCast :: MonadCodegen m => SrcLoc -> Operand -> Type -> Type -> m Operand Source #

Cast an operand to match a desired LLVM type.

ensureMatchingType :: MonadCodegen m => SrcLoc -> Operand -> Type -> m Operand Source #

Convert an operand to match a desired LLVM type if needed.

toBool :: MonadCodegen m => SrcLoc -> Operand -> m Operand Source #

Convert an operand to a boolean value.