From c49384836e1475506f37514044de3221d8f63163 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 7 Oct 2010 19:51:21 +0000 Subject: [PATCH] Add initialization routines for VMCore. llvm-svn: 115963 --- include/llvm-c/Initialization.h | 1 + include/llvm/InitializePasses.h | 4 ++++ lib/VMCore/Core.cpp | 16 ++++++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) 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 ----------------------------------------------------===*/