From c54c957d2e647d2f9bfdc0bf31561fca5a02c5df Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 19 May 2020 15:37:40 -0400 Subject: Reduce the size of Token (#1349) * Token size on 64 bits is 24 bytes (from 40). On 32 bits is 16 bytes from 24. * Added hasContent method to Token. Some other small improvements around Token. --- source/slang/slang-parameter-binding.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/slang-parameter-binding.cpp') diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index 353888b69..2ce7f5f2a 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -490,7 +490,7 @@ LayoutSemanticInfo ExtractLayoutSemanticInfo( info.index = 0; info.kind = LayoutResourceKind::None; - UnownedStringSlice registerName = semantic->registerName.Content; + UnownedStringSlice registerName = semantic->registerName.getContent(); if (registerName.getLength() == 0) return info; @@ -533,7 +533,7 @@ LayoutSemanticInfo ExtractLayoutSemanticInfo( UInt space = 0; if( auto registerSemantic = as(semantic) ) { - auto const& spaceName = registerSemantic->spaceName.Content; + auto const& spaceName = registerSemantic->spaceName.getContent(); if(spaceName.getLength() != 0) { UnownedStringSlice spaceSpelling; @@ -564,7 +564,7 @@ LayoutSemanticInfo ExtractLayoutSemanticInfo( } // TODO: handle component mask part of things... - if( semantic->componentMask.Content.getLength() != 0 ) + if( semantic->componentMask.hasContent()) { getSink(context)->diagnose(semantic->componentMask, Diagnostics::componentMaskNotSupported); } @@ -589,7 +589,7 @@ static bool findLayoutArg( { if( modifier ) { - *outVal = (UInt) strtoull(String(modifier->valToken.Content).getBuffer(), nullptr, 10); + *outVal = (UInt) strtoull(String(modifier->valToken.getContent()).getBuffer(), nullptr, 10); return true; } } @@ -1336,7 +1336,7 @@ struct SimpleSemanticInfo SimpleSemanticInfo decomposeSimpleSemantic( HLSLSimpleSemantic* semantic) { - auto composedName = semantic->name.Content; + auto composedName = semantic->name.getContent(); // look for a trailing sequence of decimal digits // at the end of the composed name -- cgit v1.2.3