Skip to content

Commit a7e20dd

Browse files
committed
LowLevelType: replace a reachable llvm_unreachable with assert
assert is more appropriate here and fixes `runtime error: execution reached an unreachable program point` in a -DLLVM_USE_SANITIZER=Undefined build (-fno-sanitize-recover=all causes llc to exit instead of crash (report_fatal_error)) when testing MachineVerifier/test_g_assert_[sz]ext.mir.
1 parent 3364d76 commit a7e20dd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/include/llvm/CodeGen/LowLevelType.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,9 @@ class LLT {
238238
return getFieldValue(VectorSizeFieldInfo);
239239
else
240240
return getFieldValue(PointerVectorSizeFieldInfo);
241-
} else if (IsPointer)
242-
return getFieldValue(PointerSizeFieldInfo);
243-
else
244-
llvm_unreachable("unexpected LLT");
241+
}
242+
assert(IsPointer && "unexpected LLT");
243+
return getFieldValue(PointerSizeFieldInfo);
245244
}
246245

247246
constexpr unsigned getAddressSpace() const {

0 commit comments

Comments
 (0)