Ignore:
Timestamp:
Feb 21, 2023, 4:24:34 PM (3 years ago)
Author:
caparson <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
257a8f5, ce44c5f
Parents:
1180175 (diff), 9a533ba (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parserutility.h

    r1180175 r640b3df  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // parserutility.h --
     7// parserutility.h -- Collected utilities for the parser.
    88//
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 15:31:46 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:32:58 2017
    13 // Update Count     : 4
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Feb 16 12:34:00 2023
     13// Update Count     : 5
    1414//
    1515
     
    2020Expression *notZeroExpr( Expression *orig );
    2121
     22template< typename T, typename U >
     23struct maybeBuild_t {
     24        static T * doit( const U *orig ) {
     25                if ( orig ) {
     26                        return orig->build();
     27                } else {
     28                        return 0;
     29                }
     30        }
     31};
     32
     33template< typename T, typename U >
     34static inline T * maybeBuild( const U *orig ) {
     35        return maybeBuild_t<T,U>::doit(orig);
     36}
     37
     38template< typename T, typename U >
     39static inline T * maybeMoveBuild( const U *orig ) {
     40        T* ret = maybeBuild<T>(orig);
     41        delete orig;
     42        return ret;
     43}
     44
    2245// Local Variables: //
    2346// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.