Mercurial > projects > ldc
comparison gen/llvmhelpers.cpp @ 943:95d09451cb59
Reverted the template instantiation changes from rev [940]. Wasn't safe it seems :(
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Thu, 05 Feb 2009 18:17:42 +0100 |
parents | 39519a1ff603 |
children | 03d7c4aac654 |
comparison
equal
deleted
inserted
replaced
942:55559220ad72 | 943:95d09451cb59 |
---|---|
1556 | 1556 |
1557 ////////////////////////////////////////////////////////////////////////////////////////// | 1557 ////////////////////////////////////////////////////////////////////////////////////////// |
1558 | 1558 |
1559 bool mustDefineSymbol(Dsymbol* s) | 1559 bool mustDefineSymbol(Dsymbol* s) |
1560 { | 1560 { |
1561 #if 1 | |
1562 return s->getModule() == gIR->dmodule || DtoIsTemplateInstance(s) != NULL; | |
1563 #else | |
1561 Module* M = DtoIsTemplateInstance(s); | 1564 Module* M = DtoIsTemplateInstance(s); |
1562 // if it's a template instance, check the instantiating module | 1565 // if it's a template instance, check the instantiating module |
1563 // not the module that defines the template | 1566 // not the module that defines the template |
1564 if (M) | 1567 if (M) |
1565 return M == gIR->dmodule; | 1568 return M == gIR->dmodule; |
1566 return s->getModule() == gIR->dmodule; | 1569 return s->getModule() == gIR->dmodule; |
1570 #endif | |
1567 } | 1571 } |
1568 | 1572 |
1569 ////////////////////////////////////////////////////////////////////////////////////////// | 1573 ////////////////////////////////////////////////////////////////////////////////////////// |
1570 | 1574 |
1571 bool needsTemplateLinkage(Dsymbol* s) | 1575 bool needsTemplateLinkage(Dsymbol* s) |
1572 { | 1576 { |
1577 #if 1 | |
1578 return DtoIsTemplateInstance(s) != NULL; | |
1579 #else | |
1573 Module* M = DtoIsTemplateInstance(s); | 1580 Module* M = DtoIsTemplateInstance(s); |
1574 // only return true if the symbol is a template instances | 1581 // only return true if the symbol is a template instances |
1575 // and if this instance originated in the current module | 1582 // and if this instance originated in the current module |
1576 if (M) | 1583 if (M) |
1577 return M == gIR->dmodule; | 1584 return M == gIR->dmodule; |
1578 return false; | 1585 return false; |
1579 } | 1586 #endif |
1587 } |