LLVM API Documentation
00001 //===-- Scalar.cpp --------------------------------------------------------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file implements the C bindings for libLLVMIPO.a, which implements 00011 // several transformations over the LLVM intermediate representation. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #include "llvm-c/Transforms/IPO.h" 00016 #include "llvm/PassManager.h" 00017 #include "llvm/Transforms/IPO.h" 00018 00019 using namespace llvm; 00020 00021 void LLVMAddArgumentPromotionPass(LLVMPassManagerRef PM) { 00022 unwrap(PM)->add(createArgumentPromotionPass()); 00023 } 00024 00025 void LLVMAddConstantMergePass(LLVMPassManagerRef PM) { 00026 unwrap(PM)->add(createConstantMergePass()); 00027 } 00028 00029 void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM) { 00030 unwrap(PM)->add(createDeadArgEliminationPass()); 00031 } 00032 00033 void LLVMAddDeadTypeEliminationPass(LLVMPassManagerRef PM) { 00034 unwrap(PM)->add(createDeadTypeEliminationPass()); 00035 } 00036 00037 void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM) { 00038 unwrap(PM)->add(createFunctionAttrsPass()); 00039 } 00040 00041 void LLVMAddFunctionInliningPass(LLVMPassManagerRef PM) { 00042 unwrap(PM)->add(createFunctionInliningPass()); 00043 } 00044 00045 void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM) { 00046 unwrap(PM)->add(createGlobalDCEPass()); 00047 } 00048 00049 void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM) { 00050 unwrap(PM)->add(createGlobalOptimizerPass()); 00051 } 00052 00053 void LLVMAddIPConstantPropagationPass(LLVMPassManagerRef PM) { 00054 unwrap(PM)->add(createIPConstantPropagationPass()); 00055 } 00056 00057 void LLVMAddLowerSetJmpPass(LLVMPassManagerRef PM) { 00058 unwrap(PM)->add(createLowerSetJmpPass()); 00059 } 00060 00061 void LLVMAddPruneEHPass(LLVMPassManagerRef PM) { 00062 unwrap(PM)->add(createPruneEHPass()); 00063 } 00064 00065 void LLVMAddRaiseAllocationsPass(LLVMPassManagerRef PM) { 00066 unwrap(PM)->add(createRaiseAllocationsPass()); 00067 } 00068 00069 void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM) { 00070 unwrap(PM)->add(createStripDeadPrototypesPass()); 00071 } 00072 00073 void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM) { 00074 unwrap(PM)->add(createStripSymbolsPass()); 00075 }