Changeset 636 in dev for trunk/ab5.0/abdev/ab_common/src
- Timestamp:
- Jun 10, 2008, 11:40:17 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev/ab_common/src/Lexical
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/src/Lexical/Class.cpp
r632 r636 677 677 } 678 678 679 _ASSERT( false ); 679 680 throw; 680 681 } … … 693 694 } 694 695 696 _ASSERT( false ); 695 697 throw; 696 698 } … … 699 701 if( vtblMasterListOffset == -1 ) 700 702 { 703 _ASSERT( false ); 701 704 throw; 702 705 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/Meta.cpp
r632 r636 34 34 } 35 35 36 void Meta::StaticLink( Meta &meta, long dataSectionBaseOffset, int sourceIndexBase )36 void Meta::StaticLink( Meta &meta, long dataSectionBaseOffset, const std::vector<int> &relationTable ) 37 37 { 38 38 // 名前空間 … … 53 53 54 54 pUserProc->GetNativeCode().ResetDataSectionBaseOffset( dataSectionBaseOffset ); 55 pUserProc->GetNativeCode().ResetSourceIndexes( sourceIndexBase );55 pUserProc->GetNativeCode().ResetSourceIndexes( relationTable ); 56 56 57 57 this->userProcs.Put( pUserProc ); … … 75 75 CClass *pClass = meta.GetClasses().Iterator_GetNext(); 76 76 pClass->isTargetObjectModule = false; 77 pClass->Readed(); 77 78 this->GetClasses().Put( pClass ); 78 79 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp
r603 r636 45 45 sourceLine.GetLineNum(), 46 46 baseOffset + sourceLine.GetNativeCodePos(), 47 sourceLine.Get SourceIndex(),47 sourceLine.GetRelationalObjectModuleIndex(), // TODO: 複数libの取り込みを想定できていない(ソースコード行番号とネイティブコード位置の対応情報の追加は静的リンクが完了した後に行うべき) 48 48 sourceLine.GetSourceCodePos(), 49 49 sourceLine.GetCodeType() … … 152 152 } 153 153 } 154 void NativeCode::ResetSourceIndexes( long sourceIndexBase )154 void NativeCode::ResetSourceIndexes( const std::vector<int> &relationTable ) 155 155 { 156 156 BOOST_FOREACH( SourceLine &sourceLine, sourceLines ) 157 157 { 158 sourceLine.Set SourceIndex( sourceLine.GetSourceIndex() + sourceIndexBase);158 sourceLine.SetRelationalObjectModuleIndex( relationTable[sourceLine.GetRelationalObjectModuleIndex()] ); 159 159 } 160 160 } -
trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp
r603 r636 58 58 void ObjectModule::StaticLink( ObjectModule &objectModule ) 59 59 { 60 const std::vector<int> relationTable = this->GetRelationTable( objectModule.relationalObjectModuleNames ); 61 60 62 long dataSectionBaseOffset = dataTable.GetSize(); 61 int sourceIndexBase = (int)sources.size();62 63 63 64 // メタ情報を結合 64 meta.StaticLink( objectModule.meta, dataSectionBaseOffset, sourceIndexBase );65 meta.StaticLink( objectModule.meta, dataSectionBaseOffset, relationTable ); 65 66 66 67 // グローバル ネイティブコードを結合 67 68 objectModule.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset ); 68 objectModule.globalNativeCode.ResetSourceIndexes( sourceIndexBase );69 objectModule.globalNativeCode.ResetSourceIndexes( relationTable ); 69 70 globalNativeCode.PutEx( objectModule.globalNativeCode ); 70 71 … … 73 74 dataTable.Add( objectModule.dataTable ); 74 75 75 // ソースコードを結合76 BOOST_FOREACH( const BasicSource &source, objectModule.sources )77 {78 this->sources.push_back( source );79 }80 81 76 // TODO: basbufがいらなくなったら消す 82 77 extern char *basbuf; 83 basbuf = this->sources[0].GetBuffer(); 78 basbuf = this->source.GetBuffer(); 79 } 80 81 const std::vector<int> ObjectModule::GetRelationTable( const Jenga::Common::Strings &oldRelationalObjectModuleNames ) 82 { 83 // 要素 = 古いインデックス、値 = 新しいインデックス 84 std::vector<int> relationTable; 85 86 // リレーションテーブルを構築 87 BOOST_FOREACH( const std::string &oldRelationalObjectModuleName, oldRelationalObjectModuleNames ) 88 { 89 bool isMatch = false; 90 for( int i=0; i<static_cast<int>(this->relationalObjectModuleNames.size()); i++ ) 91 { 92 if( oldRelationalObjectModuleName == this->relationalObjectModuleNames[i] ) 93 { 94 isMatch = true; 95 relationTable.push_back( i ); 96 break; 97 } 98 } 99 100 if( !isMatch ) 101 { 102 // エラー 103 _ASSERT( false ); 104 } 105 } 106 107 return relationTable; 84 108 } 85 109
Note:
See TracChangeset
for help on using the changeset viewer.