comparison dmd2/module.h @ 1452:638d16625da2

LDC 2 compiles again.
author Robert Clipsham <robert@octarineparrot.com>
date Sat, 30 May 2009 17:23:32 +0100
parents 5f5e6eb790e7
children 54b3c1394d62
comparison
equal deleted inserted replaced
1423:42bd767ec5a4 1452:638d16625da2
26 struct VarDeclaration; 26 struct VarDeclaration;
27 struct Library; 27 struct Library;
28 28
29 // Back end 29 // Back end
30 #if IN_LLVM 30 #if IN_LLVM
31 class Ir;
31 struct DValue; 32 struct DValue;
32 typedef DValue elem; 33 typedef DValue elem;
34 namespace llvm { class Module; }
33 #else 35 #else
36
34 #ifdef IN_GCC 37 #ifdef IN_GCC
35 union tree_node; typedef union tree_node elem; 38 union tree_node; typedef union tree_node elem;
36 #else 39 #else
37 struct elem; 40 struct elem;
38 #endif 41 #endif
77 int needmoduleinfo; 80 int needmoduleinfo;
78 #ifdef IN_GCC 81 #ifdef IN_GCC
79 int strictlyneedmoduleinfo; 82 int strictlyneedmoduleinfo;
80 #endif 83 #endif
81 84
85 int selfimports; // 0: don't know, 1: does not, 2: does
86 int selfImports(); // returns !=0 if module imports itself
87
82 int insearch; 88 int insearch;
83 Identifier *searchCacheIdent; 89 Identifier *searchCacheIdent;
84 Dsymbol *searchCacheSymbol; // cached value of search 90 Dsymbol *searchCacheSymbol; // cached value of search
85 int searchCacheFlags; // cached flags 91 int searchCacheFlags; // cached flags
86 92
106 unsigned versionlevel; // version level 112 unsigned versionlevel; // version level
107 Array *versionids; // version identifiers 113 Array *versionids; // version identifiers
108 Array *versionidsNot; // forward referenced version identifiers 114 Array *versionidsNot; // forward referenced version identifiers
109 115
110 Macro *macrotable; // document comment macros 116 Macro *macrotable; // document comment macros
111 struct Escape *escapetable; // document comment escapes 117 Escape *escapetable; // document comment escapes
118 bool safe; // TRUE if module is marked as 'safe'
112 119
113 int doDocComment; // enable generating doc comments for this module 120 int doDocComment; // enable generating doc comments for this module
114 int doHdrGen; // enable generating header file for this module 121 int doHdrGen; // enable generating header file for this module
115 122
116 bool safe;
117
118 Module(char *arg, Identifier *ident, int doDocComment, int doHdrGen); 123 Module(char *arg, Identifier *ident, int doDocComment, int doHdrGen);
119 ~Module(); 124 ~Module();
120 125
121 static Module *load(Loc loc, Array *packages, Identifier *ident); 126 static Module *load(Loc loc, Array *packages, Identifier *ident);
122 127
123 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 128 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
124 const char *kind(); 129 const char *kind();
130 #if !IN_LLVM
131 void setDocfile(); // set docfile member
132 #endif
125 void read(Loc loc); // read file 133 void read(Loc loc); // read file
126 #if IN_GCC 134 #if IN_GCC
127 void parse(bool dump_source = false); // syntactic parse 135 void parse(bool dump_source = false); // syntactic parse
128 #else 136 #else
129 void parse(); // syntactic parse 137 void parse(); // syntactic parse
130 #endif 138 #endif
131 void semantic(Scope* unused_sc = NULL); // semantic analysis 139 void semantic(Scope* unused_sc = NULL); // semantic analysis
132 void semantic2(Scope* unused_sc = NULL); // pass 2 semantic analysis 140 void semantic2(Scope* unused_sc = NULL); // pass 2 semantic analysis
133 void semantic3(Scope* unused_sc = NULL); // pass 3 semantic analysis 141 void semantic3(Scope* unused_sc = NULL); // pass 3 semantic analysis
134 void inlineScan(); // scan for functions to inline 142 void inlineScan(); // scan for functions to inline
143 #if !IN_LLVM
144 void setHdrfile(); // set hdrfile member
145 #endif
135 #ifdef _DH 146 #ifdef _DH
136 void genhdrfile(); // generate D import file 147 void genhdrfile(); // generate D import file
137 #endif 148 #endif
138 void genobjfile(int multiobj);
139 // void gensymfile(); 149 // void gensymfile();
140 void gendocfile(); 150 void gendocfile();
141 int needModuleInfo(); 151 int needModuleInfo();
142 Dsymbol *search(Loc loc, Identifier *ident, int flags); 152 Dsymbol *search(Loc loc, Identifier *ident, int flags);
143 void deleteObjFile(); 153 void deleteObjFile();
144 void addDeferredSemantic(Dsymbol *s); 154 void addDeferredSemantic(Dsymbol *s);
145 void runDeferredSemantic(); 155 void runDeferredSemantic();
156 int imports(Module *m);
146 157
147 // Back end 158 // Back end
148 159 #if IN_DMD
149 int doppelganger; // sub-module 160 int doppelganger; // sub-module
150 Symbol *cov; // private uint[] __coverage; 161 Symbol *cov; // private uint[] __coverage;
151 unsigned *covb; // bit array of valid code line numbers 162 unsigned *covb; // bit array of valid code line numbers
152 163
153 Symbol *sictor; // module order independent constructor 164 Symbol *sictor; // module order independent constructor
167 static Symbol *gencritsec(); 178 static Symbol *gencritsec();
168 elem *toEfilename(); 179 elem *toEfilename();
169 elem *toEmodulename(); 180 elem *toEmodulename();
170 181
171 Symbol *toSymbol(); 182 Symbol *toSymbol();
183 #endif
172 void genmoduleinfo(); 184 void genmoduleinfo();
173 185
186 #if IN_LLVM
174 // LDC 187 // LDC
188 llvm::Module* genLLVMModule(Ir* sir);
175 void buildTargetFiles(); 189 void buildTargetFiles();
176 File* buildFilePath(char* forcename, const char* path, const char* ext); 190 File* buildFilePath(const char* forcename, const char* path, const char* ext);
177 Module *isModule() { return this; } 191 Module *isModule() { return this; }
178 192
179 bool llvmForceLogging; 193 bool llvmForceLogging;
180 194
181 // array ops emitted in this module already 195 // array ops emitted in this module already
182 StringTable arrayfuncs; 196 StringTable arrayfuncs;
197 #endif
183 }; 198 };
184 199
185 200
186 struct ModuleDeclaration 201 struct ModuleDeclaration
187 { 202 {