Ignore:
Timestamp:
Jul 24, 2019, 10:40:28 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
77d2432, 96ac72c
Parents:
6130304 (diff), 8fc15cf (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/InitTweak/InitTweak.cc

    r6130304 r83b52f1  
    99// Author           : Rob Schluntz
    1010// Created On       : Fri May 13 11:26:36 2016
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Mon Jun 10 13:30:00 2019
    13 // Update Count     : 5
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Fri Jun 19 14:34:00 2019
     13// Update Count     : 6
    1414//
    1515
     
    633633                        return nullptr;
    634634                }
     635
     636                DeclarationWithType * getFunctionCore( const Expression * expr ) {
     637                        if ( const auto * appExpr = dynamic_cast< const ApplicationExpr * >( expr ) ) {
     638                                return getCalledFunction( appExpr->function );
     639                        } else if ( const auto * untyped = dynamic_cast< const UntypedExpr * >( expr ) ) {
     640                                return getCalledFunction( untyped->function );
     641                        }
     642                        assertf( false, "getFunction with unknown expression: %s", toString( expr ).c_str() );
     643                }
    635644        }
    636645
    637646        DeclarationWithType * getFunction( Expression * expr ) {
    638                 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) {
    639                         return getCalledFunction( appExpr->get_function() );
    640                 } else if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * > ( expr ) ) {
    641                         return getCalledFunction( untyped->get_function() );
    642                 }
    643                 assertf( false, "getFunction received unknown expression: %s", toString( expr ).c_str() );
     647                return getFunctionCore( expr );
     648        }
     649
     650        const DeclarationWithType * getFunction( const Expression * expr ) {
     651                return getFunctionCore( expr );
    644652        }
    645653
Note: See TracChangeset for help on using the changeset viewer.