Changeset 62 in dev for BasicCompiler64/Compile_Var.cpp


Ignore:
Timestamp:
Feb 22, 2007, 3:57:56 AM (17 years ago)
Author:
dai_9181
Message:

グローバル変数に対してByRefを指定できるようにした

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/Compile_Var.cpp

    r56 r62  
    647647    pRelativeVar->offset=GlobalVar[i].offset;
    648648    pRelativeVar->bOffsetOffset=0;
    649     pRelativeVar->dwKind=VAR_GLOBAL;
     649    if(GlobalVar[i].fRef){
     650        // 参照型
     651        pRelativeVar->dwKind = VAR_REFGLOBAL;
     652    }
     653    else pRelativeVar->dwKind=VAR_GLOBAL;
    650654    *pType=GlobalVar[i].type;
    651655    lpIndex=GlobalVar[i].u.index;
     
    11811185        GetNowStaticVarFullName(VarName,temporary);
    11821186
    1183         AddGlobalVariable(temporary,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);
     1187        AddGlobalVariable(isRef,temporary,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);
    11841188
    11851189        /*
     
    11941198            /////////////////////////
    11951199
    1196             AddGlobalVariable(VarName,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);
     1200            AddGlobalVariable(isRef,VarName,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);
    11971201        }
    11981202        else{
     
    13671371        }
    13681372    }
     1373    else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){
     1374        if(pRelativeVar->bOffsetOffset){
     1375            //add r11,qword ptr[offset]
     1376            op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
     1377            obp-=sizeof(long);
     1378            pobj_GlobalVarSchedule->add();
     1379            obp+=sizeof(long);
     1380        }
     1381        else{
     1382            //mov r11,qword ptr[offset]
     1383            op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
     1384            obp-=sizeof(long);
     1385            pobj_GlobalVarSchedule->add();
     1386            obp+=sizeof(long);
     1387        }
     1388
     1389        goto directmem;
     1390    }
    13691391    else if(pRelativeVar->dwKind==VAR_LOCAL){
    13701392        if(pRelativeVar->bOffsetOffset){
Note: See TracChangeset for help on using the changeset viewer.