From a2d90fb275962da84611160f8ddd74d934a68dbd Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 4 Aug 2023 15:47:39 -0700 Subject: Redesign `DeclRef` and systematic `Val` deduplication (#3049) * Redesign DeclRef + Deduplicate Val. * Update project files * Fix warning. * Fix. * Fix. * Remove `Val::_equalsImplOverride`. * Rmove `Val::_getHashCodeOverride`. * Remove `semanticVisitor` param from `resolve`. * Cleanups. --------- Co-authored-by: Yong He --- source/compiler-core/slang-name.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/compiler-core/slang-name.cpp') diff --git a/source/compiler-core/slang-name.cpp b/source/compiler-core/slang-name.cpp index cc2033339..c815b8aa8 100644 --- a/source/compiler-core/slang-name.cpp +++ b/source/compiler-core/slang-name.cpp @@ -19,7 +19,7 @@ const char* getCstr(Name* name) return name ? name->text.getBuffer() : nullptr; } -Name* NamePool::getName(String const& text) +Name* NamePool::getName(UnownedStringSlice text) { RefPtr name; if (rootPool->names.tryGetValue(text, name)) @@ -31,6 +31,11 @@ Name* NamePool::getName(String const& text) return name; } +Name* NamePool::getName(String const& text) +{ + return getName(text.getUnownedSlice()); +} + Name* NamePool::tryGetName(String const& text) { RefPtr name; -- cgit v1.2.3