diff options
| author | Yong He <yonghe@outlook.com> | 2024-02-23 16:39:46 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-23 16:39:46 -0800 |
| commit | 401d8cdb12ae69aeb216c80c9bb90240d8359649 (patch) | |
| tree | 4548c9de52bdeff424a0a3969ad407fccb3c0f09 /source/slang/slang-check-decl.cpp | |
| parent | 58eb6f7da01af1767282ee12b0b4b25c57e52afb (diff) | |
Add slangc interface to compile and use ir modules. (#3615)
* Add slangc interface to compile and use ir modules.
* Fix glsl scalar layout settings not copied to target.
* Fix.
* Cleanups.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index 28db66c45..25f535825 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -1712,7 +1712,7 @@ namespace Slang { if (auto varDeclRefType = as<DeclRefType>(varDecl->type.type)) { - parentAggTypeDecl->unionTagsWith(getTypeTags(varDecl->type.type)); + parentAggTypeDecl->unionTagsWith(getTypeTags(varDeclRefType)); } } @@ -9321,20 +9321,21 @@ namespace Slang else if (as<PrivateModifier>(modifier)) return DeclVisibility::Private; } - // Interface members will always have the same visibility as the interface itself. if (auto interfaceDecl = findParentInterfaceDecl(decl)) { return getDeclVisibility(interfaceDecl); } - else if (as<NamespaceDecl>(decl)) + auto defaultVis = DeclVisibility::Default; + if (auto parentModule = getModuleDecl(decl)) + defaultVis = parentModule->isInLegacyLanguage ? DeclVisibility::Public : DeclVisibility::Internal; + + // Members of other agg type decls will have their default visibility capped to the parents'. + if (as<NamespaceDecl>(decl)) { return DeclVisibility::Public; } - if (auto parentModule = getModuleDecl(decl)) - return parentModule->isInLegacyLanguage ? DeclVisibility::Public : DeclVisibility::Internal; - - return DeclVisibility::Default; + return defaultVis; } void diagnoseCapabilityProvenance(DiagnosticSink* sink, Decl* decl, CapabilityAtom missingAtom) |
