summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-clone.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-05-26 13:53:10 -0400
committerGitHub <noreply@github.com>2020-05-26 13:53:10 -0400
commitb1369040c3d6d6a8704bdb17d9de99f36a108e07 (patch)
tree2761b93946969fe2f505161d3c75e8cabb6107b6 /source/slang/slang-ir-clone.cpp
parentee2ec68596262398b2d77c128f45b3f32a28c35e (diff)
Improvements around hashing (#1355)
* Fields from upper to lower case in slang-ast-decl.h * Lower camel field names in slang-ast-stmt.h * Fix fields in slang-ast-expr.h * slang-ast-type.h make fields lowerCamel. * slang-ast-base.h members functions lowerCamel. * Method names in slang-ast-type.h to lowerCamel. * GetCanonicalType -> getCanonicalType * Substitute -> substitute * Equals -> equals ToString -> toString * ParentDecl -> parentDecl Members -> members * * Make hash code types explicit * Use HashCode as return type of GetHashCode * Added conversion from double to int64_t * Split Stable from other hash functions * toHash32/64 to convert a HashCode to the other styles. GetHashCode32/64 -> getHashCode32/64 GetStableHashCode32/64 -> getStableHashCode32/64 * Other Get/Stable/HashCode32/64 fixes * GetHashCode -> getHashCode * Equals -> equals * CreateCanonicalType -> createCanonicalType * Catches of polymorphic types should be through references otherwise slicing can occur. * Fixes for newer verison of gcc. Fix hashing problem on gcc for Dictionary. * Another fix for GetHashPos * Fix signed issue around GetHashPos
Diffstat (limited to 'source/slang/slang-ir-clone.cpp')
-rw-r--r--source/slang/slang-ir-clone.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/slang-ir-clone.cpp b/source/slang/slang-ir-clone.cpp
index 9f9349f99..8155a4d34 100644
--- a/source/slang/slang-ir-clone.cpp
+++ b/source/slang/slang-ir-clone.cpp
@@ -299,13 +299,13 @@ bool IRSimpleSpecializationKey::operator==(IRSimpleSpecializationKey const& othe
return true;
}
-int IRSimpleSpecializationKey::GetHashCode() const
+HashCode IRSimpleSpecializationKey::getHashCode() const
{
auto valCount = vals.getCount();
- int hash = Slang::GetHashCode(valCount);
+ HashCode hash = Slang::getHashCode(valCount);
for( Index ii = 0; ii < valCount; ++ii )
{
- hash = combineHash(hash, Slang::GetHashCode(vals[ii]));
+ hash = combineHash(hash, Slang::getHashCode(vals[ii]));
}
return hash;
}