Skip to content

Commit a76b907

Browse files
committed
review comments: use early exit code convention
1 parent 8e88fa7 commit a76b907

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

clang/lib/Parse/ParseHLSLRootSignature.cpp

+9-10
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,18 @@ bool RootSignatureLexer::LexNumber(RootSignatureToken &Result) {
2828
if (Literal.hadError)
2929
return true; // Error has already been reported so just return
3030

31+
if (!Literal.isIntegerLiteral())
32+
return true; // TODO: report unsupported number literal specification
33+
3134
// Retrieve the number value to store into the token
32-
if (Literal.isIntegerLiteral()) {
33-
Result.Kind = TokenKind::int_literal;
35+
Result.Kind = TokenKind::int_literal;
3436

35-
APSInt X = APSInt(32, Result.Signed);
36-
if (Literal.GetIntegerValue(X))
37-
return true; // TODO: Report overflow error
37+
APSInt X = APSInt(32, Result.Signed);
38+
if (Literal.GetIntegerValue(X))
39+
return true; // TODO: Report overflow error
3840

39-
X = Negative ? -X : X;
40-
Result.IntLiteral = (uint32_t)X.getZExtValue();
41-
} else {
42-
return true; // TODO: report unsupported number literal specification
43-
}
41+
X = Negative ? -X : X;
42+
Result.IntLiteral = (uint32_t)X.getZExtValue();
4443

4544
AdvanceBuffer(NumSpelling.size());
4645
return false;

0 commit comments

Comments
 (0)