[PATCH] D145371: [AArch64TargetParser] reinstate assert for optional

Tomas Matheson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 05:02:50 PST 2023


tmatheson created this revision.
tmatheson added a reviewer: zixuw.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
tmatheson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

D145206 <https://reviews.llvm.org/D145206> changed value() to value_or(0), removing the assert that checks
that there is a minor version. Add it back explicitly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145371

Files:
  llvm/include/llvm/TargetParser/AArch64TargetParser.h


Index: llvm/include/llvm/TargetParser/AArch64TargetParser.h
===================================================================
--- llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -288,6 +288,8 @@
       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);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145371.502600.patch
Type: text/x-patch
Size: 641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230306/18da96f3/attachment.bin>


More information about the llvm-commits mailing list