Adding Metadata to LLVM IR?

Hi,

I have a custom MIR analysis and I need to propagate its results to some of the LLVM IR instructions. Is there a way to store custom metadata in the LLVM IR? I'm currently investigating the rust_codegen_ssa::mir crate but I'm not absolutely sure to find it there.

I appreciate every response :slight_smile:

You need the rustc_codegen_llvm crate. That is the crate directly interacting with LLVM.

1 Like