comparison gen/toobj.cpp @ 324:c542d12017e5 trunk

[svn r345] Fixed the new moduleinfo stuff to have consistent symbol names with the D style.
author lindquist
date Thu, 10 Jul 2008 00:13:09 +0200
parents 0d52412d5b1a
children aaade6ded589
comparison
equal deleted inserted replaced
323:0d52412d5b1a 324:c542d12017e5
304 { 304 {
305 // build ctor type 305 // build ctor type
306 const LLFunctionType* fty = LLFunctionType::get(LLType::VoidTy, std::vector<const LLType*>(), false); 306 const LLFunctionType* fty = LLFunctionType::get(LLType::VoidTy, std::vector<const LLType*>(), false);
307 307
308 // build ctor name 308 // build ctor name
309 std::string fname = gIR->dmodule->mangle(); 309 std::string fname = "_D";
310 fname += gIR->dmodule->mangle();
310 fname += "16__moduleinfoCtorZ"; 311 fname += "16__moduleinfoCtorZ";
311 312
312 // build a function that registers the moduleinfo in the global moduleinfo linked list 313 // build a function that registers the moduleinfo in the global moduleinfo linked list
313 LLFunction* ctor = LLFunction::Create(fty, LLGlobalValue::InternalLinkage, fname, gIR->module); 314 LLFunction* ctor = LLFunction::Create(fty, LLGlobalValue::InternalLinkage, fname, gIR->module);
314 315
318 mrefvalues.push_back(LLConstant::getNullValue(modulerefTy->getContainedType(0))); 319 mrefvalues.push_back(LLConstant::getNullValue(modulerefTy->getContainedType(0)));
319 mrefvalues.push_back(moduleinfo); 320 mrefvalues.push_back(moduleinfo);
320 LLConstant* thismrefinit = LLConstantStruct::get(modulerefTy, mrefvalues); 321 LLConstant* thismrefinit = LLConstantStruct::get(modulerefTy, mrefvalues);
321 322
322 // create the ModuleReference node for this module 323 // create the ModuleReference node for this module
323 std::string thismrefname = gIR->dmodule->mangle(); 324 std::string thismrefname = "_D";
325 thismrefname += gIR->dmodule->mangle();
324 thismrefname += "11__moduleRefZ"; 326 thismrefname += "11__moduleRefZ";
325 LLGlobalVariable* thismref = new LLGlobalVariable(modulerefTy, false, LLGlobalValue::InternalLinkage, thismrefinit, thismrefname, gIR->module); 327 LLGlobalVariable* thismref = new LLGlobalVariable(modulerefTy, false, LLGlobalValue::InternalLinkage, thismrefinit, thismrefname, gIR->module);
326 328
327 // make sure _Dmodule_ref is declared 329 // make sure _Dmodule_ref is declared
328 LLGlobalVariable* mref = gIR->module->getNamedGlobal("_Dmodule_ref"); 330 LLGlobalVariable* mref = gIR->module->getNamedGlobal("_Dmodule_ref");