summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-08-09 09:11:23 -0700
committerGitHub <noreply@github.com>2023-08-09 09:11:23 -0700
commitc4615fe0ae7e1849b23e9a96d1453794b0b40e90 (patch)
tree0d8d4eed0c90df9664420737d60749f391c11ffb /source/slang/slang-syntax.cpp
parent793a29afc9539f893883b5ad8d88639d63f401e0 (diff)
Clean up and improve Val deduplication performance. (#3069)
* Clean up and improve Val deuplication performance. * Fix. * Fix. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index f6b902c68..b7e9af43a 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -423,21 +423,20 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt
}
else if (auto magicMod = declRef.getDecl()->findModifier<MagicTypeModifier>())
{
+ if (magicMod->magicNodeType == ASTNodeType(-1))
+ {
+ SLANG_UNEXPECTED("unhandled type");
+ }
// Always create builtin types in global AST builder.
if (astBuilder->getSharedASTBuilder()->getInnerASTBuilder() != astBuilder)
return DeclRefType::create(astBuilder->getSharedASTBuilder()->getInnerASTBuilder(), declRef);
declRef = createDefaultSubstitutionsIfNeeded(astBuilder, nullptr, declRef);
- auto classInfo = astBuilder->findSyntaxClass(magicMod->magicName.getUnownedSlice());
- if (!classInfo.classInfo)
- {
- SLANG_UNEXPECTED("unhandled type");
- }
ValNodeDesc nodeDesc = {};
- nodeDesc.type = (ASTNodeType)classInfo.classInfo->m_classId;
+ nodeDesc.type = magicMod->magicNodeType;
nodeDesc.operands.add(ValNodeOperand(declRef));
nodeDesc.init();
- NodeBase* type = astBuilder->_getOrCreateImpl(nodeDesc);
+ NodeBase* type = astBuilder->_getOrCreateImpl(_Move(nodeDesc));
if (!type)
{
SLANG_UNEXPECTED("constructor failure");