Add a handful of additional useful pass manager things to the C API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98296 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nate Begeman 2010-03-11 23:06:07 +00:00
parent 56698803d9
commit 47a53a6e4c
2 changed files with 25 additions and 0 deletions

View File

@ -79,6 +79,10 @@ void LLVMAddSCCPPass(LLVMPassManagerRef PM);
/** See llvm::createScalarReplAggregatesPass function. */
void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM);
/** See llvm::createScalarReplAggregatesPass function. */
void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
int Threshold);
/** See llvm::createSimplifyLibCallsPass function. */
void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
@ -91,6 +95,12 @@ void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM);
/** See llvm::demotePromoteMemoryToRegisterPass function. */
void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
/** See llvm::createVerifierPass function. */
void LLVMAddVerifierPass(LLVMPassManagerRef PM);
/** PM->add(new TargetData(M)) */
void LLVMAddTargetData(LLVMPassManagerRef PM, LLVMModuleRef M);
#ifdef __cplusplus
}
#endif /* defined(__cplusplus) */

View File

@ -14,6 +14,8 @@
#include "llvm-c/Transforms/Scalar.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Verifier.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/Scalar.h"
using namespace llvm;
@ -90,6 +92,11 @@ void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createScalarReplAggregatesPass());
}
void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
int Threshold) {
unwrap(PM)->add(createScalarReplAggregatesPass(Threshold));
}
void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createSimplifyLibCallsPass());
}
@ -105,3 +112,11 @@ void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM) {
void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createDemoteRegisterToMemoryPass());
}
void LLVMAddVerifierPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createVerifierPass());
}
void LLVMAddTargetData(LLVMPassManagerRef PM, LLVMModuleRef M) {
unwrap(PM)->add(new TargetData(unwrap(M)));
}