diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-05-19 15:37:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-19 15:37:40 -0400 |
| commit | c54c957d2e647d2f9bfdc0bf31561fca5a02c5df (patch) | |
| tree | 8b54c10f40a005fdac0d9837254c430a837a0a3f /source/slang/slang-parameter-binding.cpp | |
| parent | 1de14312917a0427a7a0858615b65261da60f748 (diff) | |
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.
Diffstat (limited to 'source/slang/slang-parameter-binding.cpp')
| -rw-r--r-- | source/slang/slang-parameter-binding.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<HLSLRegisterSemantic>(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 |
