Skip to content

Commit

Permalink
review comments: use early exit code convention
Browse files Browse the repository at this point in the history
  • Loading branch information
inbelic committed Jan 16, 2025
1 parent 8e88fa7 commit a76b907
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions clang/lib/Parse/ParseHLSLRootSignature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@ bool RootSignatureLexer::LexNumber(RootSignatureToken &Result) {
if (Literal.hadError)
return true; // Error has already been reported so just return

if (!Literal.isIntegerLiteral())
return true; // TODO: report unsupported number literal specification

// Retrieve the number value to store into the token
if (Literal.isIntegerLiteral()) {
Result.Kind = TokenKind::int_literal;
Result.Kind = TokenKind::int_literal;

APSInt X = APSInt(32, Result.Signed);
if (Literal.GetIntegerValue(X))
return true; // TODO: Report overflow error
APSInt X = APSInt(32, Result.Signed);
if (Literal.GetIntegerValue(X))
return true; // TODO: Report overflow error

X = Negative ? -X : X;
Result.IntLiteral = (uint32_t)X.getZExtValue();
} else {
return true; // TODO: report unsupported number literal specification
}
X = Negative ? -X : X;
Result.IntLiteral = (uint32_t)X.getZExtValue();

AdvanceBuffer(NumSpelling.size());
return false;
Expand Down

0 comments on commit a76b907

Please sign in to comment.