archivesOfToyLang/tshunhue/中秋節相關東西/型別設計方案/h.py

24 lines
500 B
Python
Raw Normal View History

2023-09-30 22:30:08 +08:00
#/usr/bin/env python3
import llvmlite.ir as ll
import llvmlite.binding as llvm
llvm.initialize()
llvm.initialize_native_target()
context = ll.Context()
module = ll.Module(context=context)
module.triple = llvm.get_default_triple()
my_type2 = context.get_identified_type("MyType2")
a_type = ll.LiteralStructType((ll.FloatType(), ll.IntType(1)), packed=True)
my_type2.set_body(ll.FloatType(),ll.IntType(32)) # setting %"MyType2" = type {float, i32}
# module.add_global(my_type2)
print(module)