Changeset 79 in dev for BasicCompiler64
- Timestamp:
- Mar 25, 2007, 5:58:57 AM (18 years ago)
- Location:
- BasicCompiler64
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/BasicCompiler.vcproj
r78 r79 152 152 Optimization="2" 153 153 InlineFunctionExpansion="1" 154 AdditionalIncludeDirectories="..\cpplibs\boost;..\ cpplibs\Base"154 AdditionalIncludeDirectories="..\cpplibs\boost;..\BasicCompiler_Common\include" 155 155 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;_AMD64_;_WIN64" 156 156 StringPooling="true" … … 253 253 Optimization="2" 254 254 InlineFunctionExpansion="1" 255 AdditionalIncludeDirectories="..\cpplibs\boost;..\ cpplibs\Base"255 AdditionalIncludeDirectories="..\cpplibs\boost;..\BasicCompiler_Common\include" 256 256 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;ENG" 257 257 StringPooling="true" … … 348 348 Name="VCCLCompilerTool" 349 349 Optimization="2" 350 AdditionalIncludeDirectories="..\cpplibs\boost;..\ cpplibs\Base"350 AdditionalIncludeDirectories="..\cpplibs\boost;..\BasicCompiler_Common\include" 351 351 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;_AMD64_;_WIN64" 352 352 MinimalRebuild="false" -
BasicCompiler64/Compile_Func.cpp
r78 r79 185 185 pUserProc->Using(); 186 186 } 187 void Opcode_Func_SizeOf( const char *Parameter ){ 188 LONG_PTR lpIndex; 189 int type = GetTypeFixed(Parameter,&lpIndex); 190 191 int size; 192 if( type == DEF_OBJECT ){ 193 CClass *pClass = (CClass *)lpIndex; 194 size = pClass->GetSize(); 195 } 196 else{ 197 size=GetTypeSize(type,lpIndex); 198 } 187 void Opcode_Func_SizeOf( const string &typeName ){ 188 Type tempType; 189 if( !Type::StringToType( typeName, tempType ) ){ 190 SetError(3,typeName,cp); 191 return; 192 } 193 194 int typeSize = ( tempType.IsObject() ) ? 195 tempType.GetClass().GetSize() : tempType.GetSize(); 199 196 200 197 //mov rax,size 201 op_mov_RV(sizeof(_int64),REG_RAX, size);198 op_mov_RV(sizeof(_int64),REG_RAX,typeSize); 202 199 } 203 200 void Opcode_Func_VarPtr( const char *Parameter, Type &resultType, bool isCallOn ){ -
BasicCompiler64/Compile_Var.cpp
r76 r79 1074 1074 } 1075 1075 1076 void dim( bool isRef,char *VarName,int *SubScripts,Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlags){1076 void dim( char *VarName,int *SubScripts,Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlags){ 1077 1077 if( UserProc::IsGlobalAreaCompiling() ){ 1078 1078 ///////////////////////// … … 1080 1080 ///////////////////////// 1081 1081 1082 AddGlobalVariable( isRef,VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags);1082 AddGlobalVariable(VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags); 1083 1083 } 1084 1084 else{ … … 1095 1095 bool isConst = ( dwFlags & DIMFLAG_CONST ) ? true:false; 1096 1096 1097 Variable *pVar = new Variable( VarName, type, isConst , isRef);1097 Variable *pVar = new Variable( VarName, type, isConst ); 1098 1098 1099 1099 if( SubScripts[0] != -1 ){ -
BasicCompiler64/NumOpe.cpp
r76 r79 177 177 int type_stack[255]; 178 178 LONG_PTR index_stack[255]; 179 bool isNothing_stack[255]; 179 180 BOOL bUseHeap[255]; 180 181 _int64 i64data; … … 187 188 if(idCalc){ 188 189 if(type_stack[sp-2]==DEF_OBJECT){ 189 //オーバーロードされたオペレータを呼び出す 190 i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,bUseHeap,sp); 191 if(i2==0){ 192 if(idCalc==CALC_EQUAL) lstrcpy(temp2,"=="); 193 else GetCalcName(idCalc,temp2); 194 sprintf(temporary,"Operator %s",temp2); 195 SetError(27,temporary,cp); 196 goto error; 190 if( idCalc == CALC_AS 191 && type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST ) 192 && index_stack[sp-1] == index_stack[sp-2] 193 || isNothing_stack[sp-2] ){ 194 // 同一の型、またはNothingに対するAsはAs演算子を呼び出さない 197 195 } 198 else if(i2==-1) goto error; 199 200 continue; 196 else{ 197 //オーバーロードされたオペレータを呼び出す 198 i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,bUseHeap,sp); 199 if(i2==0){ 200 if(idCalc==CALC_EQUAL) lstrcpy(temp2,"=="); 201 else GetCalcName(idCalc,temp2); 202 sprintf(temporary,"Operator %s",temp2); 203 SetError(27,temporary,cp); 204 goto error; 205 } 206 else if(i2==-1) goto error; 207 208 continue; 209 } 201 210 } 202 211 … … 208 217 case 0: 209 218 index_stack[sp]=-1; 219 isNothing_stack[sp] = false; 210 220 bUseHeap[sp]=0; 211 221 … … 424 434 // Nothing 425 435 if( lstrcmp( term, "Nothing" ) == 0 ){ 436 isNothing_stack[sp] = true; 437 426 438 type_stack[sp] = DEF_OBJECT; 427 439 if( baseType.IsObject() ){ … … 554 566 // 型名の場合 555 567 ////////////// 556 557 LONG_PTR lp; 558 i3=GetTypeFixed(term,&lp); 559 if(i3!=-1){ 560 type_stack[sp]=i3|FLAG_CAST; 561 index_stack[sp]=lp; 568 Type tempType; 569 if( Type::StringToType( term, tempType ) ){ 570 type_stack[sp] = tempType.GetBasicType() | FLAG_CAST; 571 index_stack[sp] = tempType.GetIndex(); 562 572 sp++; 563 573 break; 564 574 } 565 566 575 567 576 -
BasicCompiler64/Opcode.h
r78 r79 323 323 #define DIMFLAG_STATIC 0x04 324 324 #define DIMFLAG_CONST 0x08 325 void dim( bool isRef,char *VarName,int *SubScripts,Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlags);325 void dim( char *VarName,int *SubScripts,Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlags); 326 326 void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar); 327 327
Note:
See TracChangeset
for help on using the changeset viewer.