Fix header-abi-diff skips diff when config.json is not found

Skip loading config.json when the config.json is not found so the
header-abi-diff will still perform abi diff.

Test: preform abi diff without config.json
Bug: 243328443
Change-Id: I92ebf7e7bfe6abb57bdefa211eaf604efaee517e
This commit is contained in:
Mu-Le Lee
2022-08-22 05:16:49 +00:00
parent 2ce72d8673
commit 82c4dd2bc7
2 changed files with 5 additions and 5 deletions

View File

@@ -213,7 +213,10 @@ bool ShouldEmitWarningMessage(CompatibilityStatusIR status) {
int main(int argc, const char **argv) {
llvm::cl::ParseCommandLineOptions(argc, argv, "header-checker");
ReadConfigFile(GetConfigFilePath(old_dump));
const std::string config_file_path = GetConfigFilePath(old_dump);
if (llvm::sys::fs::exists(config_file_path)) {
ReadConfigFile(config_file_path);
}
std::set<std::string> ignored_symbols;
if (llvm::sys::fs::exists(ignore_symbol_list)) {

View File

@@ -72,10 +72,7 @@ bool ConfigFile::Load(std::istream &istream) {
bool ConfigFile::Load(const std::string &path) {
std::ifstream stream(path);
if (stream.is_open()) {
return Load(stream);
}
return false;
return stream && Load(stream);
}
} // namespace utils