forked from OSchip/llvm-project
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:
parent
ffcc2be7fa
commit
d30423f872
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue