Skip to content

Commit 0d8ea82

Browse files
committed
Change error handling to be consistent within each file
1 parent 5a28041 commit 0d8ea82

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,9 @@ static Value *expandIsFPClass(CallInst *Orig) {
322322
return RetVal;
323323
}
324324
default:
325-
// Deliberately falling through to the unreachable below.
326-
break;
325+
report_fatal_error(Twine("Unsupported FPClassTest"),
326+
/* gen_crash_diag=*/false);
327327
}
328-
llvm_unreachable("Unsupported FPClassTest");
329328
}
330329

331330
static Value *expandAnyOrAllIntrinsic(CallInst *Orig,

llvm/lib/Target/DirectX/DXILOpLowering.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,10 @@ class OpLowerer {
766766
OpCode = dxil::OpCode::IsFinite;
767767
break;
768768
default:
769-
llvm_unreachable("Unsupported FPClassTest for DXILOpLowering");
769+
SmallString<128> Msg =
770+
formatv("Unsupported FPClassTest {0} for DXIL Op Lowering",
771+
TCI->getZExtValue());
772+
return make_error<StringError>(Msg, inconvertibleErrorCode());
770773
}
771774

772775
Expected<CallInst *> OpCall =

0 commit comments

Comments
 (0)