Well, if you have a struct vkd3d_shader_message_context, you can just call vkd3d_shader_error(). Note that the location from header->begin->location is likely to be a fair bit more accurate than whatever is in cfg->parser->location.
Good point, hopefully the latest revision is better. There is certainly some refactoring that should be done in the pipeline frontend -> passes -> backend (including at the level of VSIR), but it would probably be excessive for this MR. I think I can try to work something out of your proposals in the next few days.