Changeset 1fbab5a for src/Tuples


Ignore:
Timestamp:
Mar 16, 2017, 4:50:08 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
Children:
395fc37, 64ac636, ef42b143
Parents:
2f26687a (diff), d6d747d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

Location:
src/Tuples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleAssignment.cc

    r2f26687a r1fbab5a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar  6 23:40:14 2017
    13 // Update Count     : 5
     12// Last Modified On : Thu Mar 16 08:04:51 2017
     13// Update Count     : 7
    1414//
    1515
     
    199199                                Type * type = InitTweak::getPointerBase( castType );
    200200                                assert( type );
    201                                 type->get_qualifiers() -= Type::Qualifiers(true, true, true, false, true, false);
     201                                type->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );
    202202                                type->set_isLvalue( true ); // xxx - might not need this
    203203                                expr = new CastExpr( expr, castType );
     
    240240        ObjectDecl * TupleAssignSpotter::Matcher::newObject( UniqueName & namer, Expression * expr ) {
    241241                assert( expr->has_result() && ! expr->get_result()->isVoid() );
    242                 ObjectDecl * ret = new ObjectDecl( namer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->get_result()->clone(), new SingleInit( expr->clone() ) );
     242                ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->get_result()->clone(), new SingleInit( expr->clone() ) );
    243243                ConstructorInit * ctorInit = InitTweak::genCtorInit( ret );
    244244                ret->set_init( ctorInit );
  • src/Tuples/TupleExpansion.cc

    r2f26687a r1fbab5a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar  7 07:43:56 2017
    13 // Update Count     : 12
     12// Last Modified On : Thu Mar 16 08:05:17 2017
     13// Update Count     : 15
    1414//
    1515
     
    187187                        }
    188188                        BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool );
    189                         ObjectDecl * finished = new ObjectDecl( toString( "_unq_expr_finished_", id ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::Bool ), new SingleInit( new ConstantExpr( Constant( boolType->clone(), "0" ) ), noDesignators ) );
     189                        ObjectDecl * finished = new ObjectDecl( toString( "_unq_expr_finished_", id ), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::Bool ), new SingleInit( new ConstantExpr( Constant( boolType->clone(), "0" ) ), noDesignators ) );
    190190                        addDeclaration( finished );
    191191                        // (finished ? _unq_expr_N : (_unq_expr_N = <unqExpr->get_expr()>, finished = 1, _unq_expr_N))
     
    221221                        decl->set_body( true );
    222222                        for ( size_t i = 0; i < tupleSize; ++i ) {
    223                                 TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", i ), DeclarationNode::StorageClasses(), nullptr, TypeDecl::Any );
    224                                 decl->get_members().push_back( new ObjectDecl( toString("field_", i ), DeclarationNode::StorageClasses(), LinkageSpec::C, nullptr, new TypeInstType( Type::Qualifiers(), tyParam->get_name(), tyParam ), nullptr ) );
     223                                TypeDecl * tyParam = new TypeDecl( toString( "tuple_param_", i ), Type::StorageClasses(), nullptr, TypeDecl::Any );
     224                                decl->get_members().push_back( new ObjectDecl( toString("field_", i ), Type::StorageClasses(), LinkageSpec::C, nullptr, new TypeInstType( Type::Qualifiers(), tyParam->get_name(), tyParam ), nullptr ) );
    225225                                decl->get_parameters().push_back( tyParam );
    226226                        }
    227227                        if ( tupleSize == 0 ) {
    228228                                // empty structs are not standard C. Add a dummy field to empty tuples to silence warnings when a compound literal Tuple0 is created.
    229                                 decl->get_members().push_back( new ObjectDecl( "dummy", DeclarationNode::StorageClasses(), LinkageSpec::C, nullptr, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) );
     229                                decl->get_members().push_back( new ObjectDecl( "dummy", Type::StorageClasses(), LinkageSpec::C, nullptr, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) );
    230230                        }
    231231                        typeMap[tupleSize] = decl;
     
    305305        Type * makeTupleType( const std::list< Expression * > & exprs ) {
    306306                // produce the TupleType which aggregates the types of the exprs
    307                 TupleType *tupleType = new TupleType( Type::Qualifiers(true, true, true, true, true, true) );
     307                TupleType *tupleType = new TupleType( Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex ) );
    308308                Type::Qualifiers &qualifiers = tupleType->get_qualifiers();
    309309                for ( Expression * expr : exprs ) {
Note: See TracChangeset for help on using the changeset viewer.