Changeset 53a2e97 for src/SymTab


Ignore:
Timestamp:
May 25, 2015, 1:58:45 PM (10 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:
367e082
Parents:
7c64920
Message:

generated assignment routine no longer tries to assign to const fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r7c64920 r53a2e97  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:50:04 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 16:50:09 2015
    13 // Update Count     : 3
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Fri May 22 15:29:16 2015
     13// Update Count     : 9
    1414//
    1515
     
    560560                for ( std::list< Declaration * >::const_iterator member = aggregateDecl->get_members().begin(); member != aggregateDecl->get_members().end(); ++member ) {
    561561                        if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( *member ) ) {
     562                                Type::Qualifiers & qualifiers = dwt->get_type()->get_qualifiers();
     563                                if ( qualifiers.isConst ) {
     564                                        // don't assign const members
     565                                        continue;
     566                                }
     567
    562568                                if ( ArrayType *array = dynamic_cast< ArrayType * >( dwt->get_type() ) ) {
    563569                                        makeArrayAssignment( srcParam, dstParam, dwt, array, back_inserter( assignDecl->get_statements()->get_kids() ) );
Note: See TracChangeset for help on using the changeset viewer.