From 6875c2ea260c260cab5545938d9e6b45cc51b91b 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. llvm-svn: 115946 --- llvm/include/llvm-c/Initialization.h | 2 + llvm/include/llvm/InitializePasses.h | 6 +++ llvm/lib/Analysis/Analysis.cpp | 56 ++++++++++++++++++++++++++++ llvm/lib/Analysis/IPA/CMakeLists.txt | 1 + 4 files changed, 65 insertions(+) diff --git a/llvm/include/llvm-c/Initialization.h b/llvm/include/llvm-c/Initialization.h index 252f73100380..b32e22e37870 100644 --- a/llvm/include/llvm-c/Initialization.h +++ b/llvm/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/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h index 99e2bedec8b0..2720c8fcff9e 100644 --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/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/llvm/lib/Analysis/Analysis.cpp b/llvm/lib/Analysis/Analysis.cpp index 398dec7dd0a1..b2a109bd57bf 100644 --- a/llvm/lib/Analysis/Analysis.cpp +++ b/llvm/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/llvm/lib/Analysis/IPA/CMakeLists.txt b/llvm/lib/Analysis/IPA/CMakeLists.txt index 007ad228ae56..8ffef29870ae 100644 --- a/llvm/lib/Analysis/IPA/CMakeLists.txt +++ b/llvm/lib/Analysis/IPA/CMakeLists.txt @@ -3,4 +3,5 @@ add_llvm_library(LLVMipa CallGraphSCCPass.cpp FindUsedTypes.cpp GlobalsModRef.cpp + IPA.cpp )