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/Pass.h"
18 #include "llvm/Transforms/IPO.h"
22 void LLVMAddArgumentPromotionPass(LLVMPassManagerRef PM) {
23 unwrap(PM)->add(createArgumentPromotionPass());
26 void LLVMAddConstantMergePass(LLVMPassManagerRef PM) {
27 unwrap(PM)->add(createConstantMergePass());
30 void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM) {
31 unwrap(PM)->add(createDeadArgEliminationPass());
34 void LLVMAddDeadTypeEliminationPass(LLVMPassManagerRef PM) {
35 unwrap(PM)->add(createDeadTypeEliminationPass());
38 void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM) {
39 unwrap(PM)->add(createFunctionAttrsPass());
42 void LLVMAddFunctionInliningPass(LLVMPassManagerRef PM) {
43 unwrap(PM)->add(createFunctionInliningPass());
46 void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM) {
47 unwrap(PM)->add(createGlobalDCEPass());
50 void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM) {
51 unwrap(PM)->add(createGlobalOptimizerPass());
54 void LLVMAddIPConstantPropagationPass(LLVMPassManagerRef PM) {
55 unwrap(PM)->add(createIPConstantPropagationPass());
58 void LLVMAddLowerSetJmpPass(LLVMPassManagerRef PM) {
59 unwrap(PM)->add(createLowerSetJmpPass());
62 void LLVMAddPruneEHPass(LLVMPassManagerRef PM) {
63 unwrap(PM)->add(createPruneEHPass());
66 void LLVMAddRaiseAllocationsPass(LLVMPassManagerRef PM) {
67 // FIXME: Remove in LLVM 3.0.
70 void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM) {
71 unwrap(PM)->add(createStripDeadPrototypesPass());
74 void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM) {
75 unwrap(PM)->add(createStripSymbolsPass());