summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-01-03 18:09:35 -0800
committerGitHub <noreply@github.com>2018-01-03 18:09:35 -0800
commite90dfcfd6a0a6d92688012b1216c46c24965cfc0 (patch)
tree89b1e0e3f0e95ea0bf586bd67fa36066f0021ce7 /source/slang/slang.cpp
parent5da16a6360e40b9fd4d2275a5ef5b1af740c4abb (diff)
parent550405d2de2ca617046e73fe5ec7e5e1765a5c97 (diff)
Merge pull request #349 from csyonghe/master
Add API for querying TypeLayout from a Type
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 3156e5008..0b3e0ceb7 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -590,6 +590,22 @@ RefPtr<ModuleDecl> CompileRequest::findOrImportModule(
loc);
}
+Decl * CompileRequest::lookupGlobalDecl(Name * name)
+{
+ Decl* resultDecl = nullptr;
+ for (auto module : loadedModulesList)
+ {
+ if (module->moduleDecl->memberDictionary.TryGetValue(name, resultDecl))
+ break;
+ }
+ for (auto transUnit : translationUnits)
+ {
+ if (transUnit->SyntaxNode->memberDictionary.TryGetValue(name, resultDecl))
+ break;
+ }
+ return resultDecl;
+}
+
RefPtr<ModuleDecl> findOrImportModule(
CompileRequest* request,
Name* name,