Changes in src/SynTree/FunctionDecl.cc [97dbc09:871cdb4]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/FunctionDecl.cc
r97dbc09 r871cdb4 26 26 #include "Statement.h" // for CompoundStmt 27 27 #include "Type.h" // for Type, FunctionType, Type::FuncSpecif... 28 #include "VarExprReplacer.h"29 28 30 29 extern bool translation_unit_nomain; … … 40 39 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 41 40 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 42 43 VarExprReplacer::DeclMap declMap;44 for ( auto p : group_iterate( other.type->parameters, type->parameters ) ) {45 declMap[ std::get<0>(p) ] = std::get<1>(p);46 }47 for ( auto p : group_iterate( other.type->returnVals, type->returnVals ) ) {48 declMap[ std::get<0>(p) ] = std::get<1>(p);49 }50 if ( ! declMap.empty() ) {51 VarExprReplacer replacer( declMap );52 accept( replacer );53 }54 41 } 55 42 … … 57 44 delete type; 58 45 delete statements; 59 }60 61 FunctionDecl * FunctionDecl::newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements ) {62 return new FunctionDecl( name, Type::StorageClasses(), LinkageSpec::C, type, statements );63 46 } 64 47
Note: See TracChangeset
for help on using the changeset viewer.