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

Last change on this file since 277 was 275, checked in by dai_9181, 17 years ago
File size: 3.2 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 )
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
58 this->userProcs.Put( pUserProc );
59 }
60 meta.GetUserProcs().PullOutAll();
61
62 // DLL関数
63 meta.GetDllProcs().Iterator_Reset();
64 while( meta.GetDllProcs().Iterator_HasNext() )
65 {
66 DllProc *pDllProc = meta.GetDllProcs().Iterator_GetNext();
67 pDllProc->isTargetObjectModule = false;
68 this->dllProcs.Put( pDllProc );
69 }
70 meta.GetDllProcs().PullOutAll();
71
72 // クラス
73 meta.GetClasses().Iterator_Reset();
74 while( meta.GetClasses().Iterator_HasNext() )
75 {
76 CClass *pClass = meta.GetClasses().Iterator_GetNext();
77 pClass->isTargetObjectModule = false;
78 this->GetClasses().Put( pClass );
79 }
80 meta.GetClasses().PullOutAll();
81
82 // グローバル変数
83 BOOST_FOREACH( Variable *pVar, meta.globalVars )
84 {
85 pVar->isTargetObjectModule = false;
86 this->globalVars.Add( pVar );
87 }
88 meta.globalVars.PullOutAll();
89
90 // グローバル定数
91 meta.GetGlobalConsts().Iterator_Reset();
92 while( meta.GetGlobalConsts().Iterator_HasNext() )
93 {
94 CConst *pConst = meta.GetGlobalConsts().Iterator_GetNext();
95 pConst->isTargetObjectModule = false;
96 this->GetGlobalConsts().Put( pConst );
97 }
98 meta.GetGlobalConsts().PullOutAll();
99
100 // グローバル定数マクロ
101 meta.GetGlobalConstMacros().Iterator_Reset();
102 while( meta.GetGlobalConstMacros().Iterator_HasNext() )
103 {
104 ConstMacro *pConstMacro = meta.GetGlobalConstMacros().Iterator_GetNext();
105 pConstMacro->isTargetObjectModule = false;
106 this->GetGlobalConstMacros().Put( pConstMacro );
107 }
108 meta.GetGlobalConstMacros().PullOutAll();
109
110 // blittable型
111 BOOST_FOREACH( BlittableType &blittableType, meta.blittableTypes )
112 {
113 blittableType.isTargetObjectModule = false;
114 this->blittableTypes.push_back( blittableType );
115 }
116 meta.blittableTypes.clear();
117
118 // TypeDef
119 BOOST_FOREACH( TypeDef &typeDef, meta.typeDefs )
120 {
121 typeDef.isTargetObjectModule = false;
122 this->typeDefs.push_back( typeDef );
123 }
124 meta.typeDefs.clear();
125
126 // 関数ポインタ
127 BOOST_FOREACH( ProcPointer *pProcPointer, meta.procPointers )
128 {
129 pProcPointer->isTargetObjectModule = false;
130 this->procPointers.push_back( pProcPointer );
131 }
132 meta.procPointers.PullOutAll();
133}
Note: See TracBrowser for help on using the repository browser.