Skip to content

Commit 217cb76

Browse files
committed
lexer review: handle parsing of unsigned integers
1 parent c6c9a12 commit 217cb76

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ bool RootSignatureParser::ParseDescriptorRangeOffset(DescriptorRangeOffset *X) {
416416
}
417417

418418
bool RootSignatureParser::ParseUInt(uint32_t *X) {
419+
// Treat a postively signed integer as though it is unsigned to match DXC
420+
TryConsumeExpectedToken(TokenKind::pu_plus);
419421
if (ConsumeExpectedToken(TokenKind::int_literal))
420422
return true;
421423

clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseDTClausesTest) {
334334
DescriptorTable(
335335
visibility = SHADER_VISIBILITY_PIXEL,
336336
CBV(b0),
337-
SRV(t42, space = 3, offset = 32, numDescriptors = 4, flags = 0),
337+
SRV(t42, space = +3, offset = 32, numDescriptors = 4, flags = 0),
338338
Sampler(s987, space = 2, offset = DESCRIPTOR_RANGE_OFFSET_APPEND),
339339
UAV(u987234,
340340
flags = Descriptors_Volatile | Data_Volatile

0 commit comments

Comments
 (0)