diff --git a/include/llvm-c/Initialization.h b/include/llvm-c/Initialization.h index 775af4fce1f..01dbeb6cdf7 100644 --- a/include/llvm-c/Initialization.h +++ b/include/llvm-c/Initialization.h @@ -22,6 +22,7 @@ extern "C" { #endif +void LLVMInitializeCore(LLVMPassRegistryRef R); void LLVMInitializeTransformUtils(LLVMPassRegistryRef R); void LLVMInitializeScalarOpts(LLVMPassRegistryRef R); void LLVMInitializeIPO(LLVMPassRegistryRef R); diff --git a/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h index 62d0574b9bc..37351997761 100644 --- a/include/llvm/InitializePasses.h +++ b/include/llvm/InitializePasses.h @@ -19,6 +19,10 @@ namespace llvm { class PassRegistry; +/// initializeCore - Initialize all passes linked into the +/// TransformUtils library. +void initializeCore(PassRegistry&); + /// initializeTransformUtils - Initialize all passes linked into the /// TransformUtils library. void initializeTransformUtils(PassRegistry&); diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 2b1469341af..c5940d3423f 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// // -// This file implements the C bindings for libLLVMCore.a, which implements -// the LLVM intermediate representation. +// This file implements the common infrastructure (including the C bindings) +// for libLLVMCore.a, which implements the LLVM intermediate representation. // //===----------------------------------------------------------------------===// @@ -34,6 +34,18 @@ using namespace llvm; +void llvm::initializeCore(PassRegistry &Registry) { + initializeDominatorTreePass(Registry); + initializeDominanceFrontierPass(Registry); + initializePrintModulePassPass(Registry); + initializePrintFunctionPassPass(Registry); + initializeVerifierPass(Registry); + initializePreVerifierPass(Registry); +} + +void LLVMInitializeCore(LLVMPassRegistryRef R) { + initializeCore(*unwrap(R)); +} /*===-- Error handling ----------------------------------------------------===*/