diff gen/llvmhelpers.h @ 940:39519a1ff603

Changed the way LDC determines if a template instantiation needs to get a definition, seems to speed up compile times quite a bit in some cases.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 04 Feb 2009 18:48:03 +0100
parents 2ebac4750adb
children 4d366a75d95f
line wrap: on
line diff
--- a/gen/llvmhelpers.h	Wed Feb 04 18:39:39 2009 +0100
+++ b/gen/llvmhelpers.h	Wed Feb 04 18:48:03 2009 +0100
@@ -61,8 +61,8 @@
 // return the same val as passed in, modified to the target type, if possible, otherwise returns a new DValue
 DValue* DtoPaintType(Loc& loc, DValue* val, Type* to);
 
-// is template instance check
-bool DtoIsTemplateInstance(Dsymbol* s);
+// is template instance check, returns module where instantiated
+Module* DtoIsTemplateInstance(Dsymbol* s);
 
 // these are all basically drivers for the codegeneration called by the main loop
 void DtoResolveDsymbol(Dsymbol* dsym);
@@ -108,6 +108,12 @@
 // fixup an overloaded intrinsic name string
 void DtoOverloadedIntrinsicName(TemplateInstance* ti, TemplateDeclaration* td, std::string& name);
 
+// return true if the symbol should be defined in the current module, not just declared
+bool mustDefineSymbol(Dsymbol* s);
+
+// returns true if the symbol needs template linkage, or just external
+bool needsTemplateLinkage(Dsymbol* s);
+
 ////////////////////////////////////////////
 // gen/tocall.cpp stuff below
 ////////////////////////////////////////////