PassManagerBuilder.h revision 9313da5a90838c7242101dae250e86dcfc708e6a
1/*===-- llvm-c/Transform/PassManagerBuilder.h - PMB C Interface ---*- C -*-===*\ 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 header declares the C interface to the PassManagerBuilder class. *| 11|* *| 12\*===----------------------------------------------------------------------===*/ 13 14#ifndef LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H 15#define LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H 16 17#include "llvm-c/Core.h" 18 19typedef struct LLVMOpaquePassManagerBuilder *LLVMPassManagerBuilderRef; 20 21#ifdef __cplusplus 22#include "llvm/Transforms/IPO/PassManagerBuilder.h" 23extern "C" { 24#endif 25 26/** 27 * @defgroup LLVMCTransformsPassManagerBuilder Pass manager builder 28 * @ingroup LLVMCTransforms 29 * 30 * @{ 31 */ 32 33/** See llvm::PassManagerBuilder. */ 34LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate(void); 35void LLVMPassManagerBuilderDispose(LLVMPassManagerBuilderRef PMB); 36 37/** See llvm::PassManagerBuilder::OptLevel. */ 38void 39LLVMPassManagerBuilderSetOptLevel(LLVMPassManagerBuilderRef PMB, 40 unsigned OptLevel); 41 42/** See llvm::PassManagerBuilder::SizeLevel. */ 43void 44LLVMPassManagerBuilderSetSizeLevel(LLVMPassManagerBuilderRef PMB, 45 unsigned SizeLevel); 46 47/** See llvm::PassManagerBuilder::DisableUnitAtATime. */ 48void 49LLVMPassManagerBuilderSetDisableUnitAtATime(LLVMPassManagerBuilderRef PMB, 50 LLVMBool Value); 51 52/** See llvm::PassManagerBuilder::DisableUnrollLoops. */ 53void 54LLVMPassManagerBuilderSetDisableUnrollLoops(LLVMPassManagerBuilderRef PMB, 55 LLVMBool Value); 56 57/** See llvm::PassManagerBuilder::DisableSimplifyLibCalls */ 58void 59LLVMPassManagerBuilderSetDisableSimplifyLibCalls(LLVMPassManagerBuilderRef PMB, 60 LLVMBool Value); 61 62/** See llvm::PassManagerBuilder::Inliner. */ 63void 64LLVMPassManagerBuilderUseInlinerWithThreshold(LLVMPassManagerBuilderRef PMB, 65 unsigned Threshold); 66 67/** See llvm::PassManagerBuilder::populateFunctionPassManager. */ 68void 69LLVMPassManagerBuilderPopulateFunctionPassManager(LLVMPassManagerBuilderRef PMB, 70 LLVMPassManagerRef PM); 71 72/** See llvm::PassManagerBuilder::populateModulePassManager. */ 73void 74LLVMPassManagerBuilderPopulateModulePassManager(LLVMPassManagerBuilderRef PMB, 75 LLVMPassManagerRef PM); 76 77/** See llvm::PassManagerBuilder::populateLTOPassManager. */ 78void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB, 79 LLVMPassManagerRef PM, 80 LLVMBool Internalize, 81 LLVMBool RunInliner); 82 83/** 84 * @} 85 */ 86 87#ifdef __cplusplus 88} 89 90namespace llvm { 91 inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) { 92 return reinterpret_cast<PassManagerBuilder*>(P); 93 } 94 95 inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) { 96 return reinterpret_cast<LLVMPassManagerBuilderRef>(P); 97 } 98} 99#endif 100 101#endif 102