diff options
| author | Yong He <yongh@outlook.com> | 2018-01-03 12:53:16 -0800 |
|---|---|---|
| committer | Yong He <yongh@outlook.com> | 2018-01-03 12:53:16 -0800 |
| commit | 771da268461e9ad3addf94a452a4c13ee291918e (patch) | |
| tree | 82086fa2b8e0b740cc532d33dc9fdc78a05e681f /source | |
| parent | 36bc65aa95210f383df9564c75bf1fa9efdadf8a (diff) | |
spReflection_FindTypeByName: add lookup in translationUnits.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/reflection.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/reflection.cpp b/source/slang/reflection.cpp index 0558ff773..59b50891c 100644 --- a/source/slang/reflection.cpp +++ b/source/slang/reflection.cpp @@ -438,12 +438,17 @@ SLANG_API SlangReflectionType * spReflection_FindTypeByName(SlangReflection * re return (SlangReflectionType*)result.Ptr(); Decl* resultDecl = nullptr; + auto nameObj = compileRequest->getNamePool()->getName(name); for (auto module : compileRequest->loadedModulesList) { - auto nameObj = compileRequest->getNamePool()->getName(name); if (module->moduleDecl->memberDictionary.TryGetValue(nameObj, resultDecl)) break; } + for (auto transUnit : compileRequest->translationUnits) + { + if (transUnit->SyntaxNode->memberDictionary.TryGetValue(nameObj, resultDecl)) + break; + } if (resultDecl) { RefPtr<DeclRefType> declRefType = new DeclRefType(); |
