diff options
| author | Tim Foley <tim.foley.is@gmail.com> | 2017-06-15 17:18:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-15 17:18:00 -0700 |
| commit | 0bf3d6d4db7409fcd288ff69e75e8e8b4f082969 (patch) | |
| tree | 7bee1ed3a1f235ac97de9f8d9893f2994015c5c3 /source/slang/reflection.cpp | |
| parent | 1353a7854a738ae173aa1b2f3361f54b82757095 (diff) | |
| parent | e0389f5a1f32cb611e5a595a5974ee1d5c15f43d (diff) | |
Merge pull request #27 from tfoleyNV/decl-ref-cleanup
Replace `DeclRef` approach
Diffstat (limited to 'source/slang/reflection.cpp')
| -rw-r--r-- | source/slang/reflection.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/slang/reflection.cpp b/source/slang/reflection.cpp index 220e5bcdf..89fd94093 100644 --- a/source/slang/reflection.cpp +++ b/source/slang/reflection.cpp @@ -135,7 +135,7 @@ SLANG_API SlangTypeKind spReflectionType_GetKind(SlangReflectionType* inType) else if( auto declRefType = type->As<DeclRefType>() ) { auto declRef = declRefType->declRef; - if( auto structDeclRef = declRef.As<StructDeclRef>() ) + if( auto structDeclRef = declRef.As<StructSyntaxNode>() ) { return SLANG_TYPE_KIND_STRUCT; } @@ -155,9 +155,9 @@ SLANG_API unsigned int spReflectionType_GetFieldCount(SlangReflectionType* inTyp if(auto declRefType = dynamic_cast<DeclRefType*>(type)) { auto declRef = declRefType->declRef; - if( auto structDeclRef = declRef.As<StructDeclRef>()) + if( auto structDeclRef = declRef.As<StructSyntaxNode>()) { - return structDeclRef.GetFields().Count(); + return GetFields(structDeclRef).Count(); } } @@ -174,10 +174,10 @@ SLANG_API SlangReflectionVariable* spReflectionType_GetFieldByIndex(SlangReflect if(auto declRefType = dynamic_cast<DeclRefType*>(type)) { auto declRef = declRefType->declRef; - if( auto structDeclRef = declRef.As<StructDeclRef>()) + if( auto structDeclRef = declRef.As<StructSyntaxNode>()) { - auto fieldDeclRef = structDeclRef.GetFields().ToArray()[index]; - return (SlangReflectionVariable*) fieldDeclRef.GetDecl(); + auto fieldDeclRef = GetFields(structDeclRef).ToArray()[index]; + return (SlangReflectionVariable*) fieldDeclRef.getDecl(); } } @@ -573,7 +573,7 @@ SLANG_API SlangReflectionVariable* spReflectionVariableLayout_GetVariable(SlangR auto varLayout = convert(inVarLayout); if(!varLayout) return nullptr; - return convert(varLayout->varDecl.GetDecl()); + return convert(varLayout->varDecl.getDecl()); } SLANG_API SlangReflectionTypeLayout* spReflectionVariableLayout_GetTypeLayout(SlangReflectionVariableLayout* inVarLayout) |
