From 798b80e69c49a7cab3e18acfb8d399f987b3000c Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 28 Feb 2016 17:17:00 +0000 Subject: [PATCH] [PM] Appease mingw32's auto-import DLL build with minimal tweaks, with fix for clang. char AnalysisBase::ID should be declared as extern and defined in one module. llvm-svn: 262188 --- include/llvm/Analysis/AliasAnalysis.h | 2 ++ include/llvm/Analysis/AssumptionCache.h | 2 ++ include/llvm/Analysis/CGSCCPassManager.h | 6 ++++++ include/llvm/Analysis/DominanceFrontier.h | 2 ++ include/llvm/Analysis/LazyCallGraph.h | 2 ++ include/llvm/Analysis/LoopInfo.h | 2 ++ include/llvm/Analysis/LoopPassManager.h | 2 ++ include/llvm/Analysis/PostDominators.h | 2 ++ include/llvm/Analysis/RegionInfo.h | 2 ++ include/llvm/Analysis/ScalarEvolution.h | 2 ++ include/llvm/Analysis/TargetLibraryInfo.h | 2 ++ include/llvm/Analysis/TargetTransformInfo.h | 2 ++ include/llvm/IR/Dominators.h | 2 ++ include/llvm/IR/PassManager.h | 2 ++ lib/Analysis/AliasAnalysis.cpp | 3 +++ lib/Analysis/AssumptionCache.cpp | 2 ++ lib/Analysis/CGSCCPassManager.cpp | 3 +++ lib/Analysis/DominanceFrontier.cpp | 2 ++ lib/Analysis/LazyCallGraph.cpp | 2 ++ lib/Analysis/LoopInfo.cpp | 2 ++ lib/Analysis/LoopPassManager.cpp | 1 + lib/Analysis/PostDominators.cpp | 2 ++ lib/Analysis/RegionInfo.cpp | 2 ++ lib/Analysis/ScalarEvolution.cpp | 2 ++ lib/Analysis/TargetLibraryInfo.cpp | 2 ++ lib/Analysis/TargetTransformInfo.cpp | 2 ++ lib/IR/Dominators.cpp | 2 ++ lib/IR/PassManager.cpp | 1 + 28 files changed, 60 insertions(+) diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h index 8422e010e45..327ae7bfc41 100644 --- a/include/llvm/Analysis/AliasAnalysis.h +++ b/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/include/llvm/Analysis/AssumptionCache.h b/include/llvm/Analysis/AssumptionCache.h index 79d2bc966e4..fbd4b5243ad 100644 --- a/include/llvm/Analysis/AssumptionCache.h +++ b/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/include/llvm/Analysis/CGSCCPassManager.h b/include/llvm/Analysis/CGSCCPassManager.h index 4da08741a8a..5cc1c382ad4 100644 --- a/include/llvm/Analysis/CGSCCPassManager.h +++ b/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/include/llvm/Analysis/DominanceFrontier.h b/include/llvm/Analysis/DominanceFrontier.h index 62f9f0eab18..ea2743dc810 100644 --- a/include/llvm/Analysis/DominanceFrontier.h +++ b/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/include/llvm/Analysis/LazyCallGraph.h b/include/llvm/Analysis/LazyCallGraph.h index 0c052460578..af2e067690d 100644 --- a/include/llvm/Analysis/LazyCallGraph.h +++ b/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/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 55bafd26185..d33c215e1f4 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/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/include/llvm/Analysis/LoopPassManager.h b/include/llvm/Analysis/LoopPassManager.h index c3a6c4e3545..34bd78d6eb3 100644 --- a/include/llvm/Analysis/LoopPassManager.h +++ b/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/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h index 8800d4ffd46..fac8e88c2b0 100644 --- a/include/llvm/Analysis/PostDominators.h +++ b/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/include/llvm/Analysis/RegionInfo.h b/include/llvm/Analysis/RegionInfo.h index 69e00375de9..1ab8bbef10f 100644 --- a/include/llvm/Analysis/RegionInfo.h +++ b/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/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 8487c969531..02245911112 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/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/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h index 6e0776fd17b..b6792586fae 100644 --- a/include/llvm/Analysis/TargetLibraryInfo.h +++ b/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/include/llvm/Analysis/TargetTransformInfo.h b/include/llvm/Analysis/TargetTransformInfo.h index 7c97b4fd3b9..bdc589c60ea 100644 --- a/include/llvm/Analysis/TargetTransformInfo.h +++ b/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/include/llvm/IR/Dominators.h b/include/llvm/IR/Dominators.h index dece1533acc..1082896f0c8 100644 --- a/include/llvm/IR/Dominators.h +++ b/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/include/llvm/IR/PassManager.h b/include/llvm/IR/PassManager.h index 27ca84194a6..1ba04fd0e02 100644 --- a/include/llvm/IR/PassManager.h +++ b/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/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index a30aedc4060..81d8d702885 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/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 llvm::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/lib/Analysis/AssumptionCache.cpp b/lib/Analysis/AssumptionCache.cpp index 6af2dc12d06..365397fd083 100644 --- a/lib/Analysis/AssumptionCache.cpp +++ b/lib/Analysis/AssumptionCache.cpp @@ -74,6 +74,8 @@ void AssumptionCache::registerAssumption(CallInst *CI) { #endif } +template class llvm::AnalysisBase; + PreservedAnalyses AssumptionPrinterPass::run(Function &F, AnalysisManager *AM) { AssumptionCache &AC = AM->getResult(F); diff --git a/lib/Analysis/CGSCCPassManager.cpp b/lib/Analysis/CGSCCPassManager.cpp index 6326b34d68a..cabbf917603 100644 --- a/lib/Analysis/CGSCCPassManager.cpp +++ b/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/lib/Analysis/DominanceFrontier.cpp b/lib/Analysis/DominanceFrontier.cpp index 00904a95ce7..7ec70c73f8b 100644 --- a/lib/Analysis/DominanceFrontier.cpp +++ b/lib/Analysis/DominanceFrontier.cpp @@ -56,6 +56,8 @@ LLVM_DUMP_METHOD void DominanceFrontierWrapperPass::dump() const { } #endif +template class llvm::AnalysisBase; + DominanceFrontier DominanceFrontierAnalysis::run(Function &F, FunctionAnalysisManager *AM) { DominanceFrontier DF; diff --git a/lib/Analysis/LazyCallGraph.cpp b/lib/Analysis/LazyCallGraph.cpp index 88f5cd7dd9f..718c86410cc 100644 --- a/lib/Analysis/LazyCallGraph.cpp +++ b/lib/Analysis/LazyCallGraph.cpp @@ -1499,6 +1499,8 @@ LazyCallGraph::RefSCC *LazyCallGraph::getNextRefSCCInPostOrder() { } } +template class llvm::AnalysisBase; + LazyCallGraphPrinterPass::LazyCallGraphPrinterPass(raw_ostream &OS) : OS(OS) {} static void printNode(raw_ostream &OS, LazyCallGraph::Node &N) { diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index bcec24c822f..51444b60b06 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -641,6 +641,8 @@ void LoopInfo::markAsRemoved(Loop *Unloop) { } } +template class llvm::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/lib/Analysis/LoopPassManager.cpp b/lib/Analysis/LoopPassManager.cpp index 76210fa89c0..4e90cfac9e5 100644 --- a/lib/Analysis/LoopPassManager.cpp +++ b/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/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp index d617a876b84..39ac455761d 100644 --- a/lib/Analysis/PostDominators.cpp +++ b/lib/Analysis/PostDominators.cpp @@ -44,6 +44,8 @@ FunctionPass* llvm::createPostDomTree() { return new PostDominatorTreeWrapperPass(); } +template class llvm::AnalysisBase; + PostDominatorTree PostDominatorTreeAnalysis::run(Function &F) { PostDominatorTree PDT; PDT.recalculate(F); diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp index 40501e6f7b6..87ceb35367b 100644 --- a/lib/Analysis/RegionInfo.cpp +++ b/lib/Analysis/RegionInfo.cpp @@ -185,6 +185,8 @@ namespace llvm { // RegionInfoAnalysis implementation // +template class llvm::AnalysisBase; + RegionInfo RegionInfoAnalysis::run(Function &F, AnalysisManager *AM) { RegionInfo RI; auto *DT = &AM->getResult(F); diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 2056306e127..e493a28a145 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -9554,6 +9554,8 @@ void ScalarEvolution::verify() const { // TODO: Verify more things. } +template class llvm::AnalysisBase; + ScalarEvolution ScalarEvolutionAnalysis::run(Function &F, AnalysisManager *AM) { return ScalarEvolution(F, AM->getResult(F), diff --git a/lib/Analysis/TargetLibraryInfo.cpp b/lib/Analysis/TargetLibraryInfo.cpp index 950ee549f80..38cd3ec40f0 100644 --- a/lib/Analysis/TargetLibraryInfo.cpp +++ b/lib/Analysis/TargetLibraryInfo.cpp @@ -636,6 +636,8 @@ TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass( initializeTargetLibraryInfoWrapperPassPass(*PassRegistry::getPassRegistry()); } +template class llvm::AnalysisBase; + // Register the basic pass. INITIALIZE_PASS(TargetLibraryInfoWrapperPass, "targetlibinfo", "Target Library Information", false, true) diff --git a/lib/Analysis/TargetTransformInfo.cpp b/lib/Analysis/TargetTransformInfo.cpp index a9e18e01caa..7380c44f0dd 100644 --- a/lib/Analysis/TargetTransformInfo.cpp +++ b/lib/Analysis/TargetTransformInfo.cpp @@ -377,6 +377,8 @@ TargetIRAnalysis::Result TargetIRAnalysis::run(const Function &F) { return TTICallback(F); } +template class llvm::AnalysisBase; + TargetIRAnalysis::Result TargetIRAnalysis::getDefaultTTI(const Function &F) { return Result(F.getParent()->getDataLayout()); } diff --git a/lib/IR/Dominators.cpp b/lib/IR/Dominators.cpp index c47091e2908..56247bf8598 100644 --- a/lib/IR/Dominators.cpp +++ b/lib/IR/Dominators.cpp @@ -308,6 +308,8 @@ DominatorTree DominatorTreeAnalysis::run(Function &F) { return DT; } +template class llvm::AnalysisBase; + DominatorTreePrinterPass::DominatorTreePrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses DominatorTreePrinterPass::run(Function &F, diff --git a/lib/IR/PassManager.cpp b/lib/IR/PassManager.cpp index 9d5b4cb0516..eb5ba437a29 100644 --- a/lib/IR/PassManager.cpp +++ b/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; }