Changeset 347 in dev for trunk/abdev/BasicCompiler_Common/src/Method.cpp
- Timestamp:
- Oct 11, 2007, 3:23:51 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Method.cpp
r346 r347 103 103 } 104 104 } 105 106 int Methods::GetVtblNum() const 107 { 108 int count = 0; 109 const Methods &methods = *this; 110 BOOST_FOREACH( const CMethod *pMethod, methods ) 111 { 112 if( pMethod->IsVirtual() ) 113 { 114 count++; 115 } 116 } 117 return count; 118 } 119 120 void Methods::GenerateVTablePart( long &vtableDataTableOffset ) const 121 { 122 const UserProc **ppsi = (const UserProc **)malloc(GetVtblNum()*sizeof(UserProc *)); 123 124 //関数テーブルに値をセット 125 int i2 = 0; 126 const Methods &methods = *this; 127 BOOST_FOREACH( const CMethod *pMethod, methods ){ 128 if(pMethod->IsVirtual()){ 129 if( !pMethod->GetUserProc().IsUsing() ) 130 { 131 ts((char *)pMethod->GetUserProc().GetFullName().c_str()); 132 } 133 pMethod->GetUserProc().Using(); 134 135 if(pMethod->IsAbstract()){ 136 SetError(); 137 138 ppsi[i2]=0; 139 } 140 else{ 141 ppsi[i2]=&pMethod->GetUserProc(); 142 } 143 i2++; 144 } 145 } 146 147 vtableDataTableOffset = compiler.GetObjectModule().dataTable.AddBinary( (void *)ppsi, GetVtblNum()*sizeof(LONG_PTR) ); 148 149 for( int i=0; i < GetVtblNum(); i++ ){ 150 pobj_Reloc->AddSchedule_DataSection(static_cast<DWORD>(vtableDataTableOffset+i*sizeof(LONG_PTR))); 151 } 152 153 free(ppsi); 154 }
Note:
See TracChangeset
for help on using the changeset viewer.