Changeset 4a8f150
- Timestamp:
- Dec 1, 2020, 3:39:24 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a25f64b
- Parents:
- 41c19b4
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInitNew.cpp
r41c19b4 r4a8f150 413 413 void SelfAssignChecker::previsit( const ast::ApplicationExpr * appExpr ) { 414 414 auto function = getFunction( appExpr ); 415 if ( function->name == "?=?" ) { // doesn't use isAssignment, because ?+=?, etc. should not count as self-assignment 416 if ( appExpr->args.size() == 2 ) { 417 // check for structural similarity (same variable use, ignore casts, etc. - but does not look too deeply, anything looking like a function is off limits) 418 if ( structurallySimilar( appExpr->args.front(), appExpr->args.back() ) ) { 419 SemanticWarning( appExpr->location, Warning::SelfAssignment, toCString( appExpr->args.front() ) ); 420 } 421 } 415 // Doesn't use isAssignment, because ?+=?, etc. should not count as self-assignment. 416 if ( function->name == "?=?" && appExpr->args.size() == 2 417 // Check for structural similarity (same variable use, ignore casts, etc. 418 // (but does not look too deeply, anything looking like a function is off limits). 419 && structurallySimilar( appExpr->args.front(), appExpr->args.back() ) ) { 420 SemanticWarning( appExpr->location, Warning::SelfAssignment, toCString( appExpr->args.front() ) ); 422 421 } 423 422 } -
src/ResolvExpr/Resolver.cc
r41c19b4 r4a8f150 1471 1471 auto newDecl = fixObjectType(objectDecl, symtab); 1472 1472 auto mutDecl = mutate(newDecl); 1473 1473 1474 1474 // generate CtorInit wrapper when necessary. 1475 1475 // in certain cases, fixObjectType is called before reaching … … 1489 1489 currentObject = ast::CurrentObject{ objectDecl->location, objectDecl->get_type() }; 1490 1490 } 1491 1491 1492 1492 return objectDecl; 1493 1493 } -
src/main.cc
r41c19b4 r4a8f150 9 9 // Author : Peter Buhr and Rob Schluntz 10 10 // Created On : Fri May 15 23:12:02 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : T hu Oct 8 18:17:46202013 // Update Count : 63 711 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Dec 1 14:52:00 2020 13 // Update Count : 638 14 14 // 15 15 … … 340 340 } // if 341 341 342 if( useNewAST ) {342 if( useNewAST ) { 343 343 if (Stats::Counters::enabled) { 344 344 ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New"); … … 352 352 return EXIT_SUCCESS; 353 353 } // if 354 355 // TODO: This is a quick fix to get the build working. 356 // Get rid of fillLocations or at least make a new-ast version. 357 translationUnit = convert( move( transUnit ) ); 358 CodeTools::fillLocations( translationUnit ); 359 transUnit = convert( move( translationUnit ) ); 354 360 355 361 PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary()));
Note: See TracChangeset
for help on using the changeset viewer.