Extend named metadata support in the LLVM C API

Hi folks,

I’m working on an LLVM-based Go compiler as a hobby project. I’m using Go bindings to the LLVM C API, and have found that the latter does not have full support for named metadata, which means I can’t (easily/sensibly) export debug information. Namely, you can’t create or update named metadata. I sent a patch to the llvm-commits list last weekend, but haven’t had any feedback yet. I think it may have just slipped under the radar, hence the cross-posting.

If someone could take a look and let me know if this is acceptable, I’ll be very grateful. The original message is here:


I’ll advocate for folks looking at these patches where I can, but I wanted to give you a bit of a heads up – many of the regular contributors (and reviewers) who would be qualified to review this patch are on vacation for the holidays and may be very slow to respond.

Anyways, hopefully someone can look through them, I just didn’t want you to misunderstand any subsequent delays. The next two weeks tend to be the slowest for reviews on the project.

Thanks, Chandler. There’s no rush, I can wait until people return from vacation.


The big issue with the patch is that it changes existing C API entrypoints, breaking compatibility with existing clients. Please propose a patch that adds new entry points (but doesn’t change the existing ones) if the existing ones don’t work. Thanks!