Changeset 6943a987 for src/SynTree


Ignore:
Timestamp:
Aug 29, 2016, 10:33:05 AM (9 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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:
5e644d3e
Parents:
79841be (diff), 413ad05 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/SynTree
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/AggregateDecl.cc

    r79841be r6943a987  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // AggregateDecl.cc -- 
     7// AggregateDecl.cc --
    88//
    99// Author           : Richard C. Bilson
  • src/SynTree/Declaration.cc

    r79841be r6943a987  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Dec 09 14:08:29 2015
    13 // Update Count     : 12
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 18 23:49:57 2016
     13// Update Count     : 13
    1414//
    1515
     
    2727static IdMapType idMap;
    2828
    29 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage )
     29Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage )
    3030                : name( name ), storageClass( sc ), linkage( linkage ), isInline( false ), isNoreturn( false ), uniqueId( 0 ) {
    3131}
  • src/SynTree/Declaration.h

    r79841be r6943a987  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 12 21:03:17 2016
    13 // Update Count     : 39
     12// Last Modified On : Thu Aug 18 23:50:24 2016
     13// Update Count     : 40
    1414//
    1515
     
    2626class Declaration {
    2727  public:
    28         Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage );
     28        Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage );
    2929        Declaration( const Declaration &other );
    3030        virtual ~Declaration();
     
    3434        DeclarationNode::StorageClass get_storageClass() const { return storageClass; }
    3535        void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; }
    36         LinkageSpec::Type get_linkage() const { return linkage; }
    37         void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; }
     36        LinkageSpec::Spec get_linkage() const { return linkage; }
     37        void set_linkage( LinkageSpec::Spec newValue ) { linkage = newValue; }
    3838        bool get_isInline() const { return isInline; }
    3939        void set_isInline( bool newValue ) { isInline = newValue; }
     
    5656        std::string name;
    5757        DeclarationNode::StorageClass storageClass;
    58         LinkageSpec::Type linkage;
     58        LinkageSpec::Spec linkage;
    5959        bool isInline, isNoreturn;
    6060        UniqueId uniqueId;
     
    6464class DeclarationWithType : public Declaration {
    6565  public:
    66         DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes );
     66        DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes );
    6767        DeclarationWithType( const DeclarationWithType &other );
    6868        virtual ~DeclarationWithType();
     
    9797        typedef DeclarationWithType Parent;
    9898  public:
    99         ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );
     99        ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes = std::list< Attribute * >(), bool isInline = false, bool isNoreturn = false );
    100100        ObjectDecl( const ObjectDecl &other );
    101101        virtual ~ObjectDecl();
     
    123123        typedef DeclarationWithType Parent;
    124124  public:
    125         FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() );
     125        FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, const std::list< Attribute * > attributes = std::list< Attribute * >() );
    126126        FunctionDecl( const FunctionDecl &other );
    127127        virtual ~FunctionDecl();
  • src/SynTree/DeclarationWithType.cc

    r79841be r6943a987  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Mon Apr 11 15:35:27 2016
    13 // Update Count     : 3
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 18 23:50:41 2016
     13// Update Count     : 4
    1414//
    1515
     
    1919#include "Common/utility.h"
    2020
    21 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, const std::list< Attribute * > & attributes )
     21DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes )
    2222                : Declaration( name, sc, linkage ), attributes( attributes ) {
    2323}
  • src/SynTree/Expression.cc

    r79841be r6943a987  
    200200
    201201OffsetofExpr::OffsetofExpr( const OffsetofExpr &other ) :
    202         Expression( other ), type( maybeClone( other.type ) ), member( maybeClone( other.member ) ) {}
     202        Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {}
    203203
    204204OffsetofExpr::~OffsetofExpr() {
    205205        delete type;
    206         delete member;
    207206}
    208207
     
    359358        assert( member );
    360359        os << std::string( indent + 2, ' ' );
     360        os << (void*)member << " ";
    361361        member->print( os, indent + 2 );
    362362        os << std::endl;
     
    383383                Expression( _aname ), function(_function), args(_args) {}
    384384
    385 UntypedExpr::~UntypedExpr() {}
     385UntypedExpr::~UntypedExpr() {
     386        delete function;
     387        deleteAll( args );
     388}
    386389
    387390void UntypedExpr::print( std::ostream &os, int indent ) const {
  • src/SynTree/FunctionDecl.cc

    r79841be r6943a987  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 06 15:59:48 2016
    13 // Update Count     : 19
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 18 23:50:14 2016
     13// Update Count     : 20
    1414//
    1515
     
    2222#include "Common/utility.h"
    2323
    24 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )
     24FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )
    2525                : Parent( name, sc, linkage, attributes ), type( type ), statements( statements ) {
    2626        set_isInline( isInline );
     
    3939        delete type;
    4040        delete statements;
     41        deleteAll( oldDecls );
    4142}
    4243
  • src/SynTree/Initializer.cc

    r79841be r6943a987  
    4343
    4444SingleInit::~SingleInit() {
     45        delete value;
    4546        deleteAll(designators);
    4647}
  • src/SynTree/ObjectDecl.cc

    r79841be r6943a987  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 13 13:23:32 2016
    13 // Update Count     : 30
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Aug 18 23:50:33 2016
     13// Update Count     : 31
    1414//
    1515
     
    2222#include "Statement.h"
    2323
    24 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn )
     24ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init, const std::list< Attribute * > attributes, bool isInline, bool isNoreturn )
    2525        : Parent( name, sc, linkage, attributes ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) {
    2626        set_isInline( isInline );
  • src/SynTree/Statement.cc

    r79841be r6943a987  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:25:20 2016
    13 // Update Count     : 61
     12// Last Modified On : Fri Aug 12 13:58:48 2016
     13// Update Count     : 62
    1414//
    1515
     
    124124        Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {}
    125125
    126 IfStmt::~IfStmt() {}
     126IfStmt::~IfStmt() {
     127        delete condition;
     128        delete thenPart;
     129        delete elsePart;
     130}
    127131
    128132void IfStmt::print( std::ostream &os, int indent ) const {
     
    155159        delete condition;
    156160        // destroy statements
     161        deleteAll( statements );
    157162}
    158163
     
    183188CaseStmt::~CaseStmt() {
    184189        delete condition;
     190        deleteAll( stmts );
    185191}
    186192
     
    216222WhileStmt::~WhileStmt() {
    217223        delete body;
     224        delete condition;
    218225}
    219226
     
    290297TryStmt::~TryStmt() {
    291298        delete block;
     299        deleteAll( handlers );
     300        delete finallyBlock;
    292301}
    293302
     
    309318}
    310319
    311 CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool isCatchRest ) :
    312         Statement( labels ), decl ( _decl ), body( _body ), catchRest ( isCatchRest ) {
     320CatchStmt::CatchStmt( std::list<Label> labels, Declaration *_decl, Statement *_body, bool catchAny ) :
     321        Statement( labels ), decl ( _decl ), body( _body ), catchRest ( catchAny ) {
    313322}
    314323
  • src/SynTree/Statement.h

    r79841be r6943a987  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:26:02 2016
    13 // Update Count     : 64
     12// Last Modified On : Fri Aug 12 13:57:46 2016
     13// Update Count     : 65
    1414//
    1515
     
    314314class CatchStmt : public Statement {
    315315  public:
    316         CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool isCatchRest = false );
     316        CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool catchAny = false );
    317317        CatchStmt( const CatchStmt &other );
    318318        virtual ~CatchStmt();
  • src/SynTree/TypeSubstitution.h

    r79841be r6943a987  
    169169        TypeSubstitution sub = TypeSubstitution( formalBegin, formalEnd, actual );
    170170        for ( std::list< Declaration* >::iterator i = memberBegin; i != memberEnd; ++i ) {
    171                 Declaration *newdecl = (*i)->clone();
    172                 sub.apply( newdecl );
    173                 *out++ = newdecl;
     171                sub.apply( *i );
     172                *out++ = *i;
    174173        } // for
    175174}
Note: See TracChangeset for help on using the changeset viewer.