From 076a4c06767cca12c5205d950e9cd37451f91488 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 22 May 2020 14:21:37 -0400 Subject: Tidy up around AST nodes (#1353) * Fields from upper to lower case in slang-ast-decl.h * Lower camel field names in slang-ast-stmt.h * Fix fields in slang-ast-expr.h * slang-ast-type.h make fields lowerCamel. * slang-ast-base.h members functions lowerCamel. * Method names in slang-ast-type.h to lowerCamel. * GetCanonicalType -> getCanonicalType * Substitute -> substitute * Equals -> equals ToString -> toString * ParentDecl -> parentDecl Members -> members --- source/slang/slang-parameter-binding.cpp | 48 ++++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 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 2ce7f5f2a..39cf16229 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -585,7 +585,7 @@ static bool findLayoutArg( RefPtr syntax, UInt* outVal) { - for( auto modifier : syntax->GetModifiersOfType() ) + for( auto modifier : syntax->getModifiersOfType() ) { if( modifier ) { @@ -615,7 +615,7 @@ RefPtr getTypeLayoutForGlobalShaderParameter( auto layoutContext = context->layoutContext; auto rules = layoutContext.getRulesFamily(); - if(varDecl->HasModifier() && as(type)) + if(varDecl->hasModifier() && as(type)) { return createTypeLayout( layoutContext.with(rules->getShaderRecordConstantBufferRules()), @@ -625,7 +625,7 @@ RefPtr getTypeLayoutForGlobalShaderParameter( // We want to check for a constant-buffer type with a `push_constant` layout // qualifier before we move on to anything else. - if( varDecl->HasModifier() && as(type) ) + if( varDecl->hasModifier() && as(type) ) { return createTypeLayout( layoutContext.with(rules->getPushConstantBufferRules()), @@ -640,11 +640,11 @@ RefPtr getTypeLayoutForGlobalShaderParameter( // pointer checks in the code that calls this. // HLSL `static` modifier indicates "thread local" - if(varDecl->HasModifier()) + if(varDecl->hasModifier()) return nullptr; // HLSL `groupshared` modifier indicates "thread-group local" - if(varDecl->HasModifier()) + if(varDecl->hasModifier()) return nullptr; // TODO(tfoley): there may be other cases that we need to handle here @@ -703,7 +703,7 @@ static void collectGlobalScopeParameter( auto varDeclRef = shaderParamInfo.paramDeclRef; // We apply any substitutions for global generic parameters here. - auto type = GetType(varDeclRef)->Substitute(globalGenericSubst).as(); + auto type = GetType(varDeclRef)->substitute(globalGenericSubst).as(); // We use a single operation to both check whether the // variable represents a shader parameter, and to compute @@ -776,7 +776,7 @@ static bool shouldDisableDiagnostic( Decl* decl, DiagnosticInfo const& diagnosticInfo) { - for( auto dd = decl; dd; dd = dd->ParentDecl ) + for( auto dd = decl; dd; dd = dd->parentDecl ) { for( auto modifier : dd->modifiers ) { @@ -909,7 +909,7 @@ static void addExplicitParameterBindings_HLSL( // here is where we want to extract and apply them... // Look for HLSL `register` or `packoffset` semantics. - for (auto semantic : varDecl.getDecl()->GetModifiersOfType()) + for (auto semantic : varDecl.getDecl()->getModifiersOfType()) { // Need to extract the information encoded in the semantic LayoutSemanticInfo semanticInfo = ExtractLayoutSemanticInfo(context, semantic); @@ -945,7 +945,7 @@ static void maybeDiagnoseMissingVulkanLayoutModifier( // If the user didn't specify a `binding` (and optional `set`) for Vulkan, // but they *did* specify a `register` for D3D, then that is probably an // oversight on their part. - if( auto registerModifier = varDecl.getDecl()->FindModifier() ) + if( auto registerModifier = varDecl.getDecl()->findModifier() ) { getSink(context)->diagnose(registerModifier, Diagnostics::registerModifierButNoVulkanLayout, varDecl.GetName()); } @@ -983,7 +983,7 @@ static void addExplicitParameterBindings_GLSL( if( (resInfo = typeLayout->FindResourceInfo(LayoutResourceKind::DescriptorTableSlot)) != nullptr ) { // Try to find `binding` and `set` - auto attr = varDecl.getDecl()->FindModifier(); + auto attr = varDecl.getDecl()->findModifier(); if (!attr) { maybeDiagnoseMissingVulkanLayoutModifier(context, varDecl); @@ -995,7 +995,7 @@ static void addExplicitParameterBindings_GLSL( else if( (resInfo = typeLayout->FindResourceInfo(LayoutResourceKind::RegisterSpace)) != nullptr ) { // Try to find `set` - auto attr = varDecl.getDecl()->FindModifier(); + auto attr = varDecl.getDecl()->findModifier(); if (!attr) { maybeDiagnoseMissingVulkanLayoutModifier(context, varDecl); @@ -1588,7 +1588,7 @@ static RefPtr processEntryPointVaryingParameterDecl( int semanticIndex = 0; if( !state.optSemanticName ) { - if( auto semantic = decl->FindModifier() ) + if( auto semantic = decl->findModifier() ) { semanticInfo = decomposeSimpleSemantic(semantic); semanticIndex = semanticInfo.index; @@ -1606,7 +1606,7 @@ static RefPtr processEntryPointVaryingParameterDecl( // if (decl) { - if (decl->FindModifier()) + if (decl->findModifier()) { state.isSampleRate = true; } @@ -1636,12 +1636,12 @@ static RefPtr processEntryPointVaryingParameterDecl( // if( isKhronosTarget(context->getTargetRequest()) ) { - if( auto locationAttr = decl->FindModifier() ) + if( auto locationAttr = decl->findModifier() ) { int location = locationAttr->value; int index = 0; - if( auto indexAttr = decl->FindModifier() ) + if( auto indexAttr = decl->findModifier() ) { index = indexAttr->value; } @@ -1688,7 +1688,7 @@ static RefPtr processEntryPointVaryingParameterDecl( varResInfo->space = index; } } - else if( auto indexAttr = decl->FindModifier() ) + else if( auto indexAttr = decl->findModifier() ) { getSink(context)->diagnose(indexAttr, Diagnostics::vkIndexWithoutVkLocation, decl->getName()); } @@ -1856,7 +1856,7 @@ static RefPtr processEntryPointVaryingParameter( // Note: Bad Things will happen if we have an array input // without a semantic already being enforced. - auto elementCount = (UInt) GetIntVal(arrayType->ArrayLength); + auto elementCount = (UInt) GetIntVal(arrayType->arrayLength); // We use the first element to derive the layout for the element type auto elementTypeLayout = processEntryPointVaryingParameter(context, arrayType->baseType, state, varLayout); @@ -2042,7 +2042,7 @@ static RefPtr computeEntryPointParameterTypeLayout( auto paramType = GetType(paramDeclRef); SLANG_ASSERT(paramType); - if( paramDeclRef.getDecl()->HasModifier() ) + if( paramDeclRef.getDecl()->hasModifier() ) { // An entry-point parameter that is explicitly marked `uniform` represents // a uniform shader parameter passed via the implicitly-defined @@ -2064,16 +2064,16 @@ static RefPtr computeEntryPointParameterTypeLayout( state.directionMask = 0; // If it appears to be an input, process it as such. - if( paramDeclRef.getDecl()->HasModifier() - || paramDeclRef.getDecl()->HasModifier() - || !paramDeclRef.getDecl()->HasModifier() ) + if( paramDeclRef.getDecl()->hasModifier() + || paramDeclRef.getDecl()->hasModifier() + || !paramDeclRef.getDecl()->hasModifier() ) { state.directionMask |= kEntryPointParameterDirection_Input; } // If it appears to be an output, process it as such. - if(paramDeclRef.getDecl()->HasModifier() - || paramDeclRef.getDecl()->HasModifier()) + if(paramDeclRef.getDecl()->hasModifier() + || paramDeclRef.getDecl()->hasModifier()) { state.directionMask |= kEntryPointParameterDirection_Output; } @@ -2578,7 +2578,7 @@ static RefPtr collectEntryPointParameters( auto resultType = GetResultType(entryPointFuncDeclRef); SLANG_ASSERT(resultType); - if( !resultType->Equals(resultType->getSession()->getVoidType()) ) + if( !resultType->equals(resultType->getSession()->getVoidType()) ) { state.loc = entryPointFuncDeclRef.getLoc(); state.directionMask = kEntryPointParameterDirection_Output; -- cgit v1.2.3