diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-05-22 14:21:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-22 11:21:37 -0700 |
| commit | 076a4c06767cca12c5205d950e9cd37451f91488 (patch) | |
| tree | dc3bcc376e18e5233f61b2cedfa3419717798a01 /source/slang/slang-reflection.cpp | |
| parent | daf53bb2708982a2bcc6d6cc08fe88790ccf0bc2 (diff) | |
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
Diffstat (limited to 'source/slang/slang-reflection.cpp')
| -rw-r--r-- | source/slang/slang-reflection.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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<UserDefinedAttribute>()) + for (auto x : decl->getModifiersOfType<UserDefinedAttribute>()) { 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<UserDefinedAttribute>()) + for (auto x : decl->getModifiersOfType<UserDefinedAttribute>()) { 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<UserDefinedAttribute>()) + for (auto x : decl->getModifiersOfType<UserDefinedAttribute>()) { if (id == index) return convert(x); @@ -339,7 +339,7 @@ SLANG_API size_t spReflectionType_GetElementCount(SlangReflectionType* inType) if(auto arrayType = as<ArrayExpressionType>(type)) { - return arrayType->ArrayLength ? (size_t) GetIntVal(arrayType->ArrayLength) : 0; + return arrayType->arrayLength ? (size_t) GetIntVal(arrayType->arrayLength) : 0; } else if( auto vectorType = as<VectorExpressionType>(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<ImplicitParameterGroupElementTypeModifier>()) + if(decl->hasModifier<ImplicitParameterGroupElementTypeModifier>()) 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<ParameterGroupReflectionName>()) + if(auto reflectionNameMod = var->findModifier<ParameterGroupReflectionName>()) 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<HLSLEffectSharedModifier>(); + modifier = var->findModifier<HLSLEffectSharedModifier>(); 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<NumThreadsAttribute>(); + auto numThreadsAttribute = entryPointFunc.getDecl()->findModifier<NumThreadsAttribute>(); if (numThreadsAttribute) { sizeAlongAxis[0] = numThreadsAttribute->x; |
