Changeset 6018ddb
- Timestamp:
- Feb 25, 2026, 12:52:06 AM (17 hours ago)
- Branches:
- stuck-waitfor-destruct
- Children:
- a0548c2
- Parents:
- 2b3ebe5
- git-author:
- Matthew Au-Yeung <mw2auyeu@…> (02/25/26 00:31:10)
- git-committer:
- Matthew Au-Yeung <mw2auyeu@…> (02/25/26 00:52:06)
- Files:
-
- 1 deleted
- 5 edited
- 1 moved
-
src/AST/Expr.cpp (modified) (1 diff)
-
src/AST/Expr.hpp (modified) (1 diff)
-
src/Concurrency/MutexFuncHash.hpp (modified) (3 diffs)
-
tests/.expect/linkoncedestructor.txt (moved) (moved from tests/concurrency/waitfor/.expect/autogen_destructor.txt )
-
tests/Makefile.am (modified) (2 diffs)
-
tests/concurrency/waitfor/.expect/static_inline.txt (deleted)
-
tests/concurrency/waitfor/gendestructor.hfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.cpp
r2b3ebe5 r6018ddb 264 264 } 265 265 266 ConstantExpr * ConstantExpr::from_ulonglong( const CodeLocation & loc, unsigned long long i ) {267 return new ConstantExpr{268 loc, new BasicType{ BasicKind::LongLongUnsignedInt }, std::to_string( i ) + "ULL",269 (unsigned long long)i };270 }271 272 266 ConstantExpr * ConstantExpr::from_string( const CodeLocation & loc, const std::string & str ) { 273 267 const Type * charType = new BasicType( BasicKind::Char, ast::CV::Const ); -
src/AST/Expr.hpp
r2b3ebe5 r6018ddb 464 464 /// Generates an integer constant of the given unsigned long int. 465 465 static ConstantExpr * from_ulong( const CodeLocation & loc, unsigned long i ); 466 /// Generates an integer constant of the given unsigned long long int.467 static ConstantExpr * from_ulonglong( const CodeLocation & loc, unsigned long long i );468 466 /// Generates a string constant from the given string (char type, unquoted string). 469 467 static ConstantExpr * from_string( const CodeLocation & loc, const std::string & string ); -
src/Concurrency/MutexFuncHash.hpp
r2b3ebe5 r6018ddb 18 18 #include "AST/Decl.hpp" 19 19 #include "AST/Expr.hpp" 20 #include "AST/Type.hpp" 20 21 #include "SymTab/Mangler.hpp" 21 22 … … 26 27 // since function pointers may differ for static inline functions. 27 28 static inline uint64_t hashMangle( const ast::DeclWithType * decl ) { 28 std::string name = Mangle::mangle Type( decl );29 std::string name = Mangle::mangle( decl ); 29 30 uint64_t hash = 14695981039346656037ULL; // FNV offset basis 30 31 for ( char c : name ) { … … 35 36 } 36 37 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 ) ); 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 }; 41 48 } 42 49 -
tests/Makefile.am
r2b3ebe5 r6018ddb 119 119 .PHONY : concurrency list .validate .test_makeflags 120 120 .INTERMEDIATE : .validate .validate.cfa .test_makeflags 121 <<<<<<< HEAD 121 122 EXTRA_PROGRAMS = array-collections/boxed \ 122 123 avl_test \ … … 126 127 linking/mangling/anon \ 127 128 .dummy_hack # build but do not install 129 ======= 130 EXTRA_PROGRAMS = array-collections/boxed avl_test linkonce linkoncedestructor linking/mangling/anon .dummy_hack # build but do not install 131 >>>>>>> parent of a56d544a4 (cleanup and add tests) 128 132 EXTRA_DIST = test.py \ 129 133 pybin/__init__.py \ -
tests/concurrency/waitfor/gendestructor.hfa
r2b3ebe5 r6018ddb 3 3 thread MyThread {}; 4 4 5 void main(MyThread &t); 5 void main(MyThread &t);
Note:
See TracChangeset
for help on using the changeset viewer.