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-reflection.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/slang/slang-reflection.cpp') diff --git a/source/slang/slang-reflection.cpp b/source/slang/slang-reflection.cpp index c0e83ccaf..72a20e932 100644 --- a/source/slang/slang-reflection.cpp +++ b/source/slang/slang-reflection.cpp @@ -101,7 +101,7 @@ static inline SlangReflection* convert(ProgramLayout* program) unsigned int getUserAttributeCount(Decl* decl) { unsigned int count = 0; - for (auto x : decl->GetModifiersOfType()) + for (auto x : decl->getModifiersOfType()) { SLANG_UNUSED(x); count++; @@ -112,7 +112,7 @@ unsigned int getUserAttributeCount(Decl* decl) SlangReflectionUserAttribute* findUserAttributeByName(Session* session, Decl* decl, const char* name) { auto nameObj = session->tryGetNameObj(name); - for (auto x : decl->GetModifiersOfType()) + for (auto x : decl->getModifiersOfType()) { if (x->name == nameObj) return (SlangReflectionUserAttribute*)(x); @@ -123,7 +123,7 @@ SlangReflectionUserAttribute* findUserAttributeByName(Session* session, Decl* de SlangReflectionUserAttribute* getUserAttributeByIndex(Decl* decl, unsigned int index) { unsigned int id = 0; - for (auto x : decl->GetModifiersOfType()) + for (auto x : decl->getModifiersOfType()) { if (id == index) return convert(x); @@ -339,7 +339,7 @@ SLANG_API size_t spReflectionType_GetElementCount(SlangReflectionType* inType) if(auto arrayType = as(type)) { - return arrayType->ArrayLength ? (size_t) GetIntVal(arrayType->ArrayLength) : 0; + return arrayType->arrayLength ? (size_t) GetIntVal(arrayType->arrayLength) : 0; } else if( auto vectorType = as(type)) { @@ -579,7 +579,7 @@ SLANG_API char const* spReflectionType_GetName(SlangReflectionType* inType) // Don't return a name for auto-generated anonymous types // that represent `cbuffer` members, etc. auto decl = declRef.getDecl(); - if(decl->HasModifier()) + if(decl->hasModifier()) return nullptr; return getText(declRef.GetName()).begin(); @@ -943,7 +943,7 @@ SLANG_API char const* spReflectionVariable_GetName(SlangReflectionVariable* inVa // If the variable is one that has an "external" name that is supposed // to be exposed for reflection, then report it here - if(auto reflectionNameMod = var->FindModifier()) + if(auto reflectionNameMod = var->findModifier()) return getText(reflectionNameMod->nameAndLoc.name).getBuffer(); return getText(var->getName()).getBuffer(); @@ -966,7 +966,7 @@ SLANG_API SlangReflectionModifier* spReflectionVariable_FindModifier(SlangReflec switch( modifierID ) { case SLANG_MODIFIER_SHARED: - modifier = var->FindModifier(); + modifier = var->findModifier(); break; default: @@ -1294,7 +1294,7 @@ SLANG_API void spReflectionEntryPoint_getComputeThreadGroupSize( SlangUInt sizeAlongAxis[3] = { 1, 1, 1 }; // First look for the HLSL case, where we have an attribute attached to the entry point function - auto numThreadsAttribute = entryPointFunc.getDecl()->FindModifier(); + auto numThreadsAttribute = entryPointFunc.getDecl()->findModifier(); if (numThreadsAttribute) { sizeAlongAxis[0] = numThreadsAttribute->x; -- cgit v1.2.3