summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
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,