Mercurial > projects > ldc
comparison gen/todebug.cpp @ 797:340acf1535d0
Removed KDevelop3 project files, CMake can generate them just fine!
Fixed function literals in static initializers.
Changed alignment of delegates from 2*PTRSIZE to just PTRSIZE.
Changed errors to go to stderr instead of stdout.
Fairly major rewriting of struct/union/class handling, STILL A BIT BUGGY !!!
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Sat, 29 Nov 2008 21:25:43 +0100 |
parents | e4e50f4b58cd |
children | 8e6135be6999 |
comparison
equal
deleted
inserted
replaced
796:6e7a4c3b64d2 | 797:340acf1535d0 |
---|---|
450 name = DtoConstStringPtr(sd->toChars(), "llvm.metadata"); | 450 name = DtoConstStringPtr(sd->toChars(), "llvm.metadata"); |
451 linnum = sd->loc.linnum; | 451 linnum = sd->loc.linnum; |
452 definedCU = DtoDwarfCompileUnit(sd->getModule()); | 452 definedCU = DtoDwarfCompileUnit(sd->getModule()); |
453 | 453 |
454 std::vector<LLConstant*> elems; | 454 std::vector<LLConstant*> elems; |
455 elems.reserve(ir->offsets.size()); | 455 if (!ir->aggrdecl->isInterfaceDeclaration()) // plain interfaces don't have one |
456 for (IrStruct::OffsetMap::iterator i=ir->offsets.begin(); i!=ir->offsets.end(); ++i) | |
457 { | 456 { |
458 unsigned offset = i->first; | 457 std::vector<VarDeclaration*>& arr = ir->varDecls; |
459 IrStruct::Offset& o = i->second; | 458 size_t narr = arr.size(); |
460 | 459 elems.reserve(narr); |
461 LLGlobalVariable* ptr = dwarfMemberType(o.var->loc.linnum, o.var->type, compileUnit, definedCU, o.var->toChars(), offset); | 460 for (int k=0; k<narr; k++) |
462 elems.push_back(DBG_CAST(ptr)); | 461 { |
462 VarDeclaration* vd = arr[k]; | |
463 assert(vd); | |
464 | |
465 LLGlobalVariable* ptr = dwarfMemberType(vd->loc.linnum, vd->type, compileUnit, definedCU, vd->toChars(), vd->offset); | |
466 elems.push_back(DBG_CAST(ptr)); | |
467 } | |
463 } | 468 } |
464 | 469 |
465 const LLArrayType* at = LLArrayType::get(DBG_TYPE, elems.size()); | 470 const LLArrayType* at = LLArrayType::get(DBG_TYPE, elems.size()); |
466 LLConstant* ca = LLConstantArray::get(at, elems); | 471 LLConstant* ca = LLConstantArray::get(at, elems); |
467 members = new LLGlobalVariable(ca->getType(), true, LLGlobalValue::InternalLinkage, ca, ".array", gIR->module); | 472 members = new LLGlobalVariable(ca->getType(), true, LLGlobalValue::InternalLinkage, ca, ".array", gIR->module); |