Issuing a warning from llc

I’m wondering if there’s a way to issue a warning from llc during a machine function pass.

I have access to a MachineFunction instance, but I can’t find any kind of context instance that allows me to issue warnings.

The warning is part of a hardware erratum fix. There are possible side-effects that the user would want to be warned about if they switch on this fix and I want to issue a warning to this effect.

You can get the LLVMContext from
MachineFunction->getFunction()->getContext() and call
LLVMContext::diagnose on it. But please use this sparingly, warnings
from the backend are generally not very user-friendly.