Changeset 273 in dev for trunk/abdev/BasicCompiler_Common/src/Variable.cpp
- Timestamp:
- Aug 11, 2007, 4:03:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Variable.cpp
r248 r273 73 73 return NULL; 74 74 } 75 76 void Variables::Add( Variable *pVar, bool isInitArea ) 77 { 78 int alignment = 0; 79 if( pVar->GetType().IsStruct() ){ 80 alignment = pVar->GetType().GetClass().GetFixedAlignment(); 81 } 82 83 if( isInitArea ){ 84 //初期バッファがあるとき 85 86 if( alignment ){ 87 if( allInitSize % alignment ){ 88 allInitSize += alignment - (allInitSize % alignment); 89 } 90 } 91 92 pVar->SetOffsetAddress( allInitSize ); 93 allInitSize += pVar->GetMemorySize(); 94 } 95 else{ 96 //初期バッファがないとき 97 98 if( alignment ){ 99 if( allSize % alignment ){ 100 allSize += alignment - (allSize % alignment); 101 } 102 } 103 104 pVar->SetOffsetAddress( allSize | 0x80000000 ); 105 allSize += pVar->GetMemorySize(); 106 } 107 108 push_back( pVar ); 109 }
Note:
See TracChangeset
for help on using the changeset viewer.