Don't bail out if there's no input data file specified.

Summary:
Don't attempt to read data file if it was not
specified by the user.

(cherry picked from FBD2533440)
This commit is contained in:
Maksim Panchenko 2015-10-12 14:46:18 -07:00
parent ffcc2be7fa
commit d30423f872
1 changed files with 13 additions and 11 deletions

View File

@ -693,18 +693,20 @@ int main(int argc, char **argv) {
if (!sys::fs::exists(InputFilename))
report_error(InputFilename, errc::no_such_file_or_directory);
if (!sys::fs::exists(InputDataFilename))
report_error(InputDataFilename, errc::no_such_file_or_directory);
if (!InputDataFilename.empty()) {
if (!sys::fs::exists(InputDataFilename))
report_error(InputDataFilename, errc::no_such_file_or_directory);
// Attempt to read input flo data
ErrorOr<std::unique_ptr<flo::DataReader>> ReaderOrErr =
flo::DataReader::readPerfData(InputDataFilename, errs());
if (std::error_code EC = ReaderOrErr.getError())
report_error(InputDataFilename, EC);
flo::DataReader &DR = *ReaderOrErr.get().get();
if (DumpData) {
DR.dump();
return EXIT_SUCCESS;
// Attempt to read input flo data
ErrorOr<std::unique_ptr<flo::DataReader>> ReaderOrErr =
flo::DataReader::readPerfData(InputDataFilename, errs());
if (std::error_code EC = ReaderOrErr.getError())
report_error(InputDataFilename, EC);
flo::DataReader &DR = *ReaderOrErr.get().get();
if (DumpData) {
DR.dump();
return EXIT_SUCCESS;
}
}
// Attempt to open the binary.