Skip to content

Commit 4b359d5

Browse files
author
Finn Plummer
committed
self-review: fix-up comments
1 parent 7699691 commit 4b359d5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class RootSignatureParser {
6969
bool parseDescriptorTable();
7070
bool parseDescriptorTableClause();
7171

72-
/// Each unique ParamType will have a custom parse method defined that we can
73-
/// use to invoke the parameters.
72+
/// Each unique ParamType will have a custom parse method defined that can be
73+
/// invoked to set a value to the referenced paramtype.
7474
///
7575
/// This function will switch on the ParamType using std::visit and dispatch
7676
/// onto the corresponding parse method
@@ -86,7 +86,7 @@ class RootSignatureParser {
8686
/// TokenKind::kw_space, &Clause.Space
8787
/// };
8888
/// SmallDenseSet<TokenKind> Mandatory = {
89-
/// TokenKind::kw_numDescriptors
89+
/// TokenKind::bReg
9090
/// };
9191
///
9292
/// We can read it is as:

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ bool RootSignatureParser::parseRegister(Register *Register) {
210210
"Expects to only be invoked starting at given keyword");
211211

212212
switch (CurToken.Kind) {
213+
default:
214+
llvm_unreachable("Switch for consumed token was not provided");
213215
case TokenKind::bReg:
214216
Register->ViewType = RegisterType::BReg;
215217
break;
@@ -222,8 +224,6 @@ bool RootSignatureParser::parseRegister(Register *Register) {
222224
case TokenKind::sReg:
223225
Register->ViewType = RegisterType::SReg;
224226
break;
225-
default:
226-
break; // Unreachable given Try + assert pattern
227227
}
228228

229229
if (handleUIntLiteral(&Register->Number))

0 commit comments

Comments
 (0)