summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-generics-lowering-context.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-12-06 12:05:07 -0800
committerGitHub <noreply@github.com>2023-12-06 12:05:07 -0800
commit11111e5733b189127dc2c4934d67693b9bc6e764 (patch)
tree0ba84df3e856eb104abec2ecac47242bc70a7b7d /source/slang/slang-ir-generics-lowering-context.cpp
parentfa6d8717d02912697c09f2d7de802723ac6d6e47 (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-generics-lowering-context.cpp')
-rw-r--r--source/slang/slang-ir-generics-lowering-context.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/slang/slang-ir-generics-lowering-context.cpp b/source/slang/slang-ir-generics-lowering-context.cpp
index 325568040..212e16483 100644
--- a/source/slang/slang-ir-generics-lowering-context.cpp
+++ b/source/slang/slang-ir-generics-lowering-context.cpp
@@ -60,7 +60,7 @@ namespace Slang
return result;
IRBuilder builderStorage(module);
auto builder = &builderStorage;
- builder->setInsertBefore(typeInst->next);
+ builder->setInsertAfter(typeInst);
result = builder->emitMakeRTTIObject(typeInst);
@@ -75,10 +75,11 @@ namespace Slang
String rttiObjName = exportDecoration->getMangledName();
builder->addExportDecoration(result, rttiObjName.getUnownedSlice());
}
- // Make sure the RTTI object for a public struct type has public visiblity.
- if (typeInst->findDecoration<IRPublicDecoration>())
+
+ // Make sure the RTTI object for an exported struct type is marked as export if the type is.
+ if (typeInst->findDecoration<IRHLSLExportDecoration>())
{
- builder->addPublicDecoration(result);
+ builder->addHLSLExportDecoration(result);
builder->addKeepAliveDecoration(result);
}
mapTypeToRTTIObject[typeInst] = result;