Changeset b3c7963 for src/SynTree


Ignore:
Timestamp:
Sep 12, 2017, 5:55:31 PM (7 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:
4639b0d
Parents:
a506df4 (diff), a46478a (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:/u/cforall/software/cfa/cfa-cc

Location:
src/SynTree
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/BasicType.cc

    ra506df4 rb3c7963  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb  1 17:12:15 2017
    13 // Update Count     : 8
     12// Last Modified On : Mon Sep 11 12:52:05 2017
     13// Update Count     : 9
    1414//
    1515
     
    2525
    2626void BasicType::print( std::ostream &os, int indent ) const {
    27         static const char *kindNames[] = {     
    28                 "_Bool", "char", "signed char", "unsigned char", "short signed int", "short unsigned int",
    29                 "signed int", "unsigned int", "long signed int", "long unsigned int", "long long signed int",
    30                 "long long unsigned int", "float", "double", "long double", "float _Complex", "double _Complex",
    31                 "long double _Complex", "float _Imaginary", "double _Imaginary", "long double _Imaginary"
    32         };
    33 
    3427        Type::print( os, indent );
    35         os << kindNames[ kind ];
     28        os << BasicType::typeNames[ kind ];
    3629}
    3730
  • src/SynTree/Declaration.h

    ra506df4 rb3c7963  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Aug 14 10:15:00 2017
    13 // Update Count     : 128
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sun Sep  3 19:24:06 2017
     13// Update Count     : 131
    1414//
    1515
     
    8282        int scopeLevel = 0;
    8383
    84         ConstantExpr *asmName;
     84        Expression *asmName;
    8585        std::list< Attribute * > attributes;
    8686
     
    9797        DeclarationWithType * set_scopeLevel( int newValue ) { scopeLevel = newValue; return this; }
    9898
    99         ConstantExpr *get_asmName() const { return asmName; }
    100         DeclarationWithType * set_asmName( ConstantExpr *newValue ) { asmName = newValue; return this; }
     99        Expression *get_asmName() const { return asmName; }
     100        DeclarationWithType * set_asmName( Expression *newValue ) { asmName = newValue; return this; }
    101101
    102102        std::list< Attribute * >& get_attributes() { return attributes; }
  • src/SynTree/Expression.h

    ra506df4 rb3c7963  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Aug  8 11:54:00 2017
    13 // Update Count     : 44
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sun Sep  3 19:23:46 2017
     13// Update Count     : 48
    1414//
     15
    1516#pragma once
    1617
     
    539540  public:
    540541        Expression * inout;
    541         ConstantExpr * constraint;
     542        Expression * constraint;
    542543        Expression * operand;
    543544
    544         AsmExpr( Expression * inout, ConstantExpr * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}
     545        AsmExpr( Expression * inout, Expression * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}
    545546        AsmExpr( const AsmExpr & other );
    546547        virtual ~AsmExpr() { delete inout; delete constraint; delete operand; };
     
    549550        void set_inout( Expression * newValue ) { inout = newValue; }
    550551
    551         ConstantExpr * get_constraint() const { return constraint; }
    552         void set_constraint( ConstantExpr * newValue ) { constraint = newValue; }
     552        Expression * get_constraint() const { return constraint; }
     553        void set_constraint( Expression * newValue ) { constraint = newValue; }
    553554
    554555        Expression * get_operand() const { return operand; }
  • src/SynTree/Statement.cc

    ra506df4 rb3c7963  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 17 16:17:20 2017
    13 // Update Count     : 67
     12// Last Modified On : Sun Sep  3 20:46:44 2017
     13// Update Count     : 68
    1414//
    1515
     
    5252
    5353
    54 AsmStmt::AsmStmt( std::list<Label> labels, bool voltile, ConstantExpr *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ) : Statement( labels ), voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ), gotolabels( gotolabels ) {}
     54AsmStmt::AsmStmt( std::list<Label> labels, bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ) : Statement( labels ), voltile( voltile ), instruction( instruction ), output( output ), input( input ), clobber( clobber ), gotolabels( gotolabels ) {}
    5555
    5656AsmStmt::AsmStmt( const AsmStmt & other ) : Statement( other ), voltile( other.voltile ), instruction( maybeClone( other.instruction ) ), gotolabels( other.gotolabels ) {
  • src/SynTree/Statement.h

    ra506df4 rb3c7963  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 17 15:37:53 2017
    13 // Update Count     : 72
     12// Last Modified On : Sun Sep  3 20:46:46 2017
     13// Update Count     : 77
    1414//
    1515
     
    9898  public:
    9999        bool voltile;
    100         ConstantExpr *instruction;
     100        Expression *instruction;
    101101        std::list<Expression *> output, input;
    102102        std::list<ConstantExpr *> clobber;
    103103        std::list<Label> gotolabels;
    104104
    105         AsmStmt( std::list<Label> labels, bool voltile, ConstantExpr *instruction, std::list<Expression *> input, std::list<Expression *> output, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );
     105        AsmStmt( std::list<Label> labels, bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );
    106106        AsmStmt( const AsmStmt &other );
    107107        virtual ~AsmStmt();
     
    109109        bool get_voltile() { return voltile; }
    110110        void set_voltile( bool newValue ) { voltile = newValue; }
    111         ConstantExpr *get_instruction() { return instruction; }
    112         void set_instruction( ConstantExpr *newValue ) { instruction = newValue; }
    113         std::list<Expression *> &get_output() { return output; }
    114         void set_output( const std::list<Expression *> &newValue ) { output = newValue; }
    115         std::list<Expression *> &get_input() { return input; }
     111        Expression * get_instruction() { return instruction; }
     112        void set_instruction( Expression * newValue ) { instruction = newValue; }
     113        std::list<Expression *> & get_output() { return output; }
     114        void set_output( const std::list<Expression *> & newValue ) { output = newValue; }
     115        std::list<Expression *> & get_input() { return input; }
    116116        void set_input( const std::list<Expression *> &newValue ) { input = newValue; }
    117         std::list<ConstantExpr *> &get_clobber() { return clobber; }
     117        std::list<ConstantExpr *> & get_clobber() { return clobber; }
    118118        void set_clobber( const std::list<ConstantExpr *> &newValue ) { clobber = newValue; }
    119         std::list<Label> &get_gotolabels() { return gotolabels; }
     119        std::list<Label> & get_gotolabels() { return gotolabels; }
    120120        void set_gotolabels( const std::list<Label> &newValue ) { gotolabels = newValue; }
    121121
    122         virtual AsmStmt *clone() const { return new AsmStmt( *this ); }
    123         virtual void accept( Visitor &v ) { v.visit( this ); }
    124         virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    125         virtual void print( std::ostream &os, int indent = 0 ) const;
     122        virtual AsmStmt * clone() const { return new AsmStmt( *this ); }
     123        virtual void accept( Visitor & v ) { v.visit( this ); }
     124        virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     125        virtual void print( std::ostream & os, int indent = 0 ) const;
    126126};
    127127
  • src/SynTree/Type.cc

    ra506df4 rb3c7963  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Aug  2 11:11:00 2017
    13 // Update Count     : 29
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Sep 11 13:21:25 2017
     13// Update Count     : 37
    1414//
    1515#include "Type.h"
     
    2626        "_Bool",
    2727        "char",
    28         "char",
     28        "signed char",
    2929        "unsigned char",
    30         "short",
    31         "short unsigned",
    32         "int",
     30        "signed short int",
     31        "unsigned short int",
     32        "signed int",
    3333        "unsigned int",
    34         "long int",
    35         "long unsigned int",
    36         "long long int",
    37         "long long unsigned int",
     34        "signed long int",
     35        "unsigned long int",
     36        "signed long long int",
     37        "unsigned long long int",
    3838        "float",
    3939        "double",
     
    6565
    6666Type * Type::stripDeclarator() {
    67         Type * type = this;
    68         while ( Type * at = InitTweak::getPointerBase( type ) ) {
    69                 type = at;
    70         }
     67        Type * type, * at;
     68        for ( type = this; (at = InitTweak::getPointerBase( type )); type = at );
    7169        return type;
    7270}
    7371
    7472Type * Type::stripReferences() {
    75         Type * type = this;
    76         while ( ReferenceType * ref = dynamic_cast<ReferenceType *>( type ) ) {
    77                 type = ref->get_base();
    78         }
     73        Type * type;
     74        ReferenceType * ref;
     75        for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref->get_base() );
    7976        return type;
    8077}
Note: See TracChangeset for help on using the changeset viewer.