[PM] Appease mingw32's auto-import DLL build with minimal tweaks.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 28 Feb 2016 16:38:46 +0000 (16:38 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sun, 28 Feb 2016 16:38:46 +0000 (16:38 +0000)
char AnalysisBase::ID should be declared as extern and defined in one module.

llvm-svn: 262185

28 files changed:
llvm/include/llvm/Analysis/AliasAnalysis.h
llvm/include/llvm/Analysis/AssumptionCache.h
llvm/include/llvm/Analysis/CGSCCPassManager.h
llvm/include/llvm/Analysis/DominanceFrontier.h
llvm/include/llvm/Analysis/LazyCallGraph.h
llvm/include/llvm/Analysis/LoopInfo.h
llvm/include/llvm/Analysis/LoopPassManager.h
llvm/include/llvm/Analysis/PostDominators.h
llvm/include/llvm/Analysis/RegionInfo.h
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/include/llvm/Analysis/TargetLibraryInfo.h
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/IR/Dominators.h
llvm/include/llvm/IR/PassManager.h
llvm/lib/Analysis/AliasAnalysis.cpp
llvm/lib/Analysis/AssumptionCache.cpp
llvm/lib/Analysis/CGSCCPassManager.cpp
llvm/lib/Analysis/DominanceFrontier.cpp
llvm/lib/Analysis/LazyCallGraph.cpp
llvm/lib/Analysis/LoopInfo.cpp
llvm/lib/Analysis/LoopPassManager.cpp
llvm/lib/Analysis/PostDominators.cpp
llvm/lib/Analysis/RegionInfo.cpp
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/Analysis/TargetLibraryInfo.cpp
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/IR/Dominators.cpp
llvm/lib/IR/PassManager.cpp

index 8422e01..327ae7b 100644 (file)
@@ -1024,6 +1024,8 @@ private:
   }
 };
 
+extern template class AnalysisBase<AAManager>;
+
 /// A wrapper pass to provide the legacy pass manager access to a suitably
 /// prepared AAResults object.
 class AAResultsWrapperPass : public FunctionPass {
index 79d2bc9..fbd4b52 100644 (file)
@@ -105,6 +105,8 @@ struct AssumptionAnalysis : AnalysisBase<AssumptionAnalysis> {
   AssumptionCache run(Function &F) { return AssumptionCache(F); }
 };
 
+extern template class AnalysisBase<AssumptionAnalysis>;
+
 /// \brief Printer pass for the \c AssumptionAnalysis results.
 class AssumptionPrinterPass : public PassBase<AssumptionPrinterPass> {
   raw_ostream &OS;
index 4da0874..5cc1c38 100644 (file)
@@ -48,12 +48,16 @@ extern template class InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>;
 typedef InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>
     CGSCCAnalysisManagerModuleProxy;
 
+extern template class AnalysisBase<CGSCCAnalysisManagerModuleProxy>;
+
 extern template class OuterAnalysisManagerProxy<ModuleAnalysisManager,
                                                 LazyCallGraph::SCC>;
 /// A proxy from a \c ModuleAnalysisManager to an \c SCC.
 typedef OuterAnalysisManagerProxy<ModuleAnalysisManager, LazyCallGraph::SCC>
     ModuleAnalysisManagerCGSCCProxy;
 
+extern template class AnalysisBase<ModuleAnalysisManagerCGSCCProxy>;
+
 /// \brief The core module pass which does a post-order walk of the SCCs and
 /// runs a CGSCC pass over each one.
 ///
@@ -144,6 +148,8 @@ extern template class InnerAnalysisManagerProxy<FunctionAnalysisManager,
 typedef InnerAnalysisManagerProxy<FunctionAnalysisManager, LazyCallGraph::SCC>
     FunctionAnalysisManagerCGSCCProxy;
 
+extern template class AnalysisBase<FunctionAnalysisManagerCGSCCProxy>;
+
 extern template class OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>;
 /// A proxy from a \c CGSCCAnalysisManager to a \c Function.
 typedef OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>
index 62f9f0e..ea2743d 100644 (file)
@@ -176,6 +176,8 @@ struct DominanceFrontierAnalysis : AnalysisBase<DominanceFrontierAnalysis> {
   DominanceFrontier run(Function &F, AnalysisManager<Function> *AM);
 };
 
+extern template class AnalysisBase<DominanceFrontierAnalysis>;
+
 /// \brief Printer pass for the \c DominanceFrontier.
 class DominanceFrontierPrinterPass
     : public PassBase<DominanceFrontierPrinterPass> {
index 0c05246..af2e067 100644 (file)
@@ -906,6 +906,8 @@ struct LazyCallGraphAnalysis : AnalysisBase<LazyCallGraphAnalysis> {
   LazyCallGraph run(Module &M) { return LazyCallGraph(M); }
 };
 
+extern template class AnalysisBase<LazyCallGraphAnalysis>;
+
 /// A pass which prints the call graph to a \c raw_ostream.
 ///
 /// This is primarily useful for testing the analysis.
index 55bafd2..d33c215 100644 (file)
@@ -793,6 +793,8 @@ struct LoopAnalysis : AnalysisBase<LoopAnalysis> {
   LoopInfo run(Function &F, AnalysisManager<Function> *AM);
 };
 
+extern template class AnalysisBase<LoopAnalysis>;
+
 /// \brief Printer pass for the \c LoopAnalysis results.
 class LoopPrinterPass : public PassBase<LoopPrinterPass> {
   raw_ostream &OS;
index c3a6c4e..34bd78d 100644 (file)
@@ -43,6 +43,8 @@ extern template class InnerAnalysisManagerProxy<LoopAnalysisManager, Function>;
 typedef InnerAnalysisManagerProxy<LoopAnalysisManager, Function>
     LoopAnalysisManagerFunctionProxy;
 
+extern template class AnalysisBase<LoopAnalysisManagerFunctionProxy>;
+
 extern template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop>;
 /// A proxy from a \c FunctionAnalysisManager to a \c Loop.
 typedef OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop>
index 8800d4f..fac8e88 100644 (file)
@@ -46,6 +46,8 @@ struct PostDominatorTreeAnalysis : AnalysisBase<PostDominatorTreeAnalysis> {
   PostDominatorTree run(Function &F);
 };
 
+extern template class AnalysisBase<PostDominatorTreeAnalysis>;
+
 /// \brief Printer pass for the \c PostDominatorTree.
 class PostDominatorTreePrinterPass
     : public PassBase<PostDominatorTreePrinterPass> {
index 69e0037..1ab8bbe 100644 (file)
@@ -929,6 +929,8 @@ struct RegionInfoAnalysis : AnalysisBase<RegionInfoAnalysis> {
   RegionInfo run(Function &F, AnalysisManager<Function> *AM);
 };
 
+extern template class AnalysisBase<RegionInfoAnalysis>;
+
 /// \brief Printer pass for the \c RegionInfo.
 class RegionInfoPrinterPass : public PassBase<RegionInfoPrinterPass> {
   raw_ostream &OS;
index 8487c96..0224591 100644 (file)
@@ -1421,6 +1421,8 @@ namespace llvm {
     ScalarEvolution run(Function &F, AnalysisManager<Function> *AM);
   };
 
+  extern template class AnalysisBase<ScalarEvolutionAnalysis>;
+
   /// \brief Printer pass for the \c ScalarEvolutionAnalysis results.
   class ScalarEvolutionPrinterPass
       : public PassBase<ScalarEvolutionPrinterPass> {
index 6e0776f..b679258 100644 (file)
@@ -299,6 +299,8 @@ private:
   TargetLibraryInfoImpl &lookupInfoImpl(Triple T);
 };
 
+extern template class AnalysisBase<TargetLibraryAnalysis>;
+
 class TargetLibraryInfoWrapperPass : public ImmutablePass {
   TargetLibraryInfoImpl TLIImpl;
   TargetLibraryInfo TLI;
index 7c97b4f..bdc589c 100644 (file)
@@ -938,6 +938,8 @@ private:
   static Result getDefaultTTI(const Function &F);
 };
 
+extern template class AnalysisBase<TargetIRAnalysis>;
+
 /// \brief Wrapper pass for TargetTransformInfo.
 ///
 /// This pass can be constructed from a TTI object which it stores internally
index dece153..1082896 100644 (file)
@@ -190,6 +190,8 @@ struct DominatorTreeAnalysis : AnalysisBase<DominatorTreeAnalysis> {
   DominatorTree run(Function &F);
 };
 
+extern template class AnalysisBase<DominatorTreeAnalysis>;
+
 /// \brief Printer pass for the \c DominatorTree.
 class DominatorTreePrinterPass : public PassBase<DominatorTreePrinterPass> {
   raw_ostream &OS;
index 27ca841..1ba04fd 100644 (file)
@@ -749,6 +749,8 @@ extern template class InnerAnalysisManagerProxy<FunctionAnalysisManager,
 typedef InnerAnalysisManagerProxy<FunctionAnalysisManager, Module>
     FunctionAnalysisManagerModuleProxy;
 
+extern template class AnalysisBase<FunctionAnalysisManagerModuleProxy>;
+
 /// \brief A function analysis which acts as a proxy for a module analysis
 /// manager.
 ///
index a30aedc..29670cb 100644 (file)
@@ -390,6 +390,9 @@ bool AAResults::canInstructionRangeModRef(const Instruction &I1,
 // Provide a definition for the root virtual destructor.
 AAResults::Concept::~Concept() {}
 
+// Provide a definition for the static object used to identify passes.
+template class AnalysisBase<AAManager>;
+
 namespace {
 /// A wrapper pass for external alias analyses. This just squirrels away the
 /// callback used to run any analyses and register their results.
index 6af2dc1..6626b60 100644 (file)
@@ -74,6 +74,8 @@ void AssumptionCache::registerAssumption(CallInst *CI) {
 #endif
 }
 
+template class AnalysisBase<AssumptionAnalysis>;
+
 PreservedAnalyses AssumptionPrinterPass::run(Function &F,
                                              AnalysisManager<Function> *AM) {
   AssumptionCache &AC = AM->getResult<AssumptionAnalysis>(F);
index 6326b34..cabbf91 100644 (file)
@@ -18,9 +18,12 @@ namespace llvm {
 template class PassManager<LazyCallGraph::SCC>;
 template class AnalysisManager<LazyCallGraph::SCC>;
 template class InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>;
+template class AnalysisBase<CGSCCAnalysisManagerModuleProxy>;
 template class OuterAnalysisManagerProxy<ModuleAnalysisManager,
                                          LazyCallGraph::SCC>;
+template class AnalysisBase<ModuleAnalysisManagerCGSCCProxy>;
 template class InnerAnalysisManagerProxy<FunctionAnalysisManager,
                                          LazyCallGraph::SCC>;
+template class AnalysisBase<FunctionAnalysisManagerCGSCCProxy>;
 template class OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>;
 }
index 00904a9..6fc6581 100644 (file)
@@ -56,6 +56,8 @@ LLVM_DUMP_METHOD void DominanceFrontierWrapperPass::dump() const {
 }
 #endif
 
+template class AnalysisBase<DominanceFrontierAnalysis>;
+
 DominanceFrontier DominanceFrontierAnalysis::run(Function &F,
                                                  FunctionAnalysisManager *AM) {
   DominanceFrontier DF;
index 88f5cd7..17a9d04 100644 (file)
@@ -1499,6 +1499,8 @@ LazyCallGraph::RefSCC *LazyCallGraph::getNextRefSCCInPostOrder() {
   }
 }
 
+template class AnalysisBase<LazyCallGraphAnalysis>;
+
 LazyCallGraphPrinterPass::LazyCallGraphPrinterPass(raw_ostream &OS) : OS(OS) {}
 
 static void printNode(raw_ostream &OS, LazyCallGraph::Node &N) {
index bcec24c..83ce4c3 100644 (file)
@@ -641,6 +641,8 @@ void LoopInfo::markAsRemoved(Loop *Unloop) {
   }
 }
 
+template class AnalysisBase<LoopAnalysis>;
+
 LoopInfo LoopAnalysis::run(Function &F, AnalysisManager<Function> *AM) {
   // FIXME: Currently we create a LoopInfo from scratch for every function.
   // This may prove to be too wasteful due to deallocating and re-allocating
index 76210fa..4e90cfa 100644 (file)
@@ -16,5 +16,6 @@ namespace llvm {
 template class PassManager<Loop>;
 template class AnalysisManager<Loop>;
 template class InnerAnalysisManagerProxy<LoopAnalysisManager, Function>;
+template class AnalysisBase<LoopAnalysisManagerFunctionProxy>;
 template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop>;
 }
index d617a87..1c4cfba 100644 (file)
@@ -44,6 +44,8 @@ FunctionPass* llvm::createPostDomTree() {
   return new PostDominatorTreeWrapperPass();
 }
 
+template class AnalysisBase<PostDominatorTreeAnalysis>;
+
 PostDominatorTree PostDominatorTreeAnalysis::run(Function &F) {
   PostDominatorTree PDT;
   PDT.recalculate(F);
index 40501e6..231db99 100644 (file)
@@ -185,6 +185,8 @@ namespace llvm {
 // RegionInfoAnalysis implementation
 //
 
+template class AnalysisBase<RegionInfoAnalysis>;
+
 RegionInfo RegionInfoAnalysis::run(Function &F, AnalysisManager<Function> *AM) {
   RegionInfo RI;
   auto *DT = &AM->getResult<DominatorTreeAnalysis>(F);
index 2056306..f6c2a78 100644 (file)
@@ -9554,6 +9554,8 @@ void ScalarEvolution::verify() const {
   // TODO: Verify more things.
 }
 
+template class AnalysisBase<ScalarEvolutionAnalysis>;
+
 ScalarEvolution ScalarEvolutionAnalysis::run(Function &F,
                                              AnalysisManager<Function> *AM) {
   return ScalarEvolution(F, AM->getResult<TargetLibraryAnalysis>(F),
index 950ee54..d3fc779 100644 (file)
@@ -636,6 +636,8 @@ TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass(
   initializeTargetLibraryInfoWrapperPassPass(*PassRegistry::getPassRegistry());
 }
 
+template class AnalysisBase<TargetLibraryAnalysis>;
+
 // Register the basic pass.
 INITIALIZE_PASS(TargetLibraryInfoWrapperPass, "targetlibinfo",
                 "Target Library Information", false, true)
index a9e18e0..9e5190b 100644 (file)
@@ -377,6 +377,8 @@ TargetIRAnalysis::Result TargetIRAnalysis::run(const Function &F) {
   return TTICallback(F);
 }
 
+template class AnalysisBase<TargetIRAnalysis>;
+
 TargetIRAnalysis::Result TargetIRAnalysis::getDefaultTTI(const Function &F) {
   return Result(F.getParent()->getDataLayout());
 }
index c47091e..7903799 100644 (file)
@@ -308,6 +308,8 @@ DominatorTree DominatorTreeAnalysis::run(Function &F) {
   return DT;
 }
 
+template class AnalysisBase<DominatorTreeAnalysis>;
+
 DominatorTreePrinterPass::DominatorTreePrinterPass(raw_ostream &OS) : OS(OS) {}
 
 PreservedAnalyses DominatorTreePrinterPass::run(Function &F,
index 9d5b4cb..eb5ba43 100644 (file)
@@ -20,5 +20,6 @@ template class PassManager<Function>;
 template class AnalysisManager<Module>;
 template class AnalysisManager<Function>;
 template class InnerAnalysisManagerProxy<FunctionAnalysisManager, Module>;
+template class AnalysisBase<FunctionAnalysisManagerModuleProxy>;
 template class OuterAnalysisManagerProxy<ModuleAnalysisManager, Function>;
 }