Changeset 356189a for src/SymTab


Ignore:
Timestamp:
Apr 14, 2016, 5:11:26 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, with_gc
Children:
b617e4b
Parents:
70a06f6
git-author:
Rob Schluntz <rschlunt@…> (04/14/16 17:10:08)
git-committer:
Rob Schluntz <rschlunt@…> (04/14/16 17:11:26)
Message:

output intrinsic constructor expressions as void expression or C assignment, don't generate field constructor which takes unnamed bitfield as a parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/SymTab/Autogen.cc

    r70a06f6 r356189a  
    1010// Created On       : Thu Mar 03 15:45:56 2016
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Apr 14 16:00:16 2016
     12// Last Modified On : Thu Apr 14 16:58:35 2016
    1313// Update Count     : 1
    1414//
     
    5959        }
    6060
     61        bool isUnnamedBitfield( ObjectDecl * obj ) {
     62                return obj != NULL && obj->get_name() == "" && obj->get_bitfieldWidth() != NULL;
     63        }
     64
    6165        template< typename OutputIterator >
    6266        void makeScalarFunction( Expression *src, ObjectDecl *dstParam, DeclarationWithType *member, std::string fname, OutputIterator out ) {
    6367                ObjectDecl *obj = dynamic_cast<ObjectDecl *>( member );
    6468                // unnamed bit fields are not copied as they cannot be accessed
    65                 if ( obj != NULL && obj->get_name() == "" && obj->get_bitfieldWidth() != NULL ) return;
     69                if ( isUnnamedBitfield( obj ) ) return;
    6670
    6771                // want to be able to generate assignment, ctor, and dtor generically,
     
    321325                        DeclarationWithType * member = dynamic_cast<DeclarationWithType *>( *i );
    322326                        assert( member );
     327                        if ( isUnnamedBitfield( dynamic_cast< ObjectDecl * > ( member ) ) ) {
     328                                // don't make a function whose parameter is an unnamed bitfield
     329                                continue;
     330                        }
    323331                        memCtorType->get_parameters().push_back( new ObjectDecl( member->get_name(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, member->get_type()->clone(), 0 ) );
    324332                        FunctionDecl * ctor = new FunctionDecl( "?{}", functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, memCtorType->clone(), new CompoundStmt( noLabels ), true, false );
Note: See TracChangeset for help on using the changeset viewer.