From a62be597990966b9516995650baf750ee6a0146b Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 20 Feb 2024 15:37:11 -0800 Subject: Support link time type specialization. (#3604) --- source/slang/slang-ast-decl.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/slang/slang-ast-decl.cpp') diff --git a/source/slang/slang-ast-decl.cpp b/source/slang/slang-ast-decl.cpp index 9dbd006a0..cd9c43410 100644 --- a/source/slang/slang-ast-decl.cpp +++ b/source/slang/slang-ast-decl.cpp @@ -136,4 +136,19 @@ InterfaceDecl* ThisTypeConstraintDecl::getInterfaceDecl() return as(parentDecl->parentDecl); } +void AggTypeDecl::addTag(TypeTag tag) +{ + typeTags = (TypeTag)((int)tag | (int)tag); +} + +bool AggTypeDecl::hasTag(TypeTag tag) +{ + return ((int)typeTags & (int)tag) != 0; +} + +void AggTypeDecl::unionTagsWith(TypeTag other) +{ + addTag(other); +} + } // namespace Slang -- cgit v1.2.3