comparison gen/todebug.cpp @ 173:db9890b3fb64 trunk

[svn r189] moving IR data back into DMD frontend nodes
author ChristianK
date Tue, 06 May 2008 07:56:03 +0200
parents ccd07d9f2ce9
children 7816aafeea3c
comparison
equal deleted inserted replaced
172:68a7dd38c03c 173:db9890b3fb64
112 112
113 ////////////////////////////////////////////////////////////////////////////////////////////////// 113 //////////////////////////////////////////////////////////////////////////////////////////////////
114 114
115 llvm::GlobalVariable* DtoDwarfCompileUnit(Module* m) 115 llvm::GlobalVariable* DtoDwarfCompileUnit(Module* m)
116 { 116 {
117 if (!gIR->irDsymbol[m].irModule) 117 if (!m->ir.irModule)
118 gIR->irDsymbol[m].irModule = new IrModule(m); 118 m->ir.irModule = new IrModule(m);
119 else if (gIR->irDsymbol[m].irModule->dwarfCompileUnit) 119 else if (m->ir.irModule->dwarfCompileUnit)
120 { 120 {
121 if (gIR->irDsymbol[m].irModule->dwarfCompileUnit->getParent() == gIR->module) 121 if (m->ir.irModule->dwarfCompileUnit->getParent() == gIR->module)
122 return gIR->irDsymbol[m].irModule->dwarfCompileUnit; 122 return m->ir.irModule->dwarfCompileUnit;
123 } 123 }
124 124
125 // create a valid compile unit constant for the current module 125 // create a valid compile unit constant for the current module
126 126
127 llvm::Constant* c = NULL; 127 llvm::Constant* c = NULL;
146 c = llvm::ConstantStruct::get(GetDwarfCompileUnitType(), vals); 146 c = llvm::ConstantStruct::get(GetDwarfCompileUnitType(), vals);
147 147
148 llvm::GlobalVariable* gv = new llvm::GlobalVariable(GetDwarfCompileUnitType(), true, llvm::GlobalValue::InternalLinkage, c, "llvm.dbg.compile_unit", gIR->module); 148 llvm::GlobalVariable* gv = new llvm::GlobalVariable(GetDwarfCompileUnitType(), true, llvm::GlobalValue::InternalLinkage, c, "llvm.dbg.compile_unit", gIR->module);
149 gv->setSection("llvm.metadata"); 149 gv->setSection("llvm.metadata");
150 150
151 gIR->irDsymbol[m].irModule->dwarfCompileUnit = gv; 151 m->ir.irModule->dwarfCompileUnit = gv;
152 return gv; 152 return gv;
153 } 153 }
154 154
155 ////////////////////////////////////////////////////////////////////////////////////////////////// 155 //////////////////////////////////////////////////////////////////////////////////////////////////
156 156
180 180
181 ////////////////////////////////////////////////////////////////////////////////////////////////// 181 //////////////////////////////////////////////////////////////////////////////////////////////////
182 182
183 void DtoDwarfFuncStart(FuncDeclaration* fd) 183 void DtoDwarfFuncStart(FuncDeclaration* fd)
184 { 184 {
185 assert(gIR->irDsymbol[fd].irFunc->dwarfSubProg); 185 assert(fd->ir.irFunc->dwarfSubProg);
186 gIR->ir->CreateCall(gIR->module->getFunction("llvm.dbg.func.start"), dbgToArrTy(gIR->irDsymbol[fd].irFunc->dwarfSubProg)); 186 gIR->ir->CreateCall(gIR->module->getFunction("llvm.dbg.func.start"), dbgToArrTy(fd->ir.irFunc->dwarfSubProg));
187 } 187 }
188 188
189 void DtoDwarfFuncEnd(FuncDeclaration* fd) 189 void DtoDwarfFuncEnd(FuncDeclaration* fd)
190 { 190 {
191 assert(gIR->irDsymbol[fd].irFunc->dwarfSubProg); 191 assert(fd->ir.irFunc->dwarfSubProg);
192 gIR->ir->CreateCall(gIR->module->getFunction("llvm.dbg.region.end"), dbgToArrTy(gIR->irDsymbol[fd].irFunc->dwarfSubProg)); 192 gIR->ir->CreateCall(gIR->module->getFunction("llvm.dbg.region.end"), dbgToArrTy(fd->ir.irFunc->dwarfSubProg));
193 } 193 }
194 194
195 ////////////////////////////////////////////////////////////////////////////////////////////////// 195 //////////////////////////////////////////////////////////////////////////////////////////////////
196 196
197 void DtoDwarfStopPoint(unsigned ln) 197 void DtoDwarfStopPoint(unsigned ln)