Changeset 68f9c43 for src/SymTab/Validate.cc
- Timestamp:
- Mar 16, 2018, 5:15:02 PM (6 years ago)
- Branches:
- new-env, with_gc
- Children:
- 8d7bef2
- Parents:
- 6171841
- git-author:
- Aaron Moss <a3moss@…> (03/16/18 17:04:24)
- git-committer:
- Aaron Moss <a3moss@…> (03/16/18 17:15:02)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r6171841 r68f9c43 310 310 } // if 311 311 // Always remove the hoisted aggregate from the inner structure. 312 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, isStructOrUnion , false); } );312 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, isStructOrUnion ); } ); 313 313 } 314 314 … … 365 365 // one void is the only thing in the list; remove it. 366 366 if ( containsVoid ) { 367 delete dwts.front();368 367 dwts.clear(); 369 368 } … … 492 491 } 493 492 } 494 deleteAll( td->assertions );495 493 td->assertions.clear(); 496 494 } // for … … 608 606 // expand trait instance into all of its members 609 607 expandAssertions( traitInst, back_inserter( type->assertions ) ); 610 delete traitInst;611 608 } else { 612 609 // pass other assertions through … … 682 679 SizeType = new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ); 683 680 } 684 filter( translationUnit, isTypedef , true);681 filter( translationUnit, isTypedef ); 685 682 } 686 683 … … 696 693 ret->attributes.splice( ret->attributes.end(), typeInst->attributes ); 697 694 } else { 698 deleteAll( ret->attributes );699 695 ret->attributes.clear(); 700 696 } … … 709 705 mutateAll( rtt->parameters, *visitor ); // recursively fix typedefs on parameters 710 706 } // if 711 delete typeInst;712 707 return ret; 713 708 } else { … … 795 790 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( objDecl->get_type() ) ) { // function type? 796 791 // replace the current object declaration with a function declaration 797 FunctionDecl * newDecl = new FunctionDecl( objDecl->get_name(), objDecl->get_storageClasses(), objDecl->get_linkage(), funtype, 0, objDecl->get_attributes(), objDecl->get_funcSpec() ); 798 objDecl->get_attributes().clear(); 799 objDecl->set_type( nullptr ); 800 delete objDecl; 801 return newDecl; 792 return new FunctionDecl{ 793 objDecl->get_name(), objDecl->get_storageClasses(), objDecl->get_linkage(), 794 funtype, 0, objDecl->get_attributes(), objDecl->get_funcSpec() }; 802 795 } // if 803 796 return objDecl; … … 823 816 } // if 824 817 return false; 825 } , true);818 } ); 826 819 return compoundStmt; 827 820 } … … 831 824 template<typename AggDecl> 832 825 AggDecl *EliminateTypedef::handleAggregate( AggDecl * aggDecl ) { 833 filter( aggDecl->members, isTypedef , true);826 filter( aggDecl->members, isTypedef ); 834 827 return aggDecl; 835 828 } … … 961 954 static UniqueName indexName( "_compLit" ); 962 955 963 ObjectDecl *tempvar = new ObjectDecl( indexName.newName(), storageClasses, LinkageSpec::C, nullptr, compLitExpr->get_result(), compLitExpr->get_initializer() ); 964 compLitExpr->set_result( nullptr ); 965 compLitExpr->set_initializer( nullptr ); 966 delete compLitExpr; 956 ObjectDecl * tempvar = new ObjectDecl{ 957 indexName.newName(), storageClasses, LinkageSpec::C, nullptr, compLitExpr->get_result(), compLitExpr->get_initializer() }; 967 958 declsToAddBefore.push_back( tempvar ); // add modified temporary to current block 968 959 return new VariableExpr( tempvar ); … … 1000 991 // ensure return value is not destructed by explicitly creating an empty ListInit node wherein maybeConstruct is false. 1001 992 ObjectDecl * newRet = new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) ); 1002 deleteAll( retVals );1003 993 retVals.clear(); 1004 994 retVals.push_back( newRet ); … … 1041 1031 if ( NameExpr * nameExpr = dynamic_cast< NameExpr * >( inner->arg ) ) { 1042 1032 if ( labels.count( nameExpr->name ) ) { 1043 Label name = nameExpr->name; 1044 delete addrExpr; 1045 return new LabelAddressExpr( name ); 1033 return new LabelAddressExpr{ nameExpr->name }; 1046 1034 } 1047 1035 }
Note: See TracChangeset
for help on using the changeset viewer.