I’m working on Rust support for an in-house developed hardware extension. This requires the programmer to annotate certain variables and functions. These annotations should be propagated through the compiler, preferably all the way down into the binary.
I already more or less managed to implement the front-end in a crate. For the propagation of the annotations, I’ve found a topic on llvm intrinsics and annotations:
I suppose I might be able to use llvm attributes. However, that requires modifications to the Rust compiler and/or llvm. Since there is no use-case for this work outside of the company, this work would have to be maintained by a very small team. Therefore, I would highly prefer a method that does not involve modifying the Rust compiler and/or llvm. Ideally, no unstable interfaces should be required either.
What would be my options? And if this non-invasive approach turns out to be impossible/impractical, what would be my best next option?