comparison gen/llvmhelpers.cpp @ 946:1714836f2c0b

Mostly rewrite debug info generation in terms of llvm/Analysis/DebugInfo.h. Add getCompilationModule to Dsymbol and fix template compile unit decision code. Runtime compiles with -g again.
author Christian Kamm <kamm incasoftware de>
date Sun, 08 Feb 2009 16:50:22 +0100
parents 03d7c4aac654
children 9a10fa839dc5
comparison
equal deleted inserted replaced
945:03d7c4aac654 946:1714836f2c0b
972 gvar->setInitializer(initVal); 972 gvar->setInitializer(initVal);
973 973
974 // do debug info 974 // do debug info
975 if (global.params.symdebug) 975 if (global.params.symdebug)
976 { 976 {
977 LLGlobalVariable* gv = DtoDwarfGlobalVariable(gvar, vd); 977 LLGlobalVariable* gv = DtoDwarfGlobalVariable(gvar, vd).getGV();
978 // keep a reference so GDCE doesn't delete it ! 978 // keep a reference so GDCE doesn't delete it !
979 gIR->usedArray.push_back(llvm::ConstantExpr::getBitCast(gv, getVoidPtrType())); 979 gIR->usedArray.push_back(llvm::ConstantExpr::getBitCast(gv, getVoidPtrType()));
980 } 980 }
981 } 981 }
982 } 982 }
1555 1555
1556 ////////////////////////////////////////////////////////////////////////////////////////// 1556 //////////////////////////////////////////////////////////////////////////////////////////
1557 1557
1558 bool mustDefineSymbol(Dsymbol* s) 1558 bool mustDefineSymbol(Dsymbol* s)
1559 { 1559 {
1560 #if 1 1560 #if 0
1561 return s->getModule() == gIR->dmodule || DtoIsTemplateInstance(s) != NULL; 1561 return s->getModule() == gIR->dmodule || DtoIsTemplateInstance(s) != NULL;
1562 #else 1562 #else
1563 Module* M = DtoIsTemplateInstance(s); 1563 Module* M = DtoIsTemplateInstance(s);
1564 // if it's a template instance, check the instantiating module 1564 // if it's a template instance, check the instantiating module
1565 // not the module that defines the template 1565 // not the module that defines the template
1571 1571
1572 ////////////////////////////////////////////////////////////////////////////////////////// 1572 //////////////////////////////////////////////////////////////////////////////////////////
1573 1573
1574 bool needsTemplateLinkage(Dsymbol* s) 1574 bool needsTemplateLinkage(Dsymbol* s)
1575 { 1575 {
1576 #if 1 1576 #if 0
1577 return DtoIsTemplateInstance(s) != NULL; 1577 return DtoIsTemplateInstance(s) != NULL;
1578 #else 1578 #else
1579 Module* M = DtoIsTemplateInstance(s); 1579 Module* M = DtoIsTemplateInstance(s);
1580 // only return true if the symbol is a template instances 1580 // only return true if the symbol is a template instances
1581 // and if this instance originated in the current module 1581 // and if this instance originated in the current module