summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-11-28 16:51:02 -0800
committerJames Cook <james@lindenlab.com>2009-11-28 16:51:02 -0800
commitf280c43d616d013747a9aab05141635868e00136 (patch)
tree22a502368ea5c0526fab30caf7679cff42272cdb
parentfd71800bb1c68c5d06199cf06de469ab7acdd2dc (diff)
Use extern template for common singletons to reduce code bloat/link time.
-rw-r--r--indra/llui/lluictrlfactory.cpp3
-rw-r--r--indra/llui/lluictrlfactory.h3
-rw-r--r--indra/newview/llbottomtray.cpp3
-rw-r--r--indra/newview/llbottomtray.h3
-rw-r--r--indra/newview/llfloatertestlistview.cpp7
-rw-r--r--indra/newview/llfloatertestlistview.h4
-rw-r--r--indra/newview/llselectmgr.cpp2
-rw-r--r--indra/newview/llselectmgr.h3
-rw-r--r--indra/newview/llviewercamera.cpp3
-rw-r--r--indra/newview/llviewercamera.h3
10 files changed, 34 insertions, 0 deletions
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 1c1450d7e9..49182be328 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -75,6 +75,9 @@ public:
static LLDefaultChildRegistry::Register<LLUICtrlLocate> r1("locate");
+// Build time optimization, generate this once in .cpp file
+template class LLUICtrlFactory* LLSingleton<class LLUICtrlFactory>::getInstance();
+
//-----------------------------------------------------------------------------
// LLUICtrlFactory()
//-----------------------------------------------------------------------------
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 8a9c9e23c1..adb3f7202f 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -108,6 +108,9 @@ extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP;
extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION;
extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS;
+// Build time optimization, generate this once in .cpp file
+extern template class LLUICtrlFactory* LLSingleton<class LLUICtrlFactory>::getInstance();
+
class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
{
private:
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 9cc7b8c785..4823932951 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -46,6 +46,9 @@
#include "llsyswellwindow.h"
#include "llfloatercamera.h"
+// Build time optimization, generate this once in .cpp file
+template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance();
+
LLBottomTray::LLBottomTray(const LLSD&)
: mChicletPanel(NULL),
mSysWell(NULL),
diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h
index 7640cdcf9d..3db5184f6b 100644
--- a/indra/newview/llbottomtray.h
+++ b/indra/newview/llbottomtray.h
@@ -47,6 +47,9 @@ class LLSpeakButton;
class LLNearbyChatBar;
class LLIMChiclet;
+// Build time optimization, generate this once in .cpp file
+extern template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance();
+
class LLBottomTray
: public LLSingleton<LLBottomTray>
, public LLPanel
diff --git a/indra/newview/llfloatertestlistview.cpp b/indra/newview/llfloatertestlistview.cpp
index 7171449738..ae96dfc0ed 100644
--- a/indra/newview/llfloatertestlistview.cpp
+++ b/indra/newview/llfloatertestlistview.cpp
@@ -31,6 +31,12 @@
*/
#include "llviewerprecompiledheaders.h"
+int do_foo(int i)
+{
+ return i + 1;
+}
+
+/*
#include "llfloatertestlistview.h"
LLFloaterTestListView::LLFloaterTestListView(const LLSD& seed)
@@ -39,3 +45,4 @@ LLFloaterTestListView::LLFloaterTestListView(const LLSD& seed)
LLFloaterTestListView::~LLFloaterTestListView()
{}
+*/
diff --git a/indra/newview/llfloatertestlistview.h b/indra/newview/llfloatertestlistview.h
index 0c47c2ee31..311bd18bc0 100644
--- a/indra/newview/llfloatertestlistview.h
+++ b/indra/newview/llfloatertestlistview.h
@@ -32,6 +32,9 @@
#ifndef LLFLOATERTESTLISTVIEW_H
#define LLFLOATERTESTLISTVIEW_H
+int do_foo(int i);
+
+/*
#include "llfloater.h"
class LLSD;
@@ -45,5 +48,6 @@ private:
LLFloaterTestListView(const LLSD& seed);
~LLFloaterTestListView();
};
+*/
#endif
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 2554f1ccd5..4394271ec4 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -175,6 +175,8 @@ LLObjectSelection *get_null_object_selection()
return sNullSelection;
}
+// Build time optimization, generate this function once here
+template class LLSelectMgr* LLSingleton<class LLSelectMgr>::getInstance();
//-----------------------------------------------------------------------------
// LLSelectMgr()
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 2050a73f26..7a5c583711 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -323,6 +323,9 @@ private:
typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
+// Build time optimization, generate this once in .cpp file
+extern template class LLSelectMgr* LLSingleton<class LLSelectMgr>::getInstance();
+
class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>
{
public:
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index f3c64088c9..221db2defa 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -105,6 +105,9 @@ glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up)
}
+// Build time optimization, generate this once in .cpp file
+template class LLViewerCamera* LLSingleton<class LLViewerCamera>::getInstance();
+
LLViewerCamera::LLViewerCamera() : LLCamera()
{
calcProjection(getFar());
diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h
index 2b8a0892bf..01fa86d7c5 100644
--- a/indra/newview/llviewercamera.h
+++ b/indra/newview/llviewercamera.h
@@ -52,6 +52,9 @@ const F32 OGL_TO_CFR_ROTATION[16] = { 0.f, 0.f, -1.f, 0.f, // -Z becomes X
const BOOL FOR_SELECTION = TRUE;
const BOOL NOT_FOR_SELECTION = FALSE;
+// Build time optimization, generate this once in .cpp file
+extern template class LLViewerCamera* LLSingleton<class LLViewerCamera>::getInstance();
+
class LLViewerCamera : public LLCamera, public LLSingleton<LLViewerCamera>
{
public: