From de40e7437ed4515a6849da064d28e3455591b612 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 28 Feb 2016 16:38:46 +0000 Subject: [PATCH] [PM] Appease mingw32's auto-import DLL build with minimal tweaks. char AnalysisBase::ID should be declared as extern and defined in one module. llvm-svn: 262185 --- llvm/include/llvm/Analysis/AliasAnalysis.h | 2 ++ llvm/include/llvm/Analysis/AssumptionCache.h | 2 ++ llvm/include/llvm/Analysis/CGSCCPassManager.h | 6 ++++++ llvm/include/llvm/Analysis/DominanceFrontier.h | 2 ++ llvm/include/llvm/Analysis/LazyCallGraph.h | 2 ++ llvm/include/llvm/Analysis/LoopInfo.h | 2 ++ llvm/include/llvm/Analysis/LoopPassManager.h | 2 ++ llvm/include/llvm/Analysis/PostDominators.h | 2 ++ llvm/include/llvm/Analysis/RegionInfo.h | 2 ++ llvm/include/llvm/Analysis/ScalarEvolution.h | 2 ++ llvm/include/llvm/Analysis/TargetLibraryInfo.h | 2 ++ llvm/include/llvm/Analysis/TargetTransformInfo.h | 2 ++ llvm/include/llvm/IR/Dominators.h | 2 ++ llvm/include/llvm/IR/PassManager.h | 2 ++ llvm/lib/Analysis/AliasAnalysis.cpp | 3 +++ llvm/lib/Analysis/AssumptionCache.cpp | 2 ++ llvm/lib/Analysis/CGSCCPassManager.cpp | 3 +++ llvm/lib/Analysis/DominanceFrontier.cpp | 2 ++ llvm/lib/Analysis/LazyCallGraph.cpp | 2 ++ llvm/lib/Analysis/LoopInfo.cpp | 2 ++ llvm/lib/Analysis/LoopPassManager.cpp | 1 + llvm/lib/Analysis/PostDominators.cpp | 2 ++ llvm/lib/Analysis/RegionInfo.cpp | 2 ++ llvm/lib/Analysis/ScalarEvolution.cpp | 2 ++ llvm/lib/Analysis/TargetLibraryInfo.cpp | 2 ++ llvm/lib/Analysis/TargetTransformInfo.cpp | 2 ++ llvm/lib/IR/Dominators.cpp | 2 ++ llvm/lib/IR/PassManager.cpp | 1 + 28 files changed, 60 insertions(+) diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h index 8422e01..327ae7b 100644 --- a/llvm/include/llvm/Analysis/AliasAnalysis.h +++ b/llvm/include/llvm/Analysis/AliasAnalysis.h @@ -1024,6 +1024,8 @@ private: } }; +extern template class AnalysisBase; + /// A wrapper pass to provide the legacy pass manager access to a suitably /// prepared AAResults object. class AAResultsWrapperPass : public FunctionPass { diff --git a/llvm/include/llvm/Analysis/AssumptionCache.h b/llvm/include/llvm/Analysis/AssumptionCache.h index 79d2bc9..fbd4b52 100644 --- a/llvm/include/llvm/Analysis/AssumptionCache.h +++ b/llvm/include/llvm/Analysis/AssumptionCache.h @@ -105,6 +105,8 @@ struct AssumptionAnalysis : AnalysisBase { AssumptionCache run(Function &F) { return AssumptionCache(F); } }; +extern template class AnalysisBase; + /// \brief Printer pass for the \c AssumptionAnalysis results. class AssumptionPrinterPass : public PassBase { raw_ostream &OS; diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h index 4da0874..5cc1c38 100644 --- a/llvm/include/llvm/Analysis/CGSCCPassManager.h +++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h @@ -48,12 +48,16 @@ extern template class InnerAnalysisManagerProxy; typedef InnerAnalysisManagerProxy CGSCCAnalysisManagerModuleProxy; +extern template class AnalysisBase; + extern template class OuterAnalysisManagerProxy; /// A proxy from a \c ModuleAnalysisManager to an \c SCC. typedef OuterAnalysisManagerProxy ModuleAnalysisManagerCGSCCProxy; +extern template class AnalysisBase; + /// \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 FunctionAnalysisManagerCGSCCProxy; +extern template class AnalysisBase; + extern template class OuterAnalysisManagerProxy; /// A proxy from a \c CGSCCAnalysisManager to a \c Function. typedef OuterAnalysisManagerProxy diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h index 62f9f0e..ea2743d 100644 --- a/llvm/include/llvm/Analysis/DominanceFrontier.h +++ b/llvm/include/llvm/Analysis/DominanceFrontier.h @@ -176,6 +176,8 @@ struct DominanceFrontierAnalysis : AnalysisBase { DominanceFrontier run(Function &F, AnalysisManager *AM); }; +extern template class AnalysisBase; + /// \brief Printer pass for the \c DominanceFrontier. class DominanceFrontierPrinterPass : public PassBase { diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h index 0c05246..af2e067 100644 --- a/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -906,6 +906,8 @@ struct LazyCallGraphAnalysis : AnalysisBase { LazyCallGraph run(Module &M) { return LazyCallGraph(M); } }; +extern template class AnalysisBase; + /// A pass which prints the call graph to a \c raw_ostream. /// /// This is primarily useful for testing the analysis. diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h index 55bafd2..d33c215 100644 --- a/llvm/include/llvm/Analysis/LoopInfo.h +++ b/llvm/include/llvm/Analysis/LoopInfo.h @@ -793,6 +793,8 @@ struct LoopAnalysis : AnalysisBase { LoopInfo run(Function &F, AnalysisManager *AM); }; +extern template class AnalysisBase; + /// \brief Printer pass for the \c LoopAnalysis results. class LoopPrinterPass : public PassBase { raw_ostream &OS; diff --git a/llvm/include/llvm/Analysis/LoopPassManager.h b/llvm/include/llvm/Analysis/LoopPassManager.h index c3a6c4e..34bd78d 100644 --- a/llvm/include/llvm/Analysis/LoopPassManager.h +++ b/llvm/include/llvm/Analysis/LoopPassManager.h @@ -43,6 +43,8 @@ extern template class InnerAnalysisManagerProxy; typedef InnerAnalysisManagerProxy LoopAnalysisManagerFunctionProxy; +extern template class AnalysisBase; + extern template class OuterAnalysisManagerProxy; /// A proxy from a \c FunctionAnalysisManager to a \c Loop. typedef OuterAnalysisManagerProxy diff --git a/llvm/include/llvm/Analysis/PostDominators.h b/llvm/include/llvm/Analysis/PostDominators.h index 8800d4f..fac8e88 100644 --- a/llvm/include/llvm/Analysis/PostDominators.h +++ b/llvm/include/llvm/Analysis/PostDominators.h @@ -46,6 +46,8 @@ struct PostDominatorTreeAnalysis : AnalysisBase { PostDominatorTree run(Function &F); }; +extern template class AnalysisBase; + /// \brief Printer pass for the \c PostDominatorTree. class PostDominatorTreePrinterPass : public PassBase { diff --git a/llvm/include/llvm/Analysis/RegionInfo.h b/llvm/include/llvm/Analysis/RegionInfo.h index 69e0037..1ab8bbe 100644 --- a/llvm/include/llvm/Analysis/RegionInfo.h +++ b/llvm/include/llvm/Analysis/RegionInfo.h @@ -929,6 +929,8 @@ struct RegionInfoAnalysis : AnalysisBase { RegionInfo run(Function &F, AnalysisManager *AM); }; +extern template class AnalysisBase; + /// \brief Printer pass for the \c RegionInfo. class RegionInfoPrinterPass : public PassBase { raw_ostream &OS; diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h index 8487c96..0224591 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolution.h +++ b/llvm/include/llvm/Analysis/ScalarEvolution.h @@ -1421,6 +1421,8 @@ namespace llvm { ScalarEvolution run(Function &F, AnalysisManager *AM); }; + extern template class AnalysisBase; + /// \brief Printer pass for the \c ScalarEvolutionAnalysis results. class ScalarEvolutionPrinterPass : public PassBase { diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h index 6e0776f..b679258 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h @@ -299,6 +299,8 @@ private: TargetLibraryInfoImpl &lookupInfoImpl(Triple T); }; +extern template class AnalysisBase; + class TargetLibraryInfoWrapperPass : public ImmutablePass { TargetLibraryInfoImpl TLIImpl; TargetLibraryInfo TLI; diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h index 7c97b4f..bdc589c 100644 --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -938,6 +938,8 @@ private: static Result getDefaultTTI(const Function &F); }; +extern template class AnalysisBase; + /// \brief Wrapper pass for TargetTransformInfo. /// /// This pass can be constructed from a TTI object which it stores internally diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h index dece153..1082896 100644 --- a/llvm/include/llvm/IR/Dominators.h +++ b/llvm/include/llvm/IR/Dominators.h @@ -190,6 +190,8 @@ struct DominatorTreeAnalysis : AnalysisBase { DominatorTree run(Function &F); }; +extern template class AnalysisBase; + /// \brief Printer pass for the \c DominatorTree. class DominatorTreePrinterPass : public PassBase { raw_ostream &OS; diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index 27ca841..1ba04fd 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -749,6 +749,8 @@ extern template class InnerAnalysisManagerProxy FunctionAnalysisManagerModuleProxy; +extern template class AnalysisBase; + /// \brief A function analysis which acts as a proxy for a module analysis /// manager. /// diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index a30aedc..29670cb 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -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; + namespace { /// A wrapper pass for external alias analyses. This just squirrels away the /// callback used to run any analyses and register their results. diff --git a/llvm/lib/Analysis/AssumptionCache.cpp b/llvm/lib/Analysis/AssumptionCache.cpp index 6af2dc1..6626b60 100644 --- a/llvm/lib/Analysis/AssumptionCache.cpp +++ b/llvm/lib/Analysis/AssumptionCache.cpp @@ -74,6 +74,8 @@ void AssumptionCache::registerAssumption(CallInst *CI) { #endif } +template class AnalysisBase; + PreservedAnalyses AssumptionPrinterPass::run(Function &F, AnalysisManager *AM) { AssumptionCache &AC = AM->getResult(F); diff --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp index 6326b34..cabbf91 100644 --- a/llvm/lib/Analysis/CGSCCPassManager.cpp +++ b/llvm/lib/Analysis/CGSCCPassManager.cpp @@ -18,9 +18,12 @@ namespace llvm { template class PassManager; template class AnalysisManager; template class InnerAnalysisManagerProxy; +template class AnalysisBase; template class OuterAnalysisManagerProxy; +template class AnalysisBase; template class InnerAnalysisManagerProxy; +template class AnalysisBase; template class OuterAnalysisManagerProxy; } diff --git a/llvm/lib/Analysis/DominanceFrontier.cpp b/llvm/lib/Analysis/DominanceFrontier.cpp index 00904a9..6fc6581 100644 --- a/llvm/lib/Analysis/DominanceFrontier.cpp +++ b/llvm/lib/Analysis/DominanceFrontier.cpp @@ -56,6 +56,8 @@ LLVM_DUMP_METHOD void DominanceFrontierWrapperPass::dump() const { } #endif +template class AnalysisBase; + DominanceFrontier DominanceFrontierAnalysis::run(Function &F, FunctionAnalysisManager *AM) { DominanceFrontier DF; diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp index 88f5cd7..17a9d04 100644 --- a/llvm/lib/Analysis/LazyCallGraph.cpp +++ b/llvm/lib/Analysis/LazyCallGraph.cpp @@ -1499,6 +1499,8 @@ LazyCallGraph::RefSCC *LazyCallGraph::getNextRefSCCInPostOrder() { } } +template class AnalysisBase; + LazyCallGraphPrinterPass::LazyCallGraphPrinterPass(raw_ostream &OS) : OS(OS) {} static void printNode(raw_ostream &OS, LazyCallGraph::Node &N) { diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index bcec24c..83ce4c3 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -641,6 +641,8 @@ void LoopInfo::markAsRemoved(Loop *Unloop) { } } +template class AnalysisBase; + LoopInfo LoopAnalysis::run(Function &F, AnalysisManager *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 diff --git a/llvm/lib/Analysis/LoopPassManager.cpp b/llvm/lib/Analysis/LoopPassManager.cpp index 76210fa..4e90cfa 100644 --- a/llvm/lib/Analysis/LoopPassManager.cpp +++ b/llvm/lib/Analysis/LoopPassManager.cpp @@ -16,5 +16,6 @@ namespace llvm { template class PassManager; template class AnalysisManager; template class InnerAnalysisManagerProxy; +template class AnalysisBase; template class OuterAnalysisManagerProxy; } diff --git a/llvm/lib/Analysis/PostDominators.cpp b/llvm/lib/Analysis/PostDominators.cpp index d617a87..1c4cfba 100644 --- a/llvm/lib/Analysis/PostDominators.cpp +++ b/llvm/lib/Analysis/PostDominators.cpp @@ -44,6 +44,8 @@ FunctionPass* llvm::createPostDomTree() { return new PostDominatorTreeWrapperPass(); } +template class AnalysisBase; + PostDominatorTree PostDominatorTreeAnalysis::run(Function &F) { PostDominatorTree PDT; PDT.recalculate(F); diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp index 40501e6..231db99 100644 --- a/llvm/lib/Analysis/RegionInfo.cpp +++ b/llvm/lib/Analysis/RegionInfo.cpp @@ -185,6 +185,8 @@ namespace llvm { // RegionInfoAnalysis implementation // +template class AnalysisBase; + RegionInfo RegionInfoAnalysis::run(Function &F, AnalysisManager *AM) { RegionInfo RI; auto *DT = &AM->getResult(F); diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 2056306..f6c2a78 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -9554,6 +9554,8 @@ void ScalarEvolution::verify() const { // TODO: Verify more things. } +template class AnalysisBase; + ScalarEvolution ScalarEvolutionAnalysis::run(Function &F, AnalysisManager *AM) { return ScalarEvolution(F, AM->getResult(F), diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 950ee54..d3fc779d 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -636,6 +636,8 @@ TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass( initializeTargetLibraryInfoWrapperPassPass(*PassRegistry::getPassRegistry()); } +template class AnalysisBase; + // Register the basic pass. INITIALIZE_PASS(TargetLibraryInfoWrapperPass, "targetlibinfo", "Target Library Information", false, true) diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp index a9e18e0..9e5190b 100644 --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -377,6 +377,8 @@ TargetIRAnalysis::Result TargetIRAnalysis::run(const Function &F) { return TTICallback(F); } +template class AnalysisBase; + TargetIRAnalysis::Result TargetIRAnalysis::getDefaultTTI(const Function &F) { return Result(F.getParent()->getDataLayout()); } diff --git a/llvm/lib/IR/Dominators.cpp b/llvm/lib/IR/Dominators.cpp index c47091e..7903799 100644 --- a/llvm/lib/IR/Dominators.cpp +++ b/llvm/lib/IR/Dominators.cpp @@ -308,6 +308,8 @@ DominatorTree DominatorTreeAnalysis::run(Function &F) { return DT; } +template class AnalysisBase; + DominatorTreePrinterPass::DominatorTreePrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses DominatorTreePrinterPass::run(Function &F, diff --git a/llvm/lib/IR/PassManager.cpp b/llvm/lib/IR/PassManager.cpp index 9d5b4cb..eb5ba43 100644 --- a/llvm/lib/IR/PassManager.cpp +++ b/llvm/lib/IR/PassManager.cpp @@ -20,5 +20,6 @@ template class PassManager; template class AnalysisManager; template class AnalysisManager; template class InnerAnalysisManagerProxy; +template class AnalysisBase; template class OuterAnalysisManagerProxy; } -- 2.7.4