[perf2bolt] Issue error when writing YAML for BOLTed input

Summary:
When the input file is processed by BOLT, we cannot save profile in YAML
format as it requires CFG representation of functions.

(cherry picked from FBD22941794)
This commit is contained in:
Maksim Panchenko 2020-08-12 18:10:41 -07:00
parent 8b989765f6
commit aaf49b095f
1 changed files with 7 additions and 0 deletions

View File

@ -1714,6 +1714,13 @@ void RewriteInstance::adjustCommandLineOptions() {
if (opts::Lite) {
outs() << "BOLT-INFO: enabling lite mode\n";
}
if (!opts::SaveProfile.empty() && BAT->enabledFor(InputFile)) {
errs() << "BOLT-ERROR: unable to save profile in YAML format for input "
"file processed by BOLT. Please remove -w option and use branch "
"profile.\n";
exit(1);
}
}
namespace {