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-lower-to-ir.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-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index aaa9d1a4c..46afc77b7 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -5625,7 +5625,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> } else if(definitionToken.type == TokenType::Identifier) { - definition = definitionToken.Content; + definition = definitionToken.getContent(); } else { @@ -5636,7 +5636,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> auto& targetToken = targetMod->targetToken; if( targetToken.type != TokenType::Unknown ) { - targetName = targetToken.Content; + targetName = targetToken.getContent(); } builder->addTargetIntrinsicDecoration(irInst, targetName, definition.getUnownedSlice()); @@ -5723,7 +5723,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> // if(targetMod->targetToken.type == TokenType::Unknown) return; - else if(targetMod->targetToken.Content.getLength() == 0) + else if(!targetMod->targetToken.hasContent()) return; } } @@ -6156,7 +6156,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> // a specialized definition of the particular function for the given // target, and we need to reflect that at the IR level. - getBuilder()->addTargetDecoration(irFunc, targetMod->targetToken.Content); + getBuilder()->addTargetDecoration(irFunc, targetMod->targetToken.getContent()); } // If this declaration was marked as having a target-specific lowering @@ -6173,7 +6173,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> // for(auto extensionMod : decl->GetModifiersOfType<RequiredGLSLExtensionModifier>()) { - getBuilder()->addRequireGLSLExtensionDecoration(irFunc, extensionMod->extensionNameToken.Content); + getBuilder()->addRequireGLSLExtensionDecoration(irFunc, extensionMod->extensionNameToken.getContent()); } for(auto versionMod : decl->GetModifiersOfType<RequiredGLSLVersionModifier>()) { |
