llvmlite

Link C in llvmlite

喜欢而已 提交于 2020-01-14 09:53:26
问题 Im writing an compiler in Python, using llvmlite to generate intermediate LLVM IR. Lexer and parser are finished, now im doing code generation. The compiler will be dynamic and weakly typed, so i will need to do somethings at runtime, like allocation. For this, i've already implemented some functions in C, and now i want to call these functions using builder.call from llvmlite. I have not found documentation or examples of how to do this. This function its just an simple example, the real

LLVM IR: expose variables to GDB?

你离开我真会死。 提交于 2020-01-05 17:51:38
问题 I am writing a custom programming language. I am generating LLVM IR as an intermediate (via LLVMlite), and I want to expose variables to GDB. This is an example of the generated IR: ; ModuleID = "tests/debuginfo.xan" source_filename = "debuginfo.xan" target triple = "x86_64-unknown-linux-gnu" target datalayout = "" define void @"main"(i32 %".1", i8** %".2") !dbg !10 { entry: %"$argc" = alloca i32 store i32 %".1", i32* %"$argc" %"$argv" = alloca i8** store i8** %".2", i8*** %"$argv" %"$a" =