Changeset c738ca4 for src/InitTweak
- Timestamp:
- Jun 15, 2016, 4:35:44 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- f4bc57c
- Parents:
- 7ff30d07
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
r7ff30d07 rc738ca4 115 115 116 116 namespace { 117 template<typename CallExpr> 118 std::string funcName( CallExpr * expr ) { 119 Expression * func = expr->get_function(); 117 std::string funcName( Expression * func ) { 120 118 if ( NameExpr * nameExpr = dynamic_cast< NameExpr * >( func ) ) { 121 119 return nameExpr->get_name(); 122 120 } else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( func ) ) { 123 121 return varExpr->get_var()->get_name(); 122 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( func ) ) { 123 return funcName( castExpr->get_arg() ); 124 124 } else { 125 125 assert( false && "Unexpected expression type being called as a function in call expression" ); … … 130 130 std::string getFunctionName( Expression * expr ) { 131 131 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) { 132 return funcName( appExpr );132 return funcName( appExpr->get_function() ); 133 133 } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * > ( expr ) ) { 134 return funcName( untypedExpr );134 return funcName( untypedExpr->get_function() ); 135 135 } else { 136 std::cerr << expr << std::endl; 136 137 assert( false && "Unexpected expression type passed to getFunctionName" ); 137 138 }
Note: See TracChangeset
for help on using the changeset viewer.