Skip to content

Commit 82c645d

Browse files
committed
review: update uses of llvm_unreachable
1 parent dc784ff commit 82c645d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ bool RootSignatureLexer::LexNumber(RootSignatureToken &Result) {
3434
if (Literal.hadError)
3535
return true; // Error has already been reported so just return
3636

37-
if (!Literal.isIntegerLiteral()) {
38-
// Note: if IsNumberChar allows for hexidecimal we will need to turn this
39-
// into a diagnostics for potential fixed-point literals
40-
llvm_unreachable("IsNumberChar will only support digits");
41-
return true;
42-
}
37+
// Note: if IsNumberChar allows for hexidecimal we will need to turn this
38+
// into a diagnostics for potential fixed-point literals
39+
assert(Literal.isIntegerLiteral() && "IsNumberChar will only support digits");
4340

4441
// Retrieve the number value to store into the token
4542
Result.Kind = TokenKind::int_literal;
@@ -142,7 +139,6 @@ bool RootSignatureLexer::LexToken(RootSignatureToken &Result) {
142139
break;
143140
default:
144141
llvm_unreachable("Switch for an expected token was not provided");
145-
return true;
146142
}
147143
return false;
148144
}

0 commit comments

Comments
 (0)