Skip to content

Instantly share code, notes, and snippets.

View sulami's full-sized avatar
🐙
タコ

Robin Schroer sulami

🐙
タコ
View GitHub Profile
@sulami
sulami / call_printf.py
Created April 4, 2020 11:55 — forked from alendit/call_printf.py
Call c `printf` from llvmlite
import llvmlite.ir as ir
import llvmlite.binding as llvm
from ctypes import CFUNCTYPE
def main():
m = ir.Module()
func_ty = ir.FunctionType(ir.VoidType(), [])
i32_ty = ir.IntType(32)
func = ir.Function(m, func_ty, name="printer")