Instantiate Statistic<> in one place, not in every .o file that uses it.
authorChris Lattner <sabre@nondot.org>
Wed, 30 Aug 2006 04:17:00 +0000 (04:17 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 30 Aug 2006 04:17:00 +0000 (04:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29971 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/Statistic.h
lib/Support/Statistic.cpp

index dabacf41cfeba2495aea0ce33da15554c68cabf1..99160da10637dd141a4ddad03e75fa3a3fa70e9c 100644 (file)
@@ -24,7 +24,8 @@
 #ifndef LLVM_ADT_STATISTIC_H
 #define LLVM_ADT_STATISTIC_H
 
-#include <iosfwd>
+#include <ostream>
+#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<unsigned>);
+
 } // End llvm namespace
 
 #endif
index d771f4dcfd33bb609dde8fd815f37f0d7cd1266c..56bbfe9d7a92f56e7a415a63d2bf51fa7f6b3ea8 100644 (file)
@@ -33,6 +33,8 @@ namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); }
 
 unsigned StatisticBase::NumStats = 0;
 
+TEMPLATE_INSTANTIATION(class Statistic<unsigned>);
+
 // -stats - Command line option to cause transformations to emit stats about
 // what they did.
 //