Gordon Henriksen | 41ba154 | 2008-03-16 16:32:40 +0000 | [diff] [blame] | 1 | //===-- Scalar.cpp --------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the C bindings for libLLVMScalarOpts.a, which implements |
| 11 | // several scalar transformations over the LLVM intermediate representation. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "llvm-c/Transforms/Scalar.h" |
| 16 | #include "llvm/PassManager.h" |
| 17 | #include "llvm/Transforms/Scalar.h" |
| 18 | |
| 19 | using namespace llvm; |
| 20 | |
| 21 | void LLVMAddConstantPropagationPass(LLVMPassManagerRef PM) { |
| 22 | unwrap(PM)->add(createConstantPropagationPass()); |
| 23 | } |
| 24 | |
| 25 | void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM) { |
| 26 | unwrap(PM)->add(createInstructionCombiningPass()); |
| 27 | } |
| 28 | |
Gordon Henriksen | 69cf031 | 2008-03-20 17:16:03 +0000 | [diff] [blame] | 29 | void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM) { |
| 30 | unwrap(PM)->add(createPromoteMemoryToRegisterPass()); |
| 31 | } |
| 32 | |
| 33 | void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM) { |
| 34 | unwrap(PM)->add(createDemoteRegisterToMemoryPass()); |
| 35 | } |
| 36 | |
Gordon Henriksen | 41ba154 | 2008-03-16 16:32:40 +0000 | [diff] [blame] | 37 | void LLVMAddReassociatePass(LLVMPassManagerRef PM) { |
| 38 | unwrap(PM)->add(createReassociatePass()); |
| 39 | } |
| 40 | |
| 41 | void LLVMAddGVNPass(LLVMPassManagerRef PM) { |
| 42 | unwrap(PM)->add(createGVNPass()); |
| 43 | } |
| 44 | |
| 45 | void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM) { |
| 46 | unwrap(PM)->add(createCFGSimplificationPass()); |
| 47 | } |