[llvm] 0fcd417 - [AArch64TargetParser] reinstate assert for optional
Tomas Matheson via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 7 02:43:10 PST 2023
Author: Tomas Matheson
Date: 2023-03-07T10:42:42Z
New Revision: 0fcd4177063a0e3feedc9900f68abe534e74fd3b
URL: https://github.com/llvm/llvm-project/commit/0fcd4177063a0e3feedc9900f68abe534e74fd3b
DIFF: https://github.com/llvm/llvm-project/commit/0fcd4177063a0e3feedc9900f68abe534e74fd3b.diff
LOG: [AArch64TargetParser] reinstate assert for optional
D145206 changed value() to value_or(0), removing the assert that checks
that there is a minor version. Add it back explicitly.
Differential Revision: https://reviews.llvm.org/D145371
Added:
Modified:
llvm/include/llvm/TargetParser/AArch64TargetParser.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index 348606964ea4b..3e800bdfc61f4 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -288,6 +288,8 @@ struct ArchInfo {
return this->Version > Other.Version;
}
if (this->Version.getMajor() == 9 && Other.Version.getMajor() == 8) {
+ assert(this->Version.getMinor() && Other.Version.getMinor() &&
+ "AArch64::ArchInfo should have a minor version.");
return this->Version.getMinor().value_or(0) + 5 >=
Other.Version.getMinor().value_or(0);
}
More information about the llvm-commits
mailing list