Changeset a56d544 for src/Concurrency/MutexFuncHash.hpp
- Timestamp:
- Feb 14, 2026, 10:38:00 PM (2 days ago)
- Branches:
- stuck-waitfor-destruct
- Children:
- 7e8c071
- Parents:
- c9d36b1
- git-author:
- Matthew Au-Yeung <mw2auyeu@…> (02/14/26 22:30:32)
- git-committer:
- Matthew Au-Yeung <mw2auyeu@…> (02/14/26 22:38:00)
- File:
-
- 1 edited
-
src/Concurrency/MutexFuncHash.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/MutexFuncHash.hpp
rc9d36b1 ra56d544 18 18 #include "AST/Decl.hpp" 19 19 #include "AST/Expr.hpp" 20 #include "AST/Type.hpp"21 20 #include "SymTab/Mangler.hpp" 22 21 … … 27 26 // since function pointers may differ for static inline functions. 28 27 static inline uint64_t hashMangle( const ast::DeclWithType * decl ) { 29 std::string name = Mangle::mangle ( decl );28 std::string name = Mangle::mangleType( decl ); 30 29 uint64_t hash = 14695981039346656037ULL; // FNV offset basis 31 30 for ( char c : name ) { … … 36 35 } 37 36 38 // Create a ConstantExpr for the hash with proper ULL suffix to avoid 39 // C compiler warnings about large unsigned constants. 40 static inline ast::ConstantExpr * hashMangleExpr( 41 const CodeLocation & location, const ast::DeclWithType * decl ) { 42 uint64_t hash = hashMangle( decl ); 43 return new ast::ConstantExpr{ 44 location, 45 new ast::BasicType{ ast::BasicKind::LongLongUnsignedInt }, 46 std::to_string( hash ) + "ull", 47 (unsigned long long)hash }; 37 // Create a ConstantExpr with the hash of the mangled name. 38 static inline ast::ConstantExpr * hashMangleExpr( 39 const CodeLocation & location, const ast::DeclWithType * decl ) { 40 return ast::ConstantExpr::from_ulonglong( location, hashMangle( decl ) ); 48 41 } 49 42
Note:
See TracChangeset
for help on using the changeset viewer.