From 52c917190a8094b4e5f6cc0b30e373638268f3a4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 30 Aug 2006 04:17:00 +0000 Subject: [PATCH] Instantiate Statistic<> in one place, not in every .o file that uses it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29971 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/Statistic.h | 5 ++++- lib/Support/Statistic.cpp | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/llvm/ADT/Statistic.h b/include/llvm/ADT/Statistic.h index dabacf41cfe..99160da1063 100644 --- a/include/llvm/ADT/Statistic.h +++ b/include/llvm/ADT/Statistic.h @@ -24,7 +24,8 @@ #ifndef LLVM_ADT_STATISTIC_H #define LLVM_ADT_STATISTIC_H -#include +#include +#include "llvm/Support/Compiler.h" namespace llvm { @@ -85,6 +86,8 @@ public: const Statistic &operator/=(const DataType &V) { Value /= V; return *this; } }; +EXTERN_TEMPLATE_INSTANTIATION(class Statistic); + } // End llvm namespace #endif diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp index d771f4dcfd3..56bbfe9d7a9 100644 --- a/lib/Support/Statistic.cpp +++ b/lib/Support/Statistic.cpp @@ -33,6 +33,8 @@ namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); } unsigned StatisticBase::NumStats = 0; +TEMPLATE_INSTANTIATION(class Statistic); + // -stats - Command line option to cause transformations to emit stats about // what they did. // -- 2.34.1