comparison gen/toobj.cpp @ 250:fc9c1a0eabbd trunk

[svn r267] Fixed debug info for global variables. Cleaned up the debug info code in general.
author lindquist
date Wed, 11 Jun 2008 20:53:26 +0200
parents 890b4862ec6c
children 2f2d7c843e5d
comparison
equal deleted inserted replaced
249:fa9fef362a98 250:fc9c1a0eabbd
128 // generate ModuleInfo 128 // generate ModuleInfo
129 genmoduleinfo(); 129 genmoduleinfo();
130 // do this again as moduleinfo might have pulled something in! 130 // do this again as moduleinfo might have pulled something in!
131 DtoEmptyAllLists(); 131 DtoEmptyAllLists();
132 132
133 // emit usedArray
134 const LLArrayType* usedTy = LLArrayType::get(getVoidPtrType(), ir.usedArray.size());
135 LLConstant* usedInit = LLConstantArray::get(usedTy, ir.usedArray);
136 LLGlobalVariable* usedArray = new LLGlobalVariable(usedTy, true, LLGlobalValue::ExternalLinkage, usedInit, "llvm.used", ir.module);
137 usedArray->setSection("llvm.metadata");
138
133 // verify the llvm 139 // verify the llvm
134 if (!global.params.novalidate) { 140 if (!global.params.novalidate) {
135 std::string verifyErr; 141 std::string verifyErr;
136 Logger::println("Verifying module..."); 142 Logger::println("Verifying module...");
137 LOG_SCOPE; 143 LOG_SCOPE;
572 578
573 if (static_local) 579 if (static_local)
574 DtoConstInitGlobal(this); 580 DtoConstInitGlobal(this);
575 else 581 else
576 gIR->constInitList.push_back(this); 582 gIR->constInitList.push_back(this);
577
578 if (global.params.symdebug && _linkage != llvm::GlobalValue::ExternalLinkage)
579 DtoDwarfGlobalVariable(gvar, this);
580 } 583 }
581 584
582 // inside aggregate declaration. declare a field. 585 // inside aggregate declaration. declare a field.
583 else 586 else
584 { 587 {