Skip to content

Commit d132b47

Browse files
committed
[RISCV] Replace llvm_unreachable with report_fatal_error.
Parsing errors aren't handled earlier in all cases. A simple example is llc -mtriple=riscv64 -mattr=+zve32f. If F or Finx is not also specified, this will hit a parse error. Use a fatal_error so that the error is conveyed to the user.
1 parent d1e3235 commit d132b47

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ void RISCVTargetStreamer::emitTargetAttributes(const MCSubtargetInfo &STI) {
4848
auto ParseResult = RISCVFeatures::parseFeatureBits(
4949
STI.hasFeature(RISCV::Feature64Bit), STI.getFeatureBits());
5050
if (!ParseResult) {
51-
/* Assume any error about features should handled earlier. */
52-
consumeError(ParseResult.takeError());
53-
llvm_unreachable("Parsing feature error when emitTargetAttributes?");
51+
report_fatal_error(ParseResult.takeError());
5452
} else {
5553
auto &ISAInfo = *ParseResult;
5654
emitTextAttribute(RISCVAttrs::ARCH, ISAInfo->toString());

0 commit comments

Comments
 (0)