Changeset a56d544
- 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)
- Files:
-
- 3 added
- 1 deleted
- 4 edited
- 3 moved
-
src/AST/Expr.cpp (modified) (1 diff)
-
src/AST/Expr.hpp (modified) (1 diff)
-
src/Concurrency/MutexFuncHash.hpp (modified) (3 diffs)
-
tests/Makefile.am (modified) (2 diffs)
-
tests/concurrency/waitfor/.expect/autogen_destructor.txt (moved) (moved from tests/.expect/linkoncedestructor.txt )
-
tests/concurrency/waitfor/.expect/static_inline.txt (added)
-
tests/concurrency/waitfor/autogen_destructor.cfa (added)
-
tests/concurrency/waitfor/nodestructor.cfa (moved) (moved from tests/link-once-destructor/nodestructor.cfa )
-
tests/concurrency/waitfor/nodestructor.hfa (moved) (moved from tests/link-once-destructor/nodestructor.hfa ) (1 diff)
-
tests/concurrency/waitfor/static_inline.cfa (added)
-
tests/link-once-destructor/waitfor-destructor.cfa (deleted)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.cpp
rc9d36b1 ra56d544 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 266 272 ConstantExpr * ConstantExpr::from_string( const CodeLocation & loc, const std::string & str ) { 267 273 const Type * charType = new BasicType( BasicKind::Char, ast::CV::Const ); -
src/AST/Expr.hpp
rc9d36b1 ra56d544 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 ); 466 468 /// Generates a string constant from the given string (char type, unquoted string). 467 469 static ConstantExpr * from_string( const CodeLocation & loc, const std::string & string ); -
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 -
tests/Makefile.am
rc9d36b1 ra56d544 119 119 .PHONY : concurrency list .validate .test_makeflags 120 120 .INTERMEDIATE : .validate .validate.cfa .test_makeflags 121 EXTRA_PROGRAMS = array-collections/boxed avl_test linkonce linkoncedestructor linking/mangling/anon .dummy_hack # build but do not install121 EXTRA_PROGRAMS = array-collections/boxed avl_test linkonce concurrency/waitfor/autogen_destructor linking/mangling/anon .dummy_hack # build but do not install 122 122 EXTRA_DIST = test.py \ 123 123 pybin/__init__.py \ … … 154 154 avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa 155 155 linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa 156 linkoncedestructor_SOURCES = link-once-destructor/waitfor-destructor.cfa link-once-destructor/nodestructor.cfa156 concurrency_waitfor_autogen_destructor_SOURCES = concurrency/waitfor/autogen_destructor.cfa concurrency/waitfor/nodestructor.cfa 157 157 linking_mangling_anon_SOURCES = linking/mangling/header.hfa linking/mangling/lib.cfa linking/mangling/main.cfa 158 158 # automake doesn't know we still need C/CPP rules so pretend like we have a C program -
tests/concurrency/waitfor/nodestructor.hfa
rc9d36b1 ra56d544 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.