Use new diagnostic message functions in generated code.