Changeset 46 in dev for BasicCompiler64/Compile_Func.cpp
- Timestamp:
- Feb 6, 2007, 1:19:17 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/Compile_Func.cpp
r28 r46 39 39 return 0; 40 40 } 41 void Opcode_Func_Len( char *Parameter){41 void Opcode_Func_Len( const char *Parameter ){ 42 42 int type,TypeSize; 43 43 LONG_PTR lpIndex; … … 46 46 type=GetVarType(Parameter,&lpIndex,0); 47 47 48 c har *tempParm=Parameter;48 const char *tempParm=Parameter; 49 49 char temporary[VN_SIZE]; 50 50 char temp2[32]; … … 93 93 return; 94 94 } 95 void Opcode_Func_AddressOf( char *name){95 void Opcode_Func_AddressOf( const char *name ){ 96 96 extern int cp; 97 97 SUBINFO *psi; … … 103 103 SUBINFO **ppsi; 104 104 int num; 105 ppsi=GetOverloadSubHash( name,&num);105 ppsi=GetOverloadSubHash( name, &num ); 106 106 if(!num){ 107 107 HeapDefaultFree(ppsi); … … 202 202 psi->bUse=1; 203 203 } 204 void Opcode_Func_SizeOf( char *Parameter){204 void Opcode_Func_SizeOf( const char *Parameter ){ 205 205 int type,size; 206 206 LONG_PTR lpIndex; … … 212 212 op_mov_RV(sizeof(_int64),REG_RAX,size); 213 213 } 214 void Opcode_Func_VarPtr(char *Parameter){ 215 int type; 214 void Opcode_Func_VarPtr( const char *Parameter, TYPEINFO &ReturnTypeInfo ){ 216 215 RELATIVE_VAR RelativeVar; 217 216 218 217 //変数のアドレスを取得 219 if(!GetVarOffsetReadOnly(Parameter,&type,&RelativeVar,0)) return; 218 if(!GetVarOffsetReadOnly( Parameter, &ReturnTypeInfo.type, &RelativeVar, &ReturnTypeInfo.u.lpIndex )) return; 219 220 PTR_LEVEL_UP( ReturnTypeInfo.type ); 220 221 221 222 SetVarPtrToReg(REG_RAX,&RelativeVar); 222 223 } 223 void Opcode_Func_GetPtrData( char *Parameter,int type){224 void Opcode_Func_GetPtrData( const char *Parameter, const int type ){ 224 225 int i2; 225 226 … … 246 247 } 247 248 248 int Opcode_CallFunc(char *Parameter,int FuncNum){249 void Opcode_CallFunc( const char *Parameter, const int FuncNum, TYPEINFO &ReturnTypeInfo ){ 249 250 switch(FuncNum){ 250 251 case FUNC_LEN: 251 252 Opcode_Func_Len(Parameter); 252 return DEF_LONG; 253 ReturnTypeInfo.type = DEF_LONG; 254 break; 253 255 case FUNC_ADDRESSOF: 254 256 Opcode_Func_AddressOf(Parameter); 255 return DEF_PTR_VOID; 257 ReturnTypeInfo.type = DEF_PTR_VOID; 258 break; 256 259 case FUNC_SIZEOF: 257 260 Opcode_Func_SizeOf(Parameter); 258 return DEF_LONG; 261 ReturnTypeInfo.type = DEF_LONG; 262 break; 259 263 case FUNC_VARPTR: 260 Opcode_Func_VarPtr( Parameter);261 return DEF_PTR_VOID;264 Opcode_Func_VarPtr( Parameter, ReturnTypeInfo ); 265 break; 262 266 263 267 case FUNC_GETDOUBLE: 264 268 Opcode_Func_GetPtrData(Parameter,DEF_DOUBLE); 265 return DEF_DOUBLE; 269 ReturnTypeInfo.type = DEF_DOUBLE; 270 break; 266 271 case FUNC_GETSINGLE: 267 272 Opcode_Func_GetPtrData(Parameter,DEF_SINGLE); 268 return DEF_SINGLE; 273 ReturnTypeInfo.type = DEF_SINGLE; 274 break; 269 275 case FUNC_GETQWORD: 270 276 Opcode_Func_GetPtrData(Parameter,DEF_QWORD); 271 return DEF_QWORD; 277 ReturnTypeInfo.type = DEF_QWORD; 278 break; 272 279 case FUNC_GETDWORD: 273 280 Opcode_Func_GetPtrData(Parameter,DEF_DWORD); 274 return DEF_DWORD; 281 ReturnTypeInfo.type = DEF_DWORD; 282 break; 275 283 case FUNC_GETWORD: 276 284 Opcode_Func_GetPtrData(Parameter,DEF_WORD); 277 return DEF_WORD; 285 ReturnTypeInfo.type = DEF_WORD; 286 break; 278 287 case FUNC_GETBYTE: 279 288 Opcode_Func_GetPtrData(Parameter,DEF_BYTE); 280 returnDEF_BYTE;281 }282 return 0;283 } 289 ReturnTypeInfo.type = DEF_BYTE; 290 break; 291 } 292 }
Note:
See TracChangeset
for help on using the changeset viewer.