From 861f4c38de1654515377222c05d544b1442bdd00 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 7 Oct 2010 18:31:00 +0000 Subject: [PATCH] Add initialization routines for Analysis and IPA. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115946 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm-c/Initialization.h | 2 ++ include/llvm/InitializePasses.h | 6 ++++ lib/Analysis/Analysis.cpp | 56 +++++++++++++++++++++++++++++++++ lib/Analysis/IPA/CMakeLists.txt | 1 + 4 files changed, 65 insertions(+) diff --git a/include/llvm-c/Initialization.h b/include/llvm-c/Initialization.h index 252f7310038..b32e22e3787 100644 --- a/include/llvm-c/Initialization.h +++ b/include/llvm-c/Initialization.h @@ -25,6 +25,8 @@ extern "C" { void LLVMInitializeTransformUtils(LLVMPassRegistryRef R); void LLVMInitializeScalarOpts(LLVMPassRegistryRef R); void LLVMInitializeIPO(LLVMPassRegistryRef R); +void LLVMInitializeAnalysis(LLVMPassRegistryRef R); +void LLVMInitializeIPA(LLVMPassRegistryRef R); #ifdef __cplusplus } diff --git a/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h index 99e2bedec8b..2720c8fcff9 100644 --- a/include/llvm/InitializePasses.h +++ b/include/llvm/InitializePasses.h @@ -30,6 +30,12 @@ void initializeScalarOpts(PassRegistry&); /// initializeIPO - Initialize all passes linked into the IPO library. void initializeIPO(PassRegistry&); +/// initializeAnalysis - Initialize all passes linked into the Analysis library. +void initializeAnalysis(PassRegistry&); + +/// initializeIPA - Initialize all passes linked into the IPA library. +void initializeIPA(PassRegistry&); + void initializeAAEvalPass(PassRegistry&); void initializeADCEPass(PassRegistry&); void initializeAliasAnalysisAnalysisGroup(PassRegistry&); diff --git a/lib/Analysis/Analysis.cpp b/lib/Analysis/Analysis.cpp index 398dec7dd0a..b2a109bd57b 100644 --- a/lib/Analysis/Analysis.cpp +++ b/lib/Analysis/Analysis.cpp @@ -8,11 +8,67 @@ //===----------------------------------------------------------------------===// #include "llvm-c/Analysis.h" +#include "llvm/InitializePasses.h" #include "llvm/Analysis/Verifier.h" #include using namespace llvm; +/// initializeAnalysis - Initialize all passes linked into the Analysis library. +void llvm::initializeAnalysis(PassRegistry &Registry) { + initializeAliasAnalysisAnalysisGroup(Registry); + initializeAliasAnalysisCounterPass(Registry); + initializeAAEvalPass(Registry); + initializeAliasDebuggerPass(Registry); + initializeAliasSetPrinterPass(Registry); + initializeNoAAPass(Registry); + initializeBasicAliasAnalysisPass(Registry); + initializeCFGViewerPass(Registry); + initializeCFGPrinterPass(Registry); + initializeCFGOnlyViewerPass(Registry); + initializeCFGOnlyPrinterPass(Registry); + initializePrintDbgInfoPass(Registry); + initializeDomViewerPass(Registry); + initializeDomPrinterPass(Registry); + initializeDomOnlyViewerPass(Registry); + initializePostDomViewerPass(Registry); + initializeDomOnlyPrinterPass(Registry); + initializePostDomPrinterPass(Registry); + initializePostDomOnlyViewerPass(Registry); + initializePostDomOnlyPrinterPass(Registry); + initializeIVUsersPass(Registry); + initializeInstCountPass(Registry); + initializeIntervalPartitionPass(Registry); + initializeLazyValueInfoPass(Registry); + initializeLibCallAliasAnalysisPass(Registry); + initializeLintPass(Registry); + initializeLiveValuesPass(Registry); + initializeLoopDependenceAnalysisPass(Registry); + initializeLoopInfoPass(Registry); + initializeMemDepPrinterPass(Registry); + initializeMemoryDependenceAnalysisPass(Registry); + initializeModuleDebugInfoPrinterPass(Registry); + initializePostDominatorTreePass(Registry); + initializePostDominanceFrontierPass(Registry); + initializeProfileEstimatorPassPass(Registry); + initializeNoProfileInfoPass(Registry); + initializeProfileInfoAnalysisGroup(Registry); + initializeLoaderPassPass(Registry); + initializeProfileVerifierPassPass(Registry); + initializeRegionInfoPass(Registry); + initializeRegionViewerPass(Registry); + initializeRegionPrinterPass(Registry); + initializeRegionOnlyViewerPass(Registry); + initializeRegionOnlyPrinterPass(Registry); + initializeScalarEvolutionPass(Registry); + initializeScalarEvolutionAliasAnalysisPass(Registry); + initializeTypeBasedAliasAnalysisPass(Registry); +} + +void LLVMInitializeAnalysis(LLVMPassRegistryRef R) { + initializeAnalysis(*unwrap(R)); +} + LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action, char **OutMessages) { std::string Messages; diff --git a/lib/Analysis/IPA/CMakeLists.txt b/lib/Analysis/IPA/CMakeLists.txt index 007ad228ae5..8ffef29870a 100644 --- a/lib/Analysis/IPA/CMakeLists.txt +++ b/lib/Analysis/IPA/CMakeLists.txt @@ -3,4 +3,5 @@ add_llvm_library(LLVMipa CallGraphSCCPass.cpp FindUsedTypes.cpp GlobalsModRef.cpp + IPA.cpp )