Changes in / [d28524a:4e83bb7]
- Files:
-
- 14 edited
-
libcfa/configure.ac (modified) (2 diffs)
-
libcfa/src/concurrency/ready_subqueue.hfa (modified) (1 diff)
-
src/AST/Pass.impl.hpp (modified) (1 diff)
-
src/Common/ResolvProtoDump.cpp (modified) (1 diff)
-
src/GenPoly/GenPoly.cc (modified) (1 diff)
-
src/InitTweak/GenInit.cc (modified) (1 diff)
-
src/Parser/lex.ll (modified) (1 diff)
-
src/Parser/parser.yy (modified) (6 diffs)
-
src/ResolvExpr/CurrentObject.cc (modified) (1 diff)
-
src/SymTab/Mangler.cc (modified) (1 diff)
-
src/SymTab/ValidateType.cc (modified) (1 diff)
-
src/SynTree/Type.h (modified) (2 diffs)
-
tests/pybin/tools.py (modified) (2 diffs)
-
tools/gdb/utils-gdb.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/configure.ac
rd28524a r4e83bb7 181 181 AH_TEMPLATE([CFA_HAVE_SPLICE_F_FD_IN_FIXED],[Defined if io_uring support is present when compiling libcfathread and supports the flag SPLICE_F_FD_IN_FIXED.]) 182 182 AH_TEMPLATE([CFA_HAVE_IORING_SETUP_ATTACH_WQ],[Defined if io_uring support is present when compiling libcfathread and supports the flag IORING_SETUP_ATTACH_WQ.]) 183 AH_TEMPLATE([CFA_HAVE_IORING_REGISTER_IOWQ_MAX_WORKERS],[Defined if io_uring support is present when compiling libcfathread and supports the flag IORING_REGISTER_IOWQ_MAX_WORKERS.])184 183 AH_TEMPLATE([CFA_HAVE_PREADV2],[Defined if preadv2 support is present when compiling libcfathread.]) 185 184 AH_TEMPLATE([CFA_HAVE_PWRITEV2],[Defined if pwritev2 support is present when compiling libcfathread.]) … … 190 189 191 190 define(ioring_ops, [IORING_OP_NOP,IORING_OP_READV,IORING_OP_WRITEV,IORING_OP_FSYNC,IORING_OP_READ_FIXED,IORING_OP_WRITE_FIXED,IORING_OP_POLL_ADD,IORING_OP_POLL_REMOVE,IORING_OP_SYNC_FILE_RANGE,IORING_OP_SENDMSG,IORING_OP_RECVMSG,IORING_OP_TIMEOUT,IORING_OP_TIMEOUT_REMOVE,IORING_OP_ACCEPT,IORING_OP_ASYNC_CANCEL,IORING_OP_LINK_TIMEOUT,IORING_OP_CONNECT,IORING_OP_FALLOCATE,IORING_OP_OPENAT,IORING_OP_CLOSE,IORING_OP_FILES_UPDATE,IORING_OP_STATX,IORING_OP_READ,IORING_OP_WRITE,IORING_OP_FADVISE,IORING_OP_MADVISE,IORING_OP_SEND,IORING_OP_RECV,IORING_OP_OPENAT2,IORING_OP_EPOLL_CTL,IORING_OP_SPLICE,IORING_OP_PROVIDE_BUFFERS,IORING_OP_REMOVE_BUFFER,IORING_OP_TEE]) 192 define(ioring_flags, [IOSQE_FIXED_FILE,IOSQE_IO_DRAIN,IOSQE_IO_LINK,IOSQE_IO_HARDLINK,IOSQE_ASYNC,IOSQE_BUFFER_SELECT,SPLICE_F_FD_IN_FIXED,IORING_SETUP_ATTACH_WQ ,IORING_REGISTER_IOWQ_MAX_WORKERS])191 define(ioring_flags, [IOSQE_FIXED_FILE,IOSQE_IO_DRAIN,IOSQE_IO_LINK,IOSQE_IO_HARDLINK,IOSQE_ASYNC,IOSQE_BUFFER_SELECT,SPLICE_F_FD_IN_FIXED,IORING_SETUP_ATTACH_WQ]) 193 192 194 193 define(ioring_from_decls, [ -
libcfa/src/concurrency/ready_subqueue.hfa
rd28524a r4e83bb7 49 49 // Get the relevant nodes locally 50 50 this.prev->link.next = node; 51 __atomic_store_n(&this.prev->link.ts, rdtscl(), __ATOMIC_RELAXED);51 this.prev->link.ts = rdtscl(); 52 52 this.prev = node; 53 53 #if !defined(__CFA_NO_STATISTICS__) -
src/AST/Pass.impl.hpp
rd28524a r4e83bb7 648 648 if ( __visit_children() ) { 649 649 // unlike structs, traits, and unions, enums inject their members into the global scope 650 maybe_accept( node, &EnumDecl::base );651 650 maybe_accept( node, &EnumDecl::params ); 652 651 maybe_accept( node, &EnumDecl::members ); -
src/Common/ResolvProtoDump.cpp
rd28524a r4e83bb7 227 227 } 228 228 229 void previsit( const ast::EnumInstType * ) {229 void previsit( const ast::EnumInstType * enumInst) { 230 230 // TODO: Add the meaningful text representation of typed enum 231 231 ss << (int)ast::BasicType::SignedInt; -
src/GenPoly/GenPoly.cc
rd28524a r4e83bb7 64 64 } 65 65 66 __attribute__((unu sed))66 __attribute__((ununsed)) 67 67 bool hasPolyParams( const std::vector<ast::ptr<ast::Expr>> & params, const TyVarMap & tyVars, const ast::TypeSubstitution * env) { 68 68 for (auto ¶m : params) { -
src/InitTweak/GenInit.cc
rd28524a r4e83bb7 642 642 643 643 ast::ConstructorInit * genCtorInit( const CodeLocation & loc, const ast::ObjectDecl * objDecl ) { 644 // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor for each 644 // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor for each 645 645 // constructable object 646 646 InitExpander_new srcParam{ objDecl->init }, nullParam{ (const ast::Init *)nullptr }; 647 647 ast::ptr< ast::Expr > dstParam = new ast::VariableExpr(loc, objDecl); 648 649 ast::ptr< ast::Stmt > ctor = SymTab::genImplicitCall( 648 649 ast::ptr< ast::Stmt > ctor = SymTab::genImplicitCall( 650 650 srcParam, dstParam, loc, "?{}", objDecl ); 651 ast::ptr< ast::Stmt > dtor = SymTab::genImplicitCall( 652 nullParam, dstParam, loc, "^?{}", objDecl, 651 ast::ptr< ast::Stmt > dtor = SymTab::genImplicitCall( 652 nullParam, dstParam, loc, "^?{}", objDecl, 653 653 SymTab::LoopBackward ); 654 654 655 655 // check that either both ctor and dtor are present, or neither 656 656 assert( (bool)ctor == (bool)dtor ); 657 657 658 658 if ( ctor ) { 659 // need to remember init expression, in case no ctors exist. If ctor does exist, want to 659 // need to remember init expression, in case no ctors exist. If ctor does exist, want to 660 660 // use ctor expression instead of init. 661 ctor.strict_as< ast::ImplicitCtorDtorStmt >(); 661 ctor.strict_as< ast::ImplicitCtorDtorStmt >(); 662 662 dtor.strict_as< ast::ImplicitCtorDtorStmt >(); 663 663 -
src/Parser/lex.ll
rd28524a r4e83bb7 82 82 // Stop warning due to incorrectly generated flex code. 83 83 #pragma GCC diagnostic ignored "-Wsign-compare" 84 85 // lex uses __null in a boolean context, it's fine.86 #pragma GCC diagnostic ignored "-Wnull-conversion"87 84 %} 88 85 -
src/Parser/parser.yy
rd28524a r4e83bb7 56 56 57 57 #include "SynTree/Attribute.h" // for Attribute 58 59 // lex uses __null in a boolean context, it's fine.60 #pragma GCC diagnostic ignored "-Wparentheses-equality"61 58 62 59 extern DeclarationNode * parseTree; … … 1243 1240 { 1244 1241 $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); 1245 SemanticWarning( yylloc, Warning::SuperfluousElse , "");1242 SemanticWarning( yylloc, Warning::SuperfluousElse ); 1246 1243 } 1247 1244 | WHILE '(' conditional_declaration ')' statement %prec THEN … … 1254 1251 { 1255 1252 $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); 1256 SemanticWarning( yylloc, Warning::SuperfluousElse , "");1253 SemanticWarning( yylloc, Warning::SuperfluousElse ); 1257 1254 } 1258 1255 | DO statement WHILE '(' comma_expression ')' ';' … … 1265 1262 { 1266 1263 $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) ); 1267 SemanticWarning( yylloc, Warning::SuperfluousElse , "");1264 SemanticWarning( yylloc, Warning::SuperfluousElse ); 1268 1265 } 1269 1266 | FOR '(' for_control_expression_list ')' statement %prec THEN … … 2397 2394 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}' 2398 2395 { 2399 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) 2396 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) 2400 2397 { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2401 2398 … … 2844 2841 linkage = LinkageSpec::update( yylloc, linkage, $2 ); 2845 2842 } 2846 up external_definition down 2843 up external_definition down 2847 2844 { 2848 2845 linkage = linkageStack.top(); -
src/ResolvExpr/CurrentObject.cc
rd28524a r4e83bb7 73 73 virtual void setPosition( std::list< Expression * > & designators ) = 0; 74 74 75 /// retrieve the list of possible Type/Designat ion pairs for the current position in the currect object75 /// retrieve the list of possible Type/Designaton pairs for the current position in the currect object 76 76 virtual std::list<InitAlternative> operator*() const = 0; 77 77 -
src/SymTab/Mangler.cc
rd28524a r4e83bb7 537 537 } 538 538 539 __attribute__((unused))540 539 inline std::vector< ast::ptr< ast::Type > > getTypes( const std::vector< ast::ptr< ast::DeclWithType > > & decls ) { 541 540 std::vector< ast::ptr< ast::Type > > ret; -
src/SymTab/ValidateType.cc
rd28524a r4e83bb7 222 222 // visit enum members first so that the types of self-referencing members are updated properly 223 223 // Replace the enum base; right now it works only for StructEnum 224 if ( enumDecl->base ) { 225 if ( const TypeInstType * base = dynamic_cast< TypeInstType * >(enumDecl->base) ) { 226 if ( const StructDecl * decl = local_indexer->lookupStruct( base->name ) ) { 227 enumDecl->base = new StructInstType( Type::Qualifiers(), const_cast< StructDecl * >( decl ) ); // Just linking in the node 228 } 229 } else if ( const PointerType * ptr = dynamic_cast< PointerType * >(enumDecl->base) ) { 230 if ( const TypeInstType * ptrBase = dynamic_cast< TypeInstType * >( ptr->base ) ) { 231 if ( const StructDecl * decl = local_indexer->lookupStruct( ptrBase->name ) ) { 232 enumDecl->base = new PointerType( Type::Qualifiers(), 233 new StructInstType( Type::Qualifiers(), const_cast< StructDecl * >( decl ) ) ); 234 } 235 } 224 if ( enumDecl->base && dynamic_cast<TypeInstType*>(enumDecl->base) ) { 225 std::string baseName = static_cast<TypeInstType*>(enumDecl->base)->name; 226 const StructDecl * st = local_indexer->lookupStruct( baseName ); 227 if ( st ) { 228 enumDecl->base = new StructInstType(Type::Qualifiers(),const_cast<StructDecl *>(st)); // Just linking in the node 236 229 } 237 230 } 238 239 231 if ( enumDecl->body ) { 240 232 ForwardEnumsType::iterator fwds = forwardEnums.find( enumDecl->name ); -
src/SynTree/Type.h
rd28524a r4e83bb7 274 274 class PointerType : public Type { 275 275 public: 276 Type * base;276 Type *base; 277 277 278 278 // In C99, pointer types can be qualified in many ways e.g., int f( int a[ static 3 ] ) … … 516 516 typedef ReferenceToType Parent; 517 517 public: 518 // this decl is not "owned" by the enuminst; it is merely a pointer to elsewhere in the tree,519 // where the enumused in this type is actually defined518 // this decl is not "owned" by the union inst; it is merely a pointer to elsewhere in the tree, 519 // where the union used in this type is actually defined 520 520 EnumDecl *baseEnum = nullptr; 521 521 -
tests/pybin/tools.py
rd28524a r4e83bb7 46 46 47 47 print(cmd) 48 return 0, None , None48 return 0, None 49 49 50 50 with contextlib.ExitStack() as onexit: … … 291 291 ################################################################################ 292 292 def jobserver_version(): 293 make_ret, out, err = sh('make', '.test_makeflags', '-j2', ignore_dry_run = True,output_file=subprocess.PIPE, error=subprocess.PIPE)293 make_ret, out, err = sh('make', '.test_makeflags', '-j2', output_file=subprocess.PIPE, error=subprocess.PIPE) 294 294 if make_ret != 0: 295 295 print("ERROR: cannot find Makefile jobserver version", file=sys.stderr) -
tools/gdb/utils-gdb.py
rd28524a r4e83bb7 89 89 return argv 90 90 91 class ClusterIter: 92 def __init__(self, root): 93 self.curr = None 94 self.root = root 95 96 def __iter__(self): 97 return self 98 99 def __next__(self): 100 # Clusters form a cycle 101 # If we haven't seen the root yet, then the root is the first 102 if not self.curr: 103 self.curr = self.root 104 return self.curr 105 106 # if we already saw the root, then go forward 107 self.curr = self.curr['_X4nodeS26__cluster____dbg_node_cltr_1']['_X4nextPS7cluster_1'] 108 109 # if we reached the root again, then we are done 110 if self.curr == self.root: 111 raise StopIteration 112 113 # otherwise return the next 114 return self.curr 115 116 def all_clusters(): 117 """ 118 Return: a list of all the clusters as an iterator. 119 obtained from gdb.Value of globalClusters.root (is an address) 120 """ 121 if not is_cforall(): 122 return [] 123 91 def get_cluster_root(): 92 """ 93 Return: gdb.Value of globalClusters.root (is an address) 94 """ 124 95 cluster_root = gdb.parse_and_eval('_X11mainClusterPS7cluster_1') 125 96 if cluster_root.address == 0x0: 126 97 print('No clusters, program terminated') 127 return [] 128 129 return ClusterIter(cluster_root) 130 131 class ProcIter: 132 def __init__(self, root): 133 self.curr = None 134 self.root = root 135 136 def __iter__(self): 137 return self 138 139 def check(self): 140 # check if this is the last value 141 addr = int(self.curr) 142 mask = 1 << ((8 * int(gdb.parse_and_eval('sizeof(void*)'))) - 1) 143 if 0 != (mask & addr): 144 raise StopIteration 145 146 def __next__(self): 147 cfa_t = get_cfa_types() 148 149 # Processors form a cycle 150 # If we haven't seen the root yet, then the root is the first 151 if not self.curr: 152 my_next = self.root 153 self.curr = my_next.cast(cfa_t.processor_ptr) 154 155 #check if this is an empty list 156 self.check() 157 158 return self.curr 159 160 # if we already saw the root, then go forward 161 my_next = self.curr['__anonymous_object2225']['_X4nextPY13__tE_generic__1'] 162 self.curr = my_next.cast(cfa_t.processor_ptr) 163 164 #check if we reached the end 165 self.check() 166 167 # otherwise return the next 168 return self.curr 169 170 def proc_list(cluster): 171 """ 172 Return: for a given processor, return the active and idle processors, as 2 iterators 173 """ 98 return cluster_root 99 100 def get_sched_lock(): 101 """ 102 Return: gdb.Value of __scheduler_lock 103 """ 104 lock = gdb.parse_and_eval('_X16__scheduler_lockPS20__scheduler_RWLock_t_1') 105 if lock.address == 0x0: 106 print('No scheduler lock, program terminated') 107 return lock 108 109 def all_clusters(): 110 if not is_cforall(): 111 return None 112 113 cluster_root = get_cluster_root() 114 if cluster_root.address == 0x0: 115 return 116 117 curr = cluster_root 118 ret = [curr] 119 120 while True: 121 curr = curr['_X4nodeS26__cluster____dbg_node_cltr_1']['_X4nextPS7cluster_1'] 122 if curr == cluster_root: 123 break 124 125 ret.append(curr) 126 127 return ret 128 129 def all_processors(): 130 if not is_cforall(): 131 return None 132 174 133 cfa_t = get_cfa_types() 175 proclist = cluster['_X5procsS19__cluster_proc_list_1'] 176 idle = proclist['_X5idlesS5dlist_S9processorS5dlink_S9processor___1']['__anonymous_object2167']['_X4nextPY13__tE_generic__1'] 177 active = proclist['_X7activesS5dlist_S9processorS5dlink_S9processor___1']['__anonymous_object2167']['_X4nextPY13__tE_generic__1'] 178 return ProcIter(active.cast(cfa_t.processor_ptr)), ProcIter(idle.cast(cfa_t.processor_ptr)) 179 180 def all_processors(): 181 procs = [] 182 for c in all_clusters(): 183 active, idle = proc_list(c) 184 for p in active: 185 procs.append(p) 186 187 for p in idle: 188 procs.append(p) 189 190 print(procs) 191 return procs 134 135 # get processors from registration to the RWlock 136 lock = get_sched_lock() 137 138 #get number of elements 139 count = lock['_X5readyVj_1'] 140 141 #find all the procs 142 raw_procs = [lock['_X4dataPS21__scheduler_lock_id_t_1'][i]['_X6handleVPS16__processor_id_t_1'] for i in range(count)] 143 144 # pre cast full procs 145 procs = [p.cast(cfa_t.processor_ptr) for p in raw_procs if p['_X9full_procb_1']] 146 147 # sort procs by clusters 148 return sorted(procs, key=lambda p: p['_X4cltrPS7cluster_1']) 192 149 193 150 def tls_for_pthread(pthrd): … … 203 160 204 161 def tls_for_proc(proc): 205 return proc['_X10local_dataPS16KernelThreadData_1']162 return tls_for_pthread(proc['_X13kernel_threadm_1']) 206 163 207 164 def thread_for_pthread(pthrd): … … 223 180 def lookup_cluster(name = None): 224 181 """ 225 Look up one or more cluster given a name182 Look up a cluster given its ID 226 183 @name: str 227 184 Return: gdb.Value … … 230 187 return None 231 188 232 clusters = all_clusters()233 if not clusters:189 root = get_cluster_root() 190 if root.address == 0x0: 234 191 return None 235 192 236 193 if not name: 237 return clusters.root194 return root 238 195 239 196 # lookup for the task associated with the id 240 found = [c for c in clusters if c['_X4namePKc_1'].string() == name] 241 242 if not found: 197 cluster = None 198 curr = root 199 while True: 200 if curr['_X4namePKc_1'].string() == name: 201 cluster = curr.address 202 break 203 curr = curr['_X4nodeS26__cluster____dbg_node_cltr_1']['_X4nextPS7cluster_1'] 204 if curr == root or curr == 0x0: 205 break 206 207 if not cluster: 243 208 print("Cannot find a cluster with the name: {}.".format(name)) 244 209 return None 245 210 246 return found 247 211 return cluster 248 212 249 213 def lookup_threads_by_cluster(cluster): … … 330 294 super(Processors, self).__init__('info processors', gdb.COMMAND_USER) 331 295 332 def print_processor(self, processor , in_stats):296 def print_processor(self, processor): 333 297 should_stop = processor['_X12do_terminateVb_1'] 334 298 if not should_stop: 335 status = in_stats 299 midle = processor['_X6$linksS7$dlinks_S9processor__1']['_X4nextS9$mgd_link_Y13__tE_generic___1']['_X4elemPY13__tE_generic__1'] != 0x0 300 end = processor['_X6$linksS7$dlinks_S9processor__1']['_X4nextS9$mgd_link_Y13__tE_generic___1']['_X10terminatorPv_1'] != 0x0 301 302 status = 'Idle' if midle or end else 'Active' 336 303 else: 337 304 stop_count = processor['_X10terminatedS9semaphore_1']['_X5counti_1'] … … 369 336 return 370 337 338 procs = all_processors() 339 371 340 print('{:>20} {:>11} {:<7} {}'.format('Processor', '', 'Pending', 'Object')) 372 341 print('{:>20} {:>11} {:<7} {}'.format('Name', 'Status', 'Yield', 'Address')) 373 for c in clusters: 374 print('Cluster {}'.format(c['_X4namePKc_1'].string())) 375 376 active, idle = proc_list(c) 342 cl = None 343 for p in procs: 344 # if this is a different cluster print it 345 if cl != p['_X4cltrPS7cluster_1']: 346 if cl: 347 print() 348 cl = p['_X4cltrPS7cluster_1'] 349 print('Cluster {}'.format(cl['_X4namePKc_1'].string())) 350 377 351 # print the processor information 378 for p in active: 379 self.print_processor(p, 'Active') 380 381 for p in idle: 382 self.print_processor(p, 'Idle') 383 384 print() 352 self.print_processor(p) 385 353 386 354 print() … … 465 433 cluster = lookup_cluster(arg) 466 434 if not cluster: 467 print(" No matching cluster")435 print("Could not find cluster '{}'".format(arg)) 468 436 return 469 437
Note:
See TracChangeset
for help on using the changeset viewer.