Changeset 46adb83 for src/SymTab


Ignore:
Timestamp:
Aug 8, 2017, 8:09:05 PM (8 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, with_gc
Children:
1744e6d
Parents:
533804b
Message:

Add unused attribute to union ctor/dtor parameters to silence warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r533804b r46adb83  
    1717#include <iterator>
    1818#include "SynTree/Visitor.h"
     19#include "SynTree/Attribute.h"
    1920#include "SynTree/Type.h"
    2021#include "SynTree/Statement.h"
     
    275276                // void ?{}(E *, E);
    276277                FunctionType *copyCtorType = genCopyType( refType->clone() );
     278
     279                // add unused attribute to parameters of default constructor and destructor
     280                ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     281                dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
    277282
    278283                // xxx - should we also generate void ?{}(E *, int) and E ?{}(E *, E)?
     
    516521                cloneAll( typeParams, assignType->get_forall() );
    517522
     523                // add unused attribute to parameters of default constructor and destructor
     524                ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     525                dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     526
    518527                // Routines at global scope marked "static" to prevent multiple definitions is separate translation units
    519528                // because each unit generates copies of the default routines for each aggregate.
Note: See TracChangeset for help on using the changeset viewer.