@@ -219,19 +219,28 @@ static void validateProfilingArgs(DiagnosticEngine &diags,
219219 const Arg *ProfileUse = args.getLastArg (options::OPT_profile_use);
220220 const Arg *IRProfileGenerate =
221221 args.getLastArg (options::OPT_ir_profile_generate);
222+ const Arg *IRProfileUse = args.getLastArg (options::OPT_ir_profile_use);
222223 if (ProfileGenerate && ProfileUse) {
223224 diags.diagnose (SourceLoc (), diag::error_conflicting_options,
224225 " -profile-generate" , " -profile-use" );
225226 }
227+ if (ProfileGenerate && IRProfileUse) {
228+ diags.diagnose (SourceLoc (), diag::error_conflicting_options,
229+ " -profile-generate" , " -ir-profile-use" );
230+ }
226231 if (IRProfileGenerate && ProfileUse) {
227232 diags.diagnose (SourceLoc (), diag::error_conflicting_options,
228233 " -ir-profile-generate" , " -profile-use" );
229234 }
230-
235+ if (IRProfileGenerate && IRProfileUse) {
236+ diags.diagnose (SourceLoc (), diag::error_conflicting_options,
237+ " -ir-profile-generate" , " -ir-profile-use" );
238+ }
231239 // Check if the profdata is missing
232- if (ProfileUse && !llvm::sys::fs::exists (ProfileUse->getValue ())) {
233- diags.diagnose (SourceLoc (), diag::error_profile_missing,
234- ProfileUse->getValue ());
240+ for (const Arg *use : {ProfileUse, IRProfileUse}) {
241+ if (use && !llvm::sys::fs::exists (use->getValue ())) {
242+ diags.diagnose (SourceLoc (), diag::error_profile_missing, use->getValue ());
243+ }
235244 }
236245}
237246
0 commit comments