inkwell
inkwell copied to clipboard
TargetMachine::write_to_file documentation is incorrect
TargetMachine::write_to_file
(wrapped and TargetMachine::write_to_memory_buffer
are both functions for compiling an LLVM Module to assembly language or to machine code, writing the results to a file or to memory. They are misdocumented as being functions that write the TargetMachine
to a file/memory-buffer instead of being functions to compile LLVM IR to assembly/machine code.
https://github.com/llvm/llvm-project/blob/5d214238a15ca28cca99f1a5db6ff8c4c5866711/llvm/include/llvm-c/TargetMachine.h#L135
It might be a good idea to deprecate/remove write_to_file
and write_to_memory_buffer
and create new functions compile_to_file
and compile_to_memory_buffer
, since the write_*
function names are misleading.