llvm-hs-pure
LLVM.AST.Module
ppllvm :: LLVM.AST.Module -> Data.Text.Internal.Lazy.Text
buildModule
LLVMの1つのModuleを作る
第一引数はそのモジュールの関数名
ex. "main"
function
ex. main
関数を定義する
function "main" [main関数の引数] <mainの戻り値の型> <mainのbody>
extern
固定引数の関数の定義
externVarArgs
可変長引数の外部関数の定義
「外部関数」ではないか

違うか、自作の関数か

ex. externVarArgs "printf" [ptr i8] i32
compiled-> declare external ccc i32 @printf(i8*, ...)
call
globalStrinsPtr
文字列定数のポインタを作る
LLVM IR内で文字列を表現したければこれが必要
ex. printfに渡すフォーマット文字列を作るなど
icmp
比較などをする
icmp <cond> Op Op
<cond>
のところにIntegerPredicateのEQやGTなどを指定する