Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ModuleID = "/home/callum/fns2/funs_no_errors_v2/functions_no_errors/codegen.py"
- target triple = "x86_64-unknown-linux-gnu"
- target datalayout = ""
- define void @"main"()
- {
- entry:
- %".2" = bitcast [6 x i8]* @"fstr" to i64*
- %".3" = call i64 @"myfun"()
- }
- declare dso_local i32 @"printf"(i64* %".1", ...)
- @"fstr" = internal constant [6 x i8] c"%lf \0a\00"
- define i64 @"myfun"()
- {
- function:
- %".2" = alloca double
- store double 0x4000000000000000, double* %".2"
- %".4" = alloca double
- store double 0x4008000000000000, double* %".4"
- %".6" = alloca double
- %".7" = load double, double* %".2"
- %".8" = load double, double* %".4"
- %".9" = fadd double %".7", %".8"
- store double %".9", double* %".6"
- %".11" = load double, double* %".6"
- %".12" = call i32 (i64*, ...) @"printf"(i64* %".2", double %".11")
- ret i64 0
- }
- Traceback (most recent call last):
- File "main.py", line 105, in <module>
- codegen.create_ir()
- File "/home/callum/fns2/funs_no_errors_v2/functions_no_errors/codegen.py", line 668, in create_ir
- self._compile_ir()
- File "/home/callum/fns2/funs_no_errors_v2/functions_no_errors/codegen.py", line 658, in _compile_ir
- mod = self.binding.parse_assembly(llvm_ir)
- File "/home/callum/.local/lib/python3.8/site-packages/llvmlite/binding/module.py", line 25, in parse_assembly
- raise RuntimeError("LLVM IR parsing error\n{0}".format(errmsg))
- RuntimeError: LLVM IR parsing error
- <string>:29:48: error: '%.2' defined with type 'double*' but expected 'i64*'
- %".12" = call i32 (i64*, ...) @"printf"(i64* %".2", double %".11")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement