@@ -219,19 +219,28 @@ static void validateProfilingArgs(DiagnosticEngine &diags,
219
219
const Arg *ProfileUse = args.getLastArg (options::OPT_profile_use);
220
220
const Arg *IRProfileGenerate =
221
221
args.getLastArg (options::OPT_ir_profile_generate);
222
+ const Arg *IRProfileUse = args.getLastArg (options::OPT_ir_profile_use);
222
223
if (ProfileGenerate && ProfileUse) {
223
224
diags.diagnose (SourceLoc (), diag::error_conflicting_options,
224
225
" -profile-generate" , " -profile-use" );
225
226
}
227
+ if (ProfileGenerate && IRProfileUse) {
228
+ diags.diagnose (SourceLoc (), diag::error_conflicting_options,
229
+ " -profile-generate" , " -ir-profile-use" );
230
+ }
226
231
if (IRProfileGenerate && ProfileUse) {
227
232
diags.diagnose (SourceLoc (), diag::error_conflicting_options,
228
233
" -ir-profile-generate" , " -profile-use" );
229
234
}
230
-
235
+ if (IRProfileGenerate && IRProfileUse) {
236
+ diags.diagnose (SourceLoc (), diag::error_conflicting_options,
237
+ " -ir-profile-generate" , " -ir-profile-use" );
238
+ }
231
239
// 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
+ }
235
244
}
236
245
}
237
246
0 commit comments