diff options
Diffstat (limited to 'source/slang/syntax.cpp')
| -rw-r--r-- | source/slang/syntax.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index 709206278..b1b9f6d80 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -2713,4 +2713,15 @@ RefPtr<Val> TaggedUnionSubtypeWitness::SubstituteImpl(SubstitutionSet subst, int return substWitness; } +Module* getModule(Decl* decl) +{ + for( auto dd = decl; dd; dd = dd->ParentDecl ) + { + if(auto moduleDecl = as<ModuleDecl>(dd)) + return moduleDecl->module; + } + return nullptr; +} + + } // namespace Slang |
