TheDan64 / inkwell

It's a New Kind of Wrapper for Exposing LLVM (Safely)
https://thedan64.github.io/inkwell/
Apache License 2.0
2.34k stars 227 forks source link

TargetMachine::write_to_file documentation is incorrect #240

Open programmerjake opened 3 years ago

programmerjake commented 3 years ago

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

programmerjake commented 3 years ago

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.