[4] | 1 | #include "../BasicCompiler_Common/common.h"
|
---|
| 2 |
|
---|
| 3 | #ifdef _AMD64_
|
---|
| 4 | #include "../BasicCompiler64/opcode.h"
|
---|
| 5 | #else
|
---|
[5] | 6 | #include "../BasicCompiler32/opcode.h"
|
---|
[4] | 7 | #endif
|
---|
| 8 |
|
---|
| 9 | SUBINFO *OverloadSolutionWithStrParam(char *name,SUBINFO **ppsi,int num,char *Parameter,char *ObjectName,TYPEINFO *pReturnTypeInfo){
|
---|
| 10 | // オーバーロードの解決
|
---|
| 11 |
|
---|
| 12 | //オーバーロードされていないとき
|
---|
| 13 | if(num==1) return ppsi[0];
|
---|
| 14 |
|
---|
| 15 |
|
---|
| 16 | ////////////////////////
|
---|
| 17 | // パラメータをセット
|
---|
| 18 | ////////////////////////
|
---|
| 19 |
|
---|
| 20 | CParameter *pobj_parameter=0;
|
---|
| 21 |
|
---|
[28] | 22 | char MethodName[VN_SIZE];
|
---|
| 23 | if( !SplitMemberName( name, NULL, MethodName ) ) lstrcpy( MethodName, name );
|
---|
| 24 |
|
---|
| 25 | //メソッドの場合は静的かどうかを調べる
|
---|
| 26 | bool isStatic = false;
|
---|
| 27 | CClass *pClass = ppsi[0]->pobj_ParentClass;
|
---|
| 28 | if( pClass ){
|
---|
| 29 | isStatic = pClass->IsExistStaticMethod( MethodName );
|
---|
[4] | 30 | }
|
---|
| 31 |
|
---|
| 32 | //パラメータオブジェクトを生成
|
---|
[31] | 33 | pobj_parameter=new CParameter(Parameter);
|
---|
[4] | 34 | if(pReturnTypeInfo) pobj_parameter->SetReturnType(pReturnTypeInfo);
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | SUBINFO *psi;
|
---|
| 38 | psi=pobj_parameter->OverloadSolution(name,ppsi,num);
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 | //パラメータオブジェクトを破棄
|
---|
| 42 | delete pobj_parameter;
|
---|
| 43 | pobj_parameter=0;
|
---|
| 44 |
|
---|
| 45 | return psi;
|
---|
| 46 | }
|
---|
| 47 |
|
---|
[46] | 48 | SUBINFO *OverloadSolution(const char *name,SUBINFO **ppsi,int num,PARAMETER_INFO *ppi,int ParmNum,TYPEINFO *pReturnTypeInfo){
|
---|
[4] | 49 | // オーバーロードの解決
|
---|
| 50 |
|
---|
| 51 | //オーバーロードされていないとき
|
---|
| 52 | if(num==1) return ppsi[0];
|
---|
| 53 |
|
---|
| 54 |
|
---|
| 55 | CParameter *pobj_Parameter=new CParameter(ppi,ParmNum);
|
---|
| 56 | if(pReturnTypeInfo) pobj_Parameter->SetReturnType(pReturnTypeInfo);
|
---|
| 57 |
|
---|
| 58 | SUBINFO *psi;
|
---|
| 59 | psi=pobj_Parameter->OverloadSolution(name,ppsi,num);
|
---|
| 60 |
|
---|
| 61 | delete pobj_Parameter;
|
---|
| 62 |
|
---|
| 63 | return psi;
|
---|
| 64 | }
|
---|