- Timestamp:
- 09/06/07 01:38:05 (5 years ago)
- Files:
-
- trunk/tdcsrc/expression.cc (modified) (2 diffs)
- trunk/tdcsrc/module.cc (modified) (1 diff)
- trunk/tdcsrc/objfile.cc (modified) (5 diffs)
- trunk/tdcsrc/tdc_c.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tdcsrc/expression.cc
r133 r134 534 534 e2->toElem(irs)->toC() + "])"); 535 535 536 } else if (e1->type->ty == Taarray) { 537 e2->type->vtinfo->toObjFile(); 538 return new elem("(*((" + e1->type->pointerTo()->toCtype()->toC("") + ") _aaGet(" + 539 e1->toElem(irs)->toC() + ", (void *) &" + 540 e2->type->vtinfo->mangle() + ", sizeof(" + 541 type->toCtype()->toC("") + "), " + 542 e2->toElem(irs)->toC() + ")))"); 543 536 544 } else { 537 545 return new elem("(" + e1->toElem(irs)->toC() + "[" + … … 808 816 elem *VarExp::toElem(IRState *irs) 809 817 { 818 // make sure it's genreated 819 if (var->parent && var->parent->isModule()) 820 var->toObjFile(); 821 810 822 /* if this is in a function scope, we need to figure out what parent level 811 823 * it is */ trunk/tdcsrc/module.cc
r123 r134 82 82 tdc_func_def = ""; 83 83 tdc_var_def = ""; 84 handled.clear(); 84 85 85 86 // then output the content trunk/tdcsrc/objfile.cc
r132 r134 169 169 170 170 // this may be extern 171 if (storage_class & STCextern || !fbody) { 171 if (storage_class & STCextern || 172 !fbody || 173 getModule() != tdc_cur_mod) { 172 174 // in which case we're done 173 175 return; … … 255 257 { 256 258 CHECK_HANDLED_VOID((void *) this); 257 if (tinfo->builtinTypeInfo()) return;258 259 259 260 switch (tinfo->ty) { … … 269 270 mangle()); 270 271 tdc_var_decl += "extern " + def + ";\n"; 272 if (tinfo->builtinTypeInfo()) return; 271 273 272 274 // the actual typeinfo … … 290 292 mangle()); 291 293 tdc_var_decl += "extern " + def + ";\n"; 294 if (tinfo->builtinTypeInfo()) return; 292 295 293 296 def += string(" = {\n&") + … … 300 303 return; 301 304 } 305 306 default: 307 { 308 if (tinfo->builtinTypeInfo()) { 309 // we just need a reference 310 Type::typeinfo->toObjFile(); 311 tdc_var_decl += "extern struct " + 312 Type::typeinfo->type->toCtype()->toC(mangle()) + ";\n"; 313 return; 314 } 315 } 302 316 } 303 317 trunk/tdcsrc/tdc_c.h
r133 r134 194 194 195 195 void _aaDel(void *aa, void *keyti, ...); 196 void* _aaGet(void *aa, void *keyti, size_t valuesize, ...); 196 197 void _d_assert(struct Array, uint32_t); 197 198 void _d_assert_msg(struct Array, struct Array, uint32_t);
