forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
d1e3235f60
commit
d132b47bb9
|
@ -48,9 +48,7 @@ void RISCVTargetStreamer::emitTargetAttributes(const MCSubtargetInfo &STI) {
|
|||
auto ParseResult = RISCVFeatures::parseFeatureBits(
|
||||
STI.hasFeature(RISCV::Feature64Bit), STI.getFeatureBits());
|
||||
if (!ParseResult) {
|
||||
/* Assume any error about features should handled earlier. */
|
||||
consumeError(ParseResult.takeError());
|
||||
llvm_unreachable("Parsing feature error when emitTargetAttributes?");
|
||||
report_fatal_error(ParseResult.takeError());
|
||||
} else {
|
||||
auto &ISAInfo = *ParseResult;
|
||||
emitTextAttribute(RISCVAttrs::ARCH, ISAInfo->toString());
|
||||
|
|
Loading…
Reference in New Issue