{-# LANGUAGE OverloadedStrings #-}

module LLVM.Examples.Identity (identity) where

import qualified LLVM.General.AST as AST

import LLVM.Gen
import Control.Monad
import Control.Lens ((.=))
import LLVM.General.AST.Type (double)

identity :: AST.Module
identity = mapLLVM . runLLVM defaultModule $ do
  
  moduleName .= "identity"

  defn double "id" [(double, "a", 8)] $ do
    a <- getvar' "a"
    ret a

