From 89ec3d16dc3f43a006fb5c7acf5a345789a8918e Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sun, 15 May 2022 13:30:04 +0100 Subject: [PATCH] Allow const nodes in VNRef No functional change. --- src/V3Ast.h | 2 +- src/V3Hasher.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/V3Ast.h b/src/V3Ast.h index 4c306da80..ca00b8040 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -2150,7 +2150,7 @@ static_assert(sizeof(VNRef) == sizeof(std::reference_wrapper), // without having to copy nodes into the collections. // Forward declaration to avoid including V3Hasher.h which needs V3Ast.h (this file). -size_t V3HasherUncachedHash(AstNode&); +size_t V3HasherUncachedHash(const AstNode&); // Specialization of std::hash for VNRef template // diff --git a/src/V3Hasher.cpp b/src/V3Hasher.cpp index 10c53d4c8..7cf3672b6 100644 --- a/src/V3Hasher.cpp +++ b/src/V3Hasher.cpp @@ -530,6 +530,6 @@ V3Hash V3Hasher::uncachedHash(const AstNode* nodep) { // This is used by the std::hash specialization for VNRef. // Declared separately to avoid a circular header dependency. -size_t V3HasherUncachedHash(AstNode& node) { +size_t V3HasherUncachedHash(const AstNode& node) { return static_cast(V3Hasher::uncachedHash(&node).value()); }