diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-04 15:47:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-04 15:47:39 -0700 |
| commit | a2d90fb275962da84611160f8ddd74d934a68dbd (patch) | |
| tree | 066084537b9f4fe1f367de100ed6638a88a028c1 /source/compiler-core/slang-name.cpp | |
| parent | 17da4f0dec2b86ba3a4bdaf8a2ae112047d23623 (diff) | |
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 <yhe@nvidia.com>
Diffstat (limited to 'source/compiler-core/slang-name.cpp')
| -rw-r--r-- | source/compiler-core/slang-name.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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> 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> name; |
