diff --git a/clang/lib/Parse/ParseHLSLRootSignature.cpp b/clang/lib/Parse/ParseHLSLRootSignature.cpp index e8e387cd8b043c4..f0879f1ef5cebe9 100644 --- a/clang/lib/Parse/ParseHLSLRootSignature.cpp +++ b/clang/lib/Parse/ParseHLSLRootSignature.cpp @@ -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;