#include "stdafx.h" #include "../BasicCompiler_Common/common.h" #ifdef _AMD64_ #include "../compiler_x64/opcode.h" #else #include "../compiler_x86/opcode.h" #endif const UserProc *OverloadSolutionWithStrParam( const char *name, std::vector &subs, const char *Parameter, const char *ObjectName){ // オーバーロードの解決 //オーバーロードされていないとき if( subs.size() == 1 ) return subs[0]; //////////////////////// // パラメータをセット //////////////////////// ParamImpl *pobj_parameter=0; char MethodName[VN_SIZE]; if( !SplitMemberName( name, NULL, MethodName ) ) lstrcpy( MethodName, name ); /* //メソッドの場合は静的かどうかを調べる bool isStatic = false; CClass *pClass = subs[0]->GetParentClassPtr(); if( pClass ){ isStatic = pClass->IsExistStaticMethod( MethodName ); } */ //パラメータオブジェクトを生成 pobj_parameter=new ParamImpl(Parameter); Type leftType; GetTermType( ObjectName, leftType ); const UserProc *pUserProc = pobj_parameter->OverloadSolution( name, subs, leftType ); //パラメータオブジェクトを破棄 delete pobj_parameter; pobj_parameter=0; return pUserProc; } const UserProc *OverloadSolution( const char *name, std::vector &subs, const Parameters ¶ms, const Type &returnType, const Type &leftType ) { // オーバーロードの解決 //オーバーロードされていないとき if( subs.size() == 1 ) return subs[0]; ParamImpl *pobj_Parameter=new ParamImpl( params ); if( !returnType.IsNull() ){ pobj_Parameter->SetReturnType( returnType ); } const UserProc *pUserProc = pobj_Parameter->OverloadSolution( name, subs, leftType); delete pobj_Parameter; return pUserProc; }