The project attempts to closely follow the LLVM C++ header structure.
If there is an upstream llvm/IR/Value.h header, we will define the following files here:
ir/value.cpp - The actual FFI function definitions.ir/value.rs - FFI declarations for that file.Each .cpp file should have an associated .rs file.
All FFI functions declared in Rust should be glob imported into the crate root.
All functions will be prefixed with LLVMRust and will be exported as
functions with the C ABI and no name mangling.
These should be named like LLVMRustCreate<ClassName> or LLVMRustDestroy<ClassName>.
Examples:
LLVMRustCreateContextLLVMRustDestroyContextLLVMRustCreateValueIf we have a get function on Value, the FFI function should look like
rust
LLVMRustValueGet
Static functions are not capitalized differently than standard methods.
When there is an overloaded method, and the additional overloads are solely for convienence, only implement the most general method.