Skip to content

Commit 6e83058

Browse files
committed
[RISCV] Use an assert insead of a if/else+llvm_unreachable. NFC
1 parent 705636a commit 6e83058

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/TargetParser/RISCVISAInfo.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,10 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
667667
// version since the we don't have clear version scheme for that on
668668
// ISA spec.
669669
for (const auto *Ext : RISCVGImplications) {
670-
if (auto Version = findDefaultVersion(Ext)) {
671-
// Postpone AddExtension until end of this function
672-
SeenExtMap[Ext] = {Version->Major, Version->Minor};
673-
} else
674-
llvm_unreachable("Default extension version not found?");
670+
auto Version = findDefaultVersion(Ext);
671+
assert(Version && "Default extension version not found?");
672+
// Postpone AddExtension until end of this function
673+
SeenExtMap[Ext] = {Version->Major, Version->Minor};
675674
}
676675
} else {
677676
// Baseline is `i` or `e`

0 commit comments

Comments
 (0)