Changeset 76f7fc7 for src


Ignore:
Timestamp:
May 2, 2019, 1:57:05 PM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
62ce290
Parents:
3e96559
Message:

Reduced cases where unused is placed on anonymous objects. Regenerated tests.

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r3e96559 r76f7fc7  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed May  1 15:50:00 2019
    13 // Update Count     : 496
     12// Last Modified On : Thr May  2 10:47:00 2019
     13// Update Count     : 497
    1414//
    1515#include "CodeGenerator.h"
     
    182182
    183183                Options subOptions = options;
    184                 subOptions.inParameterList = true;
     184                subOptions.anonymousUnused = functionDecl->has_body();
    185185                output << genType( functionDecl->get_functionType(), mangleName( functionDecl ), subOptions );
    186186
     
    203203                        objectDecl->set_name( name.newName() );
    204204            // Stops unused parameter warnings.
    205             if ( options.inParameterList ) {
     205            if ( options.anonymousUnused ) {
    206206                objectDecl->attributes.push_back( new Attribute( "unused" ) );
    207207            }
  • src/CodeGen/Options.h

    r3e96559 r76f7fc7  
    1010// Created On       : Tue Apr 30 11:36:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed May  1 15:52:00 2019
    13 // Update Count     : 1
     12// Last Modified On : Thr May  2 10:45:00 2019
     13// Update Count     : 2
    1414//
    1515
     
    2525
    2626                // Internal Options: Changed on some recurisive calls.
    27                 bool inParameterList = false;
     27                bool anonymousUnused = false;
    2828
    2929                Options(bool pretty, bool genC, bool lineMarks, bool printExprTypes) :
  • src/SynTree/Declaration.h

    r3e96559 r76f7fc7  
    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 : Wed May  1 07:46:49 2019
    13 // Update Count     : 134
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr May  2 10:47:00 2019
     13// Update Count     : 135
    1414//
    1515
     
    167167        CompoundStmt *get_statements() const { return statements; }
    168168        void set_statements( CompoundStmt *newValue ) { statements = newValue; }
     169        bool has_body() const { return NULL != statements; }
    169170
    170171        static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements );
Note: See TracChangeset for help on using the changeset viewer.