Skip to content

Commit d762350

Browse files
committed
[NFC] Properly handle optional minor value for ArchInfo::Version
Use `value_or` instead of `value` for checking minor versions in `ArchInfo::implies`. Differential Revision: https://reviews.llvm.org/D145206
1 parent a129536 commit d762350

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/TargetParser/AArch64TargetParser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ struct ArchInfo {
288288
return this->Version > Other.Version;
289289
}
290290
if (this->Version.getMajor() == 9 && Other.Version.getMajor() == 8) {
291-
return this->Version.getMinor().value() + 5 >=
292-
Other.Version.getMinor().value();
291+
return this->Version.getMinor().value_or(0) + 5 >=
292+
Other.Version.getMinor().value_or(0);
293293
}
294294
return false;
295295
}

0 commit comments

Comments
 (0)