source: dev/trunk/abdev/BasicCompiler_Common/src/Meta.cpp@ 280

Last change on this file since 280 was 280, checked in by dai_9181, 17 years ago
File size: 3.3 KB
Line 
1#include "stdafx.h"
2
3#include <Compiler.h>
4
5void Meta::Clear()
6{
7 // 名前空間
8 namespaceScopesCollection.clear();
9
10 // 関数・メソッド
11 userProcs.Clear();
12
13 // DLL関数
14 dllProcs.Clear();
15
16 // クラス
17 classesImpl.Clear();
18
19 // グローバル変数
20 globalVars.Clear();
21
22 // グローバル定数
23 globalConsts.Clear();
24
25 // グローバル定数マクロ
26 globalConstMacros.Clear();
27
28 // blittable型
29 blittableTypes.clear();
30
31 // TypeDef
32 typeDefs.clear();
33
34 // 関数ポインタ
35 procPointers.Clear();
36}
37
38void Meta::StaticLink( Meta &meta, long dataSectionBaseOffset, int sourceIndexBase )
39{
40 // 名前空間
41 BOOST_FOREACH( NamespaceScopes &namespaceScopes, meta.namespaceScopesCollection )
42 {
43 if( !this->namespaceScopesCollection.IsExist( namespaceScopes ) )
44 {
45 this->namespaceScopesCollection.push_back( namespaceScopes );
46 }
47 }
48
49 // 関数・メソッド
50 meta.GetUserProcs().Iterator_Reset();
51 while( meta.GetUserProcs().Iterator_HasNext() )
52 {
53 UserProc *pUserProc = meta.GetUserProcs().Iterator_GetNext();
54 pUserProc->isTargetObjectModule = false;
55
56 pUserProc->GetNativeCode().ResetDataSectionBaseOffset( dataSectionBaseOffset );
57 pUserProc->GetNativeCode().ResetSourceIndexes( sourceIndexBase );
58
59 this->userProcs.Put( pUserProc );
60 }
61 meta.GetUserProcs().PullOutAll();
62
63 // DLL関数
64 meta.GetDllProcs().Iterator_Reset();
65 while( meta.GetDllProcs().Iterator_HasNext() )
66 {
67 DllProc *pDllProc = meta.GetDllProcs().Iterator_GetNext();
68 pDllProc->isTargetObjectModule = false;
69 this->dllProcs.Put( pDllProc );
70 }
71 meta.GetDllProcs().PullOutAll();
72
73 // クラス
74 meta.GetClasses().Iterator_Reset();
75 while( meta.GetClasses().Iterator_HasNext() )
76 {
77 CClass *pClass = meta.GetClasses().Iterator_GetNext();
78 pClass->isTargetObjectModule = false;
79 this->GetClasses().Put( pClass );
80 }
81 meta.GetClasses().PullOutAll();
82
83 // グローバル変数
84 BOOST_FOREACH( Variable *pVar, meta.globalVars )
85 {
86 pVar->isTargetObjectModule = false;
87 this->globalVars.Add( pVar );
88 }
89 meta.globalVars.PullOutAll();
90
91 // グローバル定数
92 meta.GetGlobalConsts().Iterator_Reset();
93 while( meta.GetGlobalConsts().Iterator_HasNext() )
94 {
95 CConst *pConst = meta.GetGlobalConsts().Iterator_GetNext();
96 pConst->isTargetObjectModule = false;
97 this->GetGlobalConsts().Put( pConst );
98 }
99 meta.GetGlobalConsts().PullOutAll();
100
101 // グローバル定数マクロ
102 meta.GetGlobalConstMacros().Iterator_Reset();
103 while( meta.GetGlobalConstMacros().Iterator_HasNext() )
104 {
105 ConstMacro *pConstMacro = meta.GetGlobalConstMacros().Iterator_GetNext();
106 pConstMacro->isTargetObjectModule = false;
107 this->GetGlobalConstMacros().Put( pConstMacro );
108 }
109 meta.GetGlobalConstMacros().PullOutAll();
110
111 // blittable型
112 BOOST_FOREACH( BlittableType &blittableType, meta.blittableTypes )
113 {
114 blittableType.isTargetObjectModule = false;
115 this->blittableTypes.push_back( blittableType );
116 }
117 meta.blittableTypes.clear();
118
119 // TypeDef
120 BOOST_FOREACH( TypeDef &typeDef, meta.typeDefs )
121 {
122 typeDef.isTargetObjectModule = false;
123 this->typeDefs.push_back( typeDef );
124 }
125 meta.typeDefs.clear();
126
127 // 関数ポインタ
128 BOOST_FOREACH( ProcPointer *pProcPointer, meta.procPointers )
129 {
130 pProcPointer->isTargetObjectModule = false;
131 this->procPointers.push_back( pProcPointer );
132 }
133 meta.procPointers.PullOutAll();
134}
Note: See TracBrowser for help on using the repository browser.