summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index 990090537..45efca2d9 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -9228,18 +9228,15 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
auto subContext = nestedContext.getContext();
auto outerGeneric = emitOuterGenerics(subContext, decl, decl);
- // An `enum` declaration will currently lower directly to its "tag"
- // type, so that any references to the `enum` become referenes to
- // the tag type instead.
- //
// TODO: if we ever support `enum` types with payloads, we would
// need to make the `enum` lower to some kind of custom "tagged union"
// type.
IRType* loweredTagType = lowerType(subContext, decl->tagType);
+ IRType* enumType = subBuilder->createEnumType(loweredTagType);
+ addLinkageDecoration(context, enumType, decl);
- return LoweredValInfo::simple(
- finishOuterGenerics(subBuilder, loweredTagType, outerGeneric));
+ return LoweredValInfo::simple(finishOuterGenerics(subBuilder, enumType, outerGeneric));
}
LoweredValInfo visitThisTypeDecl(ThisTypeDecl* decl)