Changeset b13fc10 for src/SynTree


Ignore:
Timestamp:
May 3, 2017, 3:15:09 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
9643b31
Parents:
1ed841f (diff), dba6db9 (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:
3 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/PointerType.cc

    r1ed841f rb13fc10  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // PointerType.cc -- 
     7// PointerType.cc --
    88//
    99// Author           : Richard C. Bilson
     
    3838void PointerType::print( std::ostream &os, int indent ) const {
    3939        Type::print( os, indent );
    40         os << "pointer to ";
    41         if ( isStatic ) {
    42                 os << "static ";
    43         } // if
    44         if ( isVarLen ) {
    45                 os << "variable length array of ";
    46         } else if ( dimension ) {
    47                 os << "array of ";
    48                 dimension->print( os, indent );
    49         } // if
     40        if ( ! is_array() ) {
     41                os << "pointer to ";
     42        } else {
     43                os << "decayed ";
     44                if ( isStatic ) {
     45                        os << "static ";
     46                } // if
     47                if ( isVarLen ) {
     48                        os << "variable length array of ";
     49                } else if ( dimension ) {
     50                        os << "array of ";
     51                        dimension->print( os, indent );
     52                        os << " ";
     53                } // if
     54        }
    5055        if ( base ) {
    5156                base->print( os, indent );
  • src/SynTree/Type.h

    r1ed841f rb13fc10  
    247247        void set_isStatic( bool newValue ) { isStatic = newValue; }
    248248
     249        bool is_array() const { return isStatic || isVarLen || dimension; }
     250
    249251        virtual PointerType *clone() const { return new PointerType( *this ); }
    250252        virtual void accept( Visitor & v ) { v.visit( this ); }
  • src/SynTree/Visitor.h

    r1ed841f rb13fc10  
    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 : Thu Feb  9 14:23:24 2017
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed May  3 08:58:00 2017
    1313// Update Count     : 10
    1414//
     
    2626        virtual ~Visitor();
    2727  public:
     28        // visit: Default implementation of all functions visits the children
     29    // of the given syntax node, but performs no other action.
     30
    2831        virtual void visit( ObjectDecl *objectDecl );
    2932        virtual void visit( FunctionDecl *functionDecl );
Note: See TracChangeset for help on using the changeset viewer.