1
//===-- Scalar.cpp --------------------------------------------------------===//
3
// The LLVM Compiler Infrastructure
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
8
//===----------------------------------------------------------------------===//
10
// This file implements the C bindings for libLLVMIPO.a, which implements
11
// several transformations over the LLVM intermediate representation.
13
//===----------------------------------------------------------------------===//
15
#include "llvm-c/Transforms/IPO.h"
16
#include "llvm/PassManager.h"
17
#include "llvm/Transforms/IPO.h"
21
void LLVMAddArgumentPromotionPass(LLVMPassManagerRef PM) {
22
unwrap(PM)->add(createArgumentPromotionPass());
25
void LLVMAddConstantMergePass(LLVMPassManagerRef PM) {
26
unwrap(PM)->add(createConstantMergePass());
29
void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM) {
30
unwrap(PM)->add(createDeadArgEliminationPass());
33
void LLVMAddDeadTypeEliminationPass(LLVMPassManagerRef PM) {
34
unwrap(PM)->add(createDeadTypeEliminationPass());
37
void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM) {
38
unwrap(PM)->add(createFunctionAttrsPass());
41
void LLVMAddFunctionInliningPass(LLVMPassManagerRef PM) {
42
unwrap(PM)->add(createFunctionInliningPass());
45
void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM) {
46
unwrap(PM)->add(createGlobalDCEPass());
49
void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM) {
50
unwrap(PM)->add(createGlobalOptimizerPass());
53
void LLVMAddIPConstantPropagationPass(LLVMPassManagerRef PM) {
54
unwrap(PM)->add(createIPConstantPropagationPass());
57
void LLVMAddLowerSetJmpPass(LLVMPassManagerRef PM) {
58
unwrap(PM)->add(createLowerSetJmpPass());
61
void LLVMAddPruneEHPass(LLVMPassManagerRef PM) {
62
unwrap(PM)->add(createPruneEHPass());
65
void LLVMAddRaiseAllocationsPass(LLVMPassManagerRef PM) {
66
// FIXME: Remove in LLVM 3.0.
69
void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM) {
70
unwrap(PM)->add(createStripDeadPrototypesPass());
73
void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM) {
74
unwrap(PM)->add(createStripSymbolsPass());