diff options
| author | Yong He <yonghe@outlook.com> | 2023-12-06 12:05:07 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-06 12:05:07 -0800 |
| commit | 11111e5733b189127dc2c4934d67693b9bc6e764 (patch) | |
| tree | 0ba84df3e856eb104abec2ecac47242bc70a7b7d /source/slang/slang-ir-link.cpp | |
| parent | fa6d8717d02912697c09f2d7de802723ac6d6e47 (diff) | |
Support visibility control and default to `internal`. (#3380)
* Support visibility control and default to `internal`.
* Fix wip.
* Fixes.
* Fix.
* Fix test.
* Add legacy language detection and compatibility for existing code.
* Add doc.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-link.cpp')
| -rw-r--r-- | source/slang/slang-ir-link.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/slang/slang-ir-link.cpp b/source/slang/slang-ir-link.cpp index 87b4f3fde..36769cc34 100644 --- a/source/slang/slang-ir-link.cpp +++ b/source/slang/slang-ir-link.cpp @@ -1412,13 +1412,12 @@ struct IRSpecializationState } }; -static bool _isPublicOrHLSLExported(IRInst* inst) +static bool _isHLSLExported(IRInst* inst) { for (auto decoration : inst->getDecorations()) { const auto op = decoration->getOp(); - if (op == kIROp_PublicDecoration || - op == kIROp_HLSLExportDecoration) + if (op == kIROp_HLSLExportDecoration) { return true; } @@ -1582,8 +1581,8 @@ LinkedIR linkIR( { for (auto inst : irModule->getGlobalInsts()) { - // Is it `public` or (HLSL) `export` clone - if (_isPublicOrHLSLExported(inst)) + // Is it (HLSL) `export` clone + if (_isHLSLExported(inst)) { auto cloned = cloneValue(context, inst); if (!cloned->findDecorationImpl(kIROp_KeepAliveDecoration)) |
