Changeset 71bd8c6 for src


Ignore:
Timestamp:
Jul 8, 2015, 4:47:08 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
e5609dd
Parents:
cc79d97
Message:

fix isVarLen in array types, fix loss of typedef when variable of aggregate type is declared, fix duplicate typedef with arrays of constant size

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/GenType.cc

    rcc79d97 r71bd8c6  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun  8 14:36:02 2015
    13 // Update Count     : 9
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Jul 08 16:08:24 2015
     13// Update Count     : 10
    1414//
    1515
     
    9393                        os << "_Atomic ";
    9494                } // if
    95                 if ( isVarLen ) {
    96                         os << "*";
    97                 } // if
    9895                if ( dimension != 0 ) {
    9996                        CodeGenerator cg( os );
    10097                        dimension->accept( cg );
     98                } else if ( isVarLen ) {
     99                        // no dimension expression on a VLA
     100                        // means it came in with the * token
     101                        os << "*";
    101102                } // if
    102103                os << "]";
  • src/Parser/DeclarationNode.cc

    rcc79d97 r71bd8c6  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 12:34:05 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul  3 12:35:02 2015
    13 // Update Count     : 108
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Jul 08 16:40:37 2015
     13// Update Count     : 121
    1414//
    1515
     
    284284        newnode->type->array->dimension = size;
    285285        newnode->type->array->isStatic = isStatic;
    286         newnode->type->array->isVarLen = false;
     286        if ( newnode->type->array->dimension == 0 || dynamic_cast<ConstantNode *>( newnode->type->array->dimension ) ) {
     287                newnode->type->array->isVarLen = false;
     288        } else {
     289                newnode->type->array->isVarLen = true;
     290        } // if
    287291        return newnode->addQualifiers( qualifiers );
    288292}
     
    464468                        bitfieldWidth = o->bitfieldWidth;
    465469                } // if
     470
     471                // there may be typedefs chained onto the type
     472                if ( o->get_link() ) {
     473                        set_link( o->get_link()->clone() );
     474                }
     475
    466476        } // if
    467477        delete o;
  • src/Parser/ParseNode.cc

    rcc79d97 r71bd8c6  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:26:29 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun  6 20:17:58 2015
    13 // Update Count     : 23
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Jul 08 14:46:45 2015
     13// Update Count     : 25
    1414//
    1515
     
    4141
    4242ParseNode *ParseNode::set_link( ParseNode *next_ ) {
    43         ParseNode *follow;
    44 
    4543        if ( next_ == 0 ) return this;
    4644
    47         for ( follow = this; follow->next != 0; follow = follow->next );
    48         follow->next = next_;
     45        get_last()->next = next_;
    4946
    5047        return this;
  • src/SymTab/TypeEquality.cc

    rcc79d97 r71bd8c6  
    1010// Created On       : Tue Jul 07 16:28:29 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Jul 08 13:41:53 2015
    13 // Update Count     : 34
     12// Last Modified On : Wed Jul 08 16:20:09 2015
     13// Update Count     : 35
    1414//
    1515
     
    102102                        }
    103103
     104                        if ( ! arrayType->get_isVarLen() && ! at->get_isVarLen() ) {
     105                                ConstantExpr * ce1 = dynamic_cast< ConstantExpr * >( arrayType->get_dimension() );
     106                                ConstantExpr * ce2 = dynamic_cast< ConstantExpr * >( at->get_dimension() );
     107                                assert(ce1 && ce2);
     108
     109                                Constant * c1 = ce1->get_constant();
     110                                Constant * c2 = ce2->get_constant();
     111
     112                                result = result && c1->get_value() == c2->get_value();
     113                        }
     114
    104115                        other = at->get_base();
    105116                        arrayType->get_base()->accept( *this );
Note: See TracChangeset for help on using the changeset viewer.