From b1369040c3d6d6a8704bdb17d9de99f36a108e07 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 26 May 2020 13:53:10 -0400 Subject: 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 --- tools/render-test/bind-location.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/render-test/bind-location.cpp') diff --git a/tools/render-test/bind-location.cpp b/tools/render-test/bind-location.cpp index da344dc03..4ec590fd5 100644 --- a/tools/render-test/bind-location.cpp +++ b/tools/render-test/bind-location.cpp @@ -762,7 +762,7 @@ bool BindLocation::operator==(const ThisType& rhs) const return (m_bindPointSet && rhs.m_bindPointSet) && (m_bindPointSet->m_points == rhs.m_bindPointSet->m_points); } -int BindLocation::GetHashCode() const +HashCode BindLocation::getHashCode() const { if (!m_typeLayout) { @@ -770,11 +770,11 @@ int BindLocation::GetHashCode() const } if (m_bindPointSet) { - return m_bindPointSet->GetHashCode(); + return m_bindPointSet->getHashCode(); } else { - return Slang::combineHash(Slang::combineHash(m_category, Slang::GetHashCode(m_typeLayout)), m_point.GetHashCode()); + return Slang::combineHash(Slang::combineHash(m_category, Slang::getHashCode(m_typeLayout)), m_point.getHashCode()); } } -- cgit v1.2.3